From 84366ba467d765ba7a14084b8b8c49fb1c61ab07 Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Mon, 18 Feb 2008 14:46:53 -0800 Subject: [PATCH] lg-set: Add a broadcast whenever a user finds a set. --- lg-set.c | 4 ++++ loudgame.h | 14 ++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/lg-set.c b/lg-set.c index 365e68b..a6594b2 100644 --- a/lg-set.c +++ b/lg-set.c @@ -430,6 +430,10 @@ set_game_handle_set (set_game_t *game, loudgame_sendf (&game->lg, peer, "Yes, that's a set!"); + loudgame_broadcastf (&game->lg, + "%s found the set: %d %d %d. Please send a new 'show' command.", + peer, + slots[0], slots[1], slots[2]); for (i = 0; i < 3; i++) game->board.slots[slots[i]].has_card = 0; diff --git a/loudgame.h b/loudgame.h index 7aedd79..c899727 100644 --- a/loudgame.h +++ b/loudgame.h @@ -67,6 +67,20 @@ loudgame_vsendf (loudgame_t *lg, const char *format, va_list va); +void +loudgame_broadcast (loudgame_t *lg, + const char *message); + +void +loudgame_vbroadcastf (loudgame_t *lg, + const char *format, + va_list va); + +void +loudgame_broadcastf (loudgame_t *lg, + const char *format, + ...); + void loudgame_quit (loudgame_t *lg, int return_value); -- 2.43.0