diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-07-30 14:40:15 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-07-30 14:40:15 +0300 |
commit | fadafe160a52f47d9eeca88517562964a85499c2 (patch) | |
tree | 57dd234149a5100ba1adde53ebe2794d267790e1 /src/resources | |
parent | 4eeb20aae588b9c3d1c4ed4462306391e20e58fc (diff) | |
download | mv-fadafe160a52f47d9eeca88517562964a85499c2.tar.gz mv-fadafe160a52f47d9eeca88517562964a85499c2.tar.bz2 mv-fadafe160a52f47d9eeca88517562964a85499c2.tar.xz mv-fadafe160a52f47d9eeca88517562964a85499c2.zip |
Add badges for player names.
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 |