This commit is contained in:
aozhiwei 2024-03-19 16:39:33 +08:00
parent aff32c9c75
commit 754d7515d7
2 changed files with 10 additions and 4 deletions

View File

@ -28,7 +28,7 @@ func (this *matchMgr) Init() {
func (this *matchMgr) UnInit() {
}
func (this *matchMgr) addMatchingTeam(team *team) {
func (this *matchMgr) addMatch(team *team) {
if this.getMatchingInfoByUuid(team.GetTeamUuid()) != nil {
panic("111111")
return
@ -41,11 +41,17 @@ func (this *matchMgr) addMatchingTeam(team *team) {
this.mustBeZn(team.GetZnKey()).AddTail(&m.entry)
}
func (this *matchMgr) cancelMatching(team *team) {
func (this *matchMgr) cancelMatch(team *team) bool {
m := this.getMatchingInfoByUuid(team.GetTeamUuid())
if m != nil {
if m.matchOk != nil {
panic("cancelMatching error")
return false
}
m.entry.DelInit()
delete(this.teamUuidHash, team.GetTeamUuid())
}
return false
}
func (this *matchMgr) getMatchingInfoByUuid(teamUuid string) *matchingInfo {

View File

@ -139,7 +139,7 @@ func (this *team) StartGame() {
if !this.IsLock() && this.CanStartGame(this.owner) {
if this.IsMobaMode() {
this.state = constant.TEAM_STATE_MATCHING
_matchMgr.addMatchingTeam(this)
_matchMgr.addMatch(this)
this.SendStateNotify()
} else {
this.state = constant.TEAM_STATE_STARTED