Complete.Org: Mailing Lists: Archives: freeciv-dev: July 2003:
[Freeciv-Dev] (PR#4449) revolution choice doesn't work
Home

[Freeciv-Dev] (PR#4449) revolution choice doesn't work

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: jshort@xxxxxxxxxxxxxx
Subject: [Freeciv-Dev] (PR#4449) revolution choice doesn't work
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 10 Jul 2003 10:40:35 -0700
Reply-to: rt@xxxxxxxxxxxxxx

[jshort@xxxxxxxxxxxxxx - Fri Jun 27 18:41:01 2003]:

> I selected menu kingdom->government->democracy.
> 
> Several turns later, my revolution is over.  Up pops the "choose your 
> government" dialog.  Most confusing of all, the "revolution finished" 
> message comes up about a dozen times.

When the revolution is over, the server sends a player packet to the
player.  This packet includes packet->revolution==0 to tell that the
revolution is over.  The client sees that revolution==0 while the
government is still anarchy and does the "end revolution" handling.

But the client doesn't immediately change out of anarchy - not until it
tells the server what government it's changing to and the government
sends another packet to update the client's government.  So if the
server sends another player packet to the same player, again
packet->revolution==0 while
game.player_ptr->government==game.government_when_anarchy, and again the
"end revolution" handling is done.

This is generally a bug-prone situation, obviously.  But I suspect the
error was actually caused by unrelated changes to server/plrhand.c that
increase the number of player packets sent out.  Perhaps a recent change
so that players always have embassies with themselves?  I'm not sure.

And I'm not sure how to fix it.  Seems the server should have a better
way to tell the client when the revolution is over, rather than just
letting the client deduce it.  That way only the one packet that
actually ends the revolution will trigger the end-of-revolution client
response.  The easiest way to do this would be with a new "end
revolution" packet.

jason



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