diff options
Diffstat (limited to 'src/resources')
-rw-r--r-- | src/resources/db/badgesdb.cpp | 12 | ||||
-rw-r--r-- | src/resources/db/badgesdb.h | 2 |
2 files changed, 14 insertions, 0 deletions
diff --git a/src/resources/db/badgesdb.cpp b/src/resources/db/badgesdb.cpp index cdf61b406..d7476c7f0 100644 --- a/src/resources/db/badgesdb.cpp +++ b/src/resources/db/badgesdb.cpp @@ -27,6 +27,7 @@ namespace { BadgesInfos mGuilds; + BadgesInfos mNames; BadgesInfos mParties; bool mLoaded = false; } @@ -48,12 +49,15 @@ void BadgesDB::load() unload(); loadDB("guild", mGuilds); + loadDB("name", mNames); loadDB("party", mParties); } void BadgesDB::unload() { mParties.clear(); + mGuilds.clear(); + mNames.clear(); mLoaded = false; } @@ -65,6 +69,14 @@ const std::string BadgesDB::getPartyBadge(const std::string &name) return (*it).second; } +const std::string BadgesDB::getNameBadge(const std::string &name) +{ + BadgesInfosIter it = mNames.find(name); + if (it == mNames.end()) + return std::string(); + return (*it).second; +} + const std::string BadgesDB::getGuildBadge(const std::string &name) { BadgesInfosIter it = mGuilds.find(name); diff --git a/src/resources/db/badgesdb.h b/src/resources/db/badgesdb.h index 5e53660b9..324eac6c0 100644 --- a/src/resources/db/badgesdb.h +++ b/src/resources/db/badgesdb.h @@ -37,6 +37,8 @@ namespace BadgesDB const std::string getGuildBadge(const std::string &name); + const std::string getNameBadge(const std::string &name); + const std::string getPartyBadge(const std::string &name); } // namespace BadgesDB |