New server options to block adding GMs to friends by players and to block inviting GMs to parties
--HG-- branch : trunk
This commit is contained in:
@@ -78,6 +78,12 @@ void WorldSession::HandleGroupInviteOpcode( WorldPacket & recv_data )
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// restrict invite to GMs
|
||||||
|
if (!sWorld.getConfig(CONFIG_ALLOW_GM_GROUP) && !GetPlayer()->isGameMaster() && player->isGameMaster())
|
||||||
|
{
|
||||||
|
SendPartyResult(PARTY_OP_INVITE, membername, PARTY_RESULT_CANT_FIND_TARGET);
|
||||||
|
return;
|
||||||
|
}
|
||||||
// can't group with
|
// can't group with
|
||||||
if(!sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP) && GetPlayer()->GetTeam() != player->GetTeam())
|
if(!sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP) && GetPlayer()->GetTeam() != player->GetTeam())
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -44,6 +44,7 @@
|
|||||||
#include "Pet.h"
|
#include "Pet.h"
|
||||||
#include "SocialMgr.h"
|
#include "SocialMgr.h"
|
||||||
#include "CellImpl.h"
|
#include "CellImpl.h"
|
||||||
|
#include "AccountMgr.h"
|
||||||
#include "Vehicle.h"
|
#include "Vehicle.h"
|
||||||
#include "CreatureAI.h"
|
#include "CreatureAI.h"
|
||||||
|
|
||||||
@@ -561,12 +562,13 @@ void WorldSession::HandleAddFriendOpcode( WorldPacket & recv_data )
|
|||||||
sLog.outDebug( "WORLD: %s asked to add friend : '%s'",
|
sLog.outDebug( "WORLD: %s asked to add friend : '%s'",
|
||||||
GetPlayer()->GetName(), friendName.c_str() );
|
GetPlayer()->GetName(), friendName.c_str() );
|
||||||
|
|
||||||
CharacterDatabase.AsyncPQuery(&WorldSession::HandleAddFriendOpcodeCallBack, GetAccountId(), friendNote, "SELECT guid, race FROM characters WHERE name = '%s'", friendName.c_str());
|
CharacterDatabase.AsyncPQuery(&WorldSession::HandleAddFriendOpcodeCallBack, GetAccountId(), friendNote, "SELECT guid, race, account FROM characters WHERE name = '%s'", friendName.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
void WorldSession::HandleAddFriendOpcodeCallBack(QueryResult *result, uint32 accountId, std::string friendNote)
|
void WorldSession::HandleAddFriendOpcodeCallBack(QueryResult *result, uint32 accountId, std::string friendNote)
|
||||||
{
|
{
|
||||||
uint64 friendGuid;
|
uint64 friendGuid;
|
||||||
|
uint64 friendAcctid;
|
||||||
uint32 team;
|
uint32 team;
|
||||||
FriendsResult friendResult;
|
FriendsResult friendResult;
|
||||||
|
|
||||||
@@ -582,9 +584,12 @@ void WorldSession::HandleAddFriendOpcodeCallBack(QueryResult *result, uint32 acc
|
|||||||
{
|
{
|
||||||
friendGuid = MAKE_NEW_GUID((*result)[0].GetUInt32(), 0, HIGHGUID_PLAYER);
|
friendGuid = MAKE_NEW_GUID((*result)[0].GetUInt32(), 0, HIGHGUID_PLAYER);
|
||||||
team = Player::TeamForRace((*result)[1].GetUInt8());
|
team = Player::TeamForRace((*result)[1].GetUInt8());
|
||||||
|
friendAcctid = (*result)[2].GetUInt32();
|
||||||
|
|
||||||
delete result;
|
delete result;
|
||||||
|
|
||||||
|
if ( session->GetSecurity() >= SEC_MODERATOR || sWorld.getConfig(CONFIG_ALLOW_GM_FRIEND) || accmgr.GetSecurity(friendAcctid) < SEC_MODERATOR)
|
||||||
|
{
|
||||||
if(friendGuid)
|
if(friendGuid)
|
||||||
{
|
{
|
||||||
if(friendGuid==session->GetPlayer()->GetGUID())
|
if(friendGuid==session->GetPlayer()->GetGUID())
|
||||||
@@ -605,7 +610,7 @@ void WorldSession::HandleAddFriendOpcodeCallBack(QueryResult *result, uint32 acc
|
|||||||
friendResult = FRIEND_LIST_FULL;
|
friendResult = FRIEND_LIST_FULL;
|
||||||
sLog.outDebug( "WORLD: %s's friend list is full.", session->GetPlayer()->GetName());
|
sLog.outDebug( "WORLD: %s's friend list is full.", session->GetPlayer()->GetName());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
session->GetPlayer()->GetSocial()->SetFriendNote(GUID_LOPART(friendGuid), friendNote);
|
session->GetPlayer()->GetSocial()->SetFriendNote(GUID_LOPART(friendGuid), friendNote);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -793,6 +793,8 @@ void World::LoadConfigSettings(bool reload)
|
|||||||
m_configs[CONFIG_GM_IN_WHO_LIST] = sConfig.GetBoolDefault("GM.InWhoList", false);
|
m_configs[CONFIG_GM_IN_WHO_LIST] = sConfig.GetBoolDefault("GM.InWhoList", false);
|
||||||
m_configs[CONFIG_GM_LOG_TRADE] = sConfig.GetBoolDefault("GM.LogTrade", false);
|
m_configs[CONFIG_GM_LOG_TRADE] = sConfig.GetBoolDefault("GM.LogTrade", false);
|
||||||
m_configs[CONFIG_START_GM_LEVEL] = sConfig.GetIntDefault("GM.StartLevel", 1);
|
m_configs[CONFIG_START_GM_LEVEL] = sConfig.GetIntDefault("GM.StartLevel", 1);
|
||||||
|
m_configs[CONFIG_ALLOW_GM_GROUP] = sConfig.GetBoolDefault("GM.AllowInvite", false);
|
||||||
|
m_configs[CONFIG_ALLOW_GM_FRIEND] = sConfig.GetBoolDefault("GM.AllowFriend", false);
|
||||||
if(m_configs[CONFIG_START_GM_LEVEL] < m_configs[CONFIG_START_PLAYER_LEVEL])
|
if(m_configs[CONFIG_START_GM_LEVEL] < m_configs[CONFIG_START_PLAYER_LEVEL])
|
||||||
{
|
{
|
||||||
sLog.outError("GM.StartLevel (%i) must be in range StartPlayerLevel(%u)..%u. Set to %u.",
|
sLog.outError("GM.StartLevel (%i) must be in range StartPlayerLevel(%u)..%u. Set to %u.",
|
||||||
|
|||||||
@@ -141,6 +141,8 @@ enum WorldConfigs
|
|||||||
CONFIG_GM_IN_GM_LIST,
|
CONFIG_GM_IN_GM_LIST,
|
||||||
CONFIG_GM_IN_WHO_LIST,
|
CONFIG_GM_IN_WHO_LIST,
|
||||||
CONFIG_GM_LOG_TRADE,
|
CONFIG_GM_LOG_TRADE,
|
||||||
|
CONFIG_ALLOW_GM_GROUP,
|
||||||
|
CONFIG_ALLOW_GM_FRIEND,
|
||||||
CONFIG_START_GM_LEVEL,
|
CONFIG_START_GM_LEVEL,
|
||||||
CONFIG_GM_LOWER_SECURITY,
|
CONFIG_GM_LOWER_SECURITY,
|
||||||
CONFIG_GM_ALLOW_ACHIEVEMENT_GAINS,
|
CONFIG_GM_ALLOW_ACHIEVEMENT_GAINS,
|
||||||
|
|||||||
@@ -1006,6 +1006,16 @@ Channel.SilentlyGMJoin = 0
|
|||||||
# GM starting level (1-100)
|
# GM starting level (1-100)
|
||||||
# Default: 1
|
# Default: 1
|
||||||
#
|
#
|
||||||
|
# GM.AllowInvite
|
||||||
|
# Is GM accepting invites from players by default or not
|
||||||
|
# Default: 0 (false)
|
||||||
|
# 1 (true)
|
||||||
|
#
|
||||||
|
# GM.AllowFriend
|
||||||
|
# Are players allowed to add GMs to their friend list
|
||||||
|
# Default: 0 (false)
|
||||||
|
# 1 (true)
|
||||||
|
#
|
||||||
# GM.LowerSecurity
|
# GM.LowerSecurity
|
||||||
# Disallow a lower security member to interact with a higher one using commands
|
# Disallow a lower security member to interact with a higher one using commands
|
||||||
# Default: 0 (disable)
|
# Default: 0 (disable)
|
||||||
@@ -1027,6 +1037,8 @@ GM.InGMList = 0
|
|||||||
GM.InWhoList = 0
|
GM.InWhoList = 0
|
||||||
GM.LogTrade = 1
|
GM.LogTrade = 1
|
||||||
GM.StartLevel = 80
|
GM.StartLevel = 80
|
||||||
|
GM.AllowInvite = 0
|
||||||
|
GM.AllowFriend = 0
|
||||||
GM.LowerSecurity = 0
|
GM.LowerSecurity = 0
|
||||||
GM.AllowAchievementGain = 1
|
GM.AllowAchievementGain = 1
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user