Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2001:
[Freeciv-Dev] [Patch] Introduction of turns
Home

[Freeciv-Dev] [Patch] Introduction of turns

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv development list <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] [Patch] Introduction of turns
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Sat, 11 Aug 2001 12:26:35 +0200
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

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.

Attachment: turn1.diff
Description: Text document


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