Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2001:
[Freeciv-Dev] Re: Pop cost patch (resending via bug system) (PR#897)
Home

[Freeciv-Dev] Re: Pop cost patch (resending via bug system) (PR#897)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Arien Malec <arien_malec@xxxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Pop cost patch (resending via bug system) (PR#897)
From: Trent Piepho <xyzzy@xxxxxxxxxxxxx>
Date: Sun, 19 Aug 2001 12:52:58 -0700 (PDT)

On Sun, 19 Aug 2001, Arien Malec wrote:
> Thought I sent this, but didn't see it on list (user error, no doubt)
> 
> Corrected patch is attached. Note that I tried to play nicely with the
> surrounding code, and didn't do a wholesale indent -kr -i2 in the areas I was
> editing.

When you add a new field to a packet, you should add it at the end.  That way
you have backward compatibility.  If an old client tries to connect to a
server with popcost, it will just ignore the extra field.  And sometimes you
have let a new client connect to an old server by filling in some kind of
default value.  You check if data remains when you decode the packet, and if
there is none left for the new field, stick in some kind of default value.




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