1
This commit is contained in:
parent
bf985f9c81
commit
dd70b97f58
@ -343,6 +343,19 @@ func (this *room) GetRoomState() int32 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (this *room) notifyGameStart() {
|
func (this *room) notifyGameStart() {
|
||||||
|
if this.gameStartNotifyMsg == nil {
|
||||||
|
this.genGameStartNotifyMsg()
|
||||||
|
}
|
||||||
|
for _, m := range(this.members) {
|
||||||
|
if m.state == MEMBER_READY_STATE &&
|
||||||
|
m.hum.GetRoom() == this &&
|
||||||
|
!m.closeGameStartNotify {
|
||||||
|
m.hum.SendMsg(this.gameStartNotifyMsg)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *room) genGameStartNotifyMsg() {
|
||||||
if this.gameStartNotifyMsg == nil {
|
if this.gameStartNotifyMsg == nil {
|
||||||
this.gameStartNotifyMsg = &cs.SMRoomGameStartNotify{}
|
this.gameStartNotifyMsg = &cs.SMRoomGameStartNotify{}
|
||||||
this.gameStartNotifyMsg.ZoneId = proto.Int32(this.config.zoneId)
|
this.gameStartNotifyMsg.ZoneId = proto.Int32(this.config.zoneId)
|
||||||
@ -384,13 +397,6 @@ func (this *room) notifyGameStart() {
|
|||||||
}
|
}
|
||||||
this.gameStartNotifyMsg.CustomRoomPayload = proto.String(q5.EncodeJson(&startInfo))
|
this.gameStartNotifyMsg.CustomRoomPayload = proto.String(q5.EncodeJson(&startInfo))
|
||||||
}
|
}
|
||||||
for _, m := range(this.members) {
|
|
||||||
if m.state == MEMBER_READY_STATE &&
|
|
||||||
m.hum.GetRoom() == this &&
|
|
||||||
!m.closeGameStartNotify {
|
|
||||||
m.hum.SendMsg(this.gameStartNotifyMsg)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *room) canStart() bool {
|
func (this *room) canStart() bool {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user