diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-09-09 02:40:46 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-09-09 02:40:46 +0300 |
commit | c1fb0bf9dc98e2a30f33cbbf4f74604b36efbcba (patch) | |
tree | cb6fe9b54d41129a1c404d82f2bd2fdbfe930b1b | |
parent | 71dd90d37461d1882f0e4d45749ff458fd97a78c (diff) | |
download | manaplus-c1fb0bf9dc98e2a30f33cbbf4f74604b36efbcba.tar.gz manaplus-c1fb0bf9dc98e2a30f33cbbf4f74604b36efbcba.tar.bz2 manaplus-c1fb0bf9dc98e2a30f33cbbf4f74604b36efbcba.tar.xz manaplus-c1fb0bf9dc98e2a30f33cbbf4f74604b36efbcba.zip |
Fix whisper errors detection.
Was broken because incorrect activitives guildmanager with buggy servers.
-rw-r--r-- | src/guildmanager.cpp | 17 | ||||
-rw-r--r-- | src/guildmanager.h | 2 |
2 files changed, 17 insertions, 2 deletions
diff --git a/src/guildmanager.cpp b/src/guildmanager.cpp index eaee529b9..c5d8f8bb6 100644 --- a/src/guildmanager.cpp +++ b/src/guildmanager.cpp @@ -43,6 +43,8 @@ bool GuildManager::mEnableGuildBot = false; GuildManager::GuildManager() : mGotInfo(false), mGotName(false), + mSentInfoRequest(false), + mSentNameRequest(false), mHavePower(false), mTab(0), mRequest(false) @@ -87,6 +89,8 @@ void GuildManager::reload() mGotName = false; mHavePower = false; mRequest = false; + mSentNameRequest = false; + mSentInfoRequest = false; mTempList.clear(); if (socialWindow) @@ -124,15 +128,21 @@ void GuildManager::requestGuildInfo() if (mRequest) return; - if (!mGotName) + if (!mGotName && !mSentNameRequest) { + if (!Client::limitPackets(PACKET_CHAT)) + return; send("!info " + toString(tick_time)); mRequest = true; + mSentNameRequest = true; } - else if (!mGotInfo) + else if (!mGotInfo && !mSentInfoRequest && !mSentNameRequest) { + if (!Client::limitPackets(PACKET_CHAT)) + return; send("!getonlineinfo " + toString(tick_time)); mRequest = true; + mSentInfoRequest = true; } } @@ -181,6 +191,7 @@ void GuildManager::updateList() } } mTempList.clear(); + mSentInfoRequest = false; mGotInfo = true; } @@ -269,6 +280,7 @@ bool GuildManager::process(std::string msg) if (player_node) player_node->setGuildName(msg); mGotName = true; + mSentNameRequest = false; mRequest = false; return true; } @@ -307,6 +319,7 @@ bool GuildManager::process(std::string msg) if (player_node) player_node->setGuildName(msg); mGotName = true; + mSentNameRequest = false; mRequest = false; return true; } diff --git a/src/guildmanager.h b/src/guildmanager.h index 80014e352..5cd5e19cc 100644 --- a/src/guildmanager.h +++ b/src/guildmanager.h @@ -83,6 +83,8 @@ class GuildManager static bool mEnableGuildBot; bool mGotInfo; bool mGotName; + bool mSentInfoRequest; + bool mSentNameRequest; bool mHavePower; std::vector<std::string> mTempList; GuildChatTab *mTab; |