summaryrefslogtreecommitdiff
path: root/src/resources/db
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-07-30 14:40:15 +0300
committerAndrei Karas <akaras@inbox.ru>2015-07-30 14:40:15 +0300
commitfadafe160a52f47d9eeca88517562964a85499c2 (patch)
tree57dd234149a5100ba1adde53ebe2794d267790e1 /src/resources/db
parent4eeb20aae588b9c3d1c4ed4462306391e20e58fc (diff)
downloadmanaverse-fadafe160a52f47d9eeca88517562964a85499c2.tar.gz
manaverse-fadafe160a52f47d9eeca88517562964a85499c2.tar.bz2
manaverse-fadafe160a52f47d9eeca88517562964a85499c2.tar.xz
manaverse-fadafe160a52f47d9eeca88517562964a85499c2.zip
Add badges for player names.
Diffstat (limited to 'src/resources/db')
-rw-r--r--src/resources/db/badgesdb.cpp12
-rw-r--r--src/resources/db/badgesdb.h2
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