From 869cb1c660310140f02a0b3804e02a2f3c4a0326 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 13 Feb 2018 05:24:46 +0300 Subject: Add support for show clan badge. But for now clan unset for players. --- src/resources/db/badgesdb.cpp | 11 +++++++++++ src/resources/db/badgesdb.h | 2 ++ 2 files changed, 13 insertions(+) (limited to 'src/resources/db') 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 -- cgit v1.2.3-70-g09d2