[Tux4kids-commits] r1203 - tuxmath/branches/lan/server
akash gangil
gangil-guest at alioth.debian.org
Tue Jul 14 18:16:37 UTC 2009
Author: gangil-guest
Date: 2009-07-14 18:16:35 +0000 (Tue, 14 Jul 2009)
New Revision: 1203
Modified:
tuxmath/branches/lan/server/server.c
tuxmath/branches/lan/server/testclient.h
Log:
The server failed to reconnect after closing down once , corrected it
Modified: tuxmath/branches/lan/server/server.c
===================================================================
--- tuxmath/branches/lan/server/server.c 2009-07-14 15:00:45 UTC (rev 1202)
+++ tuxmath/branches/lan/server/server.c 2009-07-14 18:16:35 UTC (rev 1203)
@@ -281,6 +281,26 @@
return; // Leave num_clients unchanged
}
+//If everyone is disconnected, game no longer in progress:
+ if(game_in_progress == 1)
+ {
+ int i = 0, playing = 0;
+ for(i = 0; i < MAX_CLIENTS; i++)
+ {
+ if(client[i].sock != NULL)
+ {
+ playing = 1;
+ printf("%d",i);
+ break;
+ }
+ }
+ if(!playing)
+ {
+ printf("All the clients have been disconnected....\n");
+ game_in_progress = 0;
+ }
+ }
+
// If game already started, send our regrets:
if(game_in_progress)
{
@@ -364,25 +384,6 @@
}
#endif
- //If everyone is disconnected, game no longer in progress:
- if(game_in_progress == 1)
- {
- int i = 0, playing = 0;
- for(i = 0; i < MAX_CLIENTS; i++)
- {
- if(client[i].sock != NULL)
- {
- playing = 1;
- break;
- }
- }
- if(!playing)
- {
- printf("All the clients have been disconnected....\n");
- game_in_progress = 0;
- }
- }
-
return;
}
Modified: tuxmath/branches/lan/server/testclient.h
===================================================================
--- tuxmath/branches/lan/server/testclient.h 2009-07-14 15:00:45 UTC (rev 1202)
+++ tuxmath/branches/lan/server/testclient.h 2009-07-14 18:16:35 UTC (rev 1203)
@@ -11,9 +11,9 @@
*/
+/*I really doubt the existence of this file */
-
#ifndef TESTCLIENT_H
#define TESTCLIENT_H
More information about the Tux4kids-commits
mailing list