r5210 - trunk/data/qcsrc/server

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Sun Dec 14 08:02:37 EST 2008


Author: div0
Date: 2008-12-14 08:02:33 -0500 (Sun, 14 Dec 2008)
New Revision: 5210

Modified:
   trunk/data/qcsrc/server/ipban.qc
   trunk/data/qcsrc/server/vote.qc
   trunk/data/qcsrc/server/vote.qh
Log:
improve kickban display


Modified: trunk/data/qcsrc/server/ipban.qc
===================================================================
--- trunk/data/qcsrc/server/ipban.qc	2008-12-13 19:21:52 UTC (rev 5209)
+++ trunk/data/qcsrc/server/ipban.qc	2008-12-14 13:02:33 UTC (rev 5210)
@@ -330,6 +330,21 @@
 	entity e;
 	string s;
 
+	// Enforce our new ban
+	s = "";
+	FOR_EACH_REALCLIENT(e)
+		if(Ban_IsClientBanned(e, i))
+		{
+			if(s == "")
+				reason = strcat(reason, ": affects ");
+			else
+				reason = strcat(reason, ", ");
+			reason = strcat(reason, e.netname);
+			s = strcat(s, "^1NOTE:^7 banned client ", e.netname, "^7 has to go\n");
+			dropclient(e);
+		}
+	bprint(s);
+
 	if(dosync)
 		if(reason != "")
 			if(substring(reason, 0, 1) != "~") // like IRC: unauthenticated banner
@@ -379,16 +394,6 @@
 
 	Ban_SaveBans();
 
-	// Enforce our new ban
-	s = "";
-	FOR_EACH_REALCLIENT(e)
-		if(Ban_IsClientBanned(e, i))
-		{
-			s = strcat(s, "^1NOTE:^7 banned client ", e.netname, "^7 has to go\n");
-			dropclient(e);
-		}
-	bprint(s);
-
 	return TRUE;
 }
 
@@ -416,9 +421,12 @@
 			Ban_Insert(ban_ip4, bantime, reason, 1);
 			break;
 	}
+	/*
+	 * not needed, as we enforce the ban in Ban_Insert anyway
 	// and kick him
 	sprint(client, strcat("Kickbanned: ", reason, "\n"));
 	dropclient(client);
+	 */
 }
 
 float GameCommand_Ban(string command)

Modified: trunk/data/qcsrc/server/vote.qc
===================================================================
--- trunk/data/qcsrc/server/vote.qc	2008-12-13 19:21:52 UTC (rev 5209)
+++ trunk/data/qcsrc/server/vote.qc	2008-12-14 13:02:33 UTC (rev 5210)
@@ -11,6 +11,9 @@
 	return FALSE;
 }
 
+string GetKickVoteVictim_newcommand;
+string GetKickVoteVictim_reason;
+
 entity GetKickVoteVictim(string vote, string cmd, entity caller)
 {
 	float tokens;
@@ -120,7 +123,7 @@
 		if(!(victim = GetKickVoteVictim(vote, cmd, e)))
 			return FALSE;
 		RemapVote_vote = GetKickVoteVictim_newcommand;
-		RemapVote_display = strcat("^1", RemapVote_vote, " (^7", victim.netname, "^1): ", GetKickVoteVictim_reason);
+		RemapVote_display = strcat("^1", vote, " (^7", victim.netname, "^1): ", GetKickVoteVictim_reason);
 	}
 	else
 	{

Modified: trunk/data/qcsrc/server/vote.qh
===================================================================
--- trunk/data/qcsrc/server/vote.qh	2008-12-13 19:21:52 UTC (rev 5209)
+++ trunk/data/qcsrc/server/vote.qh	2008-12-14 13:02:33 UTC (rev 5210)
@@ -8,9 +8,6 @@
 .float vote_next;
 .float vote_vote;
 
-string GetKickVoteVictim_newcommand;
-string GetKickVoteVictim_reason;
-
 float VoteCheckNasty(string cmd);
 entity GetKickVoteVictim(string vote, string cmd, entity caller);
 float GameCommand_Vote(string s, entity e);




More information about the nexuiz-commits mailing list