Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2003:
[Freeciv-Dev] (PR#4760) take, observe, detach
Home

[Freeciv-Dev] (PR#4760) take, observe, detach

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: chrisk@xxxxxxxxx
Subject: [Freeciv-Dev] (PR#4760) take, observe, detach
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 7 Aug 2003 21:10:32 -0700
Reply-to: rt@xxxxxxxxxxxxxx

[kauf - Fri Aug  8 04:01:38 2003]:

> On Thu, Aug 07, 2003 at 08:02:19PM -0700, Jason Short wrote:
> > 
> > The core of the problem is that in establish_new_connection the 
> > send_player_info is only sent out when server_state==RUN_GAME_STATE
[1], 
> > but in lost_connection_to_client() it is always sent out [2].  This 
> > means you'll get buggy behavior when the client disconnects but not
when 
> > it connects.
> > 
> > Either way, the checks in these two functions should be consistent.  In 
> > this patch when disconnecting the player_info packet isn't sent unless 
> > the game is in RUN_GAME_STATE.  And the bad client logic trying to tell 
> > whether to read the tech info is simply dropped.  This should fix
all of 
> > the pregame bugs we've had so far.
> 
> Well, the first patch certainly seems to fix the observe bug, but I'm
> unsure what the connecthand.c patch accomplishes. Why shouldn't new player
> info get sent to everybody when a connection is lost whether or not
it's in
> RUN_GAME_STATE? How is this inconsistent? The two situations are
different.

If player info gets sent when people disconnect, it should get sent when
they connect.  And it's not.

In other words, currently the server is telling the client that the
player has disconnected, when the client doesn't even know that the
player was ever connected.  I remember there was a "player list in
pregame" feature request at one point - for that to work the player info
should be sent out in pregame (but perhaps it should be a
short_player_info or some such, without all the game information).

But either way, the check needs to be consistent between joining and
leaving.

> The server sends player info to one player in establish_new_connection()
> and to all the other players in lost_connection_to_client().

I'm pretty sure in establish_new_connection the server sends info about
everyone to everyone.  In lost_connection_to_client it sends info about
the departing player to everyone.

I don't think the two situations are any different.  If anything, they
should be made more the same - why do we send out player information for
everyone when a person joins, but only for that player when they leave?
 Presumably there's a reason for the first method, but there's no
explanation in the code...

> > Should this also include GAME_OVER_STATE?  It's not possible for new 
> > players to connect at this point, right?  But we still want to send out 
> > info about disconnecting players, I'd think.
> 
> well, ideally GAME_OVER_STATE should last as briefly as possible
before the
> (not-as-yet-realized) server switches back to PRE_GAME_STATE and waits for
> a new game. As long as it doesn't last to long, we can certainly prohibit
> logins (just don't let sniff_packets() run until we get back to pregame).

Hmm, that doesn't quite answer my question.  But I think the answer is
yes, we should send out the packet on logout.

jason



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