Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2005:
[Freeciv-Dev] Re: (PR#11797) odd vote behavior
Home

[Freeciv-Dev] Re: (PR#11797) odd vote behavior

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: jdorje@xxxxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#11797) odd vote behavior
From: "Per I. Mathisen" <per@xxxxxxxxxxx>
Date: Thu, 6 Jan 2005 05:09:36 -0800
Reply-to: bugs@xxxxxxxxxxx

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

On Wed, 5 Jan 2005, Mike Kaufman wrote:
> On Wed, Jan 05, 2005 at 02:13:00AM -0800, Christian Knoke wrote:
> >
> > And, are you allowed to vote, if you have a connection, but do not control a
> > (human?) player? If yes, can one cheat with that?
>
> if you are not connected to a player you cannot vote period. someone with
> the code in front of him should check this to make sure.

I would think so. Here is the code that checks on /vote command:

  if (caller == NULL || caller->player == NULL) {
    cmd_reply(CMD_VOTE, caller, C_FAIL, _("This command is client only."));
    return FALSE;
  } else if (caller->player->is_observer) {
    cmd_reply(CMD_VOTE, caller, C_FAIL, _("Observers cannot vote."));
    return FALSE;

And here is code that (double-)checks on resolution:

  for (i = 0; i < MAX_NUM_PLAYERS; i++) {
    if (game.players[i].is_alive && game.players[i].is_connected) {
      num_voters++;
    } else {
      /* Disqualify already given vote (eg if disconnected after voting) */
      vote->votes_cast[i] = VOTE_NONE;
    }
  }

  - Per





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