Fixed BanClient always banning by IP address (
bug 4626, r=fyren).
3 * =============================================================================
4 * SourceMod Admin File Reader Plugin
5 * Manages the standard flat files for admins. This is the file to compile.
7 * SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved.
8 * =============================================================================
10 * This program is free software; you can redistribute it and/or modify it under
11 * the terms of the GNU General Public License, version 3.0, as published by the
12 * Free Software Foundation.
14 * This program is distributed in the hope that it will be useful, but WITHOUT
15 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
19 * You should have received a copy of the GNU General Public License along with
20 * this program. If not, see <http://www.gnu.org/licenses/>.
22 * As a special exception, AlliedModders LLC gives you permission to link the
23 * code of this program (as well as its derivative works) to "Half-Life 2," the
24 * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
25 * by the Valve Corporation. You must obey the GNU General Public License in
26 * all respects for all other code used. Additionally, AlliedModders LLC grants
27 * this exception to all derivative works. AlliedModders LLC defines further
28 * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
29 * or <http://www.sourcemod.net/license.php>.
34 /* We like semicolons */
39 public Plugin:myinfo =
41 name = "Admin File Reader",
42 author = "AlliedModders LLC",
43 description = "Reads admin files",
44 version = SOURCEMOD_VERSION,
45 url = "http://www.sourcemod.net/"
48 /** Various parsing globals */
49 new bool:g_LoggedFileName = false; /* Whether or not the file name has been logged */
50 new g_ErrorCount = 0; /* Current error count */
51 new g_IgnoreLevel = 0; /* Nested ignored section count, so users can screw up files safely */
52 new g_CurrentLine = 0; /* Current line we're on */
53 new String:g_Filename[PLATFORM_MAX_PATH]; /* Used for error messages */
55 #include "admin-overrides.sp"
56 #include "admin-groups.sp"
57 #include "admin-users.sp"
58 #include "admin-simple.sp"
60 public OnRebuildAdminCache(AdminCachePart:part)
62 if (part == AdminCache_Overrides)
65 } else if (part == AdminCache_Groups) {
67 } else if (part == AdminCache_Admins) {
73 ParseError(const String:format[], {Handle,String,Float,_}:...)
75 decl String:buffer[512];
77 if (!g_LoggedFileName)
79 LogError("Error(s) detected parsing %s", g_Filename);
80 g_LoggedFileName = true;
83 VFormat(buffer, sizeof(buffer), format, 2);
85 LogError(" (line %d) %s", g_CurrentLine, buffer);
95 g_LoggedFileName = false;