[Freeciv-Dev] Re: (PR#13878) redesign observers
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://bugs.freeciv.org/Ticket/Display.html?id=13878 >
Per I. Mathisen wrote:
>>However there is still a significant problem: the server doesn't send
>>the right notifications when changing state.
>
> What kind of state are you talking about here?
It's kind of a long story and I don't understand the whole system. But
here goes:
When the client changes "state" I mean that it moves from being detached
to taking/watching a player, or from one player to another, or from an
observer to detach. (Maybe there's a better name for this here.)
When this happens the current method is for the server to send some sort
of "reset" to the client that triggers it to free and reallocate all
game data (map, units, cities, etc.). In detach_command() this takes
the form of
if (server_state == RUN_GAME_STATE) {
send_game_state(pconn->self, CLIENT_PRE_GAME_STATE);
send_rulesets(pconn->self);
send_server_settings(pconn->self);
send_game_info(pconn->self);
send_player_info_c(NULL, pconn->self);
send_conn_info(game.est_connections, pconn->self);
}
Now, this is very inefficient and if we can find a way to avoid it
(simply a client_reset_game_data packet would do it), that would be
great. But that's not my point here.
The bug in the patch is that when going from observer mode to taking a
player this reset is not sent. This is rather odd since even before the
patch this state change was possible and I don't know why the reset
wouldn't have been sent.
Another potential bug I find is that in unattach_connection_from_player
there is this code:
pconn->player->is_connected = FALSE;
but this function is called even when detaching an *observer* from the
player. So this seems like a bug - however I don't know what
is_connected is used for or what effects this could have.
-jason
|
|