Complete.Org: Mailing Lists: Archives: freeciv-dev: June 2005:
[Freeciv-Dev] (PR#13346) end-of-turn-voting bug..
Home

[Freeciv-Dev] (PR#13346) end-of-turn-voting bug..

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#13346) end-of-turn-voting bug..
From: "Thomas Müller" <mail@xxxxxxxxxxx>
Date: Sun, 26 Jun 2005 12:31:10 -0700
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=13346 >

Hi, i finally found the "end-of-turn-voting-bug". 
If you start a vote at the end of a turn, then press finish, and at the start 
of the new turn type /vote yes, the vote gets passed immidiatly.

Noone else has a chance to vote /no. There was a check for vote->full_turn == 
TRUE, but full_turn was always true. This way anyone can set any command on a 
pubserver, if he is fast enough, including end, cut i.e.

This is very bad, and should be fixed as soon as possible. I wrote a patch, 
now votes arent resolved automatically after one turn (which didnt work 
anyway) but only when they are won or lost.

That solves the problem that one player can cheat voting, but makes voting a 
little harder. But since its not sure if and how voting will work in cvs, 
it's not easy to completly solve that problem.

Can someone pls put this on pubservers, its for cvs but works for 2.0.2 , so i 
guess it works for S2_0 too.

Greetings,
Thomas




--- stdinhand.c.beforevoting    2005-06-26 20:49:12.000000000 +0200
+++ stdinhand.c 2005-06-26 21:20:06.000000000 +0200
@@ -226,8 +226,7 @@
   /* Check if we should resolve the vote */
   if (vote->command[0] != '\0'
       && num_voters > 0
-      && (vote->full_turn == TRUE
-          || (vote->yes > num_voters / 2)
+      && ( (vote->yes > num_voters / 2)
           || (vote->no >= (num_voters + 1) / 2))) {
     /* Yep, resolve this one */
     vote->vote_no = -1;

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#13346) end-of-turn-voting bug.., Thomas Müller <=