Complete.Org: Mailing Lists: Archives: freeciv-dev: October 2003:
[Freeciv-Dev] (PR#6584) Better error messages for /start command
Home

[Freeciv-Dev] (PR#6584) Better error messages for /start command

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#6584) Better error messages for /start command
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 21 Oct 2003 07:45:25 -0700
Reply-to: rt@xxxxxxxxxxxxxx

The attached patch improves the error messages given when /start is 
given during the wrong game state.

jason

Index: server/stdinhand.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/stdinhand.c,v
retrieving revision 1.297
diff -u -r1.297 stdinhand.c
--- server/stdinhand.c  2003/10/15 20:56:12     1.297
+++ server/stdinhand.c  2003/10/21 14:42:50
@@ -4058,8 +4058,8 @@
     timeout_command(caller, allargs);
     break;
   case CMD_START_GAME:
-    if (server_state==PRE_GAME_STATE) {
-
+    switch (server_state) {
+    case PRE_GAME_STATE:
       /* Sanity check scenario */
       if (game.is_new_game) {
        if (map.fixed_start_positions
@@ -4089,13 +4089,27 @@
       if (game.nplayers < game.min_players) {
         cmd_reply(cmd,caller, C_FAIL,
                  _("Not enough players, game will not start."));
-        break;
+      } else {
+       start_game();
       }
-
-      start_game();
-    } else {
+      break;
+    case GAME_OVER_STATE:
+      /* TODO: change this message if a /restart command is added. */
+      /* TRANS: given when /start is invoked during gameover. */
+      cmd_reply(cmd,caller, C_FAIL,
+               _("Cannot start the game: the current game is over.  The "
+                 "game will restart when all players disconnect."));
+      break;
+    case SELECT_RACES_STATE:
+      /* TRANS: given when /start is invoked during nation selection. */
+      cmd_reply(cmd,caller, C_FAIL,
+               _("Cannot start the game: it has already been started."));
+      break;
+    case RUN_GAME_STATE:
+      /* TRANS: given when /start is invoked while the game is running. */
       cmd_reply(cmd,caller, C_FAIL,
                _("Cannot start the game: it is already running."));
+      break;
     }
     break;
   case CMD_END_GAME:

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#6584) Better error messages for /start command, Jason Short <=