diff options
Diffstat (limited to '')
-rw-r--r-- | source/Protocol/ProtocolRecognizer.h | 2 | ||||
-rw-r--r-- | source/Root.cpp | 15 |
2 files changed, 14 insertions, 3 deletions
diff --git a/source/Protocol/ProtocolRecognizer.h b/source/Protocol/ProtocolRecognizer.h index 4b7877311..6672d34fc 100644 --- a/source/Protocol/ProtocolRecognizer.h +++ b/source/Protocol/ProtocolRecognizer.h @@ -36,6 +36,8 @@ public: PROTO_VERSION_1_2_5 = 29,
PROTO_VERSION_1_3_2 = 39,
PROTO_VERSION_1_4_2 = 47,
+
+ PROTO_VERSION_LATEST = PROTO_VERSION_1_4_2, // Keep this up to date, this serves as the default for PrimaryServerVersion
} ;
cProtocolRecognizer(cClientHandle * a_Client);
diff --git a/source/Root.cpp b/source/Root.cpp index bef960afd..c624ef9aa 100644 --- a/source/Root.cpp +++ b/source/Root.cpp @@ -81,7 +81,7 @@ void cRoot::InputThread(void * a_Params) -void cRoot::Start() +void cRoot::Start(void) { delete m_Log; m_Log = new cMCLogger(); @@ -104,12 +104,21 @@ void cRoot::Start() IniFile.ReadFile(); IniFile.Path("settings.ini"); } - m_PrimaryServerVersion = IniFile.GetValueSetI("Server", "PrimaryServerVersion", cProtocolRecognizer::PROTO_VERSION_1_4_2); + m_PrimaryServerVersion = IniFile.GetValueI("Server", "PrimaryServerVersion", 0); + if (m_PrimaryServerVersion == 0) + { + m_PrimaryServerVersion = cProtocolRecognizer::PROTO_VERSION_LATEST; + } + else + { + // Make a note in the log that the primary server version is explicitly set in the ini file + LOGINFO("settings.ini: [Server].PrimaryServerVersion set to %d.", m_PrimaryServerVersion); + } int Port = IniFile.GetValueSetI("Server", "Port", 25565 ); if (!m_Server->InitServer(Port)) { - LOG("Failed to start server, shutting down."); + LOGERROR("Failed to start server, shutting down."); return; } IniFile.WriteFile(); |