[Tux4kids-commits] r1138 - tuxmath/branches/lan/server

David Bruce dbruce-guest at alioth.debian.org
Fri Jul 3 17:40:59 UTC 2009


Author: dbruce-guest
Date: 2009-07-03 17:40:58 +0000 (Fri, 03 Jul 2009)
New Revision: 1138

Modified:
   tuxmath/branches/lan/server/testclient.c
Log:
small tweak to get testclient to exit cleanly when player types "exit" during game.



Modified: tuxmath/branches/lan/server/testclient.c
===================================================================
--- tuxmath/branches/lan/server/testclient.c	2009-07-03 14:32:35 UTC (rev 1137)
+++ tuxmath/branches/lan/server/testclient.c	2009-07-03 17:40:58 UTC (rev 1138)
@@ -33,15 +33,18 @@
 SDLNet_SocketSet set;
 
 MC_FlashCard flash;    //current question
+int quit = 0;
+
 int Make_Flashcard(char *buf, MC_FlashCard* fc);
 int LAN_AnsweredCorrectly(MC_FlashCard* fc);
 int playgame(void);
 void server_pinged(void);
 
+
 int main(int argc, char **argv)
 {
   IPaddress ip;           /* Server address */
-  int quit, len, sockets_used;
+  int len, sockets_used;
   char buf[NET_BUF_LEN];     // for network messages from server
   char buffer[NET_BUF_LEN];  // for command-line input
 
@@ -406,7 +409,8 @@
           ||(strncmp(buf, "exit", 4) == 0)
 	  ||(strncmp(buf, "q", 1) == 0))
         {
-          end = 1;
+          quit = 1;  //So we exit loop in main()
+          end = 1;   //Exit our loop in playgame()
         }
         else
         {




More information about the Tux4kids-commits mailing list