mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +00:00
[6982] Implemented gmlevel-based command security
This is just a simple check if target's gmlevel is lesser than the caller's one. If it is, an error is returned. Offline checks for some commands are included. That in simple words means no further .goname to a gmlevel 3 player from a gmlevel 2 or 1 account, so gmlevel 3 can work in peace. Signed-off-by: freghar <compmancz@gmail.com>
This commit is contained in:
parent
bc0a840e6a
commit
73ca2b7a54
8 changed files with 229 additions and 1 deletions
|
|
@ -31,6 +31,7 @@
|
||||||
#include "MapManager.h"
|
#include "MapManager.h"
|
||||||
#include "GridNotifiersImpl.h"
|
#include "GridNotifiersImpl.h"
|
||||||
#include "CellImpl.h"
|
#include "CellImpl.h"
|
||||||
|
#include "AccountMgr.h"
|
||||||
|
|
||||||
bool ChatHandler::load_command_table = true;
|
bool ChatHandler::load_command_table = true;
|
||||||
|
|
||||||
|
|
@ -625,6 +626,38 @@ bool ChatHandler::isAvailable(ChatCommand const& cmd) const
|
||||||
return m_session->GetSecurity() >= cmd.SecurityLevel;
|
return m_session->GetSecurity() >= cmd.SecurityLevel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ChatHandler::HasLowerSecurity(Player* target, uint64 guid)
|
||||||
|
{
|
||||||
|
uint32 target_sec;
|
||||||
|
|
||||||
|
if (!sWorld.getConfig(CONFIG_GM_LOWER_SECURITY))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// allow everything from RA console
|
||||||
|
if (!m_session)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (target)
|
||||||
|
target_sec = target->GetSession()->GetSecurity();
|
||||||
|
else if (guid)
|
||||||
|
target_sec = accmgr.GetSecurity(objmgr.GetPlayerAccountIdByGUID(guid));
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SendSysMessage(LANG_PLAYER_NOT_FOUND);
|
||||||
|
SetSentErrorMessage(true);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (m_session->GetSecurity() < target_sec)
|
||||||
|
{
|
||||||
|
SendSysMessage(LANG_YOURS_SECURITY_IS_LOW);
|
||||||
|
SetSentErrorMessage(true);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
bool ChatHandler::hasStringAbbr(const char* name, const char* part)
|
bool ChatHandler::hasStringAbbr(const char* name, const char* part)
|
||||||
{
|
{
|
||||||
// non "" command
|
// non "" command
|
||||||
|
|
|
||||||
|
|
@ -77,6 +77,7 @@ class ChatHandler
|
||||||
|
|
||||||
virtual bool isAvailable(ChatCommand const& cmd) const;
|
virtual bool isAvailable(ChatCommand const& cmd) const;
|
||||||
virtual bool needReportToTarget(Player* chr) const;
|
virtual bool needReportToTarget(Player* chr) const;
|
||||||
|
bool HasLowerSecurity(Player* target, uint64 guid);
|
||||||
|
|
||||||
void SendGlobalSysMessage(const char *str);
|
void SendGlobalSysMessage(const char *str);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -111,6 +111,10 @@ bool ChatHandler::HandleNpcWhisperCommand(const char* args)
|
||||||
|
|
||||||
uint64 receiver_guid= atol(receiver_str);
|
uint64 receiver_guid= atol(receiver_str);
|
||||||
|
|
||||||
|
// check online security
|
||||||
|
if (HasLowerSecurity(objmgr.GetPlayer(receiver_guid), 0))
|
||||||
|
return false;
|
||||||
|
|
||||||
pCreature->Whisper(text,receiver_guid);
|
pCreature->Whisper(text,receiver_guid);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -342,6 +346,10 @@ bool ChatHandler::HandleNamegoCommand(const char* args)
|
||||||
Player *chr = objmgr.GetPlayer(name.c_str());
|
Player *chr = objmgr.GetPlayer(name.c_str());
|
||||||
if (chr)
|
if (chr)
|
||||||
{
|
{
|
||||||
|
// check online security
|
||||||
|
if (HasLowerSecurity(chr, 0))
|
||||||
|
return false;
|
||||||
|
|
||||||
if(chr->IsBeingTeleported()==true)
|
if(chr->IsBeingTeleported()==true)
|
||||||
{
|
{
|
||||||
PSendSysMessage(LANG_IS_TELEPORTED, chr->GetName());
|
PSendSysMessage(LANG_IS_TELEPORTED, chr->GetName());
|
||||||
|
|
@ -402,6 +410,10 @@ bool ChatHandler::HandleNamegoCommand(const char* args)
|
||||||
}
|
}
|
||||||
else if (uint64 guid = objmgr.GetPlayerGUIDByName(name))
|
else if (uint64 guid = objmgr.GetPlayerGUIDByName(name))
|
||||||
{
|
{
|
||||||
|
// check offline security
|
||||||
|
if (HasLowerSecurity(NULL, guid))
|
||||||
|
return false;
|
||||||
|
|
||||||
PSendSysMessage(LANG_SUMMONING, name.c_str(),GetMangosString(LANG_OFFLINE));
|
PSendSysMessage(LANG_SUMMONING, name.c_str(),GetMangosString(LANG_OFFLINE));
|
||||||
|
|
||||||
// in point where GM stay
|
// in point where GM stay
|
||||||
|
|
@ -442,6 +454,10 @@ bool ChatHandler::HandleGonameCommand(const char* args)
|
||||||
Player *chr = objmgr.GetPlayer(name.c_str());
|
Player *chr = objmgr.GetPlayer(name.c_str());
|
||||||
if (chr)
|
if (chr)
|
||||||
{
|
{
|
||||||
|
// check online security
|
||||||
|
if (HasLowerSecurity(chr, 0))
|
||||||
|
return false;
|
||||||
|
|
||||||
Map* cMap = chr->GetMap();
|
Map* cMap = chr->GetMap();
|
||||||
if(cMap->IsBattleGroundOrArena())
|
if(cMap->IsBattleGroundOrArena())
|
||||||
{
|
{
|
||||||
|
|
@ -535,6 +551,10 @@ bool ChatHandler::HandleGonameCommand(const char* args)
|
||||||
|
|
||||||
if (uint64 guid = objmgr.GetPlayerGUIDByName(name))
|
if (uint64 guid = objmgr.GetPlayerGUIDByName(name))
|
||||||
{
|
{
|
||||||
|
// check offline security
|
||||||
|
if (HasLowerSecurity(NULL, guid))
|
||||||
|
return false;
|
||||||
|
|
||||||
PSendSysMessage(LANG_APPEARING_AT, name.c_str());
|
PSendSysMessage(LANG_APPEARING_AT, name.c_str());
|
||||||
|
|
||||||
// to point where player stay (if loaded)
|
// to point where player stay (if loaded)
|
||||||
|
|
@ -574,6 +594,10 @@ bool ChatHandler::HandleRecallCommand(const char* args)
|
||||||
chr = getSelectedPlayer();
|
chr = getSelectedPlayer();
|
||||||
if(!chr)
|
if(!chr)
|
||||||
chr = m_session->GetPlayer();
|
chr = m_session->GetPlayer();
|
||||||
|
|
||||||
|
// check online security
|
||||||
|
else if (HasLowerSecurity(chr, 0))
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -594,6 +618,10 @@ bool ChatHandler::HandleRecallCommand(const char* args)
|
||||||
SetSentErrorMessage(true);
|
SetSentErrorMessage(true);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check online security
|
||||||
|
if (HasLowerSecurity(chr, 0))
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(chr->IsBeingTeleported())
|
if(chr->IsBeingTeleported())
|
||||||
|
|
@ -632,6 +660,10 @@ bool ChatHandler::HandleModifyKnownTitlesCommand(const char* args)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check online security
|
||||||
|
if (HasLowerSecurity(chr, 0))
|
||||||
|
return false;
|
||||||
|
|
||||||
uint64 titles2 = titles;
|
uint64 titles2 = titles;
|
||||||
|
|
||||||
for(int i=1; i < sCharTitlesStore.GetNumRows(); ++i)
|
for(int i=1; i < sCharTitlesStore.GetNumRows(); ++i)
|
||||||
|
|
@ -681,6 +713,10 @@ bool ChatHandler::HandleModifyHPCommand(const char* args)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check online security
|
||||||
|
if (HasLowerSecurity(chr, 0))
|
||||||
|
return false;
|
||||||
|
|
||||||
PSendSysMessage(LANG_YOU_CHANGE_HP, chr->GetName(), hp, hpm);
|
PSendSysMessage(LANG_YOU_CHANGE_HP, chr->GetName(), hp, hpm);
|
||||||
if (needReportToTarget(chr))
|
if (needReportToTarget(chr))
|
||||||
ChatHandler(chr).PSendSysMessage(LANG_YOURS_HP_CHANGED, GetName(), hp, hpm);
|
ChatHandler(chr).PSendSysMessage(LANG_YOURS_HP_CHANGED, GetName(), hp, hpm);
|
||||||
|
|
@ -725,6 +761,10 @@ bool ChatHandler::HandleModifyManaCommand(const char* args)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check online security
|
||||||
|
if (HasLowerSecurity(chr, 0))
|
||||||
|
return false;
|
||||||
|
|
||||||
PSendSysMessage(LANG_YOU_CHANGE_MANA, chr->GetName(), mana, manam);
|
PSendSysMessage(LANG_YOU_CHANGE_MANA, chr->GetName(), mana, manam);
|
||||||
if (needReportToTarget(chr))
|
if (needReportToTarget(chr))
|
||||||
ChatHandler(chr).PSendSysMessage(LANG_YOURS_MANA_CHANGED, GetName(), mana, manam);
|
ChatHandler(chr).PSendSysMessage(LANG_YOURS_MANA_CHANGED, GetName(), mana, manam);
|
||||||
|
|
@ -770,6 +810,10 @@ bool ChatHandler::HandleModifyEnergyCommand(const char* args)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check online security
|
||||||
|
if (HasLowerSecurity(chr, 0))
|
||||||
|
return false;
|
||||||
|
|
||||||
PSendSysMessage(LANG_YOU_CHANGE_ENERGY, chr->GetName(), energy/10, energym/10);
|
PSendSysMessage(LANG_YOU_CHANGE_ENERGY, chr->GetName(), energy/10, energym/10);
|
||||||
if (needReportToTarget(chr))
|
if (needReportToTarget(chr))
|
||||||
ChatHandler(chr).PSendSysMessage(LANG_YOURS_ENERGY_CHANGED, GetName(), energy/10, energym/10);
|
ChatHandler(chr).PSendSysMessage(LANG_YOURS_ENERGY_CHANGED, GetName(), energy/10, energym/10);
|
||||||
|
|
@ -817,6 +861,10 @@ bool ChatHandler::HandleModifyRageCommand(const char* args)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check online security
|
||||||
|
if (HasLowerSecurity(chr, 0))
|
||||||
|
return false;
|
||||||
|
|
||||||
PSendSysMessage(LANG_YOU_CHANGE_RAGE, chr->GetName(), rage/10, ragem/10);
|
PSendSysMessage(LANG_YOU_CHANGE_RAGE, chr->GetName(), rage/10, ragem/10);
|
||||||
if (needReportToTarget(chr))
|
if (needReportToTarget(chr))
|
||||||
ChatHandler(chr).PSendSysMessage(LANG_YOURS_RAGE_CHANGED, GetName(), rage/10, ragem/10);
|
ChatHandler(chr).PSendSysMessage(LANG_YOURS_RAGE_CHANGED, GetName(), rage/10, ragem/10);
|
||||||
|
|
@ -975,6 +1023,10 @@ bool ChatHandler::HandleModifySpellCommand(const char* args)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check online security
|
||||||
|
if (HasLowerSecurity(chr, 0))
|
||||||
|
return false;
|
||||||
|
|
||||||
PSendSysMessage(LANG_YOU_CHANGE_SPELLFLATID, spellflatid, val, mark, chr->GetName());
|
PSendSysMessage(LANG_YOU_CHANGE_SPELLFLATID, spellflatid, val, mark, chr->GetName());
|
||||||
if (needReportToTarget(chr))
|
if (needReportToTarget(chr))
|
||||||
ChatHandler(chr).PSendSysMessage(LANG_YOURS_SPELLFLATID_CHANGED, GetName(), spellflatid, val, mark);
|
ChatHandler(chr).PSendSysMessage(LANG_YOURS_SPELLFLATID_CHANGED, GetName(), spellflatid, val, mark);
|
||||||
|
|
@ -1005,6 +1057,11 @@ bool ChatHandler::HandleModifyTalentCommand (const char* args)
|
||||||
SetSentErrorMessage(true);
|
SetSentErrorMessage(true);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check online security
|
||||||
|
if (HasLowerSecurity(player, 0))
|
||||||
|
return false;
|
||||||
|
|
||||||
player->SetFreeTalentPoints(tp);
|
player->SetFreeTalentPoints(tp);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
@ -1029,6 +1086,10 @@ bool ChatHandler::HandleTaxiCheatCommand(const char* args)
|
||||||
chr=m_session->GetPlayer();
|
chr=m_session->GetPlayer();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check online security
|
||||||
|
else if (HasLowerSecurity(chr, 0))
|
||||||
|
return false;
|
||||||
|
|
||||||
if (argstr == "on")
|
if (argstr == "on")
|
||||||
{
|
{
|
||||||
chr->SetTaxiCheater(true);
|
chr->SetTaxiCheater(true);
|
||||||
|
|
@ -1076,6 +1137,10 @@ bool ChatHandler::HandleModifyASpeedCommand(const char* args)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check online security
|
||||||
|
if (HasLowerSecurity(chr, 0))
|
||||||
|
return false;
|
||||||
|
|
||||||
if(chr->isInFlight())
|
if(chr->isInFlight())
|
||||||
{
|
{
|
||||||
PSendSysMessage(LANG_CHAR_IN_FLIGHT,chr->GetName());
|
PSendSysMessage(LANG_CHAR_IN_FLIGHT,chr->GetName());
|
||||||
|
|
@ -1118,6 +1183,10 @@ bool ChatHandler::HandleModifySpeedCommand(const char* args)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check online security
|
||||||
|
if (HasLowerSecurity(chr, 0))
|
||||||
|
return false;
|
||||||
|
|
||||||
if(chr->isInFlight())
|
if(chr->isInFlight())
|
||||||
{
|
{
|
||||||
PSendSysMessage(LANG_CHAR_IN_FLIGHT,chr->GetName());
|
PSendSysMessage(LANG_CHAR_IN_FLIGHT,chr->GetName());
|
||||||
|
|
@ -1157,6 +1226,10 @@ bool ChatHandler::HandleModifySwimCommand(const char* args)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check online security
|
||||||
|
if (HasLowerSecurity(chr, 0))
|
||||||
|
return false;
|
||||||
|
|
||||||
if(chr->isInFlight())
|
if(chr->isInFlight())
|
||||||
{
|
{
|
||||||
PSendSysMessage(LANG_CHAR_IN_FLIGHT,chr->GetName());
|
PSendSysMessage(LANG_CHAR_IN_FLIGHT,chr->GetName());
|
||||||
|
|
@ -1196,6 +1269,10 @@ bool ChatHandler::HandleModifyBWalkCommand(const char* args)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check online security
|
||||||
|
if (HasLowerSecurity(chr, 0))
|
||||||
|
return false;
|
||||||
|
|
||||||
if(chr->isInFlight())
|
if(chr->isInFlight())
|
||||||
{
|
{
|
||||||
PSendSysMessage(LANG_CHAR_IN_FLIGHT,chr->GetName());
|
PSendSysMessage(LANG_CHAR_IN_FLIGHT,chr->GetName());
|
||||||
|
|
@ -1235,6 +1312,10 @@ bool ChatHandler::HandleModifyFlyCommand(const char* args)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check online security
|
||||||
|
if (HasLowerSecurity(chr, 0))
|
||||||
|
return false;
|
||||||
|
|
||||||
PSendSysMessage(LANG_YOU_CHANGE_FLY_SPEED, FSpeed, chr->GetName());
|
PSendSysMessage(LANG_YOU_CHANGE_FLY_SPEED, FSpeed, chr->GetName());
|
||||||
if (needReportToTarget(chr))
|
if (needReportToTarget(chr))
|
||||||
ChatHandler(chr).PSendSysMessage(LANG_YOURS_FLY_SPEED_CHANGED, GetName(), FSpeed);
|
ChatHandler(chr).PSendSysMessage(LANG_YOURS_FLY_SPEED_CHANGED, GetName(), FSpeed);
|
||||||
|
|
@ -1266,6 +1347,10 @@ bool ChatHandler::HandleModifyScaleCommand(const char* args)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check online security
|
||||||
|
if (HasLowerSecurity(chr, 0))
|
||||||
|
return false;
|
||||||
|
|
||||||
PSendSysMessage(LANG_YOU_CHANGE_SIZE, Scale, chr->GetName());
|
PSendSysMessage(LANG_YOU_CHANGE_SIZE, Scale, chr->GetName());
|
||||||
if (needReportToTarget(chr))
|
if (needReportToTarget(chr))
|
||||||
ChatHandler(chr).PSendSysMessage(LANG_YOURS_SIZE_CHANGED, GetName(), Scale);
|
ChatHandler(chr).PSendSysMessage(LANG_YOURS_SIZE_CHANGED, GetName(), Scale);
|
||||||
|
|
@ -1509,6 +1594,10 @@ bool ChatHandler::HandleModifyMountCommand(const char* args)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check online security
|
||||||
|
if (HasLowerSecurity(chr, 0))
|
||||||
|
return false;
|
||||||
|
|
||||||
PSendSysMessage(LANG_YOU_GIVE_MOUNT, chr->GetName());
|
PSendSysMessage(LANG_YOU_GIVE_MOUNT, chr->GetName());
|
||||||
if (needReportToTarget(chr))
|
if (needReportToTarget(chr))
|
||||||
ChatHandler(chr).PSendSysMessage(LANG_MOUNT_GIVED, GetName());
|
ChatHandler(chr).PSendSysMessage(LANG_MOUNT_GIVED, GetName());
|
||||||
|
|
@ -1546,6 +1635,10 @@ bool ChatHandler::HandleModifyMoneyCommand(const char* args)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check online security
|
||||||
|
if (HasLowerSecurity(chr, 0))
|
||||||
|
return false;
|
||||||
|
|
||||||
int32 addmoney = atoi((char*)args);
|
int32 addmoney = atoi((char*)args);
|
||||||
|
|
||||||
uint32 moneyuser = chr->GetMoney();
|
uint32 moneyuser = chr->GetMoney();
|
||||||
|
|
@ -1598,6 +1691,10 @@ bool ChatHandler::HandleModifyBitCommand(const char* args)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check online security
|
||||||
|
if (HasLowerSecurity(chr, 0))
|
||||||
|
return false;
|
||||||
|
|
||||||
char* pField = strtok((char*)args, " ");
|
char* pField = strtok((char*)args, " ");
|
||||||
if (!pField)
|
if (!pField)
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -1650,6 +1747,10 @@ bool ChatHandler::HandleModifyHonorCommand (const char* args)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check online security
|
||||||
|
if (HasLowerSecurity(target, 0))
|
||||||
|
return false;
|
||||||
|
|
||||||
int32 amount = (uint32)atoi(args);
|
int32 amount = (uint32)atoi(args);
|
||||||
|
|
||||||
target->ModifyHonorPoints(amount);
|
target->ModifyHonorPoints(amount);
|
||||||
|
|
@ -1990,6 +2091,9 @@ bool ChatHandler::HandleNameTeleCommand(const char * args)
|
||||||
Player *chr = objmgr.GetPlayer(name.c_str());
|
Player *chr = objmgr.GetPlayer(name.c_str());
|
||||||
if (chr)
|
if (chr)
|
||||||
{
|
{
|
||||||
|
// check online security
|
||||||
|
if (HasLowerSecurity(chr, 0))
|
||||||
|
return false;
|
||||||
|
|
||||||
if(chr->IsBeingTeleported()==true)
|
if(chr->IsBeingTeleported()==true)
|
||||||
{
|
{
|
||||||
|
|
@ -2016,6 +2120,10 @@ bool ChatHandler::HandleNameTeleCommand(const char * args)
|
||||||
}
|
}
|
||||||
else if (uint64 guid = objmgr.GetPlayerGUIDByName(name.c_str()))
|
else if (uint64 guid = objmgr.GetPlayerGUIDByName(name.c_str()))
|
||||||
{
|
{
|
||||||
|
// check offline security
|
||||||
|
if (HasLowerSecurity(NULL, guid))
|
||||||
|
return false;
|
||||||
|
|
||||||
PSendSysMessage(LANG_TELEPORTING_TO, name.c_str(), GetMangosString(LANG_OFFLINE), tele->name.c_str());
|
PSendSysMessage(LANG_TELEPORTING_TO, name.c_str(), GetMangosString(LANG_OFFLINE), tele->name.c_str());
|
||||||
Player::SavePositionInDB(tele->mapId,tele->position_x,tele->position_y,tele->position_z,tele->orientation,MapManager::Instance().GetZoneId(tele->mapId,tele->position_x,tele->position_y),guid);
|
Player::SavePositionInDB(tele->mapId,tele->position_x,tele->position_y,tele->position_z,tele->orientation,MapManager::Instance().GetZoneId(tele->mapId,tele->position_x,tele->position_y),guid);
|
||||||
}
|
}
|
||||||
|
|
@ -2039,6 +2147,10 @@ bool ChatHandler::HandleGroupTeleCommand(const char * args)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check online security
|
||||||
|
if (HasLowerSecurity(player, 0))
|
||||||
|
return false;
|
||||||
|
|
||||||
// id, or string, or [name] Shift-click form |color|Htele:id|h[name]|h|r
|
// id, or string, or [name] Shift-click form |color|Htele:id|h[name]|h|r
|
||||||
GameTele const* tele = extractGameTeleFromLink((char*)args);
|
GameTele const* tele = extractGameTeleFromLink((char*)args);
|
||||||
if(!tele)
|
if(!tele)
|
||||||
|
|
@ -2063,6 +2175,10 @@ bool ChatHandler::HandleGroupTeleCommand(const char * args)
|
||||||
if(!pl || !pl->GetSession() )
|
if(!pl || !pl->GetSession() )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
// check online security
|
||||||
|
if (HasLowerSecurity(pl, 0))
|
||||||
|
return false;
|
||||||
|
|
||||||
if(pl->IsBeingTeleported())
|
if(pl->IsBeingTeleported())
|
||||||
{
|
{
|
||||||
PSendSysMessage(LANG_IS_TELEPORTED, pl->GetName());
|
PSendSysMessage(LANG_IS_TELEPORTED, pl->GetName());
|
||||||
|
|
@ -2112,6 +2228,10 @@ bool ChatHandler::HandleGroupgoCommand(const char* args)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check online security
|
||||||
|
if (HasLowerSecurity(player, 0))
|
||||||
|
return false;
|
||||||
|
|
||||||
Group *grp = player->GetGroup();
|
Group *grp = player->GetGroup();
|
||||||
|
|
||||||
if(!grp)
|
if(!grp)
|
||||||
|
|
@ -2142,6 +2262,10 @@ bool ChatHandler::HandleGroupgoCommand(const char* args)
|
||||||
if(!pl || pl==m_session->GetPlayer() || !pl->GetSession() )
|
if(!pl || pl==m_session->GetPlayer() || !pl->GetSession() )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
// check online security
|
||||||
|
if (HasLowerSecurity(pl, 0))
|
||||||
|
return false;
|
||||||
|
|
||||||
if(pl->IsBeingTeleported()==true)
|
if(pl->IsBeingTeleported()==true)
|
||||||
{
|
{
|
||||||
PSendSysMessage(LANG_IS_TELEPORTED, pl->GetName());
|
PSendSysMessage(LANG_IS_TELEPORTED, pl->GetName());
|
||||||
|
|
|
||||||
|
|
@ -668,6 +668,10 @@ bool ChatHandler::HandleModifyRepCommand(const char * args)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check online security
|
||||||
|
if (HasLowerSecurity(target, 0))
|
||||||
|
return false;
|
||||||
|
|
||||||
char* factionTxt = extractKeyFromLink((char*)args,"Hfaction");
|
char* factionTxt = extractKeyFromLink((char*)args,"Hfaction");
|
||||||
if(!factionTxt)
|
if(!factionTxt)
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -1239,6 +1243,11 @@ bool ChatHandler::HandleDeMorphCommand(const char* /*args*/)
|
||||||
if(!target)
|
if(!target)
|
||||||
target = m_session->GetPlayer();
|
target = m_session->GetPlayer();
|
||||||
|
|
||||||
|
|
||||||
|
// check online security
|
||||||
|
else if (target->GetTypeId() == TYPEID_PLAYER && HasLowerSecurity((Player*)target, 0))
|
||||||
|
return false;
|
||||||
|
|
||||||
target->DeMorph();
|
target->DeMorph();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -1632,6 +1641,10 @@ bool ChatHandler::HandleMorphCommand(const char* args)
|
||||||
if(!target)
|
if(!target)
|
||||||
target = m_session->GetPlayer();
|
target = m_session->GetPlayer();
|
||||||
|
|
||||||
|
// check online security
|
||||||
|
else if (target->GetTypeId() == TYPEID_PLAYER && HasLowerSecurity((Player*)target, 0))
|
||||||
|
return false;
|
||||||
|
|
||||||
target->SetDisplayId(display_id);
|
target->SetDisplayId(display_id);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -1700,6 +1713,10 @@ bool ChatHandler::HandleKickPlayerCommand(const char *args)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check online security
|
||||||
|
if (HasLowerSecurity(player, 0))
|
||||||
|
return false;
|
||||||
|
|
||||||
player->GetSession()->KickPlayer();
|
player->GetSession()->KickPlayer();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -1719,6 +1736,11 @@ bool ChatHandler::HandleKickPlayerCommand(const char *args)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check online security
|
||||||
|
Player* player = ObjectAccessor::Instance().FindPlayerByName(name.c_str());
|
||||||
|
if (player && HasLowerSecurity(player, 0))
|
||||||
|
return false;
|
||||||
|
|
||||||
if(sWorld.KickPlayer(name))
|
if(sWorld.KickPlayer(name))
|
||||||
{
|
{
|
||||||
PSendSysMessage(LANG_COMMAND_KICKMESSAGE,name.c_str());
|
PSendSysMessage(LANG_COMMAND_KICKMESSAGE,name.c_str());
|
||||||
|
|
@ -1789,6 +1811,10 @@ bool ChatHandler::HandlePInfoCommand(const char* args)
|
||||||
// get additional information from Player object
|
// get additional information from Player object
|
||||||
if(target)
|
if(target)
|
||||||
{
|
{
|
||||||
|
// check online security
|
||||||
|
if (HasLowerSecurity(target, 0))
|
||||||
|
return false;
|
||||||
|
|
||||||
targetGUID = target->GetGUID();
|
targetGUID = target->GetGUID();
|
||||||
name = target->GetName(); // re-read for case getSelectedPlayer() target
|
name = target->GetName(); // re-read for case getSelectedPlayer() target
|
||||||
accId = target->GetSession()->GetAccountId();
|
accId = target->GetSession()->GetAccountId();
|
||||||
|
|
@ -1800,6 +1826,10 @@ bool ChatHandler::HandlePInfoCommand(const char* args)
|
||||||
// get additional information from DB
|
// get additional information from DB
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
// check offline security
|
||||||
|
if (HasLowerSecurity(NULL, targetGUID))
|
||||||
|
return false;
|
||||||
|
|
||||||
// 0
|
// 0
|
||||||
QueryResult *result = CharacterDatabase.PQuery("SELECT totaltime FROM characters WHERE guid = '%u'", GUID_LOPART(targetGUID));
|
QueryResult *result = CharacterDatabase.PQuery("SELECT totaltime FROM characters WHERE guid = '%u'", GUID_LOPART(targetGUID));
|
||||||
if (!result)
|
if (!result)
|
||||||
|
|
@ -3343,12 +3373,20 @@ bool ChatHandler::HandleRenameCommand(const char* args)
|
||||||
|
|
||||||
if(target)
|
if(target)
|
||||||
{
|
{
|
||||||
|
// check online security
|
||||||
|
if (HasLowerSecurity(target, 0))
|
||||||
|
return false;
|
||||||
|
|
||||||
PSendSysMessage(LANG_RENAME_PLAYER, target->GetName());
|
PSendSysMessage(LANG_RENAME_PLAYER, target->GetName());
|
||||||
target->SetAtLoginFlag(AT_LOGIN_RENAME);
|
target->SetAtLoginFlag(AT_LOGIN_RENAME);
|
||||||
CharacterDatabase.PExecute("UPDATE characters SET at_login = at_login | '1' WHERE guid = '%u'", target->GetGUIDLow());
|
CharacterDatabase.PExecute("UPDATE characters SET at_login = at_login | '1' WHERE guid = '%u'", target->GetGUIDLow());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
// check offline security
|
||||||
|
if (HasLowerSecurity(NULL, targetGUID))
|
||||||
|
return false;
|
||||||
|
|
||||||
PSendSysMessage(LANG_RENAME_PLAYER_GUID, oldname.c_str(), GUID_LOPART(targetGUID));
|
PSendSysMessage(LANG_RENAME_PLAYER_GUID, oldname.c_str(), GUID_LOPART(targetGUID));
|
||||||
CharacterDatabase.PExecute("UPDATE characters SET at_login = at_login | '1' WHERE guid = '%u'", GUID_LOPART(targetGUID));
|
CharacterDatabase.PExecute("UPDATE characters SET at_login = at_login | '1' WHERE guid = '%u'", GUID_LOPART(targetGUID));
|
||||||
}
|
}
|
||||||
|
|
@ -3517,6 +3555,10 @@ bool ChatHandler::HandleAddHonorCommand(const char* args)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check online security
|
||||||
|
if (HasLowerSecurity(target, 0))
|
||||||
|
return false;
|
||||||
|
|
||||||
uint32 amount = (uint32)atoi(args);
|
uint32 amount = (uint32)atoi(args);
|
||||||
target->RewardHonor(NULL, 1, amount);
|
target->RewardHonor(NULL, 1, amount);
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -3532,6 +3574,10 @@ bool ChatHandler::HandleHonorAddKillCommand(const char* /*args*/)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check online security
|
||||||
|
if (target->GetTypeId() == TYPEID_PLAYER && HasLowerSecurity((Player*)target, 0))
|
||||||
|
return false;
|
||||||
|
|
||||||
m_session->GetPlayer()->RewardHonor(target, 1);
|
m_session->GetPlayer()->RewardHonor(target, 1);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
@ -3546,6 +3592,10 @@ bool ChatHandler::HandleUpdateHonorFieldsCommand(const char* /*args*/)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check online security
|
||||||
|
if (HasLowerSecurity(target, 0))
|
||||||
|
return false;
|
||||||
|
|
||||||
target->UpdateHonorFields();
|
target->UpdateHonorFields();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
@ -3788,6 +3838,10 @@ bool ChatHandler::HandleCombatStopCommand(const char* args)
|
||||||
player = m_session->GetPlayer();
|
player = m_session->GetPlayer();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check online security
|
||||||
|
if (HasLowerSecurity(player, 0))
|
||||||
|
return false;
|
||||||
|
|
||||||
player->CombatStop();
|
player->CombatStop();
|
||||||
player->getHostilRefManager().deleteReferences();
|
player->getHostilRefManager().deleteReferences();
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -4025,6 +4079,10 @@ bool ChatHandler::HandleRepairitemsCommand(const char* /*args*/)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check online security
|
||||||
|
if (HasLowerSecurity(target, 0))
|
||||||
|
return false;
|
||||||
|
|
||||||
// Repair items
|
// Repair items
|
||||||
target->DurabilityRepairAll(false, 0, false);
|
target->DurabilityRepairAll(false, 0, false);
|
||||||
|
|
||||||
|
|
@ -4048,6 +4106,10 @@ bool ChatHandler::HandleWaterwalkCommand(const char* args)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check online security
|
||||||
|
if (HasLowerSecurity(player, 0))
|
||||||
|
return false;
|
||||||
|
|
||||||
if (strncmp(args, "on", 3) == 0)
|
if (strncmp(args, "on", 3) == 0)
|
||||||
player->SetMovement(MOVE_WATER_WALK); // ON
|
player->SetMovement(MOVE_WATER_WALK); // ON
|
||||||
else if (strncmp(args, "off", 4) == 0)
|
else if (strncmp(args, "off", 4) == 0)
|
||||||
|
|
|
||||||
|
|
@ -796,6 +796,7 @@ void World::LoadConfigSettings(bool reload)
|
||||||
sLog.outError("GM.StartLevel (%i) must be in range 1..%u. Set to %u.", m_configs[CONFIG_START_GM_LEVEL], MAX_LEVEL, MAX_LEVEL);
|
sLog.outError("GM.StartLevel (%i) must be in range 1..%u. Set to %u.", m_configs[CONFIG_START_GM_LEVEL], MAX_LEVEL, MAX_LEVEL);
|
||||||
m_configs[CONFIG_START_GM_LEVEL] = MAX_LEVEL;
|
m_configs[CONFIG_START_GM_LEVEL] = MAX_LEVEL;
|
||||||
}
|
}
|
||||||
|
m_configs[CONFIG_GM_LOWER_SECURITY] = sConfig.GetBoolDefault("GM.LowerSecurity", false);
|
||||||
|
|
||||||
m_configs[CONFIG_GROUP_VISIBILITY] = sConfig.GetIntDefault("Visibility.GroupMode",0);
|
m_configs[CONFIG_GROUP_VISIBILITY] = sConfig.GetIntDefault("Visibility.GroupMode",0);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -129,6 +129,7 @@ enum WorldConfigs
|
||||||
CONFIG_GM_IN_WHO_LIST,
|
CONFIG_GM_IN_WHO_LIST,
|
||||||
CONFIG_GM_LOG_TRADE,
|
CONFIG_GM_LOG_TRADE,
|
||||||
CONFIG_START_GM_LEVEL,
|
CONFIG_START_GM_LEVEL,
|
||||||
|
CONFIG_GM_LOWER_SECURITY,
|
||||||
CONFIG_GROUP_VISIBILITY,
|
CONFIG_GROUP_VISIBILITY,
|
||||||
CONFIG_MAIL_DELIVERY_DELAY,
|
CONFIG_MAIL_DELIVERY_DELAY,
|
||||||
CONFIG_UPTIME_UPDATE,
|
CONFIG_UPTIME_UPDATE,
|
||||||
|
|
|
||||||
|
|
@ -870,6 +870,11 @@ Channel.SilentlyGMJoin = 0
|
||||||
# GM starting level (1-100)
|
# GM starting level (1-100)
|
||||||
# Default: 1
|
# Default: 1
|
||||||
#
|
#
|
||||||
|
# GM.LowerSecurity
|
||||||
|
# Disallow a lower security member to interact with a higher one using commands
|
||||||
|
# Default: 0 (disable)
|
||||||
|
# 1 (enable)
|
||||||
|
#
|
||||||
###################################################################################################################
|
###################################################################################################################
|
||||||
|
|
||||||
GM.LoginState = 2
|
GM.LoginState = 2
|
||||||
|
|
@ -880,6 +885,7 @@ GM.InGMList = 0
|
||||||
GM.InWhoList = 0
|
GM.InWhoList = 0
|
||||||
GM.LogTrade = 1
|
GM.LogTrade = 1
|
||||||
GM.StartLevel = 1
|
GM.StartLevel = 1
|
||||||
|
GM.LowerSecurity = 0
|
||||||
|
|
||||||
###################################################################################################################
|
###################################################################################################################
|
||||||
# VISIBILITY AND RADIUSES
|
# VISIBILITY AND RADIUSES
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "6981"
|
#define REVISION_NR "6982"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue