summaryrefslogtreecommitdiffstats
path: root/source/ManualBindings.cpp
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-02-01 10:12:54 +0100
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-02-01 10:12:54 +0100
commitbb49f0e021fb1fbefad44d944233fb1cf72c495c (patch)
treeebb0f2b40a3987eddf126c368237c0c60e4e6518 /source/ManualBindings.cpp
parentFixed a sigsegv on *nix (cFile double-closing files) (diff)
downloadcuberite-bb49f0e021fb1fbefad44d944233fb1cf72c495c.tar
cuberite-bb49f0e021fb1fbefad44d944233fb1cf72c495c.tar.gz
cuberite-bb49f0e021fb1fbefad44d944233fb1cf72c495c.tar.bz2
cuberite-bb49f0e021fb1fbefad44d944233fb1cf72c495c.tar.lz
cuberite-bb49f0e021fb1fbefad44d944233fb1cf72c495c.tar.xz
cuberite-bb49f0e021fb1fbefad44d944233fb1cf72c495c.tar.zst
cuberite-bb49f0e021fb1fbefad44d944233fb1cf72c495c.zip
Diffstat (limited to 'source/ManualBindings.cpp')
-rw-r--r--source/ManualBindings.cpp78
1 files changed, 76 insertions, 2 deletions
diff --git a/source/ManualBindings.cpp b/source/ManualBindings.cpp
index 7e2e45855..ba844b702 100644
--- a/source/ManualBindings.cpp
+++ b/source/ManualBindings.cpp
@@ -15,7 +15,9 @@
#include "cStringMap.h"
#include "md5/md5.h"
-extern std::vector<std::string> StringSplit(std::string str, std::string delim);
+
+
+
/****************************
* Lua bound functions with special return types
@@ -26,7 +28,7 @@ static int tolua_StringSplit(lua_State* tolua_S)
std::string str = ((std::string) tolua_tocppstring(tolua_S,1,0));
std::string delim = ((std::string) tolua_tocppstring(tolua_S,2,0));
- std::vector<std::string> Split = StringSplit( str, delim );
+ AStringVector Split = StringSplit( str, delim );
lua_createtable(tolua_S, Split.size(), 0);
int newTable = lua_gettop(tolua_S);
@@ -41,6 +43,10 @@ static int tolua_StringSplit(lua_State* tolua_S)
return 1;
}
+
+
+
+
static int tolua_LOG(lua_State* tolua_S)
{
const char* str = tolua_tocppstring(tolua_S,1,0);
@@ -48,6 +54,10 @@ static int tolua_LOG(lua_State* tolua_S)
return 0;
}
+
+
+
+
static int tolua_LOGINFO(lua_State* tolua_S)
{
const char* str = tolua_tocppstring(tolua_S,1,0);
@@ -55,6 +65,10 @@ static int tolua_LOGINFO(lua_State* tolua_S)
return 0;
}
+
+
+
+
static int tolua_LOGWARN(lua_State* tolua_S)
{
const char* str = tolua_tocppstring(tolua_S,1,0);
@@ -62,6 +76,10 @@ static int tolua_LOGWARN(lua_State* tolua_S)
return 0;
}
+
+
+
+
static int tolua_LOGERROR(lua_State* tolua_S)
{
const char* str = tolua_tocppstring(tolua_S,1,0);
@@ -69,6 +87,10 @@ static int tolua_LOGERROR(lua_State* tolua_S)
return 0;
}
+
+
+
+
static int tolua_cWorld_GetAllPlayers(lua_State* tolua_S)
{
cWorld* self = (cWorld*) tolua_tousertype(tolua_S,1,0);
@@ -79,6 +101,10 @@ static int tolua_cWorld_GetAllPlayers(lua_State* tolua_S)
return 1;
}
+
+
+
+
static int tolua_cPlugin_GetCommands(lua_State* tolua_S)
{
cPlugin* self = (cPlugin*) tolua_tousertype(tolua_S,1,0);
@@ -100,6 +126,10 @@ static int tolua_cPlugin_GetCommands(lua_State* tolua_S)
return 1;
}
+
+
+
+
static int tolua_cPluginManager_GetAllPlugins(lua_State* tolua_S)
{
cPluginManager* self = (cPluginManager*) tolua_tousertype(tolua_S,1,0);
@@ -121,6 +151,10 @@ static int tolua_cPluginManager_GetAllPlugins(lua_State* tolua_S)
return 1;
}
+
+
+
+
static int tolua_cPlayer_GetGroups(lua_State* tolua_S)
{
cPlayer* self = (cPlayer*) tolua_tousertype(tolua_S,1,0);
@@ -142,6 +176,10 @@ static int tolua_cPlayer_GetGroups(lua_State* tolua_S)
return 1;
}
+
+
+
+
static int tolua_cPlayer_GetResolvedPermissions(lua_State* tolua_S)
{
cPlayer* self = (cPlayer*) tolua_tousertype(tolua_S,1,0);
@@ -163,6 +201,10 @@ static int tolua_cPlayer_GetResolvedPermissions(lua_State* tolua_S)
return 1;
}
+
+
+
+
static int tolua_cPlugin_BindCommand(lua_State* tolua_S)
{
cPlugin* self = (cPlugin*) tolua_tousertype(tolua_S,1,0);
@@ -217,6 +259,10 @@ static int tolua_cPlugin_BindCommand(lua_State* tolua_S)
return 0;
}
+
+
+
+
static int tolua_cWebPlugin_Lua_AddTab(lua_State* tolua_S)
{
cWebPlugin_Lua* self = (cWebPlugin_Lua*) tolua_tousertype(tolua_S,1,0);
@@ -260,6 +306,10 @@ static int tolua_cWebPlugin_Lua_AddTab(lua_State* tolua_S)
return 0;
}
+
+
+
+
static int tolua_md5(lua_State* tolua_S)
{
std::string SourceString = tolua_tostring(tolua_S, 1, 0);
@@ -268,6 +318,10 @@ static int tolua_md5(lua_State* tolua_S)
return 1;
}
+
+
+
+
static int tolua_push_StringStringMap(lua_State* tolua_S, std::map< std::string, std::string >& a_StringStringMap )
{
lua_newtable(tolua_S);
@@ -285,18 +339,30 @@ static int tolua_push_StringStringMap(lua_State* tolua_S, std::map< std::string,
return 1;
}
+
+
+
+
static int tolua_get_HTTPRequest_Params(lua_State* tolua_S)
{
HTTPRequest* self = (HTTPRequest*) tolua_tousertype(tolua_S,1,0);
return tolua_push_StringStringMap(tolua_S, self->Params);
}
+
+
+
+
static int tolua_get_HTTPRequest_PostParams(lua_State* tolua_S)
{
HTTPRequest* self = (HTTPRequest*) tolua_tousertype(tolua_S,1,0);
return tolua_push_StringStringMap(tolua_S, self->PostParams);
}
+
+
+
+
static int tolua_get_HTTPRequest_FormData(lua_State* tolua_S)
{
HTTPRequest* self = (HTTPRequest*) tolua_tousertype(tolua_S,1,0);
@@ -316,6 +382,10 @@ static int tolua_get_HTTPRequest_FormData(lua_State* tolua_S)
return 1;
}
+
+
+
+
void ManualBindings::Bind( lua_State* tolua_S )
{
tolua_beginmodule(tolua_S,NULL);
@@ -357,3 +427,7 @@ void ManualBindings::Bind( lua_State* tolua_S )
tolua_endmodule(tolua_S);
}
+
+
+
+