3 * Manages the standard flat files for admins. This is the file to compile.
4 * This file is part of SourceMod, Copyright (C) 2004-2007 AlliedModders LLC
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
27 /* We like semicolons */
30 public Plugin:myinfo =
32 name = "Admin File Reader",
33 author = "AlliedModders LLC",
34 description = "Reads admin files",
35 version = SOURCEMOD_VERSION,
36 url = "http://www.sourcemod.net/"
39 /** Various parsing globals */
40 new bool:g_FlagsSet[26]; /* Maps whether flags are set */
41 new AdminFlag:g_FlagLetters[26]; /* Maps the flag letters */
42 new bool:g_LoggedFileName = false; /* Whether or not the file name has been logged */
43 new g_ErrorCount = 0; /* Current error count */
44 new g_IgnoreLevel = 0; /* Nested ignored section count, so users can screw up files safely */
45 new String:g_Filename[PLATFORM_MAX_PATH]; /* Used for error messages */
47 #include "admin-levels.sp"
48 #include "admin-overrides.sp"
49 #include "admin-groups.sp"
50 #include "admin-users.sp"
51 #include "admin-simple.sp"
53 public OnRebuildAdminCache(AdminCachePart:part)
56 if (part == AdminCache_Overrides)
59 } else if (part == AdminCache_Groups) {
61 } else if (part == AdminCache_Admins) {
67 ParseError(const String:format[], {Handle,String,Float,_}:...)
69 decl String:buffer[512];
71 if (!g_LoggedFileName)
73 LogError("Error(s) detected parsing %s", g_Filename);
74 g_LoggedFileName = true;
77 VFormat(buffer, sizeof(buffer), format, 2);
79 LogError(" (%d) %s", ++g_ErrorCount, buffer);
86 g_LoggedFileName = false;