This commit is contained in:
Branden J Brown 2024-02-02 21:13:16 -06:00
parent d2e9d6cf01
commit 1eeb33e851
1 changed files with 2 additions and 0 deletions

View File

@ -144,10 +144,12 @@ func playerActor(ctx context.Context, p person, actions chan<- action) {
func broadcast(ctx context.Context, g *game.Match, dealer, chall person, obs []observer) { func broadcast(ctx context.Context, g *game.Match, dealer, chall person, obs []observer) {
// TODO(zeph): this probably should return an error or some other signal // TODO(zeph): this probably should return an error or some other signal
// if a player drops so that the actor knows to quit // if a player drops so that the actor knows to quit
slog.InfoContext(ctx, "send to dealer")
if err := wsjson.Write(ctx, dealer.conn, g.DTO(dealer.id)); err != nil { if err := wsjson.Write(ctx, dealer.conn, g.DTO(dealer.id)); err != nil {
// TODO(zeph): concede, but we need to be careful not to recurse // TODO(zeph): concede, but we need to be careful not to recurse
slog.InfoContext(ctx, "lost dealer", "player", dealer.id, "err", err.Error()) slog.InfoContext(ctx, "lost dealer", "player", dealer.id, "err", err.Error())
} }
slog.InfoContext(ctx, "send to challenger")
if err := wsjson.Write(ctx, chall.conn, g.DTO(chall.id)); err != nil { if err := wsjson.Write(ctx, chall.conn, g.DTO(chall.id)); err != nil {
// TODO(zeph): concede, but we need to be careful not to recurse // TODO(zeph): concede, but we need to be careful not to recurse
slog.InfoContext(ctx, "lost challenger", "player", chall.id, "err", err.Error()) slog.InfoContext(ctx, "lost challenger", "player", chall.id, "err", err.Error())