View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0008148||Multi Theft Auto : San Andreas||Synchronization||public||2014-04-06 12:45||2014-06-14 20:36|
|Target Version||1.4||Fixed in Version||1.4|
|Summary||0008148: Desync when calling spawnPlayer from an event handler remotely triggered from within onClientPlayerWasted|
If you use spawnPlayer in an eventhandler triggered by onClientPlayerWasted you'll desync and receive a "Network Trouble".
This is caused by a desync of the death state, which in turn is caused by the CPlayerWastedPacket being received after the player has been respawned. Therefore the server considers the client dead (since the CPlayerWastedPacket was the last received packet) and the client considers itself alive (since it was respawned).
Personally I'm unsure on how to fix this issue, since we cannot check if the client is in the process of dying in spawnPlayer. However since this issue
If anyone got a good idea I'd be very interested to hear it. For now I'll add a simple warning to the wiki entry of spawnPlayer.
|Steps To Reproduce|
Make sure no other resource will respawn you (e.g. freeroam does this).
Start the attached resource, spawn yourself and enter /killme.
You'll be respawned and after a few seconds you'll receive the infamous Network Trouble message.
|Tags||No tags attached.|
Can't reproduce it in v1.4-unstable-6289
Oops, my testcase was broken. killPed sets CPed::m_bIsDead to true, which avoids this issue.
I updated my reproducing example above.
Player spawn packet updates the sync context to e.g. 3
caused by not sending the updated sync context to the local player on death, the contexts become de-synced and the clients packets are permanently ignored until he is re-spawned.