[Freeciv-Dev] patch: auto_ai_toggle (PR#326)
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
This patch adds an "autotoggle" server option, which toggles
players to human as they connect and back to AI when they
disconnect. (Not named "aitoggle" because that is the server
command to toggle, and gets confusing (eg, at least to 'help')
to have command and option with the same name.)
It seems to work, though I haven't tested it extensively.
I also added a call to lost_connection_to_player() in
cut_player_connection(), to tell other clients about the
removal (I think this is why 'cut' appeared not to work for
some people).
And removed a call to lost_connection_to_player() in
handle_request_join_game(), which simply generated messages
about "lost connection to unknown" when a player tried to
connect with a wrong name.
While looking at this I found a problem: before the game
starts, game.player_idx and game.player_ptr are not meaningfully
set in the client, because these are set in handle_game_info,
and a game_info packet has not yet been sent. A symptom is this
is that the messages about "AI mode is now ON/OFF" may not appear
when they should and may appear when they shouldn't (eg, when AI
mode is toggled for a different player). Once the game has
started things should be ok.
-- David
auto_ai_toggle.diff.gz
Description: GNU Zip compressed data
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Freeciv-Dev] patch: auto_ai_toggle (PR#326),
David Pfitzner <=
|
|