added ability to autovivify games in debug mode
This commit is contained in:
+1
-7
@@ -18,13 +18,7 @@ func (h JsonHandler) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||
func startGame(w http.ResponseWriter, req *http.Request) {
|
||||
log.Println("asked to create a game")
|
||||
new_game_name := idg.Hash()
|
||||
|
||||
_g := NewGame(new_game_name, *width, *height)
|
||||
go _g.run()
|
||||
|
||||
games.Lock()
|
||||
games.m[new_game_name] = _g
|
||||
games.Unlock()
|
||||
games.getOrCreate(new_game_name)
|
||||
|
||||
game_json := struct {
|
||||
Id string `json:"id"`
|
||||
|
||||
Reference in New Issue
Block a user