From dfe6e017ca54bc6e034f1903845627252a716e72 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Tue, 19 Mar 2024 18:46:34 +0800 Subject: [PATCH] 1 --- server/matchserver/team/matchmgr.go | 34 ++++++++++++++++------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/server/matchserver/team/matchmgr.go b/server/matchserver/team/matchmgr.go index 5c889651..c26ce34e 100644 --- a/server/matchserver/team/matchmgr.go +++ b/server/matchserver/team/matchmgr.go @@ -81,23 +81,27 @@ func (this *matchMgr) mustBeZn(key int64) *q5.ListHead { } func (this *matchMgr) execMatch(m *matchingInfo) { - l := this.mustBeZn(m.team.GetZnKey()) - l.ForEach( - func (ele interface{}) bool { - if targetM, ok := ele.(*matchingInfo); ok { - if m != targetM && m.team.canMatch(targetM.team) { - m.matchOk = targetM - m.matchTick = q5.GetTickCount() + if q5.GetTickCount() - m.addTick > 1000 * 7 { - targetM.matchOk = m - targetM.matchTick = q5.GetTickCount() - return false + } else { + l := this.mustBeZn(m.team.GetZnKey()) + l.ForEach( + func (ele interface{}) bool { + if targetM, ok := ele.(*matchingInfo); ok { + if m != targetM && m.team.canMatch(targetM.team) { + m.matchOk = targetM + m.matchTick = q5.GetTickCount() + + targetM.matchOk = m + targetM.matchTick = q5.GetTickCount() + return false + } } - } - return true - }) - if m.matchOk != nil { - this.onMatchOk(m) + return true + }) + if m.matchOk != nil { + this.onMatchOk(m) + } } }