fixed bug in last commit

This commit is contained in:
Stephen McQuay 2014-02-17 01:06:53 -08:00
parent 5d9103f176
commit 0bc1575f81

View File

@ -61,9 +61,8 @@ type player struct {
} }
func (p *player) recv() { func (p *player) recv() {
buff := make([]byte, maxMessageSize)
for { for {
msgs, err := p.readJSON(buff) msgs, err := p.readJSON(p.buff)
if err != nil { if err != nil {
log.Printf("%s: %s", p.Id, err) log.Printf("%s: %s", p.Id, err)
break break
@ -137,10 +136,8 @@ type Spectator struct {
} }
func (s *Spectator) recv() { func (s *Spectator) recv() {
// TODO: move this to a NewSpectator func
buff := make([]byte, maxMessageSize)
for { for {
_, err := s.readJSON(buff) _, err := s.readJSON(s.buff)
if err != nil { if err != nil {
log.Printf("%s: %s", s.Id, err) log.Printf("%s: %s", s.Id, err)
break break