From 5e2eb7d67ae933b7566f1944d0bb7744da03d586 Mon Sep 17 00:00:00 2001 From: aura Date: Tue, 17 Feb 2026 23:42:09 +0100 Subject: move source stuff to its own folder --- sourcemod/scripting/distbugfix/clientprefs.sp | 51 --------------------------- 1 file changed, 51 deletions(-) delete mode 100644 sourcemod/scripting/distbugfix/clientprefs.sp (limited to 'sourcemod/scripting/distbugfix/clientprefs.sp') diff --git a/sourcemod/scripting/distbugfix/clientprefs.sp b/sourcemod/scripting/distbugfix/clientprefs.sp deleted file mode 100644 index bee4681..0000000 --- a/sourcemod/scripting/distbugfix/clientprefs.sp +++ /dev/null @@ -1,51 +0,0 @@ - - -static Handle distbugCookie; -static int settings[MAXPLAYERS + 1]; - -void OnPluginStart_Clientprefs() -{ - distbugCookie = RegClientCookie("distbugfix_cookie_v2", "cookie for distbugfix", CookieAccess_Private); - if (distbugCookie == INVALID_HANDLE) - { - SetFailState("Couldn't create distbug cookie."); - } -} - -void OnClientCookiesCached_Clientprefs(int client) -{ - char buffer[MAX_COOKIE_SIZE]; - GetClientCookie(client, distbugCookie, buffer, sizeof(buffer)); - - settings[client] = StringToInt(buffer); -} - -void SaveClientCookies(int client) -{ - if (!GCIsValidClient(client) || !AreClientCookiesCached(client)) - { - return; - } - - char buffer[MAX_COOKIE_SIZE]; - IntToString(settings[client], buffer, sizeof(buffer)); - SetClientCookie(client, distbugCookie, buffer); -} - -bool IsSettingEnabled(int client, int setting) -{ - if (GCIsValidClient(client)) - { - return !!(settings[client] & setting); - } - return false; -} - -void ToggleSetting(int client, int setting) -{ - if (GCIsValidClient(client)) - { - settings[client] ^= setting; - SaveClientCookies(client); - } -} \ No newline at end of file -- cgit v1.2.3