Add GMSummonPlayer Config Option (#643)

This commit is contained in:
StygianTheBest
2017-09-19 14:30:23 -04:00
committed by Yehonal
parent d19b61a755
commit 209bc50ef5
4 changed files with 20 additions and 6 deletions
+2 -1
View File
@@ -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_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]) 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.", 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_LEVEL] = sConfigMgr->GetBoolDefault("Instance.IgnoreLevel", false);
m_bool_configs[CONFIG_INSTANCE_IGNORE_RAID] = sConfigMgr->GetBoolDefault("Instance.IgnoreRaid", 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_bool_configs[CONFIG_INSTANCE_SHARED_ID] = sConfigMgr->GetBoolDefault("Instance.SharedNormalHeroicId", false);
m_int_configs[CONFIG_INSTANCE_RESET_TIME_HOUR] = sConfigMgr->GetIntDefault("Instance.ResetTimeHour", 4); m_int_configs[CONFIG_INSTANCE_RESET_TIME_HOUR] = sConfigMgr->GetIntDefault("Instance.ResetTimeHour", 4);
+1
View File
@@ -93,6 +93,7 @@ enum WorldBoolConfigs
CONFIG_INSTANT_TAXI, CONFIG_INSTANT_TAXI,
CONFIG_INSTANCE_IGNORE_LEVEL, CONFIG_INSTANCE_IGNORE_LEVEL,
CONFIG_INSTANCE_IGNORE_RAID, CONFIG_INSTANCE_IGNORE_RAID,
CONFIG_INSTANCE_GMSUMMON_PLAYER,
CONFIG_INSTANCE_SHARED_ID, CONFIG_INSTANCE_SHARED_ID,
CONFIG_GM_LOG_TRADE, CONFIG_GM_LOG_TRADE,
CONFIG_ALLOW_GM_GROUP, CONFIG_ALLOW_GM_GROUP,
+9 -5
View File
@@ -688,12 +688,16 @@ public:
} }
else if (map->IsDungeon()) else if (map->IsDungeon())
{ {
// pussywizard: prevent unbinding normal player's perm bind by just summoning him >_> // Allow GM to summon players or only other GM accounts inside instances.
if (!target->GetSession()->GetSecurity()) if (!sWorld->getBoolConfig(CONFIG_INSTANCE_GMSUMMON_PLAYER))
{ {
handler->PSendSysMessage("Only GMs can be summoned to an instance!"); // pussywizard: prevent unbinding normal player's perm bind by just summoning him >_>
handler->SetSentErrorMessage(true); if (!target->GetSession()->GetSecurity())
return false; {
handler->PSendSysMessage("Only GMs can be summoned to an instance!");
handler->SetSentErrorMessage(true);
return false;
}
} }
Map* destMap = target->GetMap(); Map* destMap = target->GetMap();
+8
View File
@@ -1198,6 +1198,14 @@ Instance.IgnoreLevel = 0
Instance.IgnoreRaid = 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 # Instance.ResetTimeHour
# Description: Hour of the day when the global instance reset occurs. # Description: Hour of the day when the global instance reset occurs.