summaryrefslogtreecommitdiff
path: root/src/client.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-09-27 01:11:39 +0300
committerAndrei Karas <akaras@inbox.ru>2011-09-27 01:11:39 +0300
commit8b4027516585888ad7e807b73a2f683e5a2ee0f8 (patch)
tree25c2bd424088c615997bb87b5569b2ff68b7759f /src/client.cpp
parentb782c12e55c65b6ca9b7384d63fb833a4c53c0bf (diff)
downloadmv-8b4027516585888ad7e807b73a2f683e5a2ee0f8.tar.gz
mv-8b4027516585888ad7e807b73a2f683e5a2ee0f8.tar.bz2
mv-8b4027516585888ad7e807b73a2f683e5a2ee0f8.tar.xz
mv-8b4027516585888ad7e807b73a2f683e5a2ee0f8.zip
Add limit for stop attack packet.
Diffstat (limited to 'src/client.cpp')
-rw-r--r--src/client.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/client.cpp b/src/client.cpp
index d0348dec5..8497d337b 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -2006,6 +2006,10 @@ void Client::initPacketLimiter()
mPacketLimits[PACKET_ATTACK].cntLimit = 1;
mPacketLimits[PACKET_ATTACK].cnt = 0;
+ mPacketLimits[PACKET_STOPATTACK].timeLimit = 2 + 10;
+ mPacketLimits[PACKET_STOPATTACK].lastTime = 0;
+ mPacketLimits[PACKET_STOPATTACK].cntLimit = 1;
+ mPacketLimits[PACKET_STOPATTACK].cnt = 0;
if (!mServerConfigDir.empty())
{
@@ -2043,7 +2047,7 @@ void Client::initPacketLimiter()
mPacketLimits[f].timeLimit = atoi(line);
}
inPacketFile.close();
- if (ver == 1)
+ if (ver < 3)
writePacketLimits(packetLimitsName);
}
}
@@ -2058,7 +2062,7 @@ void Client::writePacketLimits(std::string packetLimitsName)
outPacketFile.close();
return;
}
- outPacketFile << "2" << std::endl;
+ outPacketFile << "3" << std::endl;
for (int f = 0; f < PACKET_SIZE; f ++)
{
outPacketFile << toString(mPacketLimits[f].timeLimit)