|
|
@ -19,7 +19,12 @@ type room struct {
|
|
|
|
|
|
|
|
|
|
|
|
func (r *room) update(dt time.Duration) {
|
|
|
|
func (r *room) update(dt time.Duration) {
|
|
|
|
for _, p := range r.players {
|
|
|
|
for _, p := range r.players {
|
|
|
|
for _, req := range p.pending {
|
|
|
|
if p.pending == nil {
|
|
|
|
|
|
|
|
continue
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
req := p.pending
|
|
|
|
|
|
|
|
p.pending = nil
|
|
|
|
|
|
|
|
|
|
|
|
res := req.Wants.exec(r, p, req.Seq)
|
|
|
|
res := req.Wants.exec(r, p, req.Seq)
|
|
|
|
p.outbox <- wire.Response{Re: req.Seq, Body: res.reply}
|
|
|
|
p.outbox <- wire.Response{Re: req.Seq, Body: res.reply}
|
|
|
|
if res.announce != nil {
|
|
|
|
if res.announce != nil {
|
|
|
@ -31,8 +36,6 @@ func (r *room) update(dt time.Duration) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
p.pending = p.pending[0:0]
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for _, t := range r.tiles {
|
|
|
|
for _, t := range r.tiles {
|
|
|
|
if t.here != nil {
|
|
|
|
if t.here != nil {
|
|
|
|