Complete.Org: Mailing Lists: Archives: freeciv-dev: October 2001:
[Freeciv-Dev] Re: Remove map_adjust_[xy] invocations from server (PR#10
Home

[Freeciv-Dev] Re: Remove map_adjust_[xy] invocations from server (PR#10

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: rf13@xxxxxxxxxxxxxxxxxxxxxx
Cc: "Ross W. Wetmore" <rwetmore@xxxxxxxxxxxx>, jdorje@xxxxxxxxxxxxxxxxxxxxx, freeciv-dev <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: Remove map_adjust_[xy] invocations from server (PR#1003)
From: Gaute B Strokkenes <gs234@xxxxxxxxx>
Date: Tue, 23 Oct 2001 23:38:12 +0100

On Tue, 23 Oct 2001, hawk@xxxxxxxxxxxxxxxxxxxxxxx wrote:
> 
> We have to go through the code and remove is_real_tile,
> normalize_map_pos and is_normal_map_pos. Everything is fine if the
> positions these methods work on are used in the function as an
> arguement to some access method. What happens if this isn't the
> case?

I don't see what you're getting at.  We will have to go through and
replace these things anyway.  Also, failure to run a given coordinate
pair through CHECK_POS() or whatever is not a bug in itself, it is
just a missed opportunity to find down a bug.  It's not worthwhile
being paranoid about this; in practise a bug will manifest itself soon
enough.

>> It would be a good idea to add those checks in places where it is
>> obvious that a check in map_inx() is not enough, such as
>> same_pos().
> 
> This is my first suggestion.

Then we are in violent agreement...

>> The idea is to disable it by default, and let people turn it back
>> on when they make changes to iteration macros etc. that need
>> testing of this sort.  Since that is a distinct minority of the
>> time, we do not need to care that much about how much time it
>> takes.  I don't think it is going to take that much more time than
>> the current approach (always check, always fix).
> 
> I would vote for the ignore the case.

Sorry, what do you mean?

>  - used for an outgoing packet.
> 
> For the last case (and also on general) I would wish a more strict
> testing of map positions which came from packets (server rejects,
> client aborts).

I'll leave that to someone who knows the packet protocol better.

A priori the most sensible thing to do is to always emit normalised
coordinates, and reject coordinates which are not.  But there is also
backwards compatibility to consider.

-- 
Big Gaute                               http://www.srcf.ucam.org/~gs234/
By MEER biz doo SCHOIN..


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