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", "friendapi_url": "http://127.0.0.1:8879",
"auto_start_time": 3600, "auto_start_time": 3600,
"game_start_notify_time": 20, "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) this.oldExecMatch(m)
return return
} }
l := this.mustBeZn(m.team.GetZnKey()) if m.team.HasOnlinePlayer() {
l.ForEach( m.lastHasOnlinePlayerTick = q5.GetTickCount()
func (ele interface{}) bool { l := this.mustBeZn(m.team.GetZnKey())
if targetM, ok := ele.(*matchingInfo); ok { l.ForEach(
if m != targetM && m.team.canMatch(targetM.team) { func (ele interface{}) bool {
m.matchOk = targetM if targetM, ok := ele.(*matchingInfo); ok {
m.matchTick = q5.GetTickCount() if m != targetM && m.team.canMatch(targetM.team) {
m.matchOk = targetM
m.matchTick = q5.GetTickCount()
targetM.matchOk = m targetM.matchOk = m
targetM.matchTick = q5.GetTickCount() targetM.matchTick = q5.GetTickCount()
return false return false
}
} }
} return true
return true })
}) if m.matchOk != nil {
if m.matchOk != nil { this.onMatchOk(m)
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" "mt"
"main/common" "main/common"
"main/constant" "main/constant"
"jccommon"
"fmt" "fmt"
"sort" "sort"
@ -698,7 +697,7 @@ func (this *team) NeedMatchRealPlayer() bool {
if mt.Table.Config.Get().GetMatchRealPlayer() == 0 { if mt.Table.Config.Get().GetMatchRealPlayer() == 0 {
return false return false
} }
return q5.ToInt32(this.getModeId()) == jccommon.MAP_MODE_BOUNTY return q5.ToInt32(this.getModeId()) == 2
} }
func newTeam() *team { func newTeam() *team {