1
This commit is contained in:
parent
9a6fdb07e6
commit
012d39bff2
@ -190,6 +190,7 @@ message SMCreateRoom
|
|||||||
{
|
{
|
||||||
optional int32 errcode = 1; //错误码 0:成功 1:重连失败
|
optional int32 errcode = 1; //错误码 0:成功 1:重连失败
|
||||||
optional string errmsg = 2; //错误描述
|
optional string errmsg = 2; //错误描述
|
||||||
|
optional string room_id = 3; //房间号
|
||||||
}
|
}
|
||||||
|
|
||||||
//获取房间列表
|
//获取房间列表
|
||||||
|
@ -39,6 +39,7 @@ func (this *roomMgr) ProcessCMMsg(handler *cs.CsNetMsgHandler, hdr *f5.MsgHdr) {
|
|||||||
case constant.ROOM_MGR_HANDLER_ID:
|
case constant.ROOM_MGR_HANDLER_ID:
|
||||||
hum := GetPlayerMgr().GetPlayerBySocket(hdr.GetSocket())
|
hum := GetPlayerMgr().GetPlayerBySocket(hdr.GetSocket())
|
||||||
if hum != nil {
|
if hum != nil {
|
||||||
|
hdr.Context = hum
|
||||||
cs.DispatchMsg(handler, hdr, this)
|
cs.DispatchMsg(handler, hdr, this)
|
||||||
}
|
}
|
||||||
case constant.ROOM_HANDLER_ID:
|
case constant.ROOM_HANDLER_ID:
|
||||||
@ -63,6 +64,7 @@ func (this *roomMgr) CMCreateRoom(hdr *f5.MsgHdr, msg *cs.CMCreateRoom) {
|
|||||||
m.init(q5.ToString(this.genRoomId()), this.genRoomIdx(), msg.GetMapId(), hum, msg.GetPasswd())
|
m.init(q5.ToString(this.genRoomId()), this.genRoomIdx(), msg.GetMapId(), hum, msg.GetPasswd())
|
||||||
this.idHash[m.roomId] = m
|
this.idHash[m.roomId] = m
|
||||||
|
|
||||||
|
rspMsg.RoomId = proto.String(m.roomId)
|
||||||
hum.SendMsg(rspMsg)
|
hum.SendMsg(rspMsg)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user