View Issue Details

IDProjectCategoryView StatusLast Update
0008148Multi Theft Auto : San AndreasSynchronizationpublic2014-06-14 20:36
Reportersbx320Assigned ToCazomino05 
PrioritynoneSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Product Version1.3.5 
Target Version1.4Fixed in Version1.4 
Summary0008148: Desync when calling spawnPlayer from an event handler remotely triggered from within onClientPlayerWasted
Description

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.

TagsNo tags attached.

Activities

arranTuna

2014-04-09 18:16

manager   ~~0020632

Can't reproduce it in v1.4-unstable-6289

sbx320

2014-04-10 01:23

administrator   ~~0020645

Oops, my testcase was broken. killPed sets CPed::m_bIsDead to true, which avoids this issue.

I updated my reproducing example above.

Cazomino05

2014-06-14 20:13

reporter   ~~0021025

Player spawn packet updates the sync context to e.g. 3
Player death packet updates the sync context to e.g. 4
Client is still on sync context 3 and does not update to 4 and the server ignores everything from him

Cazomino05

2014-06-14 20:36

reporter   ~~0021026

Last edited: 2014-06-14 20:36

View 2 revisions

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.
Fixed in r6555 - https://code.google.com/p/mtasa-blue/source/detail?r=6555

Issue History

Date Modified Username Field Change