mirror of
https://github.com/WiiLink24/wfc-server.git
synced 2026-03-21 17:44:58 -05:00
Call gamestats.StartServer
This commit is contained in:
parent
c9bd3ec2a8
commit
51ca27fb1e
|
|
@ -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 {
|
||||
|
|
|
|||
3
main.go
3
main.go
|
|
@ -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()) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user