Skip to content

Fixed desync when player disconnects before clients received a full update

As a result of c770f5a41612, if a client disconnects from the server before other clients have received a full update, they won't receive the DisconnectPlayer command from the server and will think that player is still in the game, even though they're not. The "P_PlayerThink: No body for player" warning message will continuously print on the client's screen until they leave, or another client connects and occupies the old slot.

Since the client doesn't execute anything extremely crucial in DisconnectPlayer command that shouldn't happen before receiving a full update, it's probably better to always let the server send this command anyways. It's also worth noting that clients always received DisconnectPlayer commands when the player leaving was a bot, whether or not they received the full update yet:

// Remove the bot from the game.
if ( NETWORK_GetState( ) == NETSTATE_SERVER )
	SERVERCOMMANDS_DisconnectPlayer( ulPlayerIdx, ulPlayerIdx, SVCF_SKIPTHISCLIENT );

The SVCF_SKIPTHISCLIENT flag prevents the SVCF_SKIP_CLIENTS_WITHOUT_FULLUPDATE flag from being added. So, this change should be fine.

Merge request reports

Loading