New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix player not being internally disconnected in some situation and add client_disconnected forward #264
Conversation
f02f013
to
3494d49
Compare
|
||
DETOUR_STATIC_CALL(SV_DropClient)(cl, crash, "%s", buffer); | ||
|
||
pPlayer->Disconnect(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be inside if (cl->edict)
d5ec961
to
f39e08d
Compare
So, after some discussions, it would be more appropriate/convenient/usable to have a replacement instead. There we go, a new forward |
Have the commits take into account FM_ClientDisconnect forward from fakemeta? Also, why client_disconnect is called when player disconnects or map change (1 called for each player connected) and FM_ClientDisconnect only called when player disconnects? I'm talking about FM_ClientDisconnect in Pre |
I'm not sure why you're talking about |
You said: "...some unexpected result, also client_disconnect won't be called." Also, I asked other thing, but any problem if no answer, it was only curiosity. |
If you follow #252 this is a situation where
|
Looks fine to me now. |
} | ||
else | ||
{ | ||
AMXXLOG_Log("client_drop forward has been disabled - check your gamedata files."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fwd name and description are wrong, the forward is not fully disabled
dab4daa
to
15ad5bc
Compare
🚢 |
e3a0d0a
to
ed4faf7
Compare
…client_disconnected forward
Fix player not being internally disconnected in some situation and add client_disconnected forward
Introduced in alliedmodders#264. Edict is reset once SV_DropClient is called, so that second check would be always false.
…disconnected (#414) * Rename client_disconnected to client_disconnecting * Add client_disconnected as post forward * Fix client not properly disconnected internally Introduced in #264. Edict is reset once SV_DropClient is called, so that second check would be always false. * Reflect changes on the concerned plugins * Revert renaming, let's add only client_remove as post forward
Issue reported by @WPMGPRoSToTeMa here #252.
This fixes the situation of a player is marked as initialized by AMXX but has not yet spawned (put in server), if he disconnects/crashes/timeout at this point,
pfnClientDisconnect
won't be triggered by the engine. Result: AMXX will think that this player is still initialized and as consequence code relying on it could provide some unexpected result, alsoclient_disconnect
won't be called.While it's necessary that this change be reflected on
client_disconnect
, instead for backward compatibility reason a new forwardclient_disconnected
has been introduced to be used as replacement.client_disconnect
is marked as deprecated.Technical note: Core hooks
SV_DropClient
, reHLDS could be supported later, once release is considerate as stable, and/or there is a more friendly approach of the API.