Complete.Org: Mailing Lists: Archives: freeciv-dev: May 2000:
[Freeciv-Dev] Re: Client interface (was: how to improve the AI's attack
Home

[Freeciv-Dev] Re: Client interface (was: how to improve the AI's attack

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Client interface (was: how to improve the AI's attack (was: old/bad code in autoattack.c (PR#351)))
From: Thue Janus Kristensen <thue@xxxxxxx>
Date: Mon, 8 May 2000 23:12:38 +0200

> * The freeciv server trusts (trusted; my comments relate to
>   freeciv-1.8.0) the freeciv clients -way- too much.  In the course of the
>   class, everyone found that their AIs could cheat substantially by just
>   not _ignoring_ the packets that weren't meant for them.  For example,
>   the server would broadcast a PACKET_UNIT_INFO to *all* players, even if
>   the recipient didn't know of the unit's existence.  I think this issue
>   has been addressed by Thue's fog-of-war work, and perhaps others.  But,
>   there's nothing like a good code audit (or packet sniffer) to verify
>   that everything is okay.

Heh. Before my patch there a DOSEND argument to send_unit_info, meaning
that the server send the packet no matter if a client could see a unit or
not.
I tried to figure out why that argument was needed, for as far as I could
see it was enough to check the known value of the tile. Whether a
send_unit_info had the DOSEND argument set seemed completely random!
I removed it in my patch, waiting for the the bug that would show me why
it should be there. It hasn't shown up yet :) I also removed the DOSEND
argument from send_tile_info and send_city_info.
(And besides the DOSEND concept would not coexist with FoW)
Also, as part of the full FoW patch I created a dummy_city, which
means that not all city info is sent whenever the server sends a city.

Now the decision about to which players to send info is taken in one
place, send_*_info.
IMHO the result of the FoW patch was a cleaner, more correct interface to
sending info, even though more was going on under the hood :)

-Thue



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