diff --git a/server/hallserver/room/room.go b/server/hallserver/room/room.go index fe211e15..4521d193 100644 --- a/server/hallserver/room/room.go +++ b/server/hallserver/room/room.go @@ -42,8 +42,8 @@ func (this *room) init(roomId string, roomIdx int64, this.roomIdx = roomIdx this.entry.Init(this) this.config.mapId = msg.GetMapId() - this.config.zoneId = owner.GetZoneId() - this.config.nodeId = owner.GetNodeId() + this.config.zoneId = msg.GetZoneId() + this.config.nodeId = msg.GetNodeId() this.config.passwd = msg.GetPasswd() this.config.maxTeamNum = constant.ROOM_MAX_TEAM_NUM this.owner = newMember(this, owner) diff --git a/server/hallserver/room/roommgr.go b/server/hallserver/room/roommgr.go index 1cd8ce1f..8fce4ffb 100644 --- a/server/hallserver/room/roommgr.go +++ b/server/hallserver/room/roommgr.go @@ -72,7 +72,7 @@ func (this *roomMgr) CMCreateRoom(hdr *f5.MsgHdr, msg *cs.CMCreateRoom) { func (this *roomMgr) CMJoinRoom(hdr *f5.MsgHdr, msg *cs.CMJoinRoom) { hum := hdr.Context.(common.Player) rspMsg := cs.SMJoinRoom{} - if hum.GetRoom() != nil { + if hum.GetRoom() != nil && hum.GetRoom().GetRoomState() == ROOM_INIT_STATE { rspMsg.Errcode = proto.Int32(1) rspMsg.Errmsg = proto.String("already room") hum.SendMsg(&rspMsg)