From 44e3126dc25c7e464528fd8be31974f7b56e5af4 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Sun, 24 Sep 2023 13:57:53 +0800 Subject: [PATCH] 1 --- server/hallserver/room/room.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/server/hallserver/room/room.go b/server/hallserver/room/room.go index 88d38822..14db407c 100644 --- a/server/hallserver/room/room.go +++ b/server/hallserver/room/room.go @@ -222,7 +222,7 @@ func (this *room) CMLeaveRoom(hdr *f5.MsgHdr, msg *cs.CMLeaveRoom) { func (this *room) CMModifyRoom(hdr *f5.MsgHdr, msg *cs.CMModifyRoom) { hum := hdr.Context.(common.Player) rspMsg := cs.SMModifyRoom{} - if this.isOwner(hum) { + if this.isOwner(hum) && this.roomState == ROOM_INIT_STATE { if msg.MapId != nil { this.config.mapId = msg.GetMapId() } @@ -250,7 +250,7 @@ func (this *room) CMStartGame(hdr *f5.MsgHdr, msg *cs.CMStartGame) { func (this *room) CMSetPrepare(hdr *f5.MsgHdr, msg *cs.CMSetPrepare) { hum := hdr.Context.(common.Player) m := this.getMember(hum.GetAccountId()) - if m != nil && m != this.owner { + if m != nil && m != this.owner && this.roomState == ROOM_INIT_STATE { m.state = MEMBER_READY_STATE notifyMsg := &cs.SMRoomMemberChangeNotify{} notifyMsg.Member = new(cs.MFMember) @@ -263,7 +263,7 @@ func (this *room) CMKickoutTeam(hdr *f5.MsgHdr, msg *cs.CMKickoutTeam) { hum := hdr.Context.(common.Player) m := this.getMember(hum.GetAccountId()) t := this.getTeamByUuid(msg.GetTeamUuid()) - if m == this.owner && t != nil && t != m.team { + if m == this.owner && t != nil && t != m.team && this.roomState == ROOM_INIT_STATE{ notifyMsg := &cs.SMRoomKickoutNotify{} this.broadcastMsg(notifyMsg) t.unInit() @@ -275,11 +275,11 @@ func (this *room) CMKickoutMember(hdr *f5.MsgHdr, msg *cs.CMKickoutMember) { hum := hdr.Context.(common.Player) m := this.getMember(hum.GetAccountId()) target := this.getMember(msg.GetTargetId()) - if m == this.owner && target != nil { + if m == this.owner && target != nil && this.roomState == ROOM_INIT_STATE { notifyMsg := &cs.SMRoomKickoutNotify{} notifyMsg.AccountIds = append(notifyMsg.AccountIds, msg.GetTargetId()) this.broadcastMsg(notifyMsg) - target.unInit() + this.removeMember(target.hum.GetAccountId()) this.notifyRoomInfo() } }