[nexuiz-commits] r6698 - trunk/data/qcsrc/server
DONOTREPLY at icculus.org
DONOTREPLY at icculus.org
Sun May 10 06:19:34 EDT 2009
Author: greenmarine
Date: 2009-05-10 06:19:30 -0400 (Sun, 10 May 2009)
New Revision: 6698
Modified:
trunk/data/qcsrc/server/cl_player.qc
trunk/data/qcsrc/server/clientcommands.qc
trunk/data/qcsrc/server/defs.qh
trunk/data/qcsrc/server/g_world.qc
Log:
fix issue 19
Modified: trunk/data/qcsrc/server/cl_player.qc
===================================================================
--- trunk/data/qcsrc/server/cl_player.qc 2009-05-10 03:33:44 UTC (rev 6697)
+++ trunk/data/qcsrc/server/cl_player.qc 2009-05-10 10:19:30 UTC (rev 6698)
@@ -665,9 +665,6 @@
self.last_selected_player = self.selected_player;
}
-.float floodcontrol_chat;
-.float floodcontrol_chatteam;
-.float floodcontrol_chattell;
void Say(entity source, float teamsay, entity privatesay, string msgin, float floodcontrol)
{
string msgstr, colorstr, cmsgstr, namestr, fullmsgstr, sourcemsgstr, fullcmsgstr, sourcecmsgstr, privatemsgprefix;
@@ -798,6 +795,9 @@
msgstr = fullmsgstr;
}
}
+
+ if (timeoutStatus == 2) //when game is paused, no flood protection
+ source.flood_field = flood = 0;
if(flood == 2)
{
@@ -1100,8 +1100,6 @@
GlobalSound(sample, chan, voicetype);
}
-.float floodcontrol_voice;
-.float floodcontrol_voiceteam;
void VoiceMessage(string type, string msg)
{
var .string sample;
@@ -1137,6 +1135,9 @@
self.flood_field = max(time, self.flood_field) + flood_spv;
else
flood = 1;
+
+ if (timeoutStatus == 2) //when game is paused, no flood protection
+ self.flood_field = flood = 0;
if (msg != "")
Say(self, ownteam, world, msg, 0);
Modified: trunk/data/qcsrc/server/clientcommands.qc
===================================================================
--- trunk/data/qcsrc/server/clientcommands.qc 2009-05-10 03:33:44 UTC (rev 6697)
+++ trunk/data/qcsrc/server/clientcommands.qc 2009-05-10 10:19:30 UTC (rev 6698)
@@ -388,6 +388,9 @@
else
self.nickspamcount += 1;
self.nickspamtime = time + cvar("g_nick_flood_penalty");
+
+ if (timeoutStatus == 2) //when game is paused, no flood protection
+ self.nickspamcount = self.nickspamtime = 0;
}
clientcommand(self,s);
Modified: trunk/data/qcsrc/server/defs.qh
===================================================================
--- trunk/data/qcsrc/server/defs.qh 2009-05-10 03:33:44 UTC (rev 6697)
+++ trunk/data/qcsrc/server/defs.qh 2009-05-10 10:19:30 UTC (rev 6698)
@@ -567,7 +567,13 @@
.vector prevorigin;
+//flood fields
.float nickspamtime; // time of last nick change
.float nickspamcount;
+.float floodcontrol_chat;
+.float floodcontrol_chatteam;
+.float floodcontrol_chattell;
+.float floodcontrol_voice;
+.float floodcontrol_voiceteam;
.float stat_shotorg; // networked stat for trueaim HUD
Modified: trunk/data/qcsrc/server/g_world.qc
===================================================================
--- trunk/data/qcsrc/server/g_world.qc 2009-05-10 03:33:44 UTC (rev 6697)
+++ trunk/data/qcsrc/server/g_world.qc 2009-05-10 10:19:30 UTC (rev 6698)
@@ -79,6 +79,10 @@
else {
//now pause the game:
timeoutStatus = 2;
+ //reset all the flood variables
+ FOR_EACH_CLIENT(plr) {
+ plr.nickspamcount = plr.nickspamtime = plr.floodcontrol_chat = plr.floodcontrol_chatteam = plr.floodcontrol_chattell = plr.floodcontrol_voice = plr.floodcontrol_voiceteam = 0;
+ }
cvar_set("slowmo", ftos(TIMEOUT_SLOWMO_VALUE));
//copy .v_angle to .lastV_angle for every player in order to fix their view during pause (see PlayerPreThink)
FOR_EACH_REALPLAYER(plr) {
More information about the nexuiz-commits
mailing list