Skip to content

Commit

Permalink
Extend AI UMS team detection to AI Hunters games
Browse files Browse the repository at this point in the history
  • Loading branch information
icza committed Aug 26, 2024
1 parent e4bb2b0 commit fa6f488
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
5 changes: 4 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@ module github.com/icza/screp

go 1.20

require golang.org/x/text v0.8.0
require (
github.com/icza/gox v0.0.0-20230924165045-adcb03233bb5
golang.org/x/text v0.17.0
)
6 changes: 4 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68=
golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
github.com/icza/gox v0.0.0-20230924165045-adcb03233bb5 h1:K7KEFpKgVcjj98jOu2Z3xMBTtTwfYVT90Zmo3ZuWmbE=
github.com/icza/gox v0.0.0-20230924165045-adcb03233bb5/go.mod h1:VbcN86fRkkUMPX2ufM85Um8zFndLZswoIW1eYtpAcVk=
golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc=
golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
6 changes: 4 additions & 2 deletions rep/replay.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"strings"
"time"

"github.com/icza/gox/stringsx"
"github.com/icza/screp/rep/repcmd"
"github.com/icza/screp/rep/repcore"
"github.com/icza/screp/repparser/repdecoder"
Expand Down Expand Up @@ -153,10 +154,11 @@ func (r *Replay) Compute() {
if r.MapData != nil {
mapName = r.MapData.Name
}
mapName = strings.ToLower(mapName)
// counter-example: " \aai \x04hunters \x02remastered \x062.0"
mapName = strings.ToLower(stringsx.Clean(mapName))
// "[ai]" maps are special, we can do better than in general:
switch {
case strings.Contains(mapName, "[ai]") || strings.Contains(mapName, "bgh random teams"):
case strings.Contains(mapName, "[ai]") || strings.Contains(mapName, "ai hunters") || strings.Contains(mapName, "bgh random teams"):
r.detectObservers(pidBuilds, obsProfileUMSAI)
r.computeUMSTeamsAI()
default:
Expand Down

0 comments on commit fa6f488

Please sign in to comment.