summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorworktycho <work.tycho@gmail.com>2015-06-05 14:04:28 +0200
committerworktycho <work.tycho@gmail.com>2015-06-05 14:04:28 +0200
commit519fd1d36de921599e93f6359c3545b014cd2923 (patch)
tree0939a4e561aaa2b8ed56225ad65da6e31b615bde /src
parentMerge pull request #2207 from mc-server/LineBlockTracerFix (diff)
parentCMake: Added buildinfo workaround for src packs / systems without git. (diff)
downloadcuberite-519fd1d36de921599e93f6359c3545b014cd2923.tar
cuberite-519fd1d36de921599e93f6359c3545b014cd2923.tar.gz
cuberite-519fd1d36de921599e93f6359c3545b014cd2923.tar.bz2
cuberite-519fd1d36de921599e93f6359c3545b014cd2923.tar.lz
cuberite-519fd1d36de921599e93f6359c3545b014cd2923.tar.xz
cuberite-519fd1d36de921599e93f6359c3545b014cd2923.tar.zst
cuberite-519fd1d36de921599e93f6359c3545b014cd2923.zip
Diffstat (limited to '')
-rw-r--r--src/Bindings/ManualBindings.cpp58
-rw-r--r--src/CMakeLists.txt1
2 files changed, 55 insertions, 4 deletions
diff --git a/src/Bindings/ManualBindings.cpp b/src/Bindings/ManualBindings.cpp
index bce1891e2..7655d8c83 100644
--- a/src/Bindings/ManualBindings.cpp
+++ b/src/Bindings/ManualBindings.cpp
@@ -34,6 +34,7 @@
#include "../CompositeChat.h"
#include "../StringCompression.h"
#include "../CommandOutput.h"
+#include "../BuildInfo.h"
@@ -2079,6 +2080,50 @@ static int tolua_cLineBlockTracer_Trace(lua_State * tolua_S)
+static int tolua_cRoot_GetBuildCommitID(lua_State * tolua_S)
+{
+ cLuaState L(tolua_S);
+ L.Push(BUILD_COMMIT_ID);
+ return 1;
+}
+
+
+
+
+
+static int tolua_cRoot_GetBuildDateTime(lua_State * tolua_S)
+{
+ cLuaState L(tolua_S);
+ L.Push(BUILD_DATETIME);
+ return 1;
+}
+
+
+
+
+
+static int tolua_cRoot_GetBuildID(lua_State * tolua_S)
+{
+ cLuaState L(tolua_S);
+ L.Push(BUILD_ID);
+ return 1;
+}
+
+
+
+
+
+static int tolua_cRoot_GetBuildSeriesName(lua_State * tolua_S)
+{
+ cLuaState L(tolua_S);
+ L.Push(BUILD_SERIES_NAME);
+ return 1;
+}
+
+
+
+
+
static int tolua_cRoot_GetFurnaceRecipe(lua_State * tolua_S)
{
cLuaState L(tolua_S);
@@ -2092,7 +2137,8 @@ static int tolua_cRoot_GetFurnaceRecipe(lua_State * tolua_S)
}
// Check the input param:
- cItem * Input = (cItem *)tolua_tousertype(L, 2, nullptr);
+ cItem * Input = nullptr;
+ L.GetStackValue(2, Input);
if (Input == nullptr)
{
LOGWARNING("cRoot:GetFurnaceRecipe: the Input parameter is nil or missing.");
@@ -2109,9 +2155,9 @@ static int tolua_cRoot_GetFurnaceRecipe(lua_State * tolua_S)
}
// Push the output, number of ticks and input as the three return values:
- tolua_pushusertype(L, Recipe->Out, "const cItem");
- tolua_pushnumber (L, (lua_Number)(Recipe->CookTime));
- tolua_pushusertype(L, Recipe->In, "const cItem");
+ L.Push(Recipe->Out);
+ L.Push(Recipe->CookTime);
+ L.Push(Recipe->In);
return 3;
}
@@ -2868,6 +2914,10 @@ void cManualBindings::Bind(lua_State * tolua_S)
tolua_function(tolua_S, "DoWithPlayerByUUID", DoWith <cRoot, cPlayer, &cRoot::DoWithPlayerByUUID>);
tolua_function(tolua_S, "ForEachPlayer", ForEach<cRoot, cPlayer, &cRoot::ForEachPlayer>);
tolua_function(tolua_S, "ForEachWorld", ForEach<cRoot, cWorld, &cRoot::ForEachWorld>);
+ tolua_function(tolua_S, "GetBuildCommitID", tolua_cRoot_GetBuildCommitID);
+ tolua_function(tolua_S, "GetBuildDateTime", tolua_cRoot_GetBuildDateTime);
+ tolua_function(tolua_S, "GetBuildID", tolua_cRoot_GetBuildID);
+ tolua_function(tolua_S, "GetBuildSeriesName", tolua_cRoot_GetBuildSeriesName);
tolua_function(tolua_S, "GetFurnaceRecipe", tolua_cRoot_GetFurnaceRecipe);
tolua_endmodule(tolua_S);
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 5556ddc4d..c68795bb3 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -83,6 +83,7 @@ SET (HDRS
BlockTracer.h
Broadcaster.h
BoundingBox.h
+ BuildInfo.h
BuildInfo.h.cmake
ByteBuffer.h
ChatColor.h