ConnectAnnounceNewPlayers: improve code
This commit is contained in:
parent
33640c77b5
commit
8f9121f79d
@ -148,8 +148,6 @@ public void SQL_OnQueryCompleted(Database db, DBResultSet results, const char[]
|
|||||||
if ((client = GetClientFromSerial(data)) == 0)
|
if ((client = GetClientFromSerial(data)) == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
int clientid = GetClientSerial(client);
|
|
||||||
|
|
||||||
char sAuthID[32];
|
char sAuthID[32];
|
||||||
GetClientAuthId(client, AuthId_Steam2, sAuthID, sizeof(sAuthID));
|
GetClientAuthId(client, AuthId_Steam2, sAuthID, sizeof(sAuthID));
|
||||||
|
|
||||||
@ -167,7 +165,7 @@ public void SQL_OnQueryCompleted(Database db, DBResultSet results, const char[]
|
|||||||
g_bNewPlayer[client] = true;
|
g_bNewPlayer[client] = true;
|
||||||
g_bNewPlayerChatBlock[client] = true;
|
g_bNewPlayerChatBlock[client] = true;
|
||||||
NewPlayerMessage(client);
|
NewPlayerMessage(client);
|
||||||
CreateTimer(10.0, BlockChat, clientid, TIMER_FLAG_NO_MAPCHANGE);
|
CreateTimer(10.0, BlockChat, GetClientSerial(client), TIMER_FLAG_NO_MAPCHANGE);
|
||||||
char sQuery[512];
|
char sQuery[512];
|
||||||
Format(sQuery, sizeof(sQuery), "INSERT INTO connections (auth) VALUES ('%s')" , sAuthID);
|
Format(sQuery, sizeof(sQuery), "INSERT INTO connections (auth) VALUES ('%s')" , sAuthID);
|
||||||
|
|
||||||
@ -203,8 +201,7 @@ public void OnClientDisconnect(int client)
|
|||||||
|
|
||||||
public Action BlockChat(Handle timer, int clientid)
|
public Action BlockChat(Handle timer, int clientid)
|
||||||
{
|
{
|
||||||
int client = -1;
|
if ((client = GetClientFromSerial(clientid)) == 0)
|
||||||
if ((client = GetClientFromSerial(clientid)) == -1)
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
g_bNewPlayerChatBlock[client] = false;
|
g_bNewPlayerChatBlock[client] = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user