From 209bc50ef5daee3456861e06f194a9924beb3253 Mon Sep 17 00:00:00 2001 From: StygianTheBest Date: Tue, 19 Sep 2017 14:30:23 -0400 Subject: [PATCH] Add GMSummonPlayer Config Option (#643) --- src/game/World/World.cpp | 3 ++- src/game/World/World.h | 1 + src/scripts/Commands/cs_misc.cpp | 14 +++++++++----- src/worldserver/worldserver.conf.dist | 8 ++++++++ 4 files changed, 20 insertions(+), 6 deletions(-) diff --git a/src/game/World/World.cpp b/src/game/World/World.cpp index 684f9af76..e7cdd9aa3 100644 --- a/src/game/World/World.cpp +++ b/src/game/World/World.cpp @@ -844,7 +844,7 @@ void World::LoadConfigSettings(bool reload) m_int_configs[CONFIG_START_ARENA_POINTS] = m_int_configs[CONFIG_MAX_ARENA_POINTS]; } - m_int_configs[CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL] = sConfigMgr->GetIntDefault("RecruitAFriend.MaxLevel", 60); + m_int_configs[CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL] = sConfigMgr->GetIntDefault("RecruitAFriend.MaxLevel", 60); if (m_int_configs[CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL] > m_int_configs[CONFIG_MAX_PLAYER_LEVEL]) { sLog->outError("RecruitAFriend.MaxLevel (%i) must be in the range 0..MaxLevel(%u). Set to %u.", @@ -858,6 +858,7 @@ void World::LoadConfigSettings(bool reload) m_bool_configs[CONFIG_INSTANCE_IGNORE_LEVEL] = sConfigMgr->GetBoolDefault("Instance.IgnoreLevel", false); m_bool_configs[CONFIG_INSTANCE_IGNORE_RAID] = sConfigMgr->GetBoolDefault("Instance.IgnoreRaid", false); + m_bool_configs[CONFIG_INSTANCE_GMSUMMON_PLAYER] = sConfigMgr->GetBoolDefault("Instance.GMSummonPlayer", false); m_bool_configs[CONFIG_INSTANCE_SHARED_ID] = sConfigMgr->GetBoolDefault("Instance.SharedNormalHeroicId", false); m_int_configs[CONFIG_INSTANCE_RESET_TIME_HOUR] = sConfigMgr->GetIntDefault("Instance.ResetTimeHour", 4); diff --git a/src/game/World/World.h b/src/game/World/World.h index a32bf65b8..96eecf073 100644 --- a/src/game/World/World.h +++ b/src/game/World/World.h @@ -93,6 +93,7 @@ enum WorldBoolConfigs CONFIG_INSTANT_TAXI, CONFIG_INSTANCE_IGNORE_LEVEL, CONFIG_INSTANCE_IGNORE_RAID, + CONFIG_INSTANCE_GMSUMMON_PLAYER, CONFIG_INSTANCE_SHARED_ID, CONFIG_GM_LOG_TRADE, CONFIG_ALLOW_GM_GROUP, diff --git a/src/scripts/Commands/cs_misc.cpp b/src/scripts/Commands/cs_misc.cpp index f7eb61d7d..edf485191 100644 --- a/src/scripts/Commands/cs_misc.cpp +++ b/src/scripts/Commands/cs_misc.cpp @@ -688,12 +688,16 @@ public: } else if (map->IsDungeon()) { - // pussywizard: prevent unbinding normal player's perm bind by just summoning him >_> - if (!target->GetSession()->GetSecurity()) + // Allow GM to summon players or only other GM accounts inside instances. + if (!sWorld->getBoolConfig(CONFIG_INSTANCE_GMSUMMON_PLAYER)) { - handler->PSendSysMessage("Only GMs can be summoned to an instance!"); - handler->SetSentErrorMessage(true); - return false; + // pussywizard: prevent unbinding normal player's perm bind by just summoning him >_> + if (!target->GetSession()->GetSecurity()) + { + handler->PSendSysMessage("Only GMs can be summoned to an instance!"); + handler->SetSentErrorMessage(true); + return false; + } } Map* destMap = target->GetMap(); diff --git a/src/worldserver/worldserver.conf.dist b/src/worldserver/worldserver.conf.dist index 6572a9d28..375643f80 100644 --- a/src/worldserver/worldserver.conf.dist +++ b/src/worldserver/worldserver.conf.dist @@ -1198,6 +1198,14 @@ Instance.IgnoreLevel = 0 Instance.IgnoreRaid = 0 +# +# Instance.GMSummonPlayer +# Description: Allow GM to summon players or only other GM accounts inside instances. +# Default: 0 - (Disabled, Only GM accounts can be summoned by GM) +# 1 - (Enabled, GM and Player accounts can be summoned by GM) + +Instance.GMSummonPlayer = 0 + # # Instance.ResetTimeHour # Description: Hour of the day when the global instance reset occurs.