summaryrefslogtreecommitdiff
path: root/src/guildmanager.cpp
diff options
context:
space:
mode:
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;
}