<URL: http://bugs.freeciv.org/Ticket/Display.html?id=39558 >

> Michael Kaufman wrote:
> > sorry, yes inventions are technically trinary, but for purposes of passing
> > to the client, they're binary, since update_research() is called upon
> > receiving a player_info packet.
> > 
> Wow, is that wrong!  I'll delete that terrible mistake as soon as I can
> test it.  All research and diplomacy and advances are handled and
> verified in the server.  The server version is canonical.  It's hard
> enough to keep things synchronized, without clients recalculating!

Not necessarily wrong [or not necessarily terrible]. as I recall
update_research() only updates TECH_REACHABLE, which has a rigid
definition [and really is only a cached value]: It doesn't matter whether 
the server tells the client or the client calculates it itself. The server 
still keeps the master record of inventions.

> > I've heard the bit about premature optimization, but in this case, you're
> > going backward.
> > 
> Actually forward, fixing a horrible implementation flaw.  It may not be the
> final efficient answer, as sending the whole list is useless -- there will
> never be more than 1 or 2 changes per player per turn.

If the list you're talking about is the inventions list, I don't think you 
get much benefit from say "sending the number of changes/the invention
indices/and the states" or just sending the whole list in a bit array.

The correct fix is to split the player_info packet into multiple packets.


Freeciv-dev mailing list

Reply via email to