From 7883bb61c05c1935dcefb82a922c166aa4d9ccbc Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 30 Apr 2025 13:36:44 +0200 Subject: added more features and server-side commands --- client.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'client.c') diff --git a/client.c b/client.c index e783a65..373a282 100644 --- a/client.c +++ b/client.c @@ -32,7 +32,9 @@ void broadcast_message(const char *message, int sender_sock) { for (int i = 0; i < 10; i++) { if (clients[i] && clients[i]->socket != sender_sock && strcmp(clients[i]->room, sender->room) == 0) { - send_to_client(clients[i]->socket, message); + char formatted[BUFFER_SIZE + 100]; + snprintf(formatted, sizeof(formatted), "%s: %s", clients[i]->username, message); + send_to_client(clients[i]->socket, formatted); } } -- cgit v1.2.3