summaryrefslogtreecommitdiff
path: root/src/resources/db
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2018-02-13 05:24:46 +0300
committerAndrei Karas <akaras@inbox.ru>2018-02-13 05:24:46 +0300
commit869cb1c660310140f02a0b3804e02a2f3c4a0326 (patch)
tree2f0df222ebf1292d17aba1f8b0fe66866a18b330 /src/resources/db
parent3a4d8f947b0358c636f983b4248777e8371678dd (diff)
downloadmv-869cb1c660310140f02a0b3804e02a2f3c4a0326.tar.gz
mv-869cb1c660310140f02a0b3804e02a2f3c4a0326.tar.bz2
mv-869cb1c660310140f02a0b3804e02a2f3c4a0326.tar.xz
mv-869cb1c660310140f02a0b3804e02a2f3c4a0326.zip
Add support for show clan badge.
But for now clan unset for players.
Diffstat (limited to 'src/resources/db')
-rw-r--r--src/resources/db/badgesdb.cpp11
-rw-r--r--src/resources/db/badgesdb.h2
2 files changed, 13 insertions, 0 deletions
diff --git a/src/resources/db/badgesdb.cpp b/src/resources/db/badgesdb.cpp
index aff03fc4f..4a9ded0d8 100644
--- a/src/resources/db/badgesdb.cpp
+++ b/src/resources/db/badgesdb.cpp
@@ -35,6 +35,7 @@ namespace
BadgesInfos mGuilds;
BadgesInfos mNames;
BadgesInfos mParties;
+ BadgesInfos mClans;
bool mLoaded = false;
} // namespace
@@ -78,12 +79,14 @@ void BadgesDB::load()
loadDB("guild", mGuilds);
loadDB("name", mNames);
loadDB("party", mParties);
+ loadDB("clan", mClans);
}
void BadgesDB::unload()
{
logger->log1("Unloading Badges database...");
mParties.clear();
+ mClans.clear();
mGuilds.clear();
mNames.clear();
mLoaded = false;
@@ -112,3 +115,11 @@ const std::string BadgesDB::getGuildBadge(const std::string &name)
return std::string();
return (*it).second;
}
+
+const std::string BadgesDB::getClanBadge(const std::string &name)
+{
+ const BadgesInfosIter it = mClans.find(name);
+ if (it == mClans.end())
+ return std::string();
+ return (*it).second;
+}
diff --git a/src/resources/db/badgesdb.h b/src/resources/db/badgesdb.h
index 6c5a94fab..78db3c113 100644
--- a/src/resources/db/badgesdb.h
+++ b/src/resources/db/badgesdb.h
@@ -40,6 +40,8 @@ namespace BadgesDB
const std::string getNameBadge(const std::string &name);
const std::string getPartyBadge(const std::string &name);
+
+ const std::string getClanBadge(const std::string &name);
} // namespace BadgesDB
#endif // RESOURCES_DB_BADGESDB_H