Complete.Org: Mailing Lists: Archives: freeciv-dev: December 1998:
Re: negative research points, was Re: [Freeciv-Dev] Some remarks (bugs?)
Home

Re: negative research points, was Re: [Freeciv-Dev] Some remarks (bugs?)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: David Pfitzner <dwp@xxxxxxxxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx
Subject: Re: negative research points, was Re: [Freeciv-Dev] Some remarks (bugs?)...
From: Mitch Davis <mjd@xxxxxxxxxxxxxxxx>
Date: Tue, 08 Dec 1998 10:56:08 +0000

David Pfitzner wrote:
> 
> Actually, I think part of the problem here is that player.researched
> (the amount of research done so far) is sent as a 16 bit quantity, so it
> probably didn't (and couldn't) underflow on the server (freeciv
> assumes 32 bit ints, in various places, I believe), but the value
> received by the client wrapped around.
> 
> I'm not sure of the best way to change these 16 bits values to 32
> bits in packets in a backwardly compatable way.  We could use
> capabilities, (which involves some CPU hit each time we make/receive
> a packet and test the capabilities?)

I don't think it will be a noticable hit.  If profiling reveals
that checking every time is a problem, then we could have a boolean
(set from the capabilities on (re)load and (re)connect
which indicated if the other side wanted 16 or 32 bits.
I think it's unlikely that capabilities will change during
a game, unless there's a reconnect or a reload, so the bool
could be set then.


> Or we can just leave it be for now.

I think we should leave it for now unless someone wants to
look at it.  If they do, I think it should be done with
capabilities, rather than extra fields.  (What will a new
client or server do if the other side isn't sending the
extra 32 bits?  It needs to test capabilities anyway..)

> Of course when we break protocol compatability (planned for 1.8)
> we could tidy this up.

Yeah, by changing the packet.  We could put a /* FIXME */ in
the code, as I generally look for them before a release.

Regards,

Mitch.




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