r5195 - trunk/data/qcsrc/server

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Fri Dec 12 08:20:37 EST 2008


Author: div0
Date: 2008-12-12 08:20:37 -0500 (Fri, 12 Dec 2008)
New Revision: 5195

Modified:
   trunk/data/qcsrc/server/ipban.qc
   trunk/data/qcsrc/server/vote.qc
Log:
do not network bans without reason, or by vcall votes


Modified: trunk/data/qcsrc/server/ipban.qc
===================================================================
--- trunk/data/qcsrc/server/ipban.qc	2008-12-12 13:06:14 UTC (rev 5194)
+++ trunk/data/qcsrc/server/ipban.qc	2008-12-12 13:20:37 UTC (rev 5195)
@@ -329,7 +329,9 @@
 	string s;
 
 	if(dosync)
-		OnlineBanList_SendBan(ip, bantime, reason);
+		if(reason != "")
+			if(substring(reason, 0, 1) != "~") // like IRC: unauthenticated banner
+				OnlineBanList_SendBan(ip, bantime, reason);
 
 	// already banned?
 	for(i = 0; i < ban_count; ++i)

Modified: trunk/data/qcsrc/server/vote.qc
===================================================================
--- trunk/data/qcsrc/server/vote.qc	2008-12-12 13:06:14 UTC (rev 5194)
+++ trunk/data/qcsrc/server/vote.qc	2008-12-12 13:20:37 UTC (rev 5195)
@@ -43,15 +43,26 @@
 		else
 			GetKickVoteVictim_reason = "";
 
+		if(cmd != "vdo" || GetKickVoteVictim_reason == "")
+			reason = "~"; // by convention, ~ prefixes a "unverified" kickban which will not be networked
+		else
+			reason = "";
 		if(caller)
-			reason = strcat("player ", caller.netname);
+		{
+			if(cvar_value_issafe(caller.netname))
+				reason = strcat(reason, "player ", caller.netname);
+			else
+				reason = strcat(reason, "player ", uri_escape(caller.netname));
+		}
 		else
-			reason = "console vote";
-		if(!cvar_value_issafe(reason))
-			reason = "some player";
+			reason = strcat(reason, "console vote");
 		if(GetKickVoteVictim_reason != "")
+		{
 			if(cvar_value_issafe(GetKickVoteVictim_reason))
 				reason = strcat(reason, ": ", GetKickVoteVictim_reason);
+			else
+				reason = strcat(reason, ": ", uri_escape(GetKickVoteVictim_reason));
+		}
 
 		n = stof(ns);
 		if(ns == ftos(n)) if(n >= 1) if(n <= maxclients)




More information about the nexuiz-commits mailing list