summaryrefslogtreecommitdiffstats
path: root/src/Server.cpp
diff options
context:
space:
mode:
authorLogicParrot <LogicParrot@users.noreply.github.com>2017-08-29 18:29:30 +0200
committerLogicParrot <LogicParrot@users.noreply.github.com>2017-08-29 18:29:30 +0200
commitbb11091402142daf2f9e8294a256bb7222bbc344 (patch)
treeb8a4828b72991b39a5cbf3ed4bc07357f9399972 /src/Server.cpp
parentFixed some headers, incorprated some code from the conflicts (diff)
parentcUUID: Fix FromHexDigit for digits >= 'a' (diff)
downloadcuberite-bb11091402142daf2f9e8294a256bb7222bbc344.tar
cuberite-bb11091402142daf2f9e8294a256bb7222bbc344.tar.gz
cuberite-bb11091402142daf2f9e8294a256bb7222bbc344.tar.bz2
cuberite-bb11091402142daf2f9e8294a256bb7222bbc344.tar.lz
cuberite-bb11091402142daf2f9e8294a256bb7222bbc344.tar.xz
cuberite-bb11091402142daf2f9e8294a256bb7222bbc344.tar.zst
cuberite-bb11091402142daf2f9e8294a256bb7222bbc344.zip
Diffstat (limited to 'src/Server.cpp')
-rw-r--r--src/Server.cpp50
1 files changed, 50 insertions, 0 deletions
diff --git a/src/Server.cpp b/src/Server.cpp
index 70d594f2d..6ddb14ae5 100644
--- a/src/Server.cpp
+++ b/src/Server.cpp
@@ -235,6 +235,56 @@ bool cServer::InitServer(cSettingsRepositoryInterface & a_Settings, bool a_Shoul
+bool cServer::RegisterForgeMod(const AString & a_ModName, const AString & a_ModVersion, UInt32 a_ProtocolVersionNumber)
+{
+ auto & Mods = RegisteredForgeMods(a_ProtocolVersionNumber);
+
+ return Mods.insert({a_ModName, a_ModVersion}).second;
+}
+
+
+
+
+
+void cServer::UnregisterForgeMod(const AString & a_ModName, UInt32 a_ProtocolVersionNumber)
+{
+ auto & Mods = RegisteredForgeMods(a_ProtocolVersionNumber);
+
+ auto it = Mods.find(a_ModName);
+ if (it != Mods.end())
+ {
+ Mods.erase(it);
+ }
+}
+
+
+
+
+AStringMap & cServer::RegisteredForgeMods(const UInt32 a_Protocol)
+{
+ auto it = m_ForgeModsByVersion.find(a_Protocol);
+
+ if (it == m_ForgeModsByVersion.end())
+ {
+ AStringMap mods;
+ m_ForgeModsByVersion.insert({a_Protocol, mods});
+ return m_ForgeModsByVersion.find(a_Protocol)->second;
+ }
+
+ return it->second;
+}
+
+
+
+
+const AStringMap & cServer::GetRegisteredForgeMods(const UInt32 a_Protocol)
+{
+ return RegisteredForgeMods(a_Protocol);
+}
+
+
+
+
bool cServer::IsPlayerInQueue(AString a_Username)
{
cCSLock Lock(m_CSClients);