func init() { //创建异步接收消息的Chans serverMsgReceiveChans = make([]dispatch.ReceiveMsgChan, 10) for i := 0; i < len(serverMsgReceiveChans); i++ { serverMsgReceiveChans[i] = make(chan dispatch.ReceiveMsg, 2048) } //创建DB同步数据消息分派 serverMsgDispatch = dispatch.NewDispatchAsync(serverMsgReceiveChans, dispatch.HandleCondition{ Condition: dbProto.IsValidSyncID, H: dispatch.Handle{ systemProto.ID_System_ConnectDBServerC2S: connectDBServer, dbProto.ID_DB_User_LoginC2S: userLogin, }, }, ) //创建DB异步数据消息分派 serverMsgDispatchAsync = dispatch.NewDispatch( dispatch.HandleCondition{ Condition: dbProto.IsValidAsyncID, H: dispatch.Handle{ dbProto.ID_DB_User_UpdateLastLoginTimeC2S: updateUserLastLoginTime, }, }, ) }
func init() { //创建异步接收消息的Chan serverMsgReceiveChan = make(chan dispatch.ReceiveMsg, 4096) //创建消息分派 serverMsgDispatch = dispatch.NewDispatchAsync([]dispatch.ReceiveMsgChan{serverMsgReceiveChan}, dispatch.Handle{ systemProto.ID_System_ConnectLogServerC2S: connectLogServer, logProto.ID_Log_CommonLogC2S: writeLogFile, }, ) }