7 #include "ManualBindings.h"
8 #include "tolua++/include/tolua++.h"
67 S.
Push(
cRoot::Get()->GetRankManager()->AddGroupToRank(GroupName, RankName));
96 S.
Push(
cRoot::Get()->GetRankManager()->AddPermissionToGroup(Permission, GroupName));
121 AString RankName, MsgPrefix, MsgSuffix, MsgNameColorCode;
122 S.
GetStackValues(2, RankName, MsgPrefix, MsgSuffix, MsgNameColorCode);
150 AString GroupName, Restriction;
154 S.
Push(
cRoot::Get()->GetRankManager()->AddRestrictionToGroup(Restriction, GroupName));
253 S.
Push(
cRoot::Get()->GetRankManager()->GetAllPermissionsRestrictions());
281 std::vector<AString> StrUUIDs;
282 StrUUIDs.reserve(Players.size());
283 for (
const auto & UUID : Players)
285 StrUUIDs.push_back(UUID.ToShortString());
426 S.
Push(Restrictions);
487 AString MsgPrefix, MsgSuffix, MsgNameColorCode;
488 if (!
cRoot::Get()->GetRankManager()->GetPlayerMsgVisuals(PlayerUUID, MsgPrefix, MsgSuffix, MsgNameColorCode))
494 S.
Push(MsgPrefix, MsgSuffix, MsgNameColorCode);
558 S.
Push(Restrictions);
718 S.
Push(Restrictions);
747 AString MsgPrefix, MsgSuffix, MsgNameColorCode;
748 if (!
cRoot::Get()->GetRankManager()->GetRankVisuals(RankName, MsgPrefix, MsgSuffix, MsgNameColorCode))
755 S.
Push(MsgPrefix, MsgSuffix, MsgNameColorCode);
876 AString GroupName, Restriction;
1030 AString GroupName, Permission;
1059 AString GroupName, Restriction;
1118 AString RankName, ReplacementRankName;
1215 S.
Push(
cRoot::Get()->GetRankManager()->SetDefaultRank(RankName));
1271 AString RankName, MsgPrefix, MsgSuffix, MsgNameColorCode;
1272 S.
GetStackValues(2, RankName, MsgPrefix, MsgSuffix, MsgNameColorCode);
1283 void cManualBindings::BindRankManager(lua_State * tolua_S)
1286 tolua_usertype(tolua_S,
"cRankManager");
1287 tolua_cclass(tolua_S,
"cRankManager",
"cRankManager",
"",
nullptr);
1290 tolua_beginmodule(tolua_S,
"cRankManager");
1333 tolua_endmodule(tolua_S);
static int tolua_cRankManager_RemoveGroupFromRank(lua_State *L)
Binds cRankManager::RemoveGroupFromRank.
static int tolua_cRankManager_SetDefaultRank(lua_State *L)
Binds cRankManager::SetDefaultRank.
static int tolua_cRankManager_AddRestrictionToGroup(lua_State *L)
Binds cRankManager::AddRestrictionToGroup.
static int tolua_cRankManager_GetRankRestrictions(lua_State *L)
Binds cRankManager::GetRankRestrictions.
static int tolua_cRankManager_AddGroupToRank(lua_State *L)
Binds cRankManager::AddGroupToRank.
static int tolua_cRankManager_GetGroupPermissions(lua_State *L)
Binds cRankManager::GetGroupPermissions.
static int tolua_cRankManager_SetRankVisuals(lua_State *L)
Binds cRankManager::SetRankVisuals.
static int tolua_cRankManager_RemoveGroup(lua_State *L)
Binds cRankManager::RemoveGroup.
static int tolua_cRankManager_AddGroup(lua_State *L)
Binds cRankManager::AddGroup.
static int tolua_cRankManager_GetAllRanks(lua_State *L)
Binds cRankManager::GetAllRanks.
static int tolua_cRankManager_RemoveRestrictionFromGroup(lua_State *L)
Binds cRankManager::RemoveRestrictionFromGroup.
static int tolua_cRankManager_IsPlayerRankSet(lua_State *L)
Binds cRankManager::IsPlayerRankSet.
static int tolua_cRankManager_RemoveRank(lua_State *L)
Binds cRankManager::RemoveRank.
static int tolua_cRankManager_GetRankPermissions(lua_State *L)
Binds cRankManager::GetRankPermissions.
static int tolua_cRankManager_AddRank(lua_State *L)
Binds cRankManager::AddRank.
static int tolua_cRankManager_IsRestrictionInGroup(lua_State *L)
Binds cRankManager::IsRestrictionInGroup.
static int tolua_cRankManager_GetPlayerName(lua_State *L)
Binds cRankManager::GetPlayerName.
static int tolua_cRankManager_GetPlayerRestrictions(lua_State *L)
Binds cRankManager::GetPlayerRestrictions.
static int tolua_cRankManager_RemovePlayerRank(lua_State *L)
Binds cRankManager::RemovePlayerRank.
static int tolua_cRankManager_SetPlayerRank(lua_State *L)
Binds cRankManager::SetPlayerRank.
static int tolua_cRankManager_GetPlayerRankName(lua_State *L)
Binds cRankManager::GetPlayerRankName.
static int tolua_cRankManager_RemovePermissionFromGroup(lua_State *L)
Binds cRankManager::RemovePermissionFromGroup.
static int tolua_cRankManager_AddPermissionToGroup(lua_State *L)
Binds cRankManager::AddPermissionToGroup.
static int tolua_cRankManager_GetRankVisuals(lua_State *L)
Binds cRankManager::GetRankVisuals.
static int tolua_cRankManager_GetPlayerMsgVisuals(lua_State *L)
Binds cRankManager::GetPlayerMsgVisuals.
static int tolua_cRankManager_GetAllPermissions(lua_State *L)
Binds cRankManager::GetAllPermissions.
static int tolua_cRankManager_GetDefaultRank(lua_State *L)
Binds cRankManager::GetDefaultRank.
static int tolua_cRankManager_GetAllGroups(lua_State *L)
Binds cRankManager::GetAllGroups.
static int tolua_cRankManager_IsGroupInRank(lua_State *L)
Binds cRankManager::IsGroupInRank.
static int tolua_cRankManager_IsPermissionInGroup(lua_State *L)
Binds cRankManager::IsPermissionInGroup.
static int tolua_cRankManager_RenameRank(lua_State *L)
Binds cRankManager::RenameRank.
static int tolua_cRankManager_GetAllPlayerUUIDs(lua_State *L)
Binds cRankManager::GetAllPlayerUUIDs.
static int tolua_cRankManager_GetRankGroups(lua_State *L)
Binds cRankManager::GetRankGroups.
static int tolua_cRankManager_GroupExists(lua_State *L)
Binds cRankManager::GroupExists.
static int tolua_cRankManager_RenameGroup(lua_State *L)
Binds cRankManager::RenameGroup.
static int tolua_cRankManager_GetAllRestrictions(lua_State *L)
Binds cRankManager::GetAllRestrictions.
static int tolua_cRankManager_GetPlayerGroups(lua_State *L)
Binds cRankManager::GetPlayerGroups.
static int tolua_cRankManager_ClearPlayerRanks(lua_State *L)
Binds cRankManager::ClearPlayerRanks.
static int tolua_cRankManager_RankExists(lua_State *L)
Binds cRankManager::RankExists.
static int tolua_cRankManager_GetAllPermissionsRestrictions(lua_State *L)
Binds cRankManager::GetAllPermissionsRestrictions.
static int tolua_cRankManager_GetGroupRestrictions(lua_State *L)
Binds cRankManager::GetGroupRestrictions.
static int tolua_cRankManager_GetPlayerPermissions(lua_State *L)
Binds cRankManager::GetPlayerPermissions.
std::vector< AString > AStringVector
Encapsulates a Lua state and provides some syntactic sugar for common operations.
void Push(Arg1 &&a_Arg1, Arg2 &&a_Arg2, Args &&... a_Args)
Pushes multiple arguments onto the Lua stack.
bool CheckParamEnd(int a_Param)
Returns true if the specified parameter on the stack is nil (indicating an end-of-parameters)
bool CheckParamString(int a_StartParam, int a_EndParam=-1)
Returns true if the specified parameters on the stack are strings; also logs warning if not.
bool CheckParamUserTable(int a_StartParam, const char *a_UserTable, int a_EndParam=-1)
Returns true if the specified parameters on the stack are of the specified usertable type; also logs ...
bool CheckParamUUID(int a_StartParam, int a_EndParam=-1)
Returns true if the specified parameters on the stack are UUIDs; also logs warning if not Accepts eit...
bool CheckParamStaticSelf(const char *a_SelfClassName)
Returns true if the first parameter is the expected class (static).
bool GetStackValue(int a_StackPos, AString &a_Value)
bool GetStackValues(int a_StartStackPos, Arg1 &&a_Arg1, Args &&... args)
Retrieves a list of values from the Lua stack, starting at the specified index.
AStringVector GetGroupPermissions(const AString &a_GroupName)
Returns the permissions that the specified group has assigned to it.
void AddGroup(const AString &a_GroupName)
Adds a new permission group.
AStringVector GetGroupRestrictions(const AString &a_GroupName)
Returns the restrictions that the specified group has assigned to it.
bool IsPermissionInGroup(const AString &a_Permission, const AString &a_GroupName)
Returns true iff the specified group contains the specified permission.
void RemoveRestrictionFromGroup(const AString &a_Restriction, const AString &a_GroupName)
Removes the specified restriction from the specified group.
bool GroupExists(const AString &a_GroupName)
Returns true iff the specified group exists in the DB.
void SetRankVisuals(const AString &a_RankName, const AString &a_MsgPrefix, const AString &a_MsgSuffix, const AString &a_MsgNameColorCode)
Sets the message visuals of an existing rank.
bool RenameGroup(const AString &a_OldName, const AString &a_NewName)
Renames the specified group.
void RemovePlayerRank(const cUUID &a_PlayerUUID)
Removes the player's rank assignment.
AStringVector GetPlayerPermissions(const cUUID &a_PlayerUUID)
Returns the permissions that the specified player has assigned to them.
AStringVector GetAllGroups(void)
Returns the names of all permission groups.
void AddRank(const AString &a_RankName, const AString &a_MsgPrefix, const AString &a_MsgSuffix, const AString &a_MsgNameColorCode)
Adds a new rank.
bool RankExists(const AString &a_RankName)
Returns true iff the specified rank exists in the DB.
AStringVector GetRankPermissions(const AString &a_RankName)
Returns all permissions that the specified rank has assigned to it, through all its groups.
AString GetPlayerName(const cUUID &a_PlayerUUID)
Returns the last name that the specified player has.
bool IsPlayerRankSet(const cUUID &a_PlayerUUID)
Returns true iff the specified player has a rank assigned to them in the DB.
void RemovePermissionFromGroup(const AString &a_Permission, const AString &a_GroupName)
Removes the specified permission from the specified group.
AStringVector GetPlayerGroups(const cUUID &a_PlayerUUID)
Returns the names of Groups that the specified player has assigned to them.
AString GetPlayerRankName(const cUUID &a_PlayerUUID)
Returns the name of the rank that the specified player has assigned to them.
void RemoveGroupFromRank(const AString &a_GroupName, const AString &a_RankName)
Removes the specified group from the specified rank.
AStringVector GetRankGroups(const AString &a_RankName)
Returns the names of groups that the specified rank has assigned to it.
void RemoveGroup(const AString &a_GroupName)
Removes the specified group completely.
void SetPlayerRank(const cUUID &a_PlayerUUID, const AString &a_PlayerName, const AString &a_RankName)
Sets the specified player's rank.
AStringVector GetRankRestrictions(const AString &a_RankName)
Returns all restrictions that the specified rank has assigned to it, through all its groups.
void RemoveRank(const AString &a_RankName, const AString &a_ReplacementRankName)
Removes the specified rank.
std::vector< cUUID > GetAllPlayerUUIDs(void)
Returns the uuids of all defined players.
AStringVector GetPlayerRestrictions(const cUUID &a_PlayerUUID)
Returns the restrictions that the specified player has assigned to them.
bool RenameRank(const AString &a_OldName, const AString &a_NewName)
Renames the specified rank.
AStringVector GetAllPermissions(void)
Returns all the distinct permissions that are stored in the DB.
void ClearPlayerRanks(void)
Removes all player ranks from the database.
bool IsGroupInRank(const AString &a_GroupName, const AString &a_RankName)
Returns true iff the specified rank contains the specified group.
bool IsRestrictionInGroup(const AString &a_Restriction, const AString &a_GroupName)
Returns true iff the specified group contains the specified restriction.
cRankManager * GetRankManager(void)