revert me: default to allowing connecting players to start games
This commit is contained in:
parent
2cbef76a37
commit
50868809bd
1
main.go
1
main.go
@ -13,7 +13,6 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var addr = flag.String("addr", ":8666", "http service address")
|
var addr = flag.String("addr", ":8666", "http service address")
|
||||||
var debug = flag.Bool("debug", false, "automatically create games if they don't exist")
|
|
||||||
var profile = flag.String("pprof", "", "if specified will run with pprof")
|
var profile = flag.String("pprof", "", "if specified will run with pprof")
|
||||||
var netprofile = flag.Bool("netprof", false, "if specified will run with net/http/pprof")
|
var netprofile = flag.Bool("netprof", false, "if specified will run with net/http/pprof")
|
||||||
var verbose = flag.Bool("verbose", false, "")
|
var verbose = flag.Bool("verbose", false, "")
|
||||||
|
@ -161,8 +161,6 @@ func addPlayer(ws *websocket.Conn) {
|
|||||||
|
|
||||||
game := games.get(gid.Id)
|
game := games.get(gid.Id)
|
||||||
if game == nil {
|
if game == nil {
|
||||||
force := *debug
|
|
||||||
if force {
|
|
||||||
game = NewGame(
|
game = NewGame(
|
||||||
gid.Id,
|
gid.Id,
|
||||||
float32(conf.Width),
|
float32(conf.Width),
|
||||||
@ -171,11 +169,6 @@ func addPlayer(ws *websocket.Conn) {
|
|||||||
)
|
)
|
||||||
go game.run()
|
go game.run()
|
||||||
games.add(game)
|
games.add(game)
|
||||||
} else {
|
|
||||||
log.Printf("ERROR: game '%s' not found", gid.Id)
|
|
||||||
websocket.JSON.Send(ws, NewFailure("game 404"))
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
player_id := idg.Hash()
|
player_id := idg.Hash()
|
||||||
|
Loading…
Reference in New Issue
Block a user