diff options
author | madmaxoft <github@xoft.cz> | 2014-04-01 22:47:39 +0200 |
---|---|---|
committer | madmaxoft <github@xoft.cz> | 2014-04-01 22:47:39 +0200 |
commit | bcf5021feb3bbb8069b80e3b892f0c80db35a4c6 (patch) | |
tree | 7a3f70a6b4fde5acd53fd5876f0257caa2e6ef15 /src/Bindings/ManualBindings.cpp | |
parent | Merged branch 'msDifference'. (diff) | |
download | cuberite-bcf5021feb3bbb8069b80e3b892f0c80db35a4c6.tar cuberite-bcf5021feb3bbb8069b80e3b892f0c80db35a4c6.tar.gz cuberite-bcf5021feb3bbb8069b80e3b892f0c80db35a4c6.tar.bz2 cuberite-bcf5021feb3bbb8069b80e3b892f0c80db35a4c6.tar.lz cuberite-bcf5021feb3bbb8069b80e3b892f0c80db35a4c6.tar.xz cuberite-bcf5021feb3bbb8069b80e3b892f0c80db35a4c6.tar.zst cuberite-bcf5021feb3bbb8069b80e3b892f0c80db35a4c6.zip |
Diffstat (limited to 'src/Bindings/ManualBindings.cpp')
-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); |