Browse Source

fixed bug in last commit

master
Stephen McQuay 6 years ago
parent
commit
0bc1575f81
1 changed files with 2 additions and 5 deletions
  1. +2
    -5
      player.go

+ 2
- 5
player.go View File

@ -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…
Cancel
Save