Documentation ¶
Index ¶
- Constants
- func AfterReLoadConfig(pconfig *Config, old_config *FileConfig, new_config *FileConfig)
- func CloseClient(pconfig *Config, client_key int64) bool
- func CommSet(pconfig *Config) bool
- func GetClientKey(pconfig *Config, uid int64) int64
- func GetClientUid(pconfig *Config, c_key int64) int64
- func HandleClientPkg(pconfig *Config, pclient *comm.ClientPkg)
- func HandleReportCmd(pconfig *Config, pmsg *comm.ReportMsg)
- func LocalSet(pconfig *Config) bool
- func NotifyLoad(arg interface{})
- func ReadClients(pconfig *Config) int64
- func ReadRsaKeyFiles(pconfig *Config) bool
- func RecvApplyGroupNotify(pconfig *Config, pnotify *ss.MsgApplyGroupNotify)
- func RecvApplyGroupRsp(pconfig *Config, prsp *ss.MsgApplyGroupRsp)
- func RecvChgGroupAttrRsp(pconfig *Config, prsp *ss.MsgChgGroupAttrRsp)
- func RecvCommonNotify(pconfig *Config, pnotify *ss.MsgCommonNotify)
- func RecvCreateGroupRsp(pconfig *Config, prsp *ss.MsgCreateGrpRsp)
- func RecvExitGroupRsp(pconfig *Config, prsp *ss.MsgExitGroupRsp)
- func RecvFetchUserProfileRsp(pconfig *Config, prsp *ss.MsgFetchUserProfileRsp)
- func RecvGroupGroundRsp(pconfig *Config, prsp *ss.MsgGroupGroudRsp)
- func RecvHeartBeatReq(pconfig *Config, preq *ss.MsgHeartBeatReq, from int)
- func RecvLoginRsp(pconfig *Config, prsp *ss.MsgLoginRsp)
- func RecvLogoutRsp(pconfig *Config, prsp *ss.MsgLogoutRsp)
- func RecvMsg(pconfig *Config) int64
- func RecvPingRsp(pconfig *Config, prsp *ss.MsgPingRsp)
- func RecvRegRsp(pconfig *Config, prsp *ss.MsgRegRsp)
- func RecvReportCmd(arg interface{})
- func RecvSendChatRsp(pconfig *Config, prsp *ss.MsgSendChatRsp)
- func RecvSyncChatList(pconfig *Config, prsp *ss.MsgSyncChatList)
- func RecvSyncGroupInfo(pconfig *Config, pinfo *ss.MsgSyncGroupInfo)
- func RecvUpdateChatRsp(pconfig *Config, prsp *ss.MsgUpdateChatRsp)
- func RecvUpdateUserRsp(pconfig *Config, prsp *ss.MsgUpdateUserRsp)
- func ReportSyncServer(arg interface{})
- func SendApplyGroupAudit(pconfig *Config, uid int64, paudit *cs.CSApplyGroupAudit)
- func SendApplyGroupReq(pconfig *Config, uid int64, preq *cs.CSApplyGroupReq) bool
- func SendChgGroupAttrReq(pconfig *Config, uid int64, pchg *cs.CSChgGroupAttrReq)
- func SendCommonQuery(pconfig *Config, uid int64, pquery *cs.CSCommonQuery)
- func SendCreateGroupReq(pconfig *Config, uid int64, preq *cs.CSCreateGroupReq) bool
- func SendExitGroupReq(pconfig *Config, uid int64, pexit *cs.CSExitGroupReq)
- func SendFetchChatHistroyReq(pconfig *Config, uid int64, pfetch *cs.CSChatHistoryReq)
- func SendFetchUserProfileReq(pconfig *Config, uid int64, pfetch *cs.CSFetchUserProfileReq)
- func SendGroupGroundReq(pconfig *Config, uid int64, pcs *cs.CSGroupGroundReq)
- func SendHeartBeatMsg(arg interface{})
- func SendKickGroupReq(pconfig *Config, uid int64, pkick *cs.CSKickGroupReq)
- func SendLoginReq(pconfig *Config, client_key int64, plogin_req *cs.CSLoginReq)
- func SendLogoutReq(pconfig *Config, uid int64, reason ss.USER_LOGOUT_REASON)
- func SendPingReq(pconfig *Config, client_key int64, pmsg *cs.CSPingReq)
- func SendQueryGroupReq(pconfig *Config, uid int64, pquery *cs.CSQueryGroupReq)
- func SendRegReq(pconfig *Config, client_key int64, preq *cs.CSRegReq)
- func SendSendChatReq(pconfig *Config, uid int64, psend *cs.CSSendChatReq)
- func SendToClient(pconfig *Config, client_key int64, proto int, pmsg interface{}) bool
- func SendToLogic(pconfig *Config, pss_msg *ss.SSMsg) bool
- func SendToServ(pconfig *Config, target_serv int, pss_msg *ss.SSMsg) bool
- func SendUpdateChatReq(pconfig *Config, uid int64, pcs *cs.CSUpdateChatReq)
- func SendUpdateUserReq(pconfig *Config, uid int64, pupdate *cs.CSUpdateUserReq)
- func ServerExit(pconfig *Config)
- func ServerStart(pconfig *Config)
- type Config
- type FileConfig
- type Msg
- type PkgBuff
- type ZlibEnv
Constants ¶
View Source
const (
MESSAGE_LEN = ss.MAX_SS_MSG_SIZE //200k
)
View Source
const (
RECV_PKG_LEN = comm.MAX_PKG_PER_RECV
)
Variables ¶
This section is empty.
Functions ¶
func AfterReLoadConfig ¶
func AfterReLoadConfig(pconfig *Config, old_config *FileConfig, new_config *FileConfig)
After ReLoad Config If Need Handle
func CloseClient ¶
server close connection positively
func GetClientKey ¶
Get ClientKey By Uid @Return:0 not exist; else ClientKey
func GetClientUid ¶
Get Uid By ClientKey @Return:0 not exist; else ClientKey
func HandleClientPkg ¶
C-->S Decode and Handle Msg
func HandleReportCmd ¶
func NotifyLoad ¶
func NotifyLoad(arg interface{})
ratio = int(valid_conn/max_conn * 100); if ratio<=30 load=0; if ratio>30 load=ratio
func ReadClients ¶
func ReadRsaKeyFiles ¶
read rsa key files if enc_type==NET_ENCRYPPT_RSA
func RecvApplyGroupNotify ¶
func RecvApplyGroupNotify(pconfig *Config, pnotify *ss.MsgApplyGroupNotify)
func RecvApplyGroupRsp ¶
func RecvApplyGroupRsp(pconfig *Config, prsp *ss.MsgApplyGroupRsp)
func RecvChgGroupAttrRsp ¶
func RecvChgGroupAttrRsp(pconfig *Config, prsp *ss.MsgChgGroupAttrRsp)
func RecvCommonNotify ¶
func RecvCommonNotify(pconfig *Config, pnotify *ss.MsgCommonNotify)
func RecvCreateGroupRsp ¶
func RecvCreateGroupRsp(pconfig *Config, prsp *ss.MsgCreateGrpRsp)
func RecvExitGroupRsp ¶
func RecvExitGroupRsp(pconfig *Config, prsp *ss.MsgExitGroupRsp)
func RecvFetchUserProfileRsp ¶
func RecvFetchUserProfileRsp(pconfig *Config, prsp *ss.MsgFetchUserProfileRsp)
func RecvGroupGroundRsp ¶
func RecvGroupGroundRsp(pconfig *Config, prsp *ss.MsgGroupGroudRsp)
func RecvHeartBeatReq ¶
func RecvHeartBeatReq(pconfig *Config, preq *ss.MsgHeartBeatReq, from int)
func RecvLoginRsp ¶
func RecvLoginRsp(pconfig *Config, prsp *ss.MsgLoginRsp)
func RecvLogoutRsp ¶
func RecvLogoutRsp(pconfig *Config, prsp *ss.MsgLogoutRsp)
func RecvPingRsp ¶
func RecvPingRsp(pconfig *Config, prsp *ss.MsgPingRsp)
func RecvRegRsp ¶
func RecvReportCmd ¶
func RecvReportCmd(arg interface{})
func RecvSendChatRsp ¶
func RecvSendChatRsp(pconfig *Config, prsp *ss.MsgSendChatRsp)
func RecvSyncChatList ¶
func RecvSyncChatList(pconfig *Config, prsp *ss.MsgSyncChatList)
func RecvSyncGroupInfo ¶
func RecvSyncGroupInfo(pconfig *Config, pinfo *ss.MsgSyncGroupInfo)
func RecvUpdateChatRsp ¶
func RecvUpdateChatRsp(pconfig *Config, prsp *ss.MsgUpdateChatRsp)
func RecvUpdateUserRsp ¶
func RecvUpdateUserRsp(pconfig *Config, prsp *ss.MsgUpdateUserRsp)
func ReportSyncServer ¶
func ReportSyncServer(arg interface{})
func SendApplyGroupAudit ¶
func SendApplyGroupAudit(pconfig *Config, uid int64, paudit *cs.CSApplyGroupAudit)
func SendApplyGroupReq ¶
func SendApplyGroupReq(pconfig *Config, uid int64, preq *cs.CSApplyGroupReq) bool
Apply Group
func SendChgGroupAttrReq ¶
func SendChgGroupAttrReq(pconfig *Config, uid int64, pchg *cs.CSChgGroupAttrReq)
func SendCommonQuery ¶
func SendCommonQuery(pconfig *Config, uid int64, pquery *cs.CSCommonQuery)
func SendCreateGroupReq ¶
func SendCreateGroupReq(pconfig *Config, uid int64, preq *cs.CSCreateGroupReq) bool
func SendExitGroupReq ¶
func SendExitGroupReq(pconfig *Config, uid int64, pexit *cs.CSExitGroupReq)
func SendFetchChatHistroyReq ¶
func SendFetchChatHistroyReq(pconfig *Config, uid int64, pfetch *cs.CSChatHistoryReq)
func SendFetchUserProfileReq ¶
func SendFetchUserProfileReq(pconfig *Config, uid int64, pfetch *cs.CSFetchUserProfileReq)
func SendGroupGroundReq ¶
func SendGroupGroundReq(pconfig *Config, uid int64, pcs *cs.CSGroupGroundReq)
func SendHeartBeatMsg ¶
func SendHeartBeatMsg(arg interface{})
func SendKickGroupReq ¶
func SendKickGroupReq(pconfig *Config, uid int64, pkick *cs.CSKickGroupReq)
func SendLoginReq ¶
func SendLoginReq(pconfig *Config, client_key int64, plogin_req *cs.CSLoginReq)
func SendLogoutReq ¶
func SendLogoutReq(pconfig *Config, uid int64, reason ss.USER_LOGOUT_REASON)
func SendQueryGroupReq ¶
func SendQueryGroupReq(pconfig *Config, uid int64, pquery *cs.CSQueryGroupReq)
func SendSendChatReq ¶
func SendSendChatReq(pconfig *Config, uid int64, psend *cs.CSSendChatReq)
func SendToClient ¶
Encode And Send to Client * @proto: cs proto * @pmsg : msg from cs.Proto2Msg
func SendUpdateChatReq ¶
func SendUpdateChatReq(pconfig *Config, uid int64, pcs *cs.CSUpdateChatReq)
func SendUpdateUserReq ¶
func SendUpdateUserReq(pconfig *Config, uid int64, pupdate *cs.CSUpdateUserReq)
func ServerExit ¶
func ServerExit(pconfig *Config)
Types ¶
type Config ¶
type Config struct { //comm NameSpace string ProcId int ProcName string ConfigFile string Daemon bool FileConfig *FileConfig Comm *comm.CommConfig ReportCmd string //used for report cmd ReportCmdToken int64 ReportServ *comm.ReportServ //report to manger //local TcpServ *comm.TcpServ Ckey2Uid map[int64]int64 //client key to uid. used for search login user Uid2Ckey map[int64]int64 //uid to client key. used for login user RsaPubKey []byte RsaPriKey []byte }
type FileConfig ¶
type FileConfig struct { //ProcName string `json:"proc_name"` LogicServ int `json:"logic_serv"` LogFile string `json:"log_file"` MaxConn int `json:"max_conn"` ListenAddr string `json:"listen_addr"` ManageAddr []string `json:"manage_addr"` ZlibOn int `json:"zlib_on"` //json compessed by zlib ValidConn int8 `json:"valid_conn"` //valid connection by key EncType int8 `json:"enc_type"` //encrypt type 0:no 1:des-ecb 2:aes-cbc-128 3:rsa+des /* rsa private and public key files method: * create private_key: openssl genrsa -out rsa_private_key.pem 1024 * create public_key: openssl rsa -in rsa_private_key.pem -pubout -out rsa_public_key.pem */ RsaPubFile string `json:"rsa_pub_key_file"` //rsa public key file if EncType=3 RsaPriFile string `json:"rsa_pri_key_file"` //rsa private key file if EncType=3 MonitorInv int `json:"monitor_inv"` //monitor interval seconds }
Click to show internal directories.
Click to hide internal directories.