From 79b77612579be43566fcbac7a153da22b4cd9dd7 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Sat, 7 Jan 2006 20:08:11 +0000 Subject: Send player name and address in the waiting data packets. Display these on the waiting screen, and improve the waiting screen appearance. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 262 --- src/net_client.c | 42 +++++++++++++++++++++++++++++++++++++++++- src/net_client.h | 11 ++++++++++- src/net_gui.c | 49 ++++++++++++++++++++++++++++++++++++++++++++----- src/net_server.c | 29 +++++++++++++++++++++++++++-- 4 files changed, 122 insertions(+), 9 deletions(-) diff --git a/src/net_client.c b/src/net_client.c index fc3082fa..7628530e 100644 --- a/src/net_client.c +++ b/src/net_client.c @@ -1,7 +1,7 @@ // Emacs style mode select -*- C++ -*- //----------------------------------------------------------------------------- // -// $Id: net_client.c 252 2006-01-02 21:50:26Z fraggle $ +// $Id: net_client.c 262 2006-01-07 20:08:11Z fraggle $ // // Copyright(C) 2005 Simon Howard // @@ -21,6 +21,10 @@ // 02111-1307, USA. // // $Log$ +// Revision 1.9 2006/01/07 20:08:11 fraggle +// Send player name and address in the waiting data packets. Display these +// on the waiting screen, and improve the waiting screen appearance. +// // Revision 1.8 2006/01/02 21:50:26 fraggle // Restructure the waiting screen code. Establish our own separate event // loop while waiting for the game to start, to avoid affecting the original @@ -105,6 +109,11 @@ boolean net_client_controller = false; int net_clients_in_game; +// Nmaes of all players + +char net_player_addresses[MAXPLAYERS][MAXPLAYERNAME]; +char net_player_names[MAXPLAYERS][MAXPLAYERNAME]; + // Waiting for the game to start? boolean net_waiting_for_start = false; @@ -126,6 +135,9 @@ static void NET_CL_ParseWaitingData(net_packet_t *packet) { unsigned int num_players; unsigned int is_controller; + char *player_names[MAXPLAYERS]; + char *player_addr[MAXPLAYERS]; + int i; if (!NET_ReadInt8(packet, &num_players) || !NET_ReadInt8(packet, &is_controller)) @@ -135,8 +147,36 @@ static void NET_CL_ParseWaitingData(net_packet_t *packet) return; } + if (num_players > MAXPLAYERS) + { + // Invalid number of players + + return; + } + + // Read the player names + + for (i=0; i