From 2fcdbfd42807111940e9c52f26491ffea1fb8a27 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Tue, 20 Nov 2012 21:28:43 +0000 Subject: 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 --- source/Server.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'source/Server.cpp') diff --git a/source/Server.cpp b/source/Server.cpp index 95d5617cb..cc5e2a731 100644 --- a/source/Server.cpp +++ b/source/Server.cpp @@ -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) -- cgit v1.2.3