1
This commit is contained in:
parent
61adb6734b
commit
9c59c73822
@ -149,16 +149,7 @@ func (this *team) getMainTeam() *team {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (this *team) onMatchOk(startTime int64) {
|
func (this *team) onMatchOk(startTime int64) {
|
||||||
this.state = constant.TEAM_STATE_STARTED
|
this.doStartGame(startTime)
|
||||||
this.startTime = startTime
|
|
||||||
this.stateNotifyMsg.State = proto.Int32(this.state)
|
|
||||||
this.genStartGameInfo()
|
|
||||||
this.SendStateNotify()
|
|
||||||
f5.GetTimer().SetInterval(1000, func(e int32, args *q5.Args) {
|
|
||||||
if e == q5.TIMER_EXEC_EVENT {
|
|
||||||
this.SendStateNotify()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *team) CanStartGame(hum common.Player) bool {
|
func (this *team) CanStartGame(hum common.Player) bool {
|
||||||
@ -184,20 +175,24 @@ func (this *team) StartGame() {
|
|||||||
_matchMgr.addMatch(this)
|
_matchMgr.addMatch(this)
|
||||||
this.SendStateNotify()
|
this.SendStateNotify()
|
||||||
} else {
|
} else {
|
||||||
this.state = constant.TEAM_STATE_STARTED
|
this.doStartGame(f5.GetApp().GetNowSeconds())
|
||||||
this.startTime = f5.GetApp().GetNowSeconds()
|
|
||||||
this.stateNotifyMsg.State = proto.Int32(this.state)
|
|
||||||
this.genStartGameInfo()
|
|
||||||
this.SendStateNotify()
|
|
||||||
f5.GetTimer().SetInterval(1000, func(e int32, args *q5.Args) {
|
|
||||||
if e == q5.TIMER_EXEC_EVENT {
|
|
||||||
this.SendStateNotify()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (this *team) doStartGame(startTime int64) {
|
||||||
|
this.state = constant.TEAM_STATE_STARTED
|
||||||
|
this.startTime = startTime
|
||||||
|
this.stateNotifyMsg.State = proto.Int32(this.state)
|
||||||
|
this.genStartGameInfo()
|
||||||
|
this.SendStateNotify()
|
||||||
|
f5.GetTimer().SetInterval(1000, func(e int32, args *q5.Args) {
|
||||||
|
if e == q5.TIMER_EXEC_EVENT {
|
||||||
|
this.SendStateNotify()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
func (this *team) GetMemberNum() int32 {
|
func (this *team) GetMemberNum() int32 {
|
||||||
return int32(len(this.memberIdHash))
|
return int32(len(this.memberIdHash))
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user