diff options
author | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-11-11 15:15:59 +0100 |
---|---|---|
committer | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-11-11 15:15:59 +0100 |
commit | 83b949f4909868a7895b5fdaae47dbca0720c806 (patch) | |
tree | 3a95780df435afd7240e26fe65501b33909d7be1 | |
parent | Cleanup: Removed deprecated functions from Lua API (diff) | |
download | cuberite-83b949f4909868a7895b5fdaae47dbca0720c806.tar cuberite-83b949f4909868a7895b5fdaae47dbca0720c806.tar.gz cuberite-83b949f4909868a7895b5fdaae47dbca0720c806.tar.bz2 cuberite-83b949f4909868a7895b5fdaae47dbca0720c806.tar.lz cuberite-83b949f4909868a7895b5fdaae47dbca0720c806.tar.xz cuberite-83b949f4909868a7895b5fdaae47dbca0720c806.tar.zst cuberite-83b949f4909868a7895b5fdaae47dbca0720c806.zip |
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(); |