diff --git a/server/matchserver/team/team.go b/server/matchserver/team/team.go index a24a3798..3ff45c12 100644 --- a/server/matchserver/team/team.go +++ b/server/matchserver/team/team.go @@ -25,6 +25,8 @@ type team struct { startTime int64 stateNotifyMsg *cs.SMTeamStateNotify accountIdHash map[string]common.Player + matchOk *team + matchTick int64 } func (this *team) init(teamUuid string, owner common.Player, msg *cs.CMLogin, mapInfo* common.MapInfoRsp) { @@ -120,6 +122,8 @@ func (this *team) IsLock() bool { } func (this *team) setMatchOk(targetM *team) { + this.matchOk = targetM + this.matchTick = q5.GetTickCount() } func (this *team) onMatchOk() { @@ -234,7 +238,9 @@ func (this *team) HandoverLeader(hum common.Player, targetId string) { } func (this *team) CancelMatch() { - if !this.Started() { + if this.Matching() { + _matchMgr.cancelMatch(this) + this.state = constant.TEAM_STATE_INIT } }