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 "GridNotifiersImpl.h"
|
||||
#include "CellImpl.h"
|
||||
#include "AccountMgr.h"
|
||||
|
||||
bool ChatHandler::load_command_table = true;
|
||||
|
||||
|
|
@ -625,6 +626,38 @@ bool ChatHandler::isAvailable(ChatCommand const& cmd) const
|
|||
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)
|
||||
{
|
||||
// non "" command
|
||||
|
|
|
|||
|
|
@ -77,6 +77,7 @@ class ChatHandler
|
|||
|
||||
virtual bool isAvailable(ChatCommand const& cmd) const;
|
||||
virtual bool needReportToTarget(Player* chr) const;
|
||||
bool HasLowerSecurity(Player* target, uint64 guid);
|
||||
|
||||
void SendGlobalSysMessage(const char *str);
|
||||
|
||||
|
|
|
|||
|
|
@ -111,6 +111,10 @@ bool ChatHandler::HandleNpcWhisperCommand(const char* args)
|
|||
|
||||
uint64 receiver_guid= atol(receiver_str);
|
||||
|
||||
// check online security
|
||||
if (HasLowerSecurity(objmgr.GetPlayer(receiver_guid), 0))
|
||||
return false;
|
||||
|
||||
pCreature->Whisper(text,receiver_guid);
|
||||
|
||||
return true;
|
||||
|
|
@ -342,6 +346,10 @@ bool ChatHandler::HandleNamegoCommand(const char* args)
|
|||
Player *chr = objmgr.GetPlayer(name.c_str());
|
||||
if (chr)
|
||||
{
|
||||
// check online security
|
||||
if (HasLowerSecurity(chr, 0))
|
||||
return false;
|
||||
|
||||
if(chr->IsBeingTeleported()==true)
|
||||
{
|
||||
PSendSysMessage(LANG_IS_TELEPORTED, chr->GetName());
|
||||
|
|
@ -402,6 +410,10 @@ bool ChatHandler::HandleNamegoCommand(const char* args)
|
|||
}
|
||||
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));
|
||||
|
||||
// in point where GM stay
|
||||
|
|
@ -442,6 +454,10 @@ bool ChatHandler::HandleGonameCommand(const char* args)
|
|||
Player *chr = objmgr.GetPlayer(name.c_str());
|
||||
if (chr)
|
||||
{
|
||||
// check online security
|
||||
if (HasLowerSecurity(chr, 0))
|
||||
return false;
|
||||
|
||||
Map* cMap = chr->GetMap();
|
||||
if(cMap->IsBattleGroundOrArena())
|
||||
{
|
||||
|
|
@ -535,6 +551,10 @@ bool ChatHandler::HandleGonameCommand(const char* args)
|
|||
|
||||
if (uint64 guid = objmgr.GetPlayerGUIDByName(name))
|
||||
{
|
||||
// check offline security
|
||||
if (HasLowerSecurity(NULL, guid))
|
||||
return false;
|
||||
|
||||
PSendSysMessage(LANG_APPEARING_AT, name.c_str());
|
||||
|
||||
// to point where player stay (if loaded)
|
||||
|
|
@ -574,6 +594,10 @@ bool ChatHandler::HandleRecallCommand(const char* args)
|
|||
chr = getSelectedPlayer();
|
||||
if(!chr)
|
||||
chr = m_session->GetPlayer();
|
||||
|
||||
// check online security
|
||||
else if (HasLowerSecurity(chr, 0))
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -594,6 +618,10 @@ bool ChatHandler::HandleRecallCommand(const char* args)
|
|||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
// check online security
|
||||
if (HasLowerSecurity(chr, 0))
|
||||
return false;
|
||||
}
|
||||
|
||||
if(chr->IsBeingTeleported())
|
||||
|
|
@ -632,6 +660,10 @@ bool ChatHandler::HandleModifyKnownTitlesCommand(const char* args)
|
|||
return false;
|
||||
}
|
||||
|
||||
// check online security
|
||||
if (HasLowerSecurity(chr, 0))
|
||||
return false;
|
||||
|
||||
uint64 titles2 = titles;
|
||||
|
||||
for(int i=1; i < sCharTitlesStore.GetNumRows(); ++i)
|
||||
|
|
@ -681,6 +713,10 @@ bool ChatHandler::HandleModifyHPCommand(const char* args)
|
|||
return false;
|
||||
}
|
||||
|
||||
// check online security
|
||||
if (HasLowerSecurity(chr, 0))
|
||||
return false;
|
||||
|
||||
PSendSysMessage(LANG_YOU_CHANGE_HP, chr->GetName(), hp, hpm);
|
||||
if (needReportToTarget(chr))
|
||||
ChatHandler(chr).PSendSysMessage(LANG_YOURS_HP_CHANGED, GetName(), hp, hpm);
|
||||
|
|
@ -725,6 +761,10 @@ bool ChatHandler::HandleModifyManaCommand(const char* args)
|
|||
return false;
|
||||
}
|
||||
|
||||
// check online security
|
||||
if (HasLowerSecurity(chr, 0))
|
||||
return false;
|
||||
|
||||
PSendSysMessage(LANG_YOU_CHANGE_MANA, chr->GetName(), mana, manam);
|
||||
if (needReportToTarget(chr))
|
||||
ChatHandler(chr).PSendSysMessage(LANG_YOURS_MANA_CHANGED, GetName(), mana, manam);
|
||||
|
|
@ -770,6 +810,10 @@ bool ChatHandler::HandleModifyEnergyCommand(const char* args)
|
|||
return false;
|
||||
}
|
||||
|
||||
// check online security
|
||||
if (HasLowerSecurity(chr, 0))
|
||||
return false;
|
||||
|
||||
PSendSysMessage(LANG_YOU_CHANGE_ENERGY, chr->GetName(), energy/10, energym/10);
|
||||
if (needReportToTarget(chr))
|
||||
ChatHandler(chr).PSendSysMessage(LANG_YOURS_ENERGY_CHANGED, GetName(), energy/10, energym/10);
|
||||
|
|
@ -817,6 +861,10 @@ bool ChatHandler::HandleModifyRageCommand(const char* args)
|
|||
return false;
|
||||
}
|
||||
|
||||
// check online security
|
||||
if (HasLowerSecurity(chr, 0))
|
||||
return false;
|
||||
|
||||
PSendSysMessage(LANG_YOU_CHANGE_RAGE, chr->GetName(), rage/10, ragem/10);
|
||||
if (needReportToTarget(chr))
|
||||
ChatHandler(chr).PSendSysMessage(LANG_YOURS_RAGE_CHANGED, GetName(), rage/10, ragem/10);
|
||||
|
|
@ -975,6 +1023,10 @@ bool ChatHandler::HandleModifySpellCommand(const char* args)
|
|||
return false;
|
||||
}
|
||||
|
||||
// check online security
|
||||
if (HasLowerSecurity(chr, 0))
|
||||
return false;
|
||||
|
||||
PSendSysMessage(LANG_YOU_CHANGE_SPELLFLATID, spellflatid, val, mark, chr->GetName());
|
||||
if (needReportToTarget(chr))
|
||||
ChatHandler(chr).PSendSysMessage(LANG_YOURS_SPELLFLATID_CHANGED, GetName(), spellflatid, val, mark);
|
||||
|
|
@ -1005,6 +1057,11 @@ bool ChatHandler::HandleModifyTalentCommand (const char* args)
|
|||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
// check online security
|
||||
if (HasLowerSecurity(player, 0))
|
||||
return false;
|
||||
|
||||
player->SetFreeTalentPoints(tp);
|
||||
return true;
|
||||
}
|
||||
|
|
@ -1029,6 +1086,10 @@ bool ChatHandler::HandleTaxiCheatCommand(const char* args)
|
|||
chr=m_session->GetPlayer();
|
||||
}
|
||||
|
||||
// check online security
|
||||
else if (HasLowerSecurity(chr, 0))
|
||||
return false;
|
||||
|
||||
if (argstr == "on")
|
||||
{
|
||||
chr->SetTaxiCheater(true);
|
||||
|
|
@ -1076,6 +1137,10 @@ bool ChatHandler::HandleModifyASpeedCommand(const char* args)
|
|||
return false;
|
||||
}
|
||||
|
||||
// check online security
|
||||
if (HasLowerSecurity(chr, 0))
|
||||
return false;
|
||||
|
||||
if(chr->isInFlight())
|
||||
{
|
||||
PSendSysMessage(LANG_CHAR_IN_FLIGHT,chr->GetName());
|
||||
|
|
@ -1118,6 +1183,10 @@ bool ChatHandler::HandleModifySpeedCommand(const char* args)
|
|||
return false;
|
||||
}
|
||||
|
||||
// check online security
|
||||
if (HasLowerSecurity(chr, 0))
|
||||
return false;
|
||||
|
||||
if(chr->isInFlight())
|
||||
{
|
||||
PSendSysMessage(LANG_CHAR_IN_FLIGHT,chr->GetName());
|
||||
|
|
@ -1157,6 +1226,10 @@ bool ChatHandler::HandleModifySwimCommand(const char* args)
|
|||
return false;
|
||||
}
|
||||
|
||||
// check online security
|
||||
if (HasLowerSecurity(chr, 0))
|
||||
return false;
|
||||
|
||||
if(chr->isInFlight())
|
||||
{
|
||||
PSendSysMessage(LANG_CHAR_IN_FLIGHT,chr->GetName());
|
||||
|
|
@ -1196,6 +1269,10 @@ bool ChatHandler::HandleModifyBWalkCommand(const char* args)
|
|||
return false;
|
||||
}
|
||||
|
||||
// check online security
|
||||
if (HasLowerSecurity(chr, 0))
|
||||
return false;
|
||||
|
||||
if(chr->isInFlight())
|
||||
{
|
||||
PSendSysMessage(LANG_CHAR_IN_FLIGHT,chr->GetName());
|
||||
|
|
@ -1235,6 +1312,10 @@ bool ChatHandler::HandleModifyFlyCommand(const char* args)
|
|||
return false;
|
||||
}
|
||||
|
||||
// check online security
|
||||
if (HasLowerSecurity(chr, 0))
|
||||
return false;
|
||||
|
||||
PSendSysMessage(LANG_YOU_CHANGE_FLY_SPEED, FSpeed, chr->GetName());
|
||||
if (needReportToTarget(chr))
|
||||
ChatHandler(chr).PSendSysMessage(LANG_YOURS_FLY_SPEED_CHANGED, GetName(), FSpeed);
|
||||
|
|
@ -1266,6 +1347,10 @@ bool ChatHandler::HandleModifyScaleCommand(const char* args)
|
|||
return false;
|
||||
}
|
||||
|
||||
// check online security
|
||||
if (HasLowerSecurity(chr, 0))
|
||||
return false;
|
||||
|
||||
PSendSysMessage(LANG_YOU_CHANGE_SIZE, Scale, chr->GetName());
|
||||
if (needReportToTarget(chr))
|
||||
ChatHandler(chr).PSendSysMessage(LANG_YOURS_SIZE_CHANGED, GetName(), Scale);
|
||||
|
|
@ -1509,6 +1594,10 @@ bool ChatHandler::HandleModifyMountCommand(const char* args)
|
|||
return false;
|
||||
}
|
||||
|
||||
// check online security
|
||||
if (HasLowerSecurity(chr, 0))
|
||||
return false;
|
||||
|
||||
PSendSysMessage(LANG_YOU_GIVE_MOUNT, chr->GetName());
|
||||
if (needReportToTarget(chr))
|
||||
ChatHandler(chr).PSendSysMessage(LANG_MOUNT_GIVED, GetName());
|
||||
|
|
@ -1546,6 +1635,10 @@ bool ChatHandler::HandleModifyMoneyCommand(const char* args)
|
|||
return false;
|
||||
}
|
||||
|
||||
// check online security
|
||||
if (HasLowerSecurity(chr, 0))
|
||||
return false;
|
||||
|
||||
int32 addmoney = atoi((char*)args);
|
||||
|
||||
uint32 moneyuser = chr->GetMoney();
|
||||
|
|
@ -1598,6 +1691,10 @@ bool ChatHandler::HandleModifyBitCommand(const char* args)
|
|||
return false;
|
||||
}
|
||||
|
||||
// check online security
|
||||
if (HasLowerSecurity(chr, 0))
|
||||
return false;
|
||||
|
||||
char* pField = strtok((char*)args, " ");
|
||||
if (!pField)
|
||||
return false;
|
||||
|
|
@ -1650,6 +1747,10 @@ bool ChatHandler::HandleModifyHonorCommand (const char* args)
|
|||
return false;
|
||||
}
|
||||
|
||||
// check online security
|
||||
if (HasLowerSecurity(target, 0))
|
||||
return false;
|
||||
|
||||
int32 amount = (uint32)atoi(args);
|
||||
|
||||
target->ModifyHonorPoints(amount);
|
||||
|
|
@ -1990,6 +2091,9 @@ bool ChatHandler::HandleNameTeleCommand(const char * args)
|
|||
Player *chr = objmgr.GetPlayer(name.c_str());
|
||||
if (chr)
|
||||
{
|
||||
// check online security
|
||||
if (HasLowerSecurity(chr, 0))
|
||||
return false;
|
||||
|
||||
if(chr->IsBeingTeleported()==true)
|
||||
{
|
||||
|
|
@ -2016,6 +2120,10 @@ bool ChatHandler::HandleNameTeleCommand(const char * args)
|
|||
}
|
||||
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());
|
||||
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;
|
||||
}
|
||||
|
||||
// check online security
|
||||
if (HasLowerSecurity(player, 0))
|
||||
return false;
|
||||
|
||||
// id, or string, or [name] Shift-click form |color|Htele:id|h[name]|h|r
|
||||
GameTele const* tele = extractGameTeleFromLink((char*)args);
|
||||
if(!tele)
|
||||
|
|
@ -2063,6 +2175,10 @@ bool ChatHandler::HandleGroupTeleCommand(const char * args)
|
|||
if(!pl || !pl->GetSession() )
|
||||
continue;
|
||||
|
||||
// check online security
|
||||
if (HasLowerSecurity(pl, 0))
|
||||
return false;
|
||||
|
||||
if(pl->IsBeingTeleported())
|
||||
{
|
||||
PSendSysMessage(LANG_IS_TELEPORTED, pl->GetName());
|
||||
|
|
@ -2112,6 +2228,10 @@ bool ChatHandler::HandleGroupgoCommand(const char* args)
|
|||
return false;
|
||||
}
|
||||
|
||||
// check online security
|
||||
if (HasLowerSecurity(player, 0))
|
||||
return false;
|
||||
|
||||
Group *grp = player->GetGroup();
|
||||
|
||||
if(!grp)
|
||||
|
|
@ -2142,6 +2262,10 @@ bool ChatHandler::HandleGroupgoCommand(const char* args)
|
|||
if(!pl || pl==m_session->GetPlayer() || !pl->GetSession() )
|
||||
continue;
|
||||
|
||||
// check online security
|
||||
if (HasLowerSecurity(pl, 0))
|
||||
return false;
|
||||
|
||||
if(pl->IsBeingTeleported()==true)
|
||||
{
|
||||
PSendSysMessage(LANG_IS_TELEPORTED, pl->GetName());
|
||||
|
|
|
|||
|
|
@ -668,6 +668,10 @@ bool ChatHandler::HandleModifyRepCommand(const char * args)
|
|||
return false;
|
||||
}
|
||||
|
||||
// check online security
|
||||
if (HasLowerSecurity(target, 0))
|
||||
return false;
|
||||
|
||||
char* factionTxt = extractKeyFromLink((char*)args,"Hfaction");
|
||||
if(!factionTxt)
|
||||
return false;
|
||||
|
|
@ -1239,6 +1243,11 @@ bool ChatHandler::HandleDeMorphCommand(const char* /*args*/)
|
|||
if(!target)
|
||||
target = m_session->GetPlayer();
|
||||
|
||||
|
||||
// check online security
|
||||
else if (target->GetTypeId() == TYPEID_PLAYER && HasLowerSecurity((Player*)target, 0))
|
||||
return false;
|
||||
|
||||
target->DeMorph();
|
||||
|
||||
return true;
|
||||
|
|
@ -1632,6 +1641,10 @@ bool ChatHandler::HandleMorphCommand(const char* args)
|
|||
if(!target)
|
||||
target = m_session->GetPlayer();
|
||||
|
||||
// check online security
|
||||
else if (target->GetTypeId() == TYPEID_PLAYER && HasLowerSecurity((Player*)target, 0))
|
||||
return false;
|
||||
|
||||
target->SetDisplayId(display_id);
|
||||
|
||||
return true;
|
||||
|
|
@ -1700,6 +1713,10 @@ bool ChatHandler::HandleKickPlayerCommand(const char *args)
|
|||
return false;
|
||||
}
|
||||
|
||||
// check online security
|
||||
if (HasLowerSecurity(player, 0))
|
||||
return false;
|
||||
|
||||
player->GetSession()->KickPlayer();
|
||||
}
|
||||
else
|
||||
|
|
@ -1719,6 +1736,11 @@ bool ChatHandler::HandleKickPlayerCommand(const char *args)
|
|||
return false;
|
||||
}
|
||||
|
||||
// check online security
|
||||
Player* player = ObjectAccessor::Instance().FindPlayerByName(name.c_str());
|
||||
if (player && HasLowerSecurity(player, 0))
|
||||
return false;
|
||||
|
||||
if(sWorld.KickPlayer(name))
|
||||
{
|
||||
PSendSysMessage(LANG_COMMAND_KICKMESSAGE,name.c_str());
|
||||
|
|
@ -1789,6 +1811,10 @@ bool ChatHandler::HandlePInfoCommand(const char* args)
|
|||
// get additional information from Player object
|
||||
if(target)
|
||||
{
|
||||
// check online security
|
||||
if (HasLowerSecurity(target, 0))
|
||||
return false;
|
||||
|
||||
targetGUID = target->GetGUID();
|
||||
name = target->GetName(); // re-read for case getSelectedPlayer() target
|
||||
accId = target->GetSession()->GetAccountId();
|
||||
|
|
@ -1800,6 +1826,10 @@ bool ChatHandler::HandlePInfoCommand(const char* args)
|
|||
// get additional information from DB
|
||||
else
|
||||
{
|
||||
// check offline security
|
||||
if (HasLowerSecurity(NULL, targetGUID))
|
||||
return false;
|
||||
|
||||
// 0
|
||||
QueryResult *result = CharacterDatabase.PQuery("SELECT totaltime FROM characters WHERE guid = '%u'", GUID_LOPART(targetGUID));
|
||||
if (!result)
|
||||
|
|
@ -3343,12 +3373,20 @@ bool ChatHandler::HandleRenameCommand(const char* args)
|
|||
|
||||
if(target)
|
||||
{
|
||||
// check online security
|
||||
if (HasLowerSecurity(target, 0))
|
||||
return false;
|
||||
|
||||
PSendSysMessage(LANG_RENAME_PLAYER, target->GetName());
|
||||
target->SetAtLoginFlag(AT_LOGIN_RENAME);
|
||||
CharacterDatabase.PExecute("UPDATE characters SET at_login = at_login | '1' WHERE guid = '%u'", target->GetGUIDLow());
|
||||
}
|
||||
else
|
||||
{
|
||||
// check offline security
|
||||
if (HasLowerSecurity(NULL, targetGUID))
|
||||
return false;
|
||||
|
||||
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));
|
||||
}
|
||||
|
|
@ -3517,6 +3555,10 @@ bool ChatHandler::HandleAddHonorCommand(const char* args)
|
|||
return false;
|
||||
}
|
||||
|
||||
// check online security
|
||||
if (HasLowerSecurity(target, 0))
|
||||
return false;
|
||||
|
||||
uint32 amount = (uint32)atoi(args);
|
||||
target->RewardHonor(NULL, 1, amount);
|
||||
return true;
|
||||
|
|
@ -3532,6 +3574,10 @@ bool ChatHandler::HandleHonorAddKillCommand(const char* /*args*/)
|
|||
return false;
|
||||
}
|
||||
|
||||
// check online security
|
||||
if (target->GetTypeId() == TYPEID_PLAYER && HasLowerSecurity((Player*)target, 0))
|
||||
return false;
|
||||
|
||||
m_session->GetPlayer()->RewardHonor(target, 1);
|
||||
return true;
|
||||
}
|
||||
|
|
@ -3546,6 +3592,10 @@ bool ChatHandler::HandleUpdateHonorFieldsCommand(const char* /*args*/)
|
|||
return false;
|
||||
}
|
||||
|
||||
// check online security
|
||||
if (HasLowerSecurity(target, 0))
|
||||
return false;
|
||||
|
||||
target->UpdateHonorFields();
|
||||
return true;
|
||||
}
|
||||
|
|
@ -3788,6 +3838,10 @@ bool ChatHandler::HandleCombatStopCommand(const char* args)
|
|||
player = m_session->GetPlayer();
|
||||
}
|
||||
|
||||
// check online security
|
||||
if (HasLowerSecurity(player, 0))
|
||||
return false;
|
||||
|
||||
player->CombatStop();
|
||||
player->getHostilRefManager().deleteReferences();
|
||||
return true;
|
||||
|
|
@ -4025,6 +4079,10 @@ bool ChatHandler::HandleRepairitemsCommand(const char* /*args*/)
|
|||
return false;
|
||||
}
|
||||
|
||||
// check online security
|
||||
if (HasLowerSecurity(target, 0))
|
||||
return false;
|
||||
|
||||
// Repair items
|
||||
target->DurabilityRepairAll(false, 0, false);
|
||||
|
||||
|
|
@ -4048,6 +4106,10 @@ bool ChatHandler::HandleWaterwalkCommand(const char* args)
|
|||
return false;
|
||||
}
|
||||
|
||||
// check online security
|
||||
if (HasLowerSecurity(player, 0))
|
||||
return false;
|
||||
|
||||
if (strncmp(args, "on", 3) == 0)
|
||||
player->SetMovement(MOVE_WATER_WALK); // ON
|
||||
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);
|
||||
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);
|
||||
|
||||
|
|
|
|||
|
|
@ -129,6 +129,7 @@ enum WorldConfigs
|
|||
CONFIG_GM_IN_WHO_LIST,
|
||||
CONFIG_GM_LOG_TRADE,
|
||||
CONFIG_START_GM_LEVEL,
|
||||
CONFIG_GM_LOWER_SECURITY,
|
||||
CONFIG_GROUP_VISIBILITY,
|
||||
CONFIG_MAIL_DELIVERY_DELAY,
|
||||
CONFIG_UPTIME_UPDATE,
|
||||
|
|
|
|||
|
|
@ -870,6 +870,11 @@ Channel.SilentlyGMJoin = 0
|
|||
# GM starting level (1-100)
|
||||
# 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
|
||||
|
|
@ -880,6 +885,7 @@ GM.InGMList = 0
|
|||
GM.InWhoList = 0
|
||||
GM.LogTrade = 1
|
||||
GM.StartLevel = 1
|
||||
GM.LowerSecurity = 0
|
||||
|
||||
###################################################################################################################
|
||||
# VISIBILITY AND RADIUSES
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "6981"
|
||||
#define REVISION_NR "6982"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue