Halflife: [GoldSource/CS][Bug] Player ghost when disconnected

Created on 22 Apr 2019  路  11Comments  路  Source: ValveSoftware/halflife

When a player disconnect, sometimes there will remain a 'ghost' of him:

  • Transparent (moving backward/forward very fast), in air. Can't shoot him.
  • Solid (static), in air. When he's shooted, will get in the above state.
  • Transparent (static), in air. Can't shoot him.
    ...

530-90_59cf66f7cc040
--> Sorry for the transparency (it does not look like this but normal, textured). That's bcs. the server plugins..

Most helpful comment

I think this happens because unlike normal entities players are not removed when they disconnect. The entity is only cleared when the slot is reused for another client in SV_WriteSpawn.

The server should move disconnected players to observer using CBasePlayer::StartDeathCam like CBasePlayer::PlayerDeathThink does. Care must be taken to ensure that this does not put the entity in a state where dangling user input values (impulse, etc) can cause problems.

All 11 comments

This ghost is timeout effect. sv_timeout sets time when player can restore connection to server.
Set smaller value to cvar for faster kick.

So this isn't a bug? Like if you want to restore it, restore in the second you connected don't break the whole game. In some cases that ghosted player can break the round because it appears as connected but there is no player alive and so on..

So this isn't a bug? Like if you want to restore it, restore in the second you connected don't break the whole game. In some cases that ghosted player can break the round because it appears as connected but there is no player alive and so on..

That's right. Some games like TF2 send you to spec until you connection is restored to avoid those issues you are speaking.

I think this happens because unlike normal entities players are not removed when they disconnect. The entity is only cleared when the slot is reused for another client in SV_WriteSpawn.

The server should move disconnected players to observer using CBasePlayer::StartDeathCam like CBasePlayer::PlayerDeathThink does. Care must be taken to ensure that this does not put the entity in a state where dangling user input values (impulse, etc) can cause problems.

I think this happens because unlike normal entities players are not removed when they disconnect. The entity is only cleared when the slot is reused for another client in SV_WriteSpawn.

The server should move disconnected players to observer using CBasePlayer::StartDeathCam like CBasePlayer::PlayerDeathThink does. Care must be taken to ensure that this does not put the entity in a state where dangling user input values (impulse, etc) can cause problems.

Yeah, I wanted to do the same in a plugin for AMX Mod X, the problem is that we have to make sure that other plugins doesn't remove him from spectator mode or observer mode.

The server should move disconnected players to observer using CBasePlayer::StartDeathCam like CBasePlayer::PlayerDeathThink does. Care must be taken to ensure that this does not put the entity in a state where dangling user input values (impulse, etc) can cause problems.

I don't agree with you. People can abuse it to evade death and increase K/D stat or smth. I think that's why entity does not disappear on disconnect and its not a bug.

The server should move disconnected players to observer using CBasePlayer::StartDeathCam like CBasePlayer::PlayerDeathThink does. Care must be taken to ensure that this does not put the entity in a state where dangling user input values (impulse, etc) can cause problems.

I don't agree with you. People can abuse it to evade death and increase K/D stat or smth. I think that's why entity does not disappear on disconnect and its not a bug.

The entity is recreated anyway on connect so the k/d ratio won't matter.

The entity is recreated anyway on connect so the k/d ratio won't matter.

I mean you are just disconnecting in the middle of fight and disappearing for enemy, and no matter what happens on connect

The entity is recreated anyway on connect so the k/d ratio won't matter.

I mean you are just disconnecting in the middle of fight and disappearing for enemy, and no matter what happens on connect

That happens in pretty much any multiplayer game though.

The server should move disconnected players to observer using CBasePlayer::StartDeathCam like CBasePlayer::PlayerDeathThink does. Care must be taken to ensure that this does not put the entity in a state where dangling user input values (impulse, etc) can cause problems.

I don't agree with you. People can abuse it to evade death and increase K/D stat or smth. I think that's why entity does not disappear on disconnect and its not a bug.

"ghost player" only happens when player loses his connection, not when he normally disconnects.

The server should move disconnected players to observer using CBasePlayer::StartDeathCam like CBasePlayer::PlayerDeathThink does. Care must be taken to ensure that this does not put the entity in a state where dangling user input values (impulse, etc) can cause problems.

I don't agree with you. People can abuse it to evade death and increase K/D stat or smth. I think that's why entity does not disappear on disconnect and its not a bug.

"ghost player" only happens when player loses his connection, not when he normally disconnects.

Ah so we're talking about a client who's timing out. Yeah that is much harder to fix. The player only runs physics when a usercmd is received so it freezes them into place. Fixing that is difficult.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

WhiteFang1319 picture WhiteFang1319  路  3Comments

LuckyStrikeOriginal picture LuckyStrikeOriginal  路  4Comments

ghost picture ghost  路  4Comments

DreaDk picture DreaDk  路  4Comments

perforatorRU picture perforatorRU  路  3Comments