1
This commit is contained in:
parent
ef14af8401
commit
a8939e79c8
@ -110,6 +110,16 @@ func (this *team) StartGame() {
|
|||||||
if !this.Started() {
|
if !this.Started() {
|
||||||
this.state = constant.TEAM_STATE_STARTED
|
this.state = constant.TEAM_STATE_STARTED
|
||||||
this.startTime = f5.GetApp().GetNowSeconds()
|
this.startTime = f5.GetApp().GetNowSeconds()
|
||||||
|
this.genStartGameInfo()
|
||||||
|
f5.GetTimer().SetInterval(1000, func(e int32, args *q5.Args) {
|
||||||
|
if e == q5.TIMER_EXEC_EVENT {
|
||||||
|
this.SendStateNotify()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *team) genStartGameInfo() {
|
||||||
startInfo := struct {
|
startInfo := struct {
|
||||||
ZoneId int32 `json:"zone_id"`
|
ZoneId int32 `json:"zone_id"`
|
||||||
NodeId int32 `json:"node_id"`
|
NodeId int32 `json:"node_id"`
|
||||||
@ -146,7 +156,6 @@ func (this *team) StartGame() {
|
|||||||
this.stateNotifyMsg.JoinMsg.TeamUuid = proto.String(this.GetTeamUuid())
|
this.stateNotifyMsg.JoinMsg.TeamUuid = proto.String(this.GetTeamUuid())
|
||||||
this.stateNotifyMsg.JoinMsg.Payload = proto.String(payload)
|
this.stateNotifyMsg.JoinMsg.Payload = proto.String(payload)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
func (this *team) broadcastMsg(msg proto.Message) {
|
func (this *team) broadcastMsg(msg proto.Message) {
|
||||||
for _, m := range this.accountIdHash {
|
for _, m := range this.accountIdHash {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user