diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-07-31 00:42:35 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-07-31 00:42:35 +0300 |
commit | f28b8c5f50ea6aa3d9b7754dafa9bb56a7b791a9 (patch) | |
tree | 40c95d8508a1cca9327d9d91c19e03261f7aca58 /src | |
parent | 8cc6679b676103c7c6696947ea43ad439e9754c5 (diff) | |
download | mv-f28b8c5f50ea6aa3d9b7754dafa9bb56a7b791a9.tar.gz mv-f28b8c5f50ea6aa3d9b7754dafa9bb56a7b791a9.tar.bz2 mv-f28b8c5f50ea6aa3d9b7754dafa9bb56a7b791a9.tar.xz mv-f28b8c5f50ea6aa3d9b7754dafa9bb56a7b791a9.zip |
Fix guildbot messages delay.
Diffstat (limited to 'src')
-rw-r--r-- | src/client.cpp | 8 | ||||
-rw-r--r-- | src/client.h | 1 | ||||
-rw-r--r-- | src/guildmanager.cpp | 4 |
3 files changed, 10 insertions, 3 deletions
diff --git a/src/client.cpp b/src/client.cpp index cfff614ef..e264235d5 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -2233,6 +2233,12 @@ void Client::initPacketLimiter() mPacketLimits[PACKET_ONLINELIST].cntLimit = 1; mPacketLimits[PACKET_ONLINELIST].cnt = 0; + // 300ms + 50 fix + mPacketLimits[PACKET_WHISPER].timeLimit = 30 + 5; + mPacketLimits[PACKET_WHISPER].lastTime = 0; + mPacketLimits[PACKET_WHISPER].cntLimit = 1; + mPacketLimits[PACKET_WHISPER].cnt = 0; + if (!mServerConfigDir.empty()) { std::string packetLimitsName = @@ -2269,7 +2275,7 @@ void Client::initPacketLimiter() mPacketLimits[f].timeLimit = atoi(line); } inPacketFile.close(); - if (ver < 4) + if (ver < 5) writePacketLimits(packetLimitsName); } } diff --git a/src/client.h b/src/client.h index 32197da8f..87786856e 100644 --- a/src/client.h +++ b/src/client.h @@ -137,6 +137,7 @@ enum PacketTypes PACKET_ATTACK = 9, PACKET_STOPATTACK = 10, PACKET_ONLINELIST = 11, + PACKET_WHISPER = 12, PACKET_SIZE }; diff --git a/src/guildmanager.cpp b/src/guildmanager.cpp index 485320130..38cf0818d 100644 --- a/src/guildmanager.cpp +++ b/src/guildmanager.cpp @@ -131,7 +131,7 @@ void GuildManager::requestGuildInfo() if (!mGotName && !mSentNameRequest) { - if (!Client::limitPackets(PACKET_CHAT)) + if (!Client::limitPackets(PACKET_WHISPER)) return; send("!info " + toString(tick_time)); mRequest = true; @@ -139,7 +139,7 @@ void GuildManager::requestGuildInfo() } else if (!mGotInfo && !mSentInfoRequest && !mSentNameRequest) { - if (!Client::limitPackets(PACKET_CHAT)) + if (!Client::limitPackets(PACKET_WHISPER)) return; send("!getonlineinfo " + toString(tick_time)); mRequest = true; |