Complete.Org: Mailing Lists: Archives: freeciv-dev: June 2004:
[Freeciv-Dev] Re: (PR#9006) player_in_territory() function
Home

[Freeciv-Dev] Re: (PR#9006) player_in_territory() function

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: use_less@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#9006) player_in_territory() function
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 18 Jun 2004 08:30:52 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=9006 >

James Canete wrote:
> -added transporter count.  On server counts all units, on client counts
> one extra unit.

> By the way, should I be benchmarking with --enable-debug=no?  I think
> that still enables "set timeout -1", but I'm not sure.  The above timing
> was with default debug settings.

It shouldn't matter, since you're just looking for a comparison.

> I placed this function in common/players.c so the client can do its own
> check for enemy units in territory before sending an expel enemy units
> demand.
> 
> However, this check will be duplicated at the server to prevent
> cheating, so it may be a waste of time to do it on client-side.

There seems to be an error in the patch:

+       in_territory += 1 + punit->occupy;
+       if punit->is_occupied
+    }

also, I don't think we should have checks like "if (is_server())" in the 
code unless they're absolutely necessary.  And, the server should not 
count all units being transported since that is cheating (although it 
may be okay if you do a handicap check first).


And, doing a preliminary check at the client is a good idea.  At least, 
that's what we do in most other places.

jason




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