This commit is contained in:
aozhiwei 2023-09-24 13:57:53 +08:00
parent 0b760d6b71
commit 44e3126dc2

View File

@ -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()
}
}