Fix player not being internally disconnected in some situation + add client_disconnected forward

This commit is contained in:
Arkshine
2015-07-17 00:26:30 +02:00
parent a9015d1d84
commit ed4faf7c11
21 changed files with 158 additions and 14 deletions

View File

@ -125,7 +125,7 @@ stock GetInfo(i, name[], namesize, auth[], authsize, ip[], ipsize, &access)
access = g_Access[target];
}
public client_disconnect(id)
public client_disconnected(id)
{
if (!is_user_bot(id))
{

View File

@ -34,7 +34,7 @@ public client_putinserver(id)
}
}
public client_disconnect(id)
public client_disconnected(id)
{
remove_task(id)
}

View File

@ -56,7 +56,7 @@ public client_authorized(id)
server_cmd("kick #%d ^"%L^"", get_user_userid(id), id, "DROPPED_RES")
}
public client_disconnect(id)
public client_disconnected(id)
{
if (get_pcvar_num(g_HidePtr))
{

View File

@ -472,7 +472,7 @@ public client_putinserver(id)
g_connected[id] = true
}
public client_disconnect(id)
public client_disconnected(id)
{
g_connected[id] = false
}

View File

@ -23,7 +23,7 @@ public plugin_init()
register_plugin("CS Stats Logging", AMXX_VERSION_STR, "AMXX Dev Team")
}
public client_disconnect(id)
public client_disconnected(id)
{
if (!g_inGame[id])
return

View File

@ -819,7 +819,7 @@ new NumOfLeaders
new LeaderID
new PScore[MAX_PLAYERS + 1]
public client_disconnect(id) {
public client_disconnected(id) {
if ( !LeadSounds || isDSMActive() ) return PLUGIN_CONTINUE
if ( PScore[id] == LeaderScore && LeaderScore > 0 ){
NumOfLeaders --

View File

@ -21,7 +21,7 @@ new g_pingCount[MAX_PLAYERS + 1]
public plugin_init()
register_plugin("Stats Logging",AMXX_VERSION_STR,"AMXX Dev Team")
public client_disconnect(id) {
public client_disconnected(id) {
if ( is_user_bot( id ) || !is_user_connected(id) || !isDSMActive() ) return PLUGIN_CONTINUE
remove_task( id )
new szTeam[16],szName[MAX_NAME_LENGTH],szAuthid[32], iStats[9], iHits[8], szWeapon[16]

View File

@ -156,16 +156,28 @@ forward client_connect(id);
forward client_authorized(id);
/**
* Called when a client is disconnecting from the server.
* @deprecated This function does not catch all cases.
*/
#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.
*
* @param id Client index
* @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 maxlen Maximum size of buffer
*
* @noreturn
*/
forward client_disconnect(id);
forward client_disconnected(id, bool:drop, message[], maxlen);
/**
* Called when a client attempts to execute a command.

View File

@ -48,7 +48,7 @@ public client_putinserver(id)
}
}
public client_disconnect(id)
public client_disconnected(id)
{
remove_task(id)
}

View File

@ -100,7 +100,7 @@ public msgScoreInfo() {
g_Class[id]=read_data(g_ScoreInfo_Class);
g_Team[id]=read_data(g_ScoreInfo_Team);
}
public client_disconnect(id) {
public client_disconnected(id) {
g_Class[id]=0;
g_Team[id]=-1;
}

View File

@ -20,7 +20,7 @@ new g_pingCount[MAX_PLAYERS + 1]
public plugin_init()
register_plugin("TFC Stats Logging",AMXX_VERSION_STR,"AMXX Dev Team")
public client_disconnect(id) {
public client_disconnected(id) {
if ( is_user_bot( id ) ) return PLUGIN_CONTINUE
remove_task( id )
new szTeam[16],szName[MAX_NAME_LENGTH],szAuthid[32], iStats[8], iHits[8], szWeapon[24]

View File

@ -22,7 +22,7 @@ new g_pingCount[MAX_PLAYERS + 1]
public plugin_init()
register_plugin("Stats Logging",AMXX_VERSION_STR,"AMXX Dev Team")
public client_disconnect(id) {
public client_disconnected(id) {
if ( is_user_bot( id ) ) return PLUGIN_CONTINUE
remove_task( id )
new szTeam[16],szName[MAX_NAME_LENGTH],szAuthid[32], iStats[8], iHits[8], szWeapon[16]