diff options
author | Tycho <work.tycho+git@gmail.com> | 2014-04-02 15:37:24 +0200 |
---|---|---|
committer | Tycho <work.tycho+git@gmail.com> | 2014-04-02 15:37:24 +0200 |
commit | 741a64c250a1085108f24f351e9d9dacd085cc82 (patch) | |
tree | a69b5aba676473e5f75822a02e14e2acc542b263 /src/Bindings | |
parent | Fixed All signedness warnings in HTTPServer.cpp (diff) | |
parent | Merge branch 'master' into globals (diff) | |
download | cuberite-741a64c250a1085108f24f351e9d9dacd085cc82.tar cuberite-741a64c250a1085108f24f351e9d9dacd085cc82.tar.gz cuberite-741a64c250a1085108f24f351e9d9dacd085cc82.tar.bz2 cuberite-741a64c250a1085108f24f351e9d9dacd085cc82.tar.lz cuberite-741a64c250a1085108f24f351e9d9dacd085cc82.tar.xz cuberite-741a64c250a1085108f24f351e9d9dacd085cc82.tar.zst cuberite-741a64c250a1085108f24f351e9d9dacd085cc82.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Bindings/ManualBindings.cpp | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/Bindings/ManualBindings.cpp b/src/Bindings/ManualBindings.cpp index 9d1a367df..51b9f3e27 100644 --- a/src/Bindings/ManualBindings.cpp +++ b/src/Bindings/ManualBindings.cpp @@ -190,6 +190,50 @@ static int tolua_LOGERROR(lua_State * tolua_S) +static int tolua_Base64Encode(lua_State * tolua_S) +{ + cLuaState L(tolua_S); + if ( + !L.CheckParamString(1) || + !L.CheckParamEnd(2) + ) + { + return 0; + } + + AString Src; + L.GetStackValue(1, Src); + AString res = Base64Encode(Src); + L.Push(res); + return 1; +} + + + + + +static int tolua_Base64Decode(lua_State * tolua_S) +{ + cLuaState L(tolua_S); + if ( + !L.CheckParamString(1) || + !L.CheckParamEnd(2) + ) + { + return 0; + } + + AString Src; + L.GetStackValue(1, Src); + AString res = Base64Decode(Src); + L.Push(res); + return 1; +} + + + + + cPluginLua * GetLuaPlugin(lua_State * L) { // Get the plugin identification out of LuaState: @@ -2869,6 +2913,8 @@ void ManualBindings::Bind(lua_State * tolua_S) tolua_function(tolua_S, "LOGWARN", tolua_LOGWARN); tolua_function(tolua_S, "LOGWARNING", tolua_LOGWARN); tolua_function(tolua_S, "LOGERROR", tolua_LOGERROR); + tolua_function(tolua_S, "Base64Encode", tolua_Base64Encode); + tolua_function(tolua_S, "Base64Decode", tolua_Base64Decode); tolua_beginmodule(tolua_S, "cFile"); tolua_function(tolua_S, "GetFolderContents", tolua_cFile_GetFolderContents); |