r3444 - in trunk/data/qcsrc: common server

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Wed Feb 27 08:59:27 EST 2008


Author: div0
Date: 2008-02-27 08:59:27 -0500 (Wed, 27 Feb 2008)
New Revision: 3444

Modified:
   trunk/data/qcsrc/common/util.qc
   trunk/data/qcsrc/server/ctf.qc
Log:
make DB use DP_QC_URI_ESCAPE


Modified: trunk/data/qcsrc/common/util.qc
===================================================================
--- trunk/data/qcsrc/common/util.qc	2008-02-27 13:56:21 UTC (rev 3443)
+++ trunk/data/qcsrc/common/util.qc	2008-02-27 13:59:27 UTC (rev 3444)
@@ -286,7 +286,7 @@
 		{
 			n = tokenizebyseparator(l, "\\");
 			for(j = 2; j < n; j += 2)
-				db_put(db, argv(j-1), argv(j));
+				db_put(db, uri_unescape(argv(j-1)), uri_unescape(argv(j)));
 		}
 	}
 	fclose(fh);
@@ -318,13 +318,16 @@
 string db_get(float db, string pKey)
 {
 	float h;
+	pKey = uri_escape(pKey);
 	h = mod(crc16(FALSE, pKey), DB_BUCKETS);
-	return infoget(bufstr_get(db, h), pKey);
+	return uri_unescape(infoget(bufstr_get(db, h), pKey));
 }
 
 void db_put(float db, string pKey, string pValue)
 {
 	float h;
+	pKey = uri_escape(pKey);
+	pValue = uri_escape(pValue);
 	h = mod(crc16(FALSE, pKey), DB_BUCKETS);
 	bufstr_set(db, h, infoadd(bufstr_get(db, h), pKey, pValue));
 }

Modified: trunk/data/qcsrc/server/ctf.qc
===================================================================
--- trunk/data/qcsrc/server/ctf.qc	2008-02-27 13:56:21 UTC (rev 3443)
+++ trunk/data/qcsrc/server/ctf.qc	2008-02-27 13:59:27 UTC (rev 3444)
@@ -251,11 +251,11 @@
 		s = ftos_decimals(t, 2);
 		s0 = ftos_decimals(flagcaptimerecord, 2);
 		h0 = db_get(ServerProgsDB, strcat(GetMapname(), "/captimerecord/netname"));
-		h1 = strreplace("\\", "\xDC", other.netname); // h1: current netname, escaped for DB (\ is 5C, other \ is DC)
+		h1 = other.netname;
 		if(h0 == h1)
 			h0 = "his";
 		else
-			h0 = strcat(strreplace("\xDC", "\\", h0), "^7's"); // h0: display text for previous netname
+			h0 = strcat(h0, "^7's"); // h0: display text for previous netname
 		if (flagcaptimerecord == 0)
 		{
 			bprint(other.netname, "^7 captured the ", other.flagcarried.netname, " in ", s, " seconds\n");




More information about the nexuiz-commits mailing list