diff options
author | Mattes D <github@xoft.cz> | 2015-04-25 19:40:44 +0200 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2015-04-25 21:05:43 +0200 |
commit | b5998873e42eaec90267010557edd47f65af1463 (patch) | |
tree | b2c31a9e263552f40e91bf2a5bc66a13778f7d20 /src/Bindings | |
parent | Added player restrictions to the DB and API. (diff) | |
download | cuberite-b5998873e42eaec90267010557edd47f65af1463.tar cuberite-b5998873e42eaec90267010557edd47f65af1463.tar.gz cuberite-b5998873e42eaec90267010557edd47f65af1463.tar.bz2 cuberite-b5998873e42eaec90267010557edd47f65af1463.tar.lz cuberite-b5998873e42eaec90267010557edd47f65af1463.tar.xz cuberite-b5998873e42eaec90267010557edd47f65af1463.tar.zst cuberite-b5998873e42eaec90267010557edd47f65af1463.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Bindings/ManualBindings.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/Bindings/ManualBindings.cpp b/src/Bindings/ManualBindings.cpp index 253d57297..c4b12aa84 100644 --- a/src/Bindings/ManualBindings.cpp +++ b/src/Bindings/ManualBindings.cpp @@ -2125,6 +2125,37 @@ static int tolua_cPlayer_GetPermissions(lua_State * tolua_S) +static int tolua_cPlayer_GetRestrictions(lua_State * tolua_S) +{ + // Function signature: cPlayer:GetRestrictions() -> {restrictions-array} + + // Check the params: + cLuaState L(tolua_S); + if ( + !L.CheckParamUserType(1, "cPlayer") || + !L.CheckParamEnd (2) + ) + { + return 0; + } + + // Get the params: + cPlayer * self = (cPlayer *)tolua_tousertype(tolua_S, 1, nullptr); + if (self == nullptr) + { + LOGWARNING("%s: invalid self (%p)", __FUNCTION__, self); + return 0; + } + + // Push the permissions: + L.Push(self->GetRestrictions()); + return 1; +} + + + + + static int tolua_cPlayer_OpenWindow(lua_State * tolua_S) { // Function signature: cPlayer:OpenWindow(Window) @@ -3756,6 +3787,7 @@ void ManualBindings::Bind(lua_State * tolua_S) tolua_beginmodule(tolua_S, "cPlayer"); tolua_function(tolua_S, "GetPermissions", tolua_cPlayer_GetPermissions); + tolua_function(tolua_S, "GetRestrictions", tolua_cPlayer_GetRestrictions); tolua_function(tolua_S, "OpenWindow", tolua_cPlayer_OpenWindow); tolua_function(tolua_S, "PermissionMatches", tolua_cPlayer_PermissionMatches); tolua_endmodule(tolua_S); |