Plumbed Delta and the IdGenerator back through

This commit is contained in:
sm
2014-03-31 23:21:20 -07:00
parent 8b52f93ca5
commit a956162205
5 changed files with 27 additions and 10 deletions
+18
View File
@@ -28,6 +28,24 @@ type Controller struct {
Profile string
}
func NewController(conf Config, mprof, pprof string) *Controller {
idg := NewIdGenerator()
return &Controller{
Idg: idg,
Conf: conf,
Games: MapLock{
M: make(map[string]*Game),
},
Memprofile: mprof,
Profile: pprof,
}
}
// TODO Eventually this thing will have a select loop for dealing with game access in a more lock-free manner?
func (c *Controller) Run() {
c.Idg.Run()
}
func (c *Controller) StartGame(w http.ResponseWriter, req *http.Request) {
log.Println("asked to create a game")