summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/guildmanager.cpp17
-rw-r--r--src/guildmanager.h2
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;