Complete.Org: Mailing Lists: Archives: freeciv-dev: October 2001:
[Freeciv-Dev] Re: PATCH: remove check_coords (PR#1013)
Home

[Freeciv-Dev] Re: PATCH: remove check_coords (PR#1013)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: PATCH: remove check_coords (PR#1013)
From: Jason Dorje Short <vze2zq63@xxxxxxxxxxx>
Date: Sun, 14 Oct 2001 16:09:23 -0400
Reply-to: jdorje@xxxxxxxxxxxx

Raimar Falke wrote:
> 
> On Sat, Oct 13, 2001 at 10:27:07PM -0700, jdorje@xxxxxxxxxxxxxxxxxxxxx wrote:
> > This patch removes the check_coords function, in preparation for it to
> > be replaced by a better check_map_pos macro/function.

> > -  if (!check_coords(&req->x, &req->y))
> > -    return;
> > +  if (!normalize_map_pos(&req->x, &req->y))
> > +    return; /* discard invalid packet */
> 
> We want to be more strict. We can expect that good clients will only
> sent normal(ized) map positions. However there is a problem (can't
> there be something without a problem?): old client may still sent map
> positions that are real but not normal(ized). Maybe we can make the
> above checks with is_normal_map_pos and than try the 1.12.0 client?!

I don't think we _need_ to be more strict; although I had originally
thought to replace the check with is_normal_map_pos I think
normalize_map_pos is safer and the tdisadvantage of using
normalize_map_pos is insignifant.  It's best to give the client as much
leeway as possible.

jason


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