Resolve queue overflow

This commit is contained in:
Trevor Slocum 2020-03-08 07:43:29 -07:00
parent 6a9e65717d
commit 42c8f99304
2 changed files with 11 additions and 2 deletions

View file

@ -101,7 +101,12 @@ func (s *Conn) Write(gc GameCommandInterface) {
}
s.Add(1)
s.out <- gc
select {
case s.out <- gc:
default:
s.Done()
s.Close()
}
}
func (s *Conn) handleLocalWrite() {

View file

@ -868,7 +868,11 @@ func (m *Matrix) Moved() {
return
}
m.Move <- 0
select {
case m.Move <- 0:
default:
m.SetGameOver()
}
}
func (m *Matrix) HardDropPiece() {