[Tux4kids-commits] r1462 - tuxmath/branches/lan/src

David Bruce dbruce-guest at alioth.debian.org
Wed Aug 26 20:02:12 UTC 2009


Author: dbruce-guest
Date: 2009-08-26 20:02:12 +0000 (Wed, 26 Aug 2009)
New Revision: 1462

Modified:
   tuxmath/branches/lan/src/titlescreen.c
Log:
Make client respond more gracefully if server not found (no longer exit)



Modified: tuxmath/branches/lan/src/titlescreen.c
===================================================================
--- tuxmath/branches/lan/src/titlescreen.c	2009-08-26 02:20:45 UTC (rev 1461)
+++ tuxmath/branches/lan/src/titlescreen.c	2009-08-26 20:02:12 UTC (rev 1462)
@@ -894,24 +894,24 @@
     
     if(mode == 1)
     {
-      if(detecting_servers(_("Detecting Servers"),_("Please Wait")))
+      if(detecting_servers(_("Detecting Servers"), _("Please Wait")))
       {
+        NameEntry(player_name, _("Enter your Name:"), _(""));
+        LAN_SetName(player_name);
+        Ready(_("Click OK when Ready"));
+        LAN_StartGame();
+        Standby(_("Waiting For Other Players"),_("To Connect"));
 
-
-      NameEntry(player_name, _("Enter your Name:"),
-                      _(""));
-
-      LAN_SetName(player_name);
-      Ready(_("Click OK when Ready"));
-      LAN_StartGame();
-      Standby(_("Waiting For Other Players"),_("To Connect"));
-
-      Opts_SetLanMode(1);  // Tells game() we are playing over network
-      game();
-      Opts_SetLanMode(0);  // Go back to local play
+        Opts_SetLanMode(1);  // Tells game() we are playing over network
+        game();
+        Opts_SetLanMode(0);  // Go back to local play
       }
+      else
+      {
+        ShowMessage(NULL, _("Sorry, no server could be found."), NULL, NULL);
+        break;
+      }
     }   
-
   }
 
   return 0;




More information about the Tux4kids-commits mailing list