Project

Profile

Help

HostedRedmine.com has moved to the Planio platform. All logins and passwords remained the same. All users will be able to login and use Redmine just as before. "Read more...":https://support.plan.io/news/187

Bug #764976

closed

Server wants us to remove unit id 1289, but we don't know about this unit! (Diplomat)

Added by Jacob Nevins over 4 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Category:
Server
Sprint/Milestone:
Start date:
Due date:
% Done:

0%

Estimated time:

Description

Couple of reproducible instances of this message, both with Diplomats:

1: Server wants us to remove unit id 1289, but we don't know about this unit!
26c2c3_timurid-T0284-Y01818-auto.sav.bz2
[l tgt="unit" id=1289 /]
Hit Turn Done.

1: Server wants us to remove unit id 483, but we don't know about this unit!
26c2c3_timurid-T0307-Y01841-auto.sav.bz2
[l tgt="unit" id=483 /]
Hit Turn Done.

Originally seen with something between 2.6.0-RC1-RC2, reproduced with RC2 + a few commits.

I'm not yet sure what happened to the units to cause them to be removed. For the first one, I think it might have been killed by [l tgt="unit" id=1250 name="Musketeers" /], but I'm not sure.

(I don't think this is likely to be related to #736060, since these aren't unique units.)


Files

Actions #1

Updated by Marko Lindqvist over 2 years ago

At least the turn 307 one is an allied diplomat that gets killed.
We have never seen it as it's stealthy unit, but when server checks if client should have been aware of the unit, can_player_see_unit_at() has this code:

/* Allied or non-hiding units are always seen. */
if (pplayers_allied(unit_owner(punit), pplayer) || !is_hiding_unit(punit)) {
return TRUE;
}
I think the part about allied units always being visible is simply wrong. That's not how other parts of the code are implemented. Shared vision would make more sense here.
Actions #2

Updated by Marko Lindqvist over 2 years ago

Server tries to send unit several times (as packet_unit_short_info). I've debugged that all the way to the packets_gen.c code. But client side never receives it. This starts to look more like low-level networking code bug than server logic bug.

Actions #3

Updated by Marko Lindqvist over 2 years ago

Marko Lindqvist wrote:

But client side never receives it.

That was user error. Client does know about the unit until it dies. Then it gets removed twice, and latter of those gives the error.

server_remove_unit_full() reduces vision before removing unit from onlookers for the very reason to avoid both of those actions potentially sending remove_unit. That doesn't work perfectly for stealth unit that loses V_INVIS vision but retains V_MAIN vision in vision reduction. Since it goes invisible with V_INVIS reduction, it gets removed. However, later removal of unit (because it has died) assumes it to be visible as can_player_see_unit_at() considers allied stealth units to be visible on seen (V_MAIN) tiles.

Actions #5

Updated by Marko Lindqvist over 2 years ago

  • Status changed from Resolved to Closed
  • Assignee set to Marko Lindqvist

Also available in: Atom PDF