[Freeciv-Dev] [Patch] Introduction of turns
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
For client side ai and maybe also for other things the definition of
the current turn is needed. The attached patch adds this. It is
straightforward except this piece:
+ /*
+ * The local idea of the game turn is increased here since the
+ * client will get unit updates (reset of move points for example)
+ * between handle_before_new_year() and handle_new_year(). These
+ * unit updates will look like they did take place in the old turn
+ * which is incorrect. If we get the authoritative information about
+ * the game turn in handle_new_year() we will check it.
+ */
IMHO the unit_info packets which are caused by reseting the move
points should happen in the new year.
server/srv_main.c:main_loop():
before_end_year();
end_turn(); /* reset move points */
game_advance_year();
send_year_to_clients(game.year);
IMHO the method end_turn() should be splitted in end_turn() and
start_turn() (start_turn would reset move points). This would allow
the sequence to be:
before_end_year();
end_turn();
game_advance_year();
send_year_to_clients(game.year);
start_turn();
I didn't make this change. The solution used in the patch works but is
a workaround.
Raimar
--
email: rf13@xxxxxxxxxxxxxxxxx
What's nice about GUI is that you see what you manipulate.
What's bad about GUI is that you can only manipulate what you see.
turn1.diff
Description: Text document
- [Freeciv-Dev] [Patch] Introduction of turns,
Raimar Falke <=
[Freeciv-Dev] Re: [Patch] Introduction of turns, Raimar Falke, 2001/08/27
|
|