trivial update
This commit is contained in:
parent
bddf4ecab2
commit
67298f6734
@ -34,14 +34,6 @@ public Action time_query_activity(Handle timer, any data)
|
|||||||
Database.Connect(SQL_OnDatabaseConnect, "unloze_playtimestats");
|
Database.Connect(SQL_OnDatabaseConnect, "unloze_playtimestats");
|
||||||
return Plugin_Continue;
|
return Plugin_Continue;
|
||||||
}
|
}
|
||||||
for (int client = 1; client <= MaxClients; client++)
|
|
||||||
if (IsValidClient(client) && !IsFakeClient(client) && IsPlayerAlive(client))
|
|
||||||
{
|
|
||||||
char sAuthID[32];
|
|
||||||
GetClientAuthId(client, AuthId_Steam2, sAuthID, sizeof(sAuthID), false);
|
|
||||||
char sIP[32];
|
|
||||||
GetClientIP(client, sIP, sizeof(sIP));
|
|
||||||
char sQuery[512];
|
|
||||||
char sServer[64];
|
char sServer[64];
|
||||||
int i_port = GetConVarInt(FindConVar("hostport"));
|
int i_port = GetConVarInt(FindConVar("hostport"));
|
||||||
if (i_port == 27015)
|
if (i_port == 27015)
|
||||||
@ -62,8 +54,17 @@ public Action time_query_activity(Handle timer, any data)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
continue;
|
return Plugin_Continue;
|
||||||
}
|
}
|
||||||
|
for (int client = 1; client <= MaxClients; client++)
|
||||||
|
{
|
||||||
|
if (IsValidClient(client) && !IsFakeClient(client) && IsPlayerAlive(client))
|
||||||
|
{
|
||||||
|
char sAuthID[32];
|
||||||
|
GetClientAuthId(client, AuthId_Steam2, sAuthID, sizeof(sAuthID), false);
|
||||||
|
char sIP[32];
|
||||||
|
GetClientIP(client, sIP, sizeof(sIP));
|
||||||
|
char sQuery[512];
|
||||||
char sName[MAX_NAME_LENGTH];
|
char sName[MAX_NAME_LENGTH];
|
||||||
GetClientName(client, sName, sizeof(sName));
|
GetClientName(client, sName, sizeof(sName));
|
||||||
int size2 = 2 * strlen(sName) + 1;
|
int size2 = 2 * strlen(sName) + 1;
|
||||||
@ -71,10 +72,10 @@ public Action time_query_activity(Handle timer, any data)
|
|||||||
g_hDatabase.Escape(sName, sEscapedName, size2 + 1);
|
g_hDatabase.Escape(sName, sEscapedName, size2 + 1);
|
||||||
Format(sQuery, sizeof(sQuery), "update unloze_playtimestats.player_time set `%s` = `%s` + 10 where steam_id = '%s' and ipv4 = '%s'", sServer, sServer, sAuthID, sIP);
|
Format(sQuery, sizeof(sQuery), "update unloze_playtimestats.player_time set `%s` = `%s` + 10 where steam_id = '%s' and ipv4 = '%s'", sServer, sServer, sAuthID, sIP);
|
||||||
g_hDatabase.Query(SQL_FinishedQuery, sQuery, _, DBPrio_Low);
|
g_hDatabase.Query(SQL_FinishedQuery, sQuery, _, DBPrio_Low);
|
||||||
Format(sQuery, sizeof(sQuery), "update unloze_playtimestats.player_time set player_name = '%s' where steam_id = '%s'", sEscapedName, sAuthID);
|
Format(sQuery, sizeof(sQuery), "update unloze_playtimestats.player_time set player_name = '%s' where steam_id = '%s' and player_name != '%s'", sEscapedName, sAuthID, sEscapedName);
|
||||||
g_hDatabase.Query(SQL_FinishedQuery, sQuery, _, DBPrio_Low);
|
g_hDatabase.Query(SQL_FinishedQuery, sQuery, _, DBPrio_Low);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return Plugin_Continue;
|
return Plugin_Continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user