From: Rudolf Polzer Date: Fri, 28 Oct 2011 14:15:23 +0000 (+0200) Subject: race/cts: store UID2Name info prefixed with "/uid2name/" not "uid2name", to not clash... X-Git-Tag: xonotic-v0.6.0~35^2~78^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=e1d927cb0bef5778aa555e9d4820f3073e9044e4;p=xonotic%2Fxonotic-data.pk3dir.git race/cts: store UID2Name info prefixed with "/uid2name/" not "uid2name", to not clash in case a map's name starts with "uid2name". --- diff --git a/qcsrc/server/cl_client.qc b/qcsrc/server/cl_client.qc index aaca49da6..657334fe8 100644 --- a/qcsrc/server/cl_client.qc +++ b/qcsrc/server/cl_client.qc @@ -3250,7 +3250,7 @@ void PlayerPostThink (void) self.stored_netname = strzone(uid2name(self.crypto_idfp)); if(self.stored_netname != self.netname) { - db_put(ServerProgsDB, strcat("uid2name", self.crypto_idfp), self.netname); + db_put(ServerProgsDB, strcat("/uid2name/", self.crypto_idfp), self.netname); strunzone(self.stored_netname); self.stored_netname = strzone(self.netname); } diff --git a/qcsrc/server/miscfunctions.qc b/qcsrc/server/miscfunctions.qc index 8b9cfec12..2fe562774 100644 --- a/qcsrc/server/miscfunctions.qc +++ b/qcsrc/server/miscfunctions.qc @@ -2037,7 +2037,19 @@ void print_to(entity e, string s) string uid2name(string myuid) { string s; - s = db_get(ServerProgsDB, strcat("uid2name", myuid)); + s = db_get(ServerProgsDB, strcat("/uid2name/", myuid)); + + // FIXME remove this later after 0.6 release + // convert old style broken records to correct style + if(s == "") + { + s = db_get(ServerProgsDB, strcat("uid2name", myuid)); + if(s != "") + { + db_put(ServerProgsDB, strcat("/uid2name/", myuid), s); + db_put(ServerProgsDB, strcat("uid2name", myuid), ""); + } + } if(s == "") s = "^1Unregistered Player";