summaryrefslogtreecommitdiffstats
path: root/src/Bindings/ManualBindings.cpp
diff options
context:
space:
mode:
authorflx5 <git@flx5.com>2015-03-11 04:14:17 +0100
committerflx5 <git@flx5.com>2015-03-11 04:14:17 +0100
commitd130696e95f83a2b7cd38258034cebf7edb890f3 (patch)
treeed12a3e1bc7cbe1b777eeecefe79a3fca9bda123 /src/Bindings/ManualBindings.cpp
parentFixed client kick/crash if many block changes happend (diff)
downloadcuberite-d130696e95f83a2b7cd38258034cebf7edb890f3.tar
cuberite-d130696e95f83a2b7cd38258034cebf7edb890f3.tar.gz
cuberite-d130696e95f83a2b7cd38258034cebf7edb890f3.tar.bz2
cuberite-d130696e95f83a2b7cd38258034cebf7edb890f3.tar.lz
cuberite-d130696e95f83a2b7cd38258034cebf7edb890f3.tar.xz
cuberite-d130696e95f83a2b7cd38258034cebf7edb890f3.tar.zst
cuberite-d130696e95f83a2b7cd38258034cebf7edb890f3.zip
Diffstat (limited to '')
-rw-r--r--src/Bindings/ManualBindings.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/Bindings/ManualBindings.cpp b/src/Bindings/ManualBindings.cpp
index cac81f325..435d72eb9 100644
--- a/src/Bindings/ManualBindings.cpp
+++ b/src/Bindings/ManualBindings.cpp
@@ -266,6 +266,21 @@ static int tolua_StringSplit(lua_State * tolua_S)
+static int tolua_StringSplitWithQuotes(lua_State * tolua_S)
+{
+ cLuaState LuaState(tolua_S);
+ std::string str = (std::string)tolua_tocppstring(LuaState, 1, 0);
+ std::string delim = (std::string)tolua_tocppstring(LuaState, 2, 0);
+
+ AStringVector Split = StringSplitWithQuotes(str, delim);
+ LuaState.Push(Split);
+ return 1;
+}
+
+
+
+
+
static int tolua_StringSplitAndTrim(lua_State * tolua_S)
{
cLuaState LuaState(tolua_S);
@@ -3663,6 +3678,7 @@ void ManualBindings::Bind(lua_State * tolua_S)
// Globals:
tolua_function(tolua_S, "Clamp", tolua_Clamp);
tolua_function(tolua_S, "StringSplit", tolua_StringSplit);
+ tolua_function(tolua_S, "StringSplitWithQuotes", tolua_StringSplitWithQuotes);
tolua_function(tolua_S, "StringSplitAndTrim", tolua_StringSplitAndTrim);
tolua_function(tolua_S, "LOG", tolua_LOG);
tolua_function(tolua_S, "LOGINFO", tolua_LOGINFO);