drop logs
parent
e95b63d9ce
commit
74a403fa6d
|
|
@ -4,7 +4,6 @@ import (
|
|||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
"log"
|
||||
"time"
|
||||
)
|
||||
|
|
@ -66,13 +65,11 @@ func (ugs *UserGameServer) listen(ctx context.Context, reader func(context.Conte
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
log.Printf("READ %s", b)
|
||||
|
||||
var m map[string]string
|
||||
if err := json.Unmarshal(b, &m); err != nil {
|
||||
return err
|
||||
}
|
||||
log.Printf("UNMARSHAL %+v", m)
|
||||
|
||||
if m["party"] == "start" {
|
||||
if gameState, err := ugs.games.GameState(ctx, ugs.ID); err != nil {
|
||||
|
|
@ -82,8 +79,7 @@ func (ugs *UserGameServer) listen(ctx context.Context, reader func(context.Conte
|
|||
return err
|
||||
}
|
||||
} else if m["k"] != "" {
|
||||
log.Println("TODO a kill occurred")
|
||||
return io.EOF
|
||||
return fmt.Errorf("not impl: a kill occurred: %+v", m)
|
||||
} else if name := m["name"]; name != "" {
|
||||
if err := ugs.games.UpdateUserName(ctx, ugs.Session.ID, name); err != nil {
|
||||
return err
|
||||
|
|
@ -93,8 +89,7 @@ func (ugs *UserGameServer) listen(ctx context.Context, reader func(context.Conte
|
|||
return err
|
||||
} else if gameState.Completed.IsZero() {
|
||||
} else {
|
||||
log.Println("TODO new game")
|
||||
return io.EOF
|
||||
return fmt.Errorf("not impl: new game: %+v", m)
|
||||
}
|
||||
} else {
|
||||
return fmt.Errorf("UNKNOWN: %+v", m)
|
||||
|
|
|
|||
Loading…
Reference in New Issue