fixed bug in last commit
This commit is contained in:
parent
5d9103f176
commit
0bc1575f81
@ -61,9 +61,8 @@ type player struct {
|
||||
}
|
||||
|
||||
func (p *player) recv() {
|
||||
buff := make([]byte, maxMessageSize)
|
||||
for {
|
||||
msgs, err := p.readJSON(buff)
|
||||
msgs, err := p.readJSON(p.buff)
|
||||
if err != nil {
|
||||
log.Printf("%s: %s", p.Id, err)
|
||||
break
|
||||
@ -137,10 +136,8 @@ type Spectator struct {
|
||||
}
|
||||
|
||||
func (s *Spectator) recv() {
|
||||
// TODO: move this to a NewSpectator func
|
||||
buff := make([]byte, maxMessageSize)
|
||||
for {
|
||||
_, err := s.readJSON(buff)
|
||||
_, err := s.readJSON(s.buff)
|
||||
if err != nil {
|
||||
log.Printf("%s: %s", s.Id, err)
|
||||
break
|
||||
|
Loading…
Reference in New Issue
Block a user