Plumbed Delta and the IdGenerator back through
This commit is contained in:
+18
@@ -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")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user