ugs aliases game state, shorter help sentences
parent
c3e9c18e95
commit
2c3e870750
|
|
@ -102,3 +102,7 @@ func (ugs *UserGameServer) listen(ctx context.Context, reader func(context.Conte
|
|||
}
|
||||
return ctx.Err()
|
||||
}
|
||||
|
||||
func (ugs *UserGameServer) State(ctx context.Context) (GameState, error) {
|
||||
return ugs.games.GameState(ctx, ugs.ID)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@ func (s *S) serveWS(w http.ResponseWriter, r *http.Request) error {
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
game := ugs.ID
|
||||
|
||||
go ugs.Listen(ctx, can, func(ctx context.Context) ([]byte, error) {
|
||||
_, b, err := c.Read(ctx)
|
||||
|
|
@ -39,7 +38,7 @@ func (s *S) serveWS(w http.ResponseWriter, r *http.Request) error {
|
|||
})
|
||||
|
||||
for ugs.More(ctx) == nil {
|
||||
gameState, err := s.games.GameState(ctx, game)
|
||||
gameState, err := ugs.State(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
@ -49,7 +48,8 @@ func (s *S) serveWS(w http.ResponseWriter, r *http.Request) error {
|
|||
"CARD ASSASSINS (Mobile Ed.)",
|
||||
"",
|
||||
"1. Get any target to say any of his or her kill words.",
|
||||
"2. Click on the kill word a target said.",
|
||||
"2. Click the word to collect points.",
|
||||
"3. Review new kill words.",
|
||||
"",
|
||||
"The game ends when everyone has been assassinated.",
|
||||
}, "<br>"),
|
||||
|
|
|
|||
Loading…
Reference in New Issue