summaryrefslogtreecommitdiffstats
path: root/src/Server.cpp
diff options
context:
space:
mode:
authorHaoTNN <haotnn@gmail.com>2015-05-19 23:22:27 +0200
committerHaoTNN <haotnn@gmail.com>2015-05-19 23:22:27 +0200
commitac1bfd967153cee45b1ffc93655fbb4833faa531 (patch)
tree7ca3aef2a46a272ae815912af66dea0afe06e63b /src/Server.cpp
parentFixes lit furnace issue in #2051 (diff)
parentMerge pull request #2076 from mc-server/Cert-disable (diff)
downloadcuberite-ac1bfd967153cee45b1ffc93655fbb4833faa531.tar
cuberite-ac1bfd967153cee45b1ffc93655fbb4833faa531.tar.gz
cuberite-ac1bfd967153cee45b1ffc93655fbb4833faa531.tar.bz2
cuberite-ac1bfd967153cee45b1ffc93655fbb4833faa531.tar.lz
cuberite-ac1bfd967153cee45b1ffc93655fbb4833faa531.tar.xz
cuberite-ac1bfd967153cee45b1ffc93655fbb4833faa531.tar.zst
cuberite-ac1bfd967153cee45b1ffc93655fbb4833faa531.zip
Diffstat (limited to '')
-rw-r--r--src/Server.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/Server.cpp b/src/Server.cpp
index 996de2695..01d5a176a 100644
--- a/src/Server.cpp
+++ b/src/Server.cpp
@@ -185,12 +185,12 @@ void cServer::PlayerDestroying(const cPlayer * a_Player)
-bool cServer::InitServer(cIniFile & a_SettingsIni, bool a_ShouldAuth)
+bool cServer::InitServer(cSettingsRepositoryInterface & a_Settings, bool a_ShouldAuth)
{
- m_Description = a_SettingsIni.GetValueSet("Server", "Description", "MCServer - in C++!");
- m_MaxPlayers = a_SettingsIni.GetValueSetI("Server", "MaxPlayers", 100);
- m_bIsHardcore = a_SettingsIni.GetValueSetB("Server", "HardcoreEnabled", false);
- m_bAllowMultiLogin = a_SettingsIni.GetValueSetB("Server", "AllowMultiLogin", false);
+ m_Description = a_Settings.GetValueSet("Server", "Description", "MCServer - in C++!");
+ m_MaxPlayers = a_Settings.GetValueSetI("Server", "MaxPlayers", 100);
+ m_bIsHardcore = a_Settings.GetValueSetB("Server", "HardcoreEnabled", false);
+ m_bAllowMultiLogin = a_Settings.GetValueSetB("Server", "AllowMultiLogin", false);
m_PlayerCount = 0;
m_PlayerCountDiff = 0;
@@ -205,9 +205,9 @@ bool cServer::InitServer(cIniFile & a_SettingsIni, bool a_ShouldAuth)
LOGINFO("Compatible clients: %s", MCS_CLIENT_VERSIONS);
LOGINFO("Compatible protocol versions %s", MCS_PROTOCOL_VERSIONS);
- m_Ports = ReadUpgradeIniPorts(a_SettingsIni, "Server", "Ports", "Port", "PortsIPv6", "25565");
+ m_Ports = ReadUpgradeIniPorts(a_Settings, "Server", "Ports", "Port", "PortsIPv6", "25565");
- m_RCONServer.Initialize(a_SettingsIni);
+ m_RCONServer.Initialize(a_Settings);
m_bIsConnected = true;
@@ -226,16 +226,16 @@ bool cServer::InitServer(cIniFile & a_SettingsIni, bool a_ShouldAuth)
}
// Check if both BungeeCord and online mode are on, if so, warn the admin:
- m_ShouldAllowBungeeCord = a_SettingsIni.GetValueSetB("Authentication", "AllowBungeeCord", false);
+ m_ShouldAllowBungeeCord = a_Settings.GetValueSetB("Authentication", "AllowBungeeCord", false);
if (m_ShouldAllowBungeeCord && m_ShouldAuthenticate)
{
LOGWARNING("WARNING: BungeeCord is allowed and server set to online mode. This is unsafe and will not work properly. Disable either authentication or BungeeCord in settings.ini.");
}
- m_ShouldLoadOfflinePlayerData = a_SettingsIni.GetValueSetB("PlayerData", "LoadOfflinePlayerData", false);
- m_ShouldLoadNamedPlayerData = a_SettingsIni.GetValueSetB("PlayerData", "LoadNamedPlayerData", true);
+ m_ShouldLoadOfflinePlayerData = a_Settings.GetValueSetB("PlayerData", "LoadOfflinePlayerData", false);
+ m_ShouldLoadNamedPlayerData = a_Settings.GetValueSetB("PlayerData", "LoadNamedPlayerData", true);
- m_ClientViewDistance = a_SettingsIni.GetValueSetI("Server", "DefaultViewDistance", cClientHandle::DEFAULT_VIEW_DISTANCE);
+ m_ClientViewDistance = a_Settings.GetValueSetI("Server", "DefaultViewDistance", cClientHandle::DEFAULT_VIEW_DISTANCE);
if (m_ClientViewDistance < cClientHandle::MIN_VIEW_DISTANCE)
{
m_ClientViewDistance = cClientHandle::MIN_VIEW_DISTANCE;