summaryrefslogtreecommitdiff
path: root/src/resources/db
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-07-29 03:23:59 +0300
committerAndrei Karas <akaras@inbox.ru>2015-07-29 03:23:59 +0300
commitcd2a71bfc4d3339dd6cf18b5a311e57d58fb548c (patch)
tree7149ca3ff5accb1dcc6e4d059480464d6aa66804 /src/resources/db
parent73fc7aa882f53e47fb93e45f13e9428624f6876d (diff)
downloadmanaplus-cd2a71bfc4d3339dd6cf18b5a311e57d58fb548c.tar.gz
manaplus-cd2a71bfc4d3339dd6cf18b5a311e57d58fb548c.tar.bz2
manaplus-cd2a71bfc4d3339dd6cf18b5a311e57d58fb548c.tar.xz
manaplus-cd2a71bfc4d3339dd6cf18b5a311e57d58fb548c.zip
Add support for guild badges.
Diffstat (limited to 'src/resources/db')
-rw-r--r--src/resources/db/badgesdb.cpp10
-rw-r--r--src/resources/db/badgesdb.h2
2 files changed, 12 insertions, 0 deletions
diff --git a/src/resources/db/badgesdb.cpp b/src/resources/db/badgesdb.cpp
index 80b480ee0..cdf61b406 100644
--- a/src/resources/db/badgesdb.cpp
+++ b/src/resources/db/badgesdb.cpp
@@ -26,6 +26,7 @@
namespace
{
+ BadgesInfos mGuilds;
BadgesInfos mParties;
bool mLoaded = false;
}
@@ -46,6 +47,7 @@ void BadgesDB::load()
if (mLoaded)
unload();
+ loadDB("guild", mGuilds);
loadDB("party", mParties);
}
@@ -62,3 +64,11 @@ const std::string BadgesDB::getPartyBadge(const std::string &name)
return std::string();
return (*it).second;
}
+
+const std::string BadgesDB::getGuildBadge(const std::string &name)
+{
+ BadgesInfosIter it = mGuilds.find(name);
+ if (it == mGuilds.end())
+ return std::string();
+ return (*it).second;
+}
diff --git a/src/resources/db/badgesdb.h b/src/resources/db/badgesdb.h
index 7c971e00f..5e53660b9 100644
--- a/src/resources/db/badgesdb.h
+++ b/src/resources/db/badgesdb.h
@@ -35,6 +35,8 @@ namespace BadgesDB
void unload();
+ const std::string getGuildBadge(const std::string &name);
+
const std::string getPartyBadge(const std::string &name);
} // namespace BadgesDB