summaryrefslogtreecommitdiff
path: root/src/guildmanager.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-09-09 02:40:46 +0300
committerAndrei Karas <akaras@inbox.ru>2011-09-09 02:40:46 +0300
commitc1fb0bf9dc98e2a30f33cbbf4f74604b36efbcba (patch)
treecb6fe9b54d41129a1c404d82f2bd2fdbfe930b1b /src/guildmanager.cpp
parent71dd90d37461d1882f0e4d45749ff458fd97a78c (diff)
downloadplus-c1fb0bf9dc98e2a30f33cbbf4f74604b36efbcba.tar.gz
plus-c1fb0bf9dc98e2a30f33cbbf4f74604b36efbcba.tar.bz2
plus-c1fb0bf9dc98e2a30f33cbbf4f74604b36efbcba.tar.xz
plus-c1fb0bf9dc98e2a30f33cbbf4f74604b36efbcba.zip
Fix whisper errors detection.
Was broken because incorrect activitives guildmanager with buggy servers.
Diffstat (limited to 'src/guildmanager.cpp')
-rw-r--r--src/guildmanager.cpp17
1 files changed, 15 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;
}