1
This commit is contained in:
parent
44a78dd2db
commit
f7df50f3ab
@ -21,6 +21,7 @@ func (this *HandlerMgr) Init() {
|
||||
cs.RegHandlerId(int(cs.CMMessageIdE__CMCreateRoom), constant.ROOM_MGR_HANDLER_ID)
|
||||
cs.RegHandlerId(int(cs.CMMessageIdE__CMJoinRoom), constant.ROOM_MGR_HANDLER_ID)
|
||||
cs.RegHandlerId(int(cs.CMMessageIdE__CMSearchRoom), constant.ROOM_MGR_HANDLER_ID)
|
||||
cs.RegHandlerId(int(cs.CMMessageIdE__CMGetCurrentRoom), constant.ROOM_MGR_HANDLER_ID)
|
||||
|
||||
cs.RegHandlerId(int(cs.CMMessageIdE__CMDisbandRoom), constant.ROOM_HANDLER_ID)
|
||||
cs.RegHandlerId(int(cs.CMMessageIdE__CMLeaveRoom), constant.ROOM_HANDLER_ID)
|
||||
|
@ -34,6 +34,15 @@ func (this *roomMgr) getRoom(roomId string) *room {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (this *roomMgr) genRoomId() int32 {
|
||||
this.currRoomId++
|
||||
return this.currRoomId
|
||||
}
|
||||
|
||||
func (this *roomMgr) genRoomIdx() int64 {
|
||||
return f5.GetApp().NewUuid()
|
||||
}
|
||||
|
||||
func (this *roomMgr) ProcessCMMsg(handler *cs.CsNetMsgHandler, hdr *f5.MsgHdr) {
|
||||
switch handler.HandlerId {
|
||||
case constant.ROOM_MGR_HANDLER_ID:
|
||||
@ -126,11 +135,11 @@ func (this *roomMgr) CMSearchRoom(hdr *f5.MsgHdr, msg *cs.CMSearchRoom) {
|
||||
hum.SendMsg(&rspMsg)
|
||||
}
|
||||
|
||||
func (this *roomMgr) genRoomId() int32 {
|
||||
this.currRoomId++
|
||||
return this.currRoomId
|
||||
}
|
||||
|
||||
func (this *roomMgr) genRoomIdx() int64 {
|
||||
return f5.GetApp().NewUuid()
|
||||
func (this *roomMgr) CMGetCurrentRoom(hdr *f5.MsgHdr, msg *cs.CMGetCurrentRoom) {
|
||||
hum := hdr.Context.(common.Player)
|
||||
rspMsg := &cs.SMGetCurrentRoom{}
|
||||
if hum.GetRoom() != nil && hum.GetRoom().GetRoomState() == ROOM_INIT_STATE {
|
||||
return
|
||||
}
|
||||
hum.SendMsg(rspMsg)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user