summaryrefslogtreecommitdiffstats
path: root/source/ManualBindings.cpp
diff options
context:
space:
mode:
authorfaketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-01-30 17:47:26 +0100
committerfaketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-01-30 17:47:26 +0100
commit9dfa0f1f15c413540e932a04e94419a8a3b37dcf (patch)
treec111ee0ad961aa365b2c681e486dae4ce7e09421 /source/ManualBindings.cpp
parentMore cFile cleanup; removed old format writing for block entities (diff)
downloadcuberite-9dfa0f1f15c413540e932a04e94419a8a3b37dcf.tar
cuberite-9dfa0f1f15c413540e932a04e94419a8a3b37dcf.tar.gz
cuberite-9dfa0f1f15c413540e932a04e94419a8a3b37dcf.tar.bz2
cuberite-9dfa0f1f15c413540e932a04e94419a8a3b37dcf.tar.lz
cuberite-9dfa0f1f15c413540e932a04e94419a8a3b37dcf.tar.xz
cuberite-9dfa0f1f15c413540e932a04e94419a8a3b37dcf.tar.zst
cuberite-9dfa0f1f15c413540e932a04e94419a8a3b37dcf.zip
Diffstat (limited to '')
-rw-r--r--source/ManualBindings.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/source/ManualBindings.cpp b/source/ManualBindings.cpp
index 45fae285d..06a148b91 100644
--- a/source/ManualBindings.cpp
+++ b/source/ManualBindings.cpp
@@ -140,6 +140,27 @@ 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);
+
+ cPlayer::StringList AllPermissions = self->GetResolvedPermissions();
+
+ lua_createtable(tolua_S, AllPermissions.size(), 0);
+ int newTable = lua_gettop(tolua_S);
+ int index = 1;
+ cPlayer::StringList::iterator iter = AllPermissions.begin();
+ while(iter != AllPermissions.end())
+ {
+ std::string& Permission = *iter;
+ tolua_pushstring( tolua_S, Permission.c_str() );
+ lua_rawseti(tolua_S, newTable, index);
+ ++iter;
+ ++index;
+ }
+ return 1;
+}
+
static int tolua_cPlugin_BindCommand(lua_State* tolua_S)
{
cPlugin* self = (cPlugin*) tolua_tousertype(tolua_S,1,0);
@@ -267,6 +288,7 @@ void ManualBindings::Bind( lua_State* tolua_S )
tolua_endmodule(tolua_S);
tolua_beginmodule(tolua_S,"cPlayer");
tolua_function(tolua_S,"GetGroups",tolua_cPlayer_GetGroups);
+ tolua_function(tolua_S,"GetResolvedPermissions",tolua_cPlayer_GetResolvedPermissions);
tolua_endmodule(tolua_S);
tolua_beginmodule(tolua_S,"cWebPlugin_Lua");
tolua_function(tolua_S,"AddTab",tolua_cWebPlugin_Lua_AddTab);