Add client_remove() forward and fix a bug with client not internally 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
This commit is contained in:
@ -178,24 +178,39 @@ forward client_authorized(id, const authid[]);
|
||||
#pragma deprecated Use client_disconnected() instead.
|
||||
forward client_disconnect(id);
|
||||
|
||||
/**
|
||||
/**
|
||||
* Called when a client is disconnected from the server.
|
||||
*
|
||||
* @note This will be called in some additional cases that client_disconnect doesn't cover,
|
||||
* most notably when a client aborts the connection process. It is guaranteed to pair
|
||||
* with the client_connect() forward.
|
||||
* @note By this point it is already too late to do anything that directly
|
||||
* affects the client.
|
||||
* @note When this fires the player entity is still valid (e.g. is_user_connected(id) will
|
||||
* return true), but no networked commands will reach the client.
|
||||
*
|
||||
* @param id Client index
|
||||
* @param drop If true, client has been explicitly dropped by game
|
||||
* @param message If drop is true, a disconnected message or buffer to copy a new message to
|
||||
* @param drop If true, the game has explicitly dropped the client
|
||||
* @param message If drop is true, a writable buffer containing the disconnect info message
|
||||
* @param maxlen Maximum size of buffer
|
||||
*
|
||||
* @noreturn
|
||||
*/
|
||||
forward client_disconnected(id, bool:drop, message[], maxlen);
|
||||
|
||||
/**
|
||||
* Called when a client entity has been removed from the server.
|
||||
*
|
||||
* @note This fires after the client_disconnected() forward, when the player entity has been
|
||||
* removed (e.g. is_user_connected(id) will return false).
|
||||
*
|
||||
* @param id Client index
|
||||
* @param drop If true, the game has explicitly dropped the client
|
||||
* @param message If drop is true, contains the disconnect info message
|
||||
*
|
||||
* @noreturn
|
||||
*/
|
||||
forward client_remove(id, bool:drop, const message[]);
|
||||
|
||||
|
||||
/**
|
||||
* Called when a client attempts to execute a command.
|
||||
*
|
||||
|
Reference in New Issue
Block a user