Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2003:
[Freeciv-Dev] Re: (PR#4781) phantom units showing up on client
Home

[Freeciv-Dev] Re: (PR#4781) phantom units showing up on client

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: rt-guest@xxxxxxxxxxxxxx
Cc: kimiko@xxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#4781) phantom units showing up on client
From: "Gregory Berkolaiko" <Gregory.Berkolaiko@xxxxxxxxxxxx>
Date: Mon, 11 Aug 2003 15:28:27 -0700
Reply-to: rt@xxxxxxxxxxxxxx

On Mon, 11 Aug 2003, Jason Short wrote:

> 
> [glip - Sat Aug  9 19:45:37 2003]:
> 
> > On Thu, 7 Aug 2003, Guest wrote:
> > 
> > > 
> > > Sometimes enemy units are visible, but aren't really there. That is, my
> > > 
> > 
> > Ha, I got it (well, at least one instance):
> > 
> > handle_unit_attack_request sends combatants' info to many connections, 
> > which isn't a mistake.
> > 
> > What is a mistake is that the client doesn't remove this information 
> > properly: in client/packhand.c handle_unit_info, if unit is not new
> > something like
> > 
> > if (!(tile_get_known(punit->x,punit->y) == TILE_KNOWN)) {
> >   cient_remove_unit(punit);
> >   refresh_tile_mapcanvas(dest_x, dest_y, FALSE);
> > }
> > 
> > should be added.
> > 
> > This should be done by somebody who knows what is happening in this 
> > function, and tested too.  The current behaviour when both combatants are 
> > displayed for a brief moment even though one of them might be under cover 
> > of fog should stay imo.
> > 
> > I attach a savegame whcih should be helpful.  Connect to Israelis 
> > and Carthagians.  Attack French explorer with Carthagian warrior.  The 
> > warrior will be briefly displayed on Israelis' client (center on Israeli 
> > explorer).  When you move Israeli explorer, you can see the phantom 
> > Carthagian warrior which is no longer.
> 
> Unfortunately it's not quite that simple.
> 
> I suppose the server must send a unit_info packet to the client to tell
> them the unit exists, even though the client can't see it.  Then a
> unit_combat packet is sent that tells of the combat itself.  So if the
> _client_ is to remove the unit, it should be done at the end of the
> unit_combat packet.  The attached patch does this, and fixes the problem
> for your savegame.
> 
> But, I think the server should send the unit disband packet (or does
> this happen as a result of the unit_combat packet?).  Or maybe it

After some investigation I concluded that
(a) server disbands unit separately in wipe_unit
(b) PACKET_REMOVE_UNIT is sent only to clients which can see the unit
(c) sending it to clients which could see the killer of the unit would be 
too much I think

Therefore your patch is the cleanest solution.

G.





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