Browse Source

Remove single-use function

Removed `RequestClientBanStatus` as it was meant to handle command
callbacks, too.
nosoop 6 years ago
parent
commit
67d2e967c3
1 changed files with 10 additions and 11 deletions
  1. 10 11
      scripting/source_cbl.sp

+ 10 - 11
scripting/source_cbl.sp

@@ -9,7 +9,7 @@
 #pragma newdecls required
 #include "source_cbl/webapi.sp"
 
-#define PLUGIN_VERSION "0.2.1"
+#define PLUGIN_VERSION "0.2.2"
 public Plugin myinfo = {
 	name = "[CSRD] SourceCBL Integration",
 	author = "nosoop",
@@ -43,23 +43,22 @@ public void OnPluginStart() {
  */
 public void OnClientPostAdminCheck(int client) {
 	if (!IsFakeClient(client) && !SkipCommunityBanListCheck(client)) {
-		RequestClientBanStatus(client);
+		char steamid64[64];
+		if (GetClientAuthId(client, AuthId_SteamID64, steamid64, sizeof(steamid64))) {
+			QueryBanList(steamid64, OnSteamAuthBanStatusReceived, GetClientUserId(client));
+		}
 	}
 }
 
+/**
+ * Check if we should skip querying the SourceCBL API if the client fulfills certain criteria.
+ */
 bool SkipCommunityBanListCheck(int client) {
-	// TODO check if account is whitelisted (command group / keyvalues / clientprefs cache, etc.)
+	// TODO check forward call order to see if cookie cache is available here
+	// TODO implement cookie cache; save time of last finished query to avoid querying too much
 	return CheckCommandAccess(client, "cbl_whitelist", ADMFLAG_ROOT);
 }
 
-void RequestClientBanStatus(int client) {
-	char steamid64[64];
-	
-	if (GetClientAuthId(client, AuthId_SteamID64, steamid64, sizeof(steamid64))) {
-		QueryBanList(steamid64, OnSteamAuthBanStatusReceived, GetClientUserId(client));
-	}
-}
-
 public Action CheckCBLStatus(int client, int argc) {
 	char steamid64[64];
 	GetCmdArgString(steamid64, sizeof(steamid64));