added ability to autovivify games in debug mode
This commit is contained in:
+2
-4
@@ -99,11 +99,9 @@ func addPlayer(ws *websocket.Conn) {
|
||||
return
|
||||
}
|
||||
|
||||
games.Lock()
|
||||
game, ok := games.m[gid.Id]
|
||||
games.Unlock()
|
||||
game, err := games.getOrCreate(gid.Id)
|
||||
|
||||
if !ok {
|
||||
if err != nil {
|
||||
log.Printf("ERROR: game %s not found", gid.Id)
|
||||
websocket.JSON.Send(ws, NewFailure("game 404"))
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user