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() {
|
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
|
||||||
|
Loading…
Reference in New Issue
Block a user