Page 1 of 1
The infamous Death Bug
Posted: Sun Jan 14, 2018 8:21 am
by Gangrenous
Okay so this one has been haunting the project for over a year. The run down is dying will cause a bit of a desync between the client and the server. I spent the night looking into what is causing it. This is probably not fully the problem but I am close. After you die the server removes your spawn from the zone, but then relocates you into a different part of the zone. Maybe we should not do it this way. Maybe we should change your entity before actually deleting it. The quick and dirty way is to zone you before the deletion, this does actually work.
Around line 500 in client.cpp
Code: Select all
player->SetX(x);
player->SetY(y);
player->SetZ(z);
player->SetHeading(heading);
If you change this to a full out zone, it fixes it every time. If you do not, try to fight again and see what happens. There is no combat text and your animation goes away, it gets wonky.
Re: The infamous Death Bug
Posted: Sun Jan 14, 2018 9:09 am
by Gangrenous
And to add, the fix is to actually prepend a zone on top of those lines above. That clears everything out before you relocate the player.
Re: The infamous Death Bug
Posted: Sun Jan 14, 2018 12:13 pm
by tyrbo
Going to tinker around with re-writing the revive function based on some of our discussion in Discord last night.
Seems a little off at first glance.
Re: The infamous Death Bug
Posted: Sun Jan 14, 2018 1:37 pm
by tyrbo
Okay, so here's what it was.
Clones, if you had them, were from DestroyGhostCmd not being sent to the reviving client, but being sent to everyone else. Ensuring that packet is sent resolves that issue. This might not be an issue with the source on svn.
However, doing so adds the player to the removed spawns list, resulting in no combat messages or animations or anything being sent for that player. The ClearEverything() function should be called, cleaning up the removed spawn list, but it appears to have been commented out at some point. Ensuring that the removed spawns list is cleared for the player or at least does not contain the player itself will resolve that bug.
edit: Still noticing some weird behavior though. Getting closer at least.
Re: The infamous Death Bug
Posted: Sun Jan 14, 2018 4:47 pm
by tyrbo
It looks like there's probably another conditional that's resulting in skipped code after a revive.
Still having some updates not being sent, digging into it now. Should have it resolved shortly.