1
This commit is contained in:
parent
0b760d6b71
commit
44e3126dc2
@ -222,7 +222,7 @@ func (this *room) CMLeaveRoom(hdr *f5.MsgHdr, msg *cs.CMLeaveRoom) {
|
|||||||
func (this *room) CMModifyRoom(hdr *f5.MsgHdr, msg *cs.CMModifyRoom) {
|
func (this *room) CMModifyRoom(hdr *f5.MsgHdr, msg *cs.CMModifyRoom) {
|
||||||
hum := hdr.Context.(common.Player)
|
hum := hdr.Context.(common.Player)
|
||||||
rspMsg := cs.SMModifyRoom{}
|
rspMsg := cs.SMModifyRoom{}
|
||||||
if this.isOwner(hum) {
|
if this.isOwner(hum) && this.roomState == ROOM_INIT_STATE {
|
||||||
if msg.MapId != nil {
|
if msg.MapId != nil {
|
||||||
this.config.mapId = msg.GetMapId()
|
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) {
|
func (this *room) CMSetPrepare(hdr *f5.MsgHdr, msg *cs.CMSetPrepare) {
|
||||||
hum := hdr.Context.(common.Player)
|
hum := hdr.Context.(common.Player)
|
||||||
m := this.getMember(hum.GetAccountId())
|
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
|
m.state = MEMBER_READY_STATE
|
||||||
notifyMsg := &cs.SMRoomMemberChangeNotify{}
|
notifyMsg := &cs.SMRoomMemberChangeNotify{}
|
||||||
notifyMsg.Member = new(cs.MFMember)
|
notifyMsg.Member = new(cs.MFMember)
|
||||||
@ -263,7 +263,7 @@ func (this *room) CMKickoutTeam(hdr *f5.MsgHdr, msg *cs.CMKickoutTeam) {
|
|||||||
hum := hdr.Context.(common.Player)
|
hum := hdr.Context.(common.Player)
|
||||||
m := this.getMember(hum.GetAccountId())
|
m := this.getMember(hum.GetAccountId())
|
||||||
t := this.getTeamByUuid(msg.GetTeamUuid())
|
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{}
|
notifyMsg := &cs.SMRoomKickoutNotify{}
|
||||||
this.broadcastMsg(notifyMsg)
|
this.broadcastMsg(notifyMsg)
|
||||||
t.unInit()
|
t.unInit()
|
||||||
@ -275,11 +275,11 @@ func (this *room) CMKickoutMember(hdr *f5.MsgHdr, msg *cs.CMKickoutMember) {
|
|||||||
hum := hdr.Context.(common.Player)
|
hum := hdr.Context.(common.Player)
|
||||||
m := this.getMember(hum.GetAccountId())
|
m := this.getMember(hum.GetAccountId())
|
||||||
target := this.getMember(msg.GetTargetId())
|
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 := &cs.SMRoomKickoutNotify{}
|
||||||
notifyMsg.AccountIds = append(notifyMsg.AccountIds, msg.GetTargetId())
|
notifyMsg.AccountIds = append(notifyMsg.AccountIds, msg.GetTargetId())
|
||||||
this.broadcastMsg(notifyMsg)
|
this.broadcastMsg(notifyMsg)
|
||||||
target.unInit()
|
this.removeMember(target.hum.GetAccountId())
|
||||||
this.notifyRoomInfo()
|
this.notifyRoomInfo()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user