1
0

Added primary server version interface to cRoot and "primaryserverversion" console command.

git-svn-id: http://mc-server.googlecode.com/svn/trunk@1059 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
madmaxoft@gmail.com
2012-11-20 21:28:43 +00:00
parent c0b8c3cb43
commit 2fcdbfd428
4 changed files with 92 additions and 2 deletions

View File

@@ -548,6 +548,25 @@ void cServer::ServerCommand(const AString & a_Cmd)
}
#endif
if (split[0].compare("primaryserverversion") == 0)
{
if (split.size() > 1)
{
int Version = atol(split[1].c_str());
if (Version == 0)
{
LOGWARNING("Cannot parse version \"%s\". Not setting anything.");
return;
}
cRoot::Get()->SetPrimaryServerVersion(Version);
}
LOGINFO("Primary server version: %d (%s)",
cRoot::Get()->m_PrimaryServerVersion,
cProtocolRecognizer::GetVersionTextFromInt(cRoot::Get()->m_PrimaryServerVersion).c_str()
);
return;
}
if (split.size() > 1)
{
if (split[0].compare("say") == 0)