1
This commit is contained in:
parent
82cbe253cb
commit
d46e44d35f
@ -13,10 +13,10 @@ func (this *HandlerMgr) init() {
|
||||
ss.RegHandlerId(int(ss.SSMessageIdE__SS_Ping), constant.WSP_LISTENER_HANDLER_ID)
|
||||
ss.RegHandlerId(int(ss.SSMessageIdE__SS_WSP_SocketDisconnect), constant.WSP_LISTENER_HANDLER_ID)
|
||||
|
||||
cs.RegHandlerId(int(cs.CMMessageIdE__CMPing), constant.PLAYER_MGR_HANDLER_ID)
|
||||
cs.RegHandlerId(int(cs.CMMessageIdE__CMLogin), constant.PLAYER_MGR_HANDLER_ID)
|
||||
cs.RegHandlerId(int(cs.CMMessageIdE__CMReconnect), constant.PLAYER_MGR_HANDLER_ID)
|
||||
|
||||
cs.RegHandlerId(int(cs.CMMessageIdE__CMPing), constant.PLAYER_HANDLER_ID)
|
||||
cs.RegHandlerId(int(cs.CMMessageIdE__CMSearchUser), constant.PLAYER_HANDLER_ID)
|
||||
cs.RegHandlerId(int(cs.CMMessageIdE__CMSearchUserByAccountId), constant.PLAYER_HANDLER_ID)
|
||||
cs.RegHandlerId(int(cs.CMMessageIdE__CMAddFriendRequest), constant.PLAYER_HANDLER_ID)
|
||||
|
@ -101,6 +101,11 @@ func (this *player) reBind(socket f5.WspCliConn) {
|
||||
_playerMgr.socketHash[this.socket] = this
|
||||
}
|
||||
|
||||
func (this *player) CMPing(hdr *f5.MsgHdr, msg *cs.CMPing) {
|
||||
rspMsg := new(cs.SMPing)
|
||||
this.SendMsg(rspMsg)
|
||||
}
|
||||
|
||||
// CMSearchUser 搜索用户
|
||||
func (this *player) CMSearchUser(hdr *f5.MsgHdr, msg *cs.CMSearchUser) {
|
||||
sinceId := msg.GetSinceId()
|
||||
|
@ -337,3 +337,15 @@ func (this *playerMgr) RemoveSocketCloseEvent(evHandle *SocketCloseEventHandle)
|
||||
panic("RemoveSocketCloseEvent error")
|
||||
}
|
||||
}
|
||||
|
||||
func (this *playerMgr) ProcessCMMsg(handler *cs.CsNetMsgHandler, hdr *f5.MsgHdr) {
|
||||
switch handler.HandlerId {
|
||||
case constant.PLAYER_MGR_HANDLER_ID:
|
||||
cs.DispatchMsg(handler, hdr, this)
|
||||
case constant.PLAYER_HANDLER_ID:
|
||||
hum := this.internalGetPlayerBySocket(hdr.GetSocket())
|
||||
if hum != nil {
|
||||
cs.DispatchMsg(handler, hdr, hum)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user