Call gamestats.StartServer

This commit is contained in:
mkwcat 2024-02-05 20:07:08 -05:00
parent c9bd3ec2a8
commit 51ca27fb1e
No known key found for this signature in database
GPG Key ID: 7A505679CE9E7AA9
2 changed files with 12 additions and 1 deletions

View File

@ -19,6 +19,7 @@ type GameInfo struct {
var (
gameList []GameInfo
readGameList = false
gameListIDLookup = map[int]int{}
gameListNameLookup = map[string]int{}
mutex = sync.RWMutex{}
@ -47,6 +48,13 @@ func GetGameInfoByName(name string) *GameInfo {
}
func ReadGameList() {
mutex.Lock()
defer mutex.Unlock()
if readGameList {
return
}
file, err := os.Open("game_list.tsv")
if err != nil {
panic(err)
@ -97,6 +105,8 @@ func ReadGameList() {
}
gameListNameLookup[entry[1]] = index
}
readGameList = true
}
func GetExpectedUnitCode(gameName string) byte {

View File

@ -4,6 +4,7 @@ import (
"sync"
"wwfc/api"
"wwfc/common"
"wwfc/gamestats"
"wwfc/gpcm"
"wwfc/gpsp"
"wwfc/logging"
@ -19,7 +20,7 @@ func main() {
logging.SetLevel(*config.LogLevel)
wg := &sync.WaitGroup{}
actions := []func(){nas.StartServer, gpcm.StartServer, qr2.StartServer, gpsp.StartServer, serverbrowser.StartServer, sake.StartServer, natneg.StartServer, api.StartServer}
actions := []func(){nas.StartServer, gpcm.StartServer, qr2.StartServer, gpsp.StartServer, serverbrowser.StartServer, sake.StartServer, natneg.StartServer, api.StartServer, gamestats.StartServer}
wg.Add(5)
for _, action := range actions {
go func(ac func()) {