From 406e02161023c70db4d4aa07bf62be196f51936a Mon Sep 17 00:00:00 2001 From: stpohle Date: Wed, 31 Dec 2003 01:09:43 +0000 Subject: [PATCH] OpenGameCache Send Servermode fixed, had some trouble with the status --- TODO | 4 +--- src/network.c | 27 ++++++++++++++++++--------- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/TODO b/TODO index 4861303..e12a5ba 100644 --- a/TODO +++ b/TODO @@ -1,4 +1,4 @@ -$Id: TODO,v 1.30 2003/12/30 20:28:17 stpohle Exp $ +$Id: TODO,v 1.31 2003/12/31 01:09:43 stpohle Exp $ * player position at start up need some little work it is still happening that player just die because @@ -7,8 +7,6 @@ $Id: TODO,v 1.30 2003/12/30 20:28:17 stpohle Exp $ * check if the player is on a field with an running explosion -* chat is not working - * gameserver can't see any games.. somehow ipv6 and ipv4 got mixed up diff --git a/src/network.c b/src/network.c index c3bef5c..62d1277 100644 --- a/src/network.c +++ b/src/network.c @@ -1,4 +1,4 @@ -/* $Id: network.c,v 1.48 2003/12/28 19:07:38 stpohle Exp $ */ +/* $Id: network.c,v 1.49 2003/12/31 01:09:43 stpohle Exp $ */ /* network routines. */ @@ -796,14 +796,23 @@ void send_ogc_update () { if (PS_IS_used (players[i].state)) j++; - if (bman.state == GS_running) - sprintf (status, "running"); - if (bman.state == GS_ready) - sprintf (status, "ready"); - if (bman.state == GS_wait) - sprintf (status, "wait"); - if (bman.state == GS_update) - sprintf (status, "update"); + switch (bman.state) { + case (GS_running): + sprintf (status, "running"); + break; + case (GS_ready): + sprintf (status, "ready"); + break; + case (GS_wait): + sprintf (status, "wait"); + break; + case (GS_update): + sprintf (status, "update"); + break; + default: + sprintf (status, "error"); + break; + } ogc_sendgamestatus (bman.sock, "BomberClone", VERSION, bman.gamename, j, bman.maxplayer, status); };