Core/Misc: Add permission that allows player to be AFK on the battleground.
(cherry picked from commit 554fc8eee0bcbb70acd012c04f6f02197c6d949c)
This commit is contained in:
@@ -2292,6 +2292,7 @@ INSERT INTO `rbac_linked_permissions` VALUES
|
||||
(192,854),
|
||||
(193,48),
|
||||
(193,52),
|
||||
(193,53),
|
||||
(193,194),
|
||||
(193,197),
|
||||
(194,1),
|
||||
@@ -3008,6 +3009,7 @@ INSERT INTO `rbac_permissions` VALUES
|
||||
(50,'Allow user to check his own email with .account'),
|
||||
(51,'Allow trading between factions'),
|
||||
(52,'No battleground deserter debuff'),
|
||||
(53,'Can be AFK on the battleground'),
|
||||
(192,'Role: Sec Level Administrator'),
|
||||
(193,'Role: Sec Level Gamemaster'),
|
||||
(194,'Role: Sec Level Moderator'),
|
||||
@@ -4120,6 +4122,7 @@ INSERT INTO `updates` VALUES
|
||||
('2023_12_26_00_auth.sql','5C8716F7F6E2792E15A42BDA8F2D855A7DE95FC5','ARCHIVED','2023-12-26 13:38:58',0),
|
||||
('2024_01_05_00_auth.sql','7F401D473B08BBE5212551E96A86F85107CE7C8E','ARCHIVED','2023-12-19 10:05:39',0),
|
||||
('2024_01_06_00_auth.sql','767D697594D5471B67CC0FDF0D7BB15374116A71','RELEASED','2024-01-06 09:53:51',0),
|
||||
('2024_01_06_01_auth.sql','3D9E0A906A357877DB8E7B72E0797AB38EF884BC','RELEASED','2024-01-06 11:33:07',0),
|
||||
('2024_01_10_00_auth.sql','75F06894D95986AEAB2933F141DB7693FABB0324','ARCHIVED','2024-01-10 11:14:55',0),
|
||||
('2024_01_21_00_auth.sql','5F12B88EAADC5390AD42843290BD13CEF3BF2E0B','ARCHIVED','2024-01-21 21:21:50',0),
|
||||
('2024_01_23_00_auth.sql','55E3C2CC1FAF02916EB47711CD2278443F7AA183','ARCHIVED','2024-01-23 09:40:35',0),
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
--
|
||||
DELETE FROM `rbac_permissions` WHERE `id` = 53;
|
||||
INSERT INTO `rbac_permissions` (`id`, `name`) VALUES (53, "Can be AFK on the battleground");
|
||||
|
||||
DELETE FROM `rbac_linked_permissions` WHERE `linkedId` = 53;
|
||||
INSERT INTO `rbac_linked_permissions` (`id`, `linkedId`) VALUES
|
||||
(193, 53);
|
||||
@@ -103,6 +103,7 @@ enum RBACPermissions
|
||||
RBAC_PERM_MAY_CHECK_OWN_EMAIL = 50,
|
||||
RBAC_PERM_ALLOW_TWO_SIDE_TRADE = 51,
|
||||
RBAC_PERM_NO_BATTLEGROUND_DESERTER_DEBUFF = 52,
|
||||
RBAC_PERM_CAN_AFK_ON_BATTLEGROUND = 53,
|
||||
|
||||
// Free space for core permissions (till 149)
|
||||
// Roles (Permissions with delegated permissions) use 199 and descending
|
||||
|
||||
@@ -1192,7 +1192,7 @@ void Player::ToggleAFK()
|
||||
SetPlayerFlag(PLAYER_FLAGS_AFK);
|
||||
|
||||
// afk player not allowed in battleground
|
||||
if (!IsGameMaster() && isAFK() && InBattleground() && !InArena())
|
||||
if (!GetSession()->HasPermission(rbac::RBAC_PERM_CAN_AFK_ON_BATTLEGROUND) && isAFK() && InBattleground() && !InArena())
|
||||
LeaveBattleground();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user