[nexuiz-commits] r8393 - trunk/data/qcsrc/common

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Mon Dec 14 10:58:24 EST 2009


Author: div0
Date: 2009-12-14 10:58:24 -0500 (Mon, 14 Dec 2009)
New Revision: 8393

Modified:
   trunk/data/qcsrc/common/mapinfo.qc
   trunk/data/qcsrc/common/mapinfo.qh
Log:
factor out the hardcoded ACL


Modified: trunk/data/qcsrc/common/mapinfo.qc
===================================================================
--- trunk/data/qcsrc/common/mapinfo.qc	2009-12-14 15:56:13 UTC (rev 8392)
+++ trunk/data/qcsrc/common/mapinfo.qc	2009-12-14 15:58:24 UTC (rev 8393)
@@ -553,16 +553,8 @@
 		print("Map ", pFilename, " contains a potentially harmful setting, ignored\n");
 	else if not (cvar_value_issafe(s))
 		print("Map ", pFilename, " contains a potentially harmful setting, ignored\n");
-	else if(substring(t, 0, 10) == "g_mapinfo_")
+	else if(matchacl(MAPINFO_SETTEMP_ACL_SYSTEM, t) <= 0)
 		print("Map ", pFilename, " contains a potentially harmful setting, ignored\n");
-	else if(substring(t, 0, 5) == "rcon_")
-		print("Map ", pFilename, " contains a potentially harmful setting, ignored\n");
-	else if(substring(t, 0, 8) == "settemp_")
-		print("Map ", pFilename, " contains a potentially harmful setting, ignored\n");
-	else if(substring(t, 0, 1) == "_")
-		print("Map ", pFilename, " contains a potentially harmful setting, ignored\n");
-	else if(substring(t, 0, 5) == "g_ban")
-		print("Map ", pFilename, " contains a potentially harmful setting, ignored\n");
 	else if(matchacl(acl, t) <= 0)
 		print("Map ", pFilename, " contains a denied setting, ignored\n");
 	else
@@ -594,7 +586,7 @@
 	float r, f, n, i;
 	string acl;
 
-	acl = cvar_string("g_mapinfo_settemp_acl");
+	acl = MAPINFO_SETTEMP_ACL_USER;
 
 	if(strstrofs(pFilename, "/", 0) >= 0)
 	{

Modified: trunk/data/qcsrc/common/mapinfo.qh
===================================================================
--- trunk/data/qcsrc/common/mapinfo.qh	2009-12-14 15:56:13 UTC (rev 8392)
+++ trunk/data/qcsrc/common/mapinfo.qh	2009-12-14 15:58:24 UTC (rev 8393)
@@ -82,3 +82,6 @@
 void MapInfo_ClearTemps(); // call this when done with mapinfo for this frame
 
 void MapInfo_Shutdown(); // call this in the shutdown handler
+
+#define MAPINFO_SETTEMP_ACL_USER cvar_string("g_mapinfo_settemp_acl")
+#define MAPINFO_SETTEMP_ACL_SYSTEM "-g_mapinfo_* -rcon_* -settemp_* -_* -g_ban* +*"



More information about the nexuiz-commits mailing list