summaryrefslogtreecommitdiffstats
path: root/src/Server.cpp
diff options
context:
space:
mode:
authorworktycho <work.tycho@gmail.com>2015-09-29 14:32:30 +0200
committerworktycho <work.tycho@gmail.com>2015-09-29 14:32:30 +0200
commitc76a89fbec7b503aba070e5189c566662231e7b0 (patch)
tree8ebb9154a78f78ca4d81e39d3c0604afdf0cadf3 /src/Server.cpp
parentMerge pull request #2507 from cuberite/LuaStrictStrings (diff)
parentAdded LuaState tracker and memory stats logging. (diff)
downloadcuberite-c76a89fbec7b503aba070e5189c566662231e7b0.tar
cuberite-c76a89fbec7b503aba070e5189c566662231e7b0.tar.gz
cuberite-c76a89fbec7b503aba070e5189c566662231e7b0.tar.bz2
cuberite-c76a89fbec7b503aba070e5189c566662231e7b0.tar.lz
cuberite-c76a89fbec7b503aba070e5189c566662231e7b0.tar.xz
cuberite-c76a89fbec7b503aba070e5189c566662231e7b0.tar.zst
cuberite-c76a89fbec7b503aba070e5189c566662231e7b0.zip
Diffstat (limited to 'src/Server.cpp')
-rw-r--r--src/Server.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/Server.cpp b/src/Server.cpp
index a21248695..12c45467d 100644
--- a/src/Server.cpp
+++ b/src/Server.cpp
@@ -145,6 +145,8 @@ cServer::cServer(void) :
m_ShouldLoadOfflinePlayerData(false),
m_ShouldLoadNamedPlayerData(true)
{
+ // Initialize the LuaStateTracker singleton before the app goes multithreaded:
+ cLuaStateTracker::GetStats();
}
@@ -522,6 +524,13 @@ void cServer::ExecuteConsoleCommand(const AString & a_Cmd, cCommandOutputCallbac
a_Output.Finished();
return;
}
+
+ else if (split[0].compare("luastats") == 0)
+ {
+ a_Output.Out(cLuaStateTracker::GetStats());
+ a_Output.Finished();
+ return;
+ }
#if defined(_MSC_VER) && defined(_DEBUG) && defined(ENABLE_LEAK_FINDER)
else if (split[0].compare("dumpmem") == 0)
{