From bcd18b8f26100d95be971599e9c45275cfb6d273 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Sun, 3 Jan 2021 15:12:23 -0500 Subject: [PATCH] Core/WorldSession: Add RBAC permission for skipping idle connection check Port From (https://github.com/TrinityCore/TrinityCore/commit/7625bd960ebc4fab970fb27072aececf9e936e2f) --- Source/Framework/Constants/AccountConst.cs | 2 +- Source/Game/Server/WorldSession.cs | 2 +- sql/base/auth_database.sql | 3 +++ sql/updates/auth/master/2017_10_13_00_auth.sql | 7 +++++++ 4 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 sql/updates/auth/master/2017_10_13_00_auth.sql diff --git a/Source/Framework/Constants/AccountConst.cs b/Source/Framework/Constants/AccountConst.cs index 795d06056..dccd715a5 100644 --- a/Source/Framework/Constants/AccountConst.cs +++ b/Source/Framework/Constants/AccountConst.cs @@ -57,7 +57,7 @@ namespace Framework.Constants JoinRandomBg = 4, JoinArenas = 5, JoinDungeonFinder = 6, - // 7 - Reuse + IgnoreIdleConnection = 7, // 8 - Reuse // 9 - Reuse UseCharacterTemplates = 10, diff --git a/Source/Game/Server/WorldSession.cs b/Source/Game/Server/WorldSession.cs index f3c563425..2b1f534db 100644 --- a/Source/Game/Server/WorldSession.cs +++ b/Source/Game/Server/WorldSession.cs @@ -242,7 +242,7 @@ namespace Game // Before we process anything: /// If necessary, kick the player because the client didn't send anything for too long /// (or they've been idling in character select) - if (IsConnectionIdle()) + if (IsConnectionIdle() && !HasPermission(RBACPermissions.IgnoreIdleConnection)) m_Socket[(int)ConnectionType.Realm].CloseSocket(); WorldPacket firstDelayedPacket = null; diff --git a/sql/base/auth_database.sql b/sql/base/auth_database.sql index cde9da4ba..1f80a8648 100644 --- a/sql/base/auth_database.sql +++ b/sql/base/auth_database.sql @@ -821,6 +821,7 @@ INSERT INTO `rbac_linked_permissions` VALUES (195,24), (195,49), (195,199), +(196,7), (196,10), (196,200), (196,201), @@ -1437,6 +1438,7 @@ INSERT INTO `rbac_permissions` VALUES (4,'Join Random Battleground'), (5,'Join Arenas'), (6,'Join Dungeon Finder'), +(7,'Skip idle connection check'), (10,'Use character templates'), (11,'Log GM trades'), (12,'Skip character creation demon hunter min level check'), @@ -2322,6 +2324,7 @@ INSERT INTO `updates` VALUES ('2017_08_04_00_auth.sql','2E994A704C64FECE3CE0883ED0CAC5E5A0E3A36C','ARCHIVED','2017-08-04 23:46:32',0), ('2017_08_13_00_auth_2016_09_22_00_auth.sql','70047954E3556BFA430ADD5680EF8797F74A4B9E','ARCHIVED','2017-08-13 12:00:00',0), ('2017_09_22_00_auth.sql','9313CCE80A18212E6F0C78D83316DE8582AE8084','ARCHIVED','2017-09-22 18:05:17',0), +('2017_10_13_00_auth.sql','87674E0D166AC60E3725B445714427892E42C6FE','ARCHIVED','2017-10-13 00:00:00',0), ('2017_11_11_01_auth.sql','0D6EDB6B2FC8B9FBDF11ECD79B4B8E943328B6A9','ARCHIVED','2017-11-11 18:49:45',0), ('2017_12_30_00_auth.sql','F360E9555AC68E28834E3FF807E4E37A090EF363','ARCHIVED','2017-12-30 00:23:32',0), ('2017_12_30_01_auth.sql','1E11C78BA6D1D8E8CED7423DF92D1D197D6061EE','ARCHIVED','2017-12-30 23:00:00',0), diff --git a/sql/updates/auth/master/2017_10_13_00_auth.sql b/sql/updates/auth/master/2017_10_13_00_auth.sql new file mode 100644 index 000000000..145714e95 --- /dev/null +++ b/sql/updates/auth/master/2017_10_13_00_auth.sql @@ -0,0 +1,7 @@ +DELETE FROM `rbac_permissions` WHERE `id`=7; +INSERT INTO `rbac_permissions` (`id`,`name`) VALUES +(7, 'Skip idle connection check'); + +DELETE FROM `rbac_linked_permissions` WHERE `linkedId`=7; +INSERT INTO `rbac_linked_permissions` (`id`,`linkedId`) VALUES +(196,7);