From 48e50398ce3feb85048ea8272094174be8d9edf2 Mon Sep 17 00:00:00 2001 From: jenz Date: Mon, 6 May 2024 18:49:02 +0200 Subject: [PATCH] expanded from top 100 to top 1000, also added time tracking for ze2. does probably not damage to add --- .../scripting/unloze_player_time.sp | 28 ++++--------------- 1 file changed, 6 insertions(+), 22 deletions(-) diff --git a/discord_verificiation/scripting/unloze_player_time.sp b/discord_verificiation/scripting/unloze_player_time.sp index 9d5bb1df..40bf24cb 100644 --- a/discord_verificiation/scripting/unloze_player_time.sp +++ b/discord_verificiation/scripting/unloze_player_time.sp @@ -11,7 +11,7 @@ Database g_hDatabase; bool is_bot_player[MAXPLAYERS + 1]; Handle g_h_time_activity = null; char g_csSID[MAXPLAYERS + 1][65]; -char g_cTimeRecords[100][128]; +char g_cTimeRecords[1000][128]; int g_iPlayerTimeServer[MAXPLAYERS + 1]; int g_iPlayerAFKTime; int g_iPlayerCount_excludeSpec; @@ -39,7 +39,7 @@ public Action time_query_activity(Handle timer, any data) } char sServer[64]; int i_port = GetConVarInt(FindConVar("hostport")); - if (i_port == 27015) + if (i_port == 27015 || i_port == 27035) //might as well count play time on ze2. it was not done before but its a bit like why not anyways. { Format(sServer, sizeof(sServer), "ze_time"); } @@ -108,22 +108,6 @@ public void OnPluginStart() delete cvar2; } -/* -public Action log_average_hour_count(Handle timer, any data) -{ - int i_port = GetConVarInt(FindConVar("hostport")); - int avg_hour = GetAveragePlayerActiveTimeServer(); - if (!g_hDatabase) - { - return Plugin_Handled; - } - char sQuery[512]; - Format(sQuery, sizeof(sQuery), "INSERT INTO `average_hours` (`avg_hour`, `server_port`) VALUES ('%i', '%i')", avg_hour, i_port); - g_hDatabase.Query(SQL_FinishedQuery, sQuery, _, DBPrio_Low); - return Plugin_Continue; -} -*/ - public void Cvar_playerAFKTime(ConVar convar, const char[] oldValue, const char[] newValue) { g_iPlayerAFKTime = convar.IntValue; @@ -434,7 +418,7 @@ public void OnMapStart() char sServer[32]; int i_port = GetConVarInt(FindConVar("hostport")); - if (i_port == 27015 || i_port == 27019) + if (i_port == 27015 || i_port == 27019 || i_port == 27035) { Format(sServer, sizeof(sServer), "ze_time"); } @@ -454,7 +438,7 @@ public void OnMapStart() { return; } - Format(sQuery, sizeof(sQuery), "select player_name, sum(%s) as %s_total from unloze_playtimestats.player_time GROUP BY steam_id order by %s_total desc limit 100", sServer, sServer, sServer); + Format(sQuery, sizeof(sQuery), "select player_name, sum(%s) as %s_total from unloze_playtimestats.player_time GROUP BY steam_id order by %s_total desc limit 1000", sServer, sServer, sServer); g_hDatabase.Query(SQL_OnQueryCompletedTopTime, sQuery); } @@ -463,7 +447,7 @@ public Action Command_TopTime(int client, int args) char sTitle[64]; char sServer[32]; int i_port = GetConVarInt(FindConVar("hostport")); - if (i_port == 27015 || i_port == 27019) + if (i_port == 27015 || i_port == 27019 || i_port == 27035) { Format(sServer, sizeof(sServer), "ZE"); } @@ -479,7 +463,7 @@ public Action Command_TopTime(int client, int args) { Format(sServer, sizeof(sServer), "JB"); } - Format(sTitle, sizeof(sTitle), "[UNLOZE Playtime] Top 100 Record Holders for %s:", sServer); + Format(sTitle, sizeof(sTitle), "[UNLOZE Playtime] Top 1000 Record Holders for %s:", sServer); Menu menu = new Menu(MenuHandler1); menu.SetTitle(sTitle); for (int i = 0; i < sizeof(g_cTimeRecords); i++)