[Freeciv-Dev] (PR#12983) Reuse delta generator structs
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: |
[Freeciv-Dev] (PR#12983) Reuse delta generator structs |
From: |
"Per I. Mathisen" <per@xxxxxxxxxxx> |
Date: |
Wed, 4 May 2005 13:40:02 -0700 |
Reply-to: |
bugs@xxxxxxxxxxx |
<URL: http://bugs.freeciv.org/Ticket/Display.html?id=12983 >
This patch reuses two delta generator structs inside struct game. Doing
this has the following immediate benefits:
- a ton of forgotten ruleset parameters are sent to the client
- this framework makes it a lot easier to add ruleset parameters,
and ensures that they are sent to the client
- the tedious copy-struct-to-packet code can be reduced to one line:
game.rules = packet;
and
game.control = packet;
similarly for the client side.
- it is the right thing to do as it removes duplicated code
The patch is, however, enormous. I do not want to wait very long before
committing it (although given its size I would prefer if someone else
looked over it and committed it instead).
Also, the choice of where to put ruleset variables was a bit arbitrary,
between game_info, ruleset_game and ruleset_control. I tended to choose
game_info since this was the most flexible - and the delta cache ensures
this is not inefficient anyway.
There are some more variables in struct game that can be moved, but I
would rather do that in a later patch...
I am a bit uncertain as to whether we really need the ruleset_control
packet separate from game_info. It looks to me like they can easily be
combined, as long as game_info is sent once before sending rulesets.
(The patch has gotten only minimal testing and proof-reading as of yet.)
- Per
gamestruct1a.diff.gz
Description: application/gunzip
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Freeciv-Dev] (PR#12983) Reuse delta generator structs,
Per I. Mathisen <=
|
|