• This is a read only backup of the old Emudevs forum. If you want to have anything removed, please message me on Discord: KittyKaev

[SOLVED] RBAC Function

Status
Not open for further replies.

Xele

Enthusiast
hi budy

is there exist a function to get player RBAC group id ?

E.X if (player->GetGroup() = 1) { blah blah }

Trinitycore
 

Neth

BETA Tester
not sure to understand, your pseudo-code is saying : if player group is equal to 1
 

Tommy

Founder
The "GetGroup()" method isn't RBAC, it is a ingame party method...

I don't know why you want to get the groupID. If you have the groupID set to a specific number (1,2,3 or 4) by default every account will have it. What you can do is check if the player "HasPermission".

Code:
if (player->GetSession()->HasPermission(RBAC_PERMISSION....))
{
   // Do something
}
 
Last edited:

Neth

BETA Tester
you mean that sAccountMgr->GetRBACGroup(groupId); ?

edit faded was faster than me D:
 

Xele

Enthusiast
there are 2 RBAC groups, player & vip, then i want to get them from Session
if (sAccountMgr->GetRBACGroup(groupId) == vip)
{
// Do something
}
else
...
 

Neth

BETA Tester
replace vip by the number you created for vip ? I really don't understand what's so hard unless i'm missing the whole point of this thread?
 

Tommy

Founder
there are 2 RBAC groups, player & vip, then i want to get them from Session
if (sAccountMgr->GetRBACGroup(groupId) == vip)
{
// Do something
}
else
...

That doesn't make any sense. You aren't getting a players account and you aren't getting anything but the group data that doesn't pertain to anything. The best way to do this is set a custom VIP permission to an accountId.

Go to your "rbac_permissions" table and insert a new permission with the name VIP. After that go to your RBAC.h file and inside of the enumerator "RBACPermissions" put your custom VIP permission there, like so:

(Look at the very bottom of this code)
Code:
enum RBACPermissions
{
    RBAC_PERM_INSTANT_LOGOUT                                 = 1,
    RBAC_PERM_SKIP_QUEUE                                     = 2,
    RBAC_PERM_JOIN_NORMAL_BG                                 = 3,
    RBAC_PERM_JOIN_RANDOM_BG                                 = 4,
    RBAC_PERM_JOIN_ARENAS                                    = 5,
    RBAC_PERM_JOIN_DUNGEON_FINDER                            = 6,
    RBAC_PERM_PLAYER_COMMANDS                                = 7,
    RBAC_PERM_MODERATOR_COMMANDS                             = 8,
    RBAC_PERM_GAMEMASTER_COMMANDS                            = 9,
    RBAC_PERM_ADMINISTRATOR_COMMANDS                         = 10,
    RBAC_PERM_LOG_GM_TRADE                                   = 11,
    // Free = 12
    RBAC_PERM_SKIP_CHECK_INSTANCE_REQUIRED_BOSSES            = 13,
    RBAC_PERM_SKIP_CHECK_CHARACTER_CREATION_TEAMMASK         = 14,
    RBAC_PERM_SKIP_CHECK_CHARACTER_CREATION_CLASSMASK        = 15,
    RBAC_PERM_SKIP_CHECK_CHARACTER_CREATION_RACEMASK         = 16,
    RBAC_PERM_SKIP_CHECK_CHARACTER_CREATION_RESERVEDNAME     = 17,
    RBAC_PERM_SKIP_CHECK_CHARACTER_CREATION_HEROIC_CHARACTER = 18,
    RBAC_PERM_SKIP_CHECK_CHAT_CHANNEL_REQ                    = 19,
    RBAC_PERM_SKIP_CHECK_DISABLE_MAP                         = 20,
    RBAC_PERM_SKIP_CHECK_MORE_TALENTS_THAN_ALLOWED           = 21,
    RBAC_PERM_SKIP_CHECK_CHAT_SPAM                           = 22,
    RBAC_PERM_SKIP_CHECK_OVERSPEED_PING                      = 23,
    RBAC_PERM_TWO_SIDE_CHARACTER_CREATION                    = 24,
    RBAC_PERM_TWO_SIDE_INTERACTION_CHAT                      = 25,
    RBAC_PERM_TWO_SIDE_INTERACTION_CHANNEL                   = 26,
    RBAC_PERM_TWO_SIDE_INTERACTION_MAIL                      = 27,
    RBAC_PERM_TWO_SIDE_WHO_LIST                              = 28,
    RBAC_PERM_TWO_SIDE_ADD_FRIEND                            = 29,
    RBAC_PERM_COMMANDS_SAVE_WITHOUT_DELAY                    = 30,
    RBAC_PERM_COMMANDS_USE_UNSTUCK_WITH_ARGS                 = 31,
    RBAC_PERM_COMMANDS_BE_ASSIGNED_TICKET                    = 32,
    RBAC_PERM_COMMANDS_NOTIFY_COMMAND_NOT_FOUND_ERROR        = 33,
    RBAC_PERM_COMMANDS_APPEAR_IN_GM_LIST                     = 34,
    RBAC_PERM_WHO_SEE_ALL_SEC_LEVELS                         = 35,
    RBAC_PERM_CAN_FILTER_WHISPERS                            = 36,
    RBAC_PERM_CHAT_USE_STAFF_BADGE                           = 37,
    RBAC_PERM_RESURRECT_WITH_FULL_HPS                        = 38,
    RBAC_PERM_RESTORE_SAVED_GM_STATE                         = 39,
    RBAC_PERM_ALLOW_GM_FRIEND                                = 40,
    RBAC_PERM_USE_START_GM_LEVEL                             = 41,
    RBAC_PERM_OPCODE_WORLD_TELEPORT                          = 42,
    RBAC_PERM_OPCODE_WHOIS                                   = 43,
    RBAC_PERM_RECEIVE_GLOBAL_GM_TEXTMESSAGE                  = 44,
    RBAC_PERM_SILENTLY_JOIN_CHANNEL                          = 45,
    RBAC_PERM_CHANGE_CHANNEL_NOT_MODERATOR                   = 46,
    RBAC_PERM_CHECK_FOR_LOWER_SECURITY                       = 47,
    [COLOR=#00ff00]RBAC_PERM_CHECK_IF_VIP                                       = 48[/COLOR],
    RBAC_PERM_MAX
};

Afterwards, you can call it like this (like I showed in the above post):

Code:
if (player->GetSession()->HasPermission([COLOR=#00ff00]RBAC_PERM_CHECK_IF_VIP[/COLOR]))
{
   // Do something
}

What you're trying to do isn't right. What I showed you is the easy way without going through the trouble in creating an entirely new group. Anyway, enjoy. :p
 
Last edited:

Xele

Enthusiast
That doesn't make any sense. You aren't getting a players account and you aren't getting anything but the group data that doesn't pertain to anything. The best way to do this is set a custom VIP permission to an accountId.

Go to your "rbac_permissions" table and insert a new permission with the name VIP. After that go to your RBAC.h file and inside of the enumerator "RBACPermissions" put your custom VIP permission there, like so:

(Look at the very bottom of this code)
Code:
enum RBACPermissions
{
    RBAC_PERM_INSTANT_LOGOUT                                 = 1,
    RBAC_PERM_SKIP_QUEUE                                     = 2,
    RBAC_PERM_JOIN_NORMAL_BG                                 = 3,
    RBAC_PERM_JOIN_RANDOM_BG                                 = 4,
    RBAC_PERM_JOIN_ARENAS                                    = 5,
    RBAC_PERM_JOIN_DUNGEON_FINDER                            = 6,
    RBAC_PERM_PLAYER_COMMANDS                                = 7,
    RBAC_PERM_MODERATOR_COMMANDS                             = 8,
    RBAC_PERM_GAMEMASTER_COMMANDS                            = 9,
    RBAC_PERM_ADMINISTRATOR_COMMANDS                         = 10,
    RBAC_PERM_LOG_GM_TRADE                                   = 11,
    // Free = 12
    RBAC_PERM_SKIP_CHECK_INSTANCE_REQUIRED_BOSSES            = 13,
    RBAC_PERM_SKIP_CHECK_CHARACTER_CREATION_TEAMMASK         = 14,
    RBAC_PERM_SKIP_CHECK_CHARACTER_CREATION_CLASSMASK        = 15,
    RBAC_PERM_SKIP_CHECK_CHARACTER_CREATION_RACEMASK         = 16,
    RBAC_PERM_SKIP_CHECK_CHARACTER_CREATION_RESERVEDNAME     = 17,
    RBAC_PERM_SKIP_CHECK_CHARACTER_CREATION_HEROIC_CHARACTER = 18,
    RBAC_PERM_SKIP_CHECK_CHAT_CHANNEL_REQ                    = 19,
    RBAC_PERM_SKIP_CHECK_DISABLE_MAP                         = 20,
    RBAC_PERM_SKIP_CHECK_MORE_TALENTS_THAN_ALLOWED           = 21,
    RBAC_PERM_SKIP_CHECK_CHAT_SPAM                           = 22,
    RBAC_PERM_SKIP_CHECK_OVERSPEED_PING                      = 23,
    RBAC_PERM_TWO_SIDE_CHARACTER_CREATION                    = 24,
    RBAC_PERM_TWO_SIDE_INTERACTION_CHAT                      = 25,
    RBAC_PERM_TWO_SIDE_INTERACTION_CHANNEL                   = 26,
    RBAC_PERM_TWO_SIDE_INTERACTION_MAIL                      = 27,
    RBAC_PERM_TWO_SIDE_WHO_LIST                              = 28,
    RBAC_PERM_TWO_SIDE_ADD_FRIEND                            = 29,
    RBAC_PERM_COMMANDS_SAVE_WITHOUT_DELAY                    = 30,
    RBAC_PERM_COMMANDS_USE_UNSTUCK_WITH_ARGS                 = 31,
    RBAC_PERM_COMMANDS_BE_ASSIGNED_TICKET                    = 32,
    RBAC_PERM_COMMANDS_NOTIFY_COMMAND_NOT_FOUND_ERROR        = 33,
    RBAC_PERM_COMMANDS_APPEAR_IN_GM_LIST                     = 34,
    RBAC_PERM_WHO_SEE_ALL_SEC_LEVELS                         = 35,
    RBAC_PERM_CAN_FILTER_WHISPERS                            = 36,
    RBAC_PERM_CHAT_USE_STAFF_BADGE                           = 37,
    RBAC_PERM_RESURRECT_WITH_FULL_HPS                        = 38,
    RBAC_PERM_RESTORE_SAVED_GM_STATE                         = 39,
    RBAC_PERM_ALLOW_GM_FRIEND                                = 40,
    RBAC_PERM_USE_START_GM_LEVEL                             = 41,
    RBAC_PERM_OPCODE_WORLD_TELEPORT                          = 42,
    RBAC_PERM_OPCODE_WHOIS                                   = 43,
    RBAC_PERM_RECEIVE_GLOBAL_GM_TEXTMESSAGE                  = 44,
    RBAC_PERM_SILENTLY_JOIN_CHANNEL                          = 45,
    RBAC_PERM_CHANGE_CHANNEL_NOT_MODERATOR                   = 46,
    RBAC_PERM_CHECK_FOR_LOWER_SECURITY                       = 47,
    [COLOR=#00ff00]RBAC_PERM_CHECK_IF_VIP                                       = 48[/COLOR],
    RBAC_PERM_MAX
};

Afterwards, you can call it like this (like I showed in the above post):

Code:
if (player->GetSession()->HasPermission([COLOR=#00ff00]RBAC_PERM_CHECK_IF_VIP[/COLOR]))
{
   // Do something
}

What you're trying to do isn't right. What I showed you is the easy way without going through the trouble in creating an entirely new group. Anyway, enjoy. :p

yeah im looking for that! great!
 
Status
Not open for further replies.
Top