Complete.Org: Mailing Lists: Archives: freeciv-dev: October 2004:
[Freeciv-Dev] (PR#10559) Game: You voted for "set gen 3"
Home

[Freeciv-Dev] (PR#10559) Game: You voted for "set gen 3"

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#10559) Game: You voted for "set gen 3"
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 19 Oct 2004 23:35:24 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=10559 >

> [jdorje - Sat Oct 16 18:16:01 2004]:
> 
> Any time a vote is started, all players see this line:
> 
>    Game: You voted for "set gen 3"

Any cmd_reply that is C_OK is sent to all connections!  See
cmd_reply_line in stdinhand.c.  This is correct for most replies.  For
instance if you /set aifill 5 everyone should see "Aifill set to 5."

Looks like the correct fix is to use C_COMMENT here.

jason

? diff
? newtiles
Index: server/stdinhand.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/stdinhand.c,v
retrieving revision 1.359
diff -u -r1.359 stdinhand.c
--- server/stdinhand.c  9 Oct 2004 21:44:21 -0000       1.359
+++ server/stdinhand.c  20 Oct 2004 06:35:24 -0000
@@ -2078,13 +2078,15 @@
 
       if (vote->command[0] != '\0') {
         j++;
-        cmd_reply(CMD_VOTE, caller, C_OK, _("Vote %d \"%s\": %d for, %d "
-                  "against"), vote->vote_no, vote->command, vote->yes, 
+        cmd_reply(CMD_VOTE, caller, C_COMMENT,
+                 _("Vote %d \"%s\": %d for, %d against"),
+                 vote->vote_no, vote->command, vote->yes, 
                   vote->no);
       }
     }
     if (j == 0) {
-      cmd_reply(CMD_VOTE, caller, C_OK, _("There are no votes going on."));
+      cmd_reply(CMD_VOTE, caller, C_COMMENT,
+               _("There are no votes going on."));
     }
     return FALSE; /* see below */
   } if (check) {
@@ -2126,11 +2128,11 @@
       goto cleanup;
     }
     if (strcmp(arg[0], "yes") == 0) {
-      cmd_reply(CMD_VOTE, caller, C_OK, _("You voted for \"%s\""), 
+      cmd_reply(CMD_VOTE, caller, C_COMMENT, _("You voted for \"%s\""), 
                 vote->command);
       vote->votes_cast[caller->player->player_no] = 2;
     } else if (strcmp(arg[0], "no") == 0) {
-      cmd_reply(CMD_VOTE, caller, C_OK, _("You voted against \"%s\""), 
+      cmd_reply(CMD_VOTE, caller, C_COMMENT, _("You voted against \"%s\""), 
                 vote->command);
       vote->votes_cast[caller->player->player_no] = 3;
     }
@@ -3258,8 +3260,9 @@
     /* If we already have a vote going, cancel it in favour of the new
      * vote command. You can only have one vote at a time. */
     if (votes[idx].command[0] != '\0') {
-      cmd_reply(CMD_VOTE, caller, C_OK, _("Your new vote cancelled your "
-                "previous vote."));
+      cmd_reply(CMD_VOTE, caller, C_COMMENT,
+               _("Your new vote cancelled your "
+                 "previous vote."));
       votes[idx].command[0] = '\0';
     }
 

[Prev in Thread] Current Thread [Next in Thread]