1
0

PrimaryServerVersion is not force-saved into settings.ini.

Server admins are advised to keep the value undefined, which will default in the latest supported version being the primary

git-svn-id: http://mc-server.googlecode.com/svn/trunk@1034 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
madmaxoft@gmail.com 2012-11-11 14:15:59 +00:00
parent 6b34a94477
commit 83b949f490
2 changed files with 14 additions and 3 deletions

View File

@ -36,6 +36,8 @@ public:
PROTO_VERSION_1_2_5 = 29, PROTO_VERSION_1_2_5 = 29,
PROTO_VERSION_1_3_2 = 39, PROTO_VERSION_1_3_2 = 39,
PROTO_VERSION_1_4_2 = 47, 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); cProtocolRecognizer(cClientHandle * a_Client);

View File

@ -81,7 +81,7 @@ void cRoot::InputThread(void * a_Params)
void cRoot::Start() void cRoot::Start(void)
{ {
delete m_Log; delete m_Log;
m_Log = new cMCLogger(); m_Log = new cMCLogger();
@ -104,12 +104,21 @@ void cRoot::Start()
IniFile.ReadFile(); IniFile.ReadFile();
IniFile.Path("settings.ini"); 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 ); int Port = IniFile.GetValueSetI("Server", "Port", 25565 );
if (!m_Server->InitServer(Port)) if (!m_Server->InitServer(Port))
{ {
LOG("Failed to start server, shutting down."); LOGERROR("Failed to start server, shutting down.");
return; return;
} }
IniFile.WriteFile(); IniFile.WriteFile();