This commit is contained in:
aozhiwei 2024-07-12 16:43:36 +08:00
parent 9e04f4c7d0
commit dcb522f0a5
3 changed files with 25 additions and 18 deletions

View File

@ -3,5 +3,6 @@
"friendapi_url": "http://127.0.0.1:8879",
"auto_start_time": 3600,
"game_start_notify_time": 20,
"delay_delete_time": 60
"delay_delete_time": 60,
"match_real_player": 1
}

View File

@ -87,23 +87,30 @@ func (this *matchMgr) execMatch(m *matchingInfo) {
this.oldExecMatch(m)
return
}
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 m.team.HasOnlinePlayer() {
m.lastHasOnlinePlayerTick = q5.GetTickCount()
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
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)
}
} else if q5.GetTickCount() - m.lastHasOnlinePlayerTick > 1000 * 60 * 30 {
this.cancelMatch(m.team)
_teamMgr.removeTeam(m.team.GetTeamUuid())
f5.GetSysLog().Info("matchMgr.execMatch team Timeout:%s", m.team.GetTeamUuid())
}
}

View File

@ -7,7 +7,6 @@ import (
"mt"
"main/common"
"main/constant"
"jccommon"
"fmt"
"sort"
@ -698,7 +697,7 @@ func (this *team) NeedMatchRealPlayer() bool {
if mt.Table.Config.Get().GetMatchRealPlayer() == 0 {
return false
}
return q5.ToInt32(this.getModeId()) == jccommon.MAP_MODE_BOUNTY
return q5.ToInt32(this.getModeId()) == 2
}
func newTeam() *team {