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: Trent Piepho <xyzzy@xxxxxxxxxxxxx>
Cc: Arien Malec <arien_malec@xxxxxxxxx>, freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Pop cost patch (resending via bug system) (PR#897)
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 19 Aug 2001 22:00:52 +0200
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Sun, Aug 19, 2001 at 12:52:58PM -0700, Trent Piepho wrote:
> 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.

This isn't necessary. Since the reading and writing is guarded by
has_cap() calls there is no problem.

> 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.

AFAIK correct.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "A common mistake that people make, when trying to design 
  something completely foolproof is to underestimate the 
  ingenuity of complete fools."
    -- Douglas Adams in Mostly Harmless


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