Core/Player: New PartyLevelReq setting (#17707)

(cherry picked from commit bfda0ba91d)

Typo fix
(cherry picked from commit 35f06ccb55)
This commit is contained in:
Aokromes
2016-08-01 10:43:49 +02:00
committed by joschiwald
parent 04f7de8957
commit 5264374fd6
4 changed files with 17 additions and 0 deletions

View File

@@ -100,6 +100,12 @@ void WorldSession::HandlePartyInviteOpcode(WorldPackets::Party::PartyInviteClien
return;
}
if (!player->GetSocial()->HasFriend(GetPlayer()->GetGUID()) && GetPlayer()->getLevel() < sWorld->getIntConfig(CONFIG_PARTY_LEVEL_REQ))
{
SendPartyResult(PARTY_OP_INVITE, player->GetName(), ERR_INVITE_RESTRICTED);
return;
}
Group* group = GetPlayer()->GetGroup();
if (group && group->isBGGroup())
group = GetPlayer()->GetOriginalGroup();

View File

@@ -662,6 +662,7 @@ void World::LoadConfigSettings(bool reload)
m_int_configs[CONFIG_CHAT_CHANNEL_LEVEL_REQ] = sConfigMgr->GetIntDefault("ChatLevelReq.Channel", 1);
m_int_configs[CONFIG_CHAT_WHISPER_LEVEL_REQ] = sConfigMgr->GetIntDefault("ChatLevelReq.Whisper", 1);
m_int_configs[CONFIG_CHAT_SAY_LEVEL_REQ] = sConfigMgr->GetIntDefault("ChatLevelReq.Say", 1);
m_int_configs[CONFIG_PARTY_LEVEL_REQ] = sConfigMgr->GetIntDefault("PartyLevelReq", 1);
m_int_configs[CONFIG_TRADE_LEVEL_REQ] = sConfigMgr->GetIntDefault("LevelReq.Trade", 1);
m_int_configs[CONFIG_AUCTION_LEVEL_REQ] = sConfigMgr->GetIntDefault("LevelReq.Auction", 1);
m_int_configs[CONFIG_MAIL_LEVEL_REQ] = sConfigMgr->GetIntDefault("LevelReq.Mail", 1);

View File

@@ -302,6 +302,7 @@ enum WorldIntConfigs
CONFIG_CHAT_CHANNEL_LEVEL_REQ,
CONFIG_CHAT_WHISPER_LEVEL_REQ,
CONFIG_CHAT_SAY_LEVEL_REQ,
CONFIG_PARTY_LEVEL_REQ,
CONFIG_TRADE_LEVEL_REQ,
CONFIG_AUCTION_LEVEL_REQ,
CONFIG_MAIL_LEVEL_REQ,

View File

@@ -1803,6 +1803,15 @@ ChatLevelReq.Whisper = 1
ChatLevelReq.Say = 1
#
# PartyLevelReq
# Description: Minimum level at which players can invite to group, even if they aren't on
# the invitee friends list. (Players who are on that friend list can always
# invite despite having lower level)
# Default: 1
PartyLevelReq = 1
#
# PreserveCustomChannels
# Description: Store custom chat channel settings like password, automatic ownership handout