summaryrefslogtreecommitdiff
path: root/src/client.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-11-30 20:50:31 +0300
committerAndrei Karas <akaras@inbox.ru>2011-11-30 20:50:31 +0300
commitbf41736950d9e22be8b2b201dcd4833a50b26a99 (patch)
tree50ba5ff1db2740ec8de08093b899473ec8a25cd0 /src/client.cpp
parent7c6621108b54fd66fbb7aa87be067a34abcc3ced (diff)
downloadmv-bf41736950d9e22be8b2b201dcd4833a50b26a99.tar.gz
mv-bf41736950d9e22be8b2b201dcd4833a50b26a99.tar.bz2
mv-bf41736950d9e22be8b2b201dcd4833a50b26a99.tar.xz
mv-bf41736950d9e22be8b2b201dcd4833a50b26a99.zip
Add limits for online list packet.
Diffstat (limited to 'src/client.cpp')
-rw-r--r--src/client.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/client.cpp b/src/client.cpp
index d8bb747fb..fefb5bc71 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -2055,6 +2055,11 @@ void Client::initPacketLimiter()
mPacketLimits[PACKET_STOPATTACK].cntLimit = 1;
mPacketLimits[PACKET_STOPATTACK].cnt = 0;
+ mPacketLimits[PACKET_ONLINELIST].timeLimit = 1800;
+ mPacketLimits[PACKET_ONLINELIST].lastTime = 0;
+ mPacketLimits[PACKET_ONLINELIST].cntLimit = 1;
+ mPacketLimits[PACKET_ONLINELIST].cnt = 0;
+
if (!mServerConfigDir.empty())
{
std::string packetLimitsName =
@@ -2091,7 +2096,7 @@ void Client::initPacketLimiter()
mPacketLimits[f].timeLimit = atoi(line);
}
inPacketFile.close();
- if (ver < 3)
+ if (ver < 4)
writePacketLimits(packetLimitsName);
}
}
@@ -2106,7 +2111,7 @@ void Client::writePacketLimits(std::string packetLimitsName)
outPacketFile.close();
return;
}
- outPacketFile << "3" << std::endl;
+ outPacketFile << "4" << std::endl;
for (int f = 0; f < PACKET_SIZE; f ++)
{
outPacketFile << toString(mPacketLimits[f].timeLimit)