mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-31 00:46:46 +00:00
[Commands] Assign #opcode to a #reload alias (#3401)
* [Commands] Assign #opcode to a #reload alias # Notes - Can use `#reload opcodes * Add ServerOP_ReloadOpcodes
This commit is contained in:
@@ -1,9 +0,0 @@
|
||||
#include "../client.h"
|
||||
#include "../../common/patches/patches.h"
|
||||
|
||||
void command_opcode(Client *c, const Seperator *sep)
|
||||
{
|
||||
ReloadAllPatches();
|
||||
c->Message(Chat::White, "Opcodes for all patches have been reloaded");
|
||||
}
|
||||
|
||||
+57
-81
@@ -1,16 +1,18 @@
|
||||
#include "../client.h"
|
||||
#include "../../common/patches/patches.h"
|
||||
|
||||
void command_reload(Client *c, const Seperator *sep)
|
||||
{
|
||||
std::string command = sep->arg[0] ? sep->arg[0] : "";
|
||||
int arguments = sep->argnum;
|
||||
const auto arguments = sep->argnum;
|
||||
if (!arguments && Strings::Contains(command, "#reload")) {
|
||||
c->SendReloadCommandMessages();
|
||||
return;
|
||||
}
|
||||
|
||||
bool is_rq_alias = sep->arg[0] && Strings::Contains(command, "#rq");
|
||||
bool is_logs_reload_alias = sep->arg[0] && Strings::Contains(command, "#rl");
|
||||
bool is_opcodes_reload_alias = sep->arg[0] && Strings::Contains(command, "#opcode");
|
||||
bool is_rq_alias = sep->arg[0] && Strings::Contains(command, "#rq");
|
||||
bool is_aa = !strcasecmp(sep->arg[1], "aa");
|
||||
bool is_alternate_currencies = !strcasecmp(sep->arg[1], "alternate_currencies");
|
||||
bool is_blocked_spells = !strcasecmp(sep->arg[1], "blocked_spells");
|
||||
@@ -24,6 +26,7 @@ void command_reload(Client *c, const Seperator *sep)
|
||||
bool is_merchants = !strcasecmp(sep->arg[1], "merchants");
|
||||
bool is_npc_emotes = !strcasecmp(sep->arg[1], "npc_emotes");
|
||||
bool is_objects = !strcasecmp(sep->arg[1], "objects");
|
||||
bool is_opcodes = !strcasecmp(sep->arg[1], "opcodes") || is_opcodes_reload_alias;
|
||||
bool is_perl_export = !strcasecmp(sep->arg[1], "perl_export");
|
||||
bool is_quest = !strcasecmp(sep->arg[1], "quest") || (is_rq_alias);
|
||||
bool is_rules = !strcasecmp(sep->arg[1], "rules");
|
||||
@@ -51,6 +54,7 @@ void command_reload(Client *c, const Seperator *sep)
|
||||
!is_merchants &&
|
||||
!is_npc_emotes &&
|
||||
!is_objects &&
|
||||
!is_opcodes &&
|
||||
!is_perl_export &&
|
||||
!is_quest &&
|
||||
!is_rules &&
|
||||
@@ -63,7 +67,7 @@ void command_reload(Client *c, const Seperator *sep)
|
||||
!is_world &&
|
||||
!is_zone &&
|
||||
!is_zone_points
|
||||
) {
|
||||
) {
|
||||
c->SendReloadCommandMessages();
|
||||
return;
|
||||
}
|
||||
@@ -73,36 +77,28 @@ void command_reload(Client *c, const Seperator *sep)
|
||||
if (is_aa) {
|
||||
c->Message(Chat::White, "Attempting to reload Alternate Advancement Data globally.");
|
||||
pack = new ServerPacket(ServerOP_ReloadAAData, 0);
|
||||
}
|
||||
else if (is_alternate_currencies) {
|
||||
} else if (is_alternate_currencies) {
|
||||
c->Message(Chat::White, "Attempting to reload Alternate Currencies globally.");
|
||||
pack = new ServerPacket(ServerOP_ReloadAlternateCurrencies, 0);
|
||||
}
|
||||
else if (is_blocked_spells) {
|
||||
} else if (is_blocked_spells) {
|
||||
c->Message(Chat::White, "Attempting to reload Blocked Spells globally.");
|
||||
pack = new ServerPacket(ServerOP_ReloadBlockedSpells, 0);
|
||||
}
|
||||
else if (is_commands) {
|
||||
} else if (is_commands) {
|
||||
c->Message(Chat::White, "Attempting to reload Commands globally.");
|
||||
pack = new ServerPacket(ServerOP_ReloadCommands, 0);
|
||||
}
|
||||
else if (is_content_flags) {
|
||||
} else if (is_content_flags) {
|
||||
c->Message(Chat::White, "Attempting to reload Content Flags globally.");
|
||||
pack = new ServerPacket(ServerOP_ReloadContentFlags, 0);
|
||||
}
|
||||
else if (is_doors) {
|
||||
} else if (is_doors) {
|
||||
c->Message(Chat::White, "Attempting to reload Doors globally.");
|
||||
pack = new ServerPacket(ServerOP_ReloadDoors, 0);
|
||||
}
|
||||
else if (is_dztemplates) {
|
||||
} else if (is_dztemplates) {
|
||||
c->Message(Chat::White, "Attempting to reload Dynamic Zone Templates globally.");
|
||||
pack = new ServerPacket(ServerOP_ReloadDzTemplates, 0);
|
||||
}
|
||||
else if (is_ground_spawns) {
|
||||
} else if (is_ground_spawns) {
|
||||
c->Message(Chat::White, "Attempting to reload Ground Spawns globally.");
|
||||
pack = new ServerPacket(ServerOP_ReloadGroundSpawns, 0);
|
||||
}
|
||||
else if (is_level_mods) {
|
||||
} else if (is_level_mods) {
|
||||
if (!RuleB(Zone, LevelBasedEXPMods)) {
|
||||
c->Message(Chat::White, "Level Based Experience Modifiers are disabled.");
|
||||
return;
|
||||
@@ -110,75 +106,60 @@ void command_reload(Client *c, const Seperator *sep)
|
||||
|
||||
c->Message(Chat::White, "Attempting to reload Level Based Experience Modifiers globally.");
|
||||
pack = new ServerPacket(ServerOP_ReloadLevelEXPMods, 0);
|
||||
}
|
||||
else if (is_logs) {
|
||||
} else if (is_logs) {
|
||||
c->Message(Chat::White, "Attempting to reload Log Settings globally.");
|
||||
pack = new ServerPacket(ServerOP_ReloadLogs, 0);
|
||||
}
|
||||
else if (is_merchants) {
|
||||
} else if (is_merchants) {
|
||||
c->Message(Chat::White, "Attempting to reload Merchants globally.");
|
||||
pack = new ServerPacket(ServerOP_ReloadMerchants, 0);
|
||||
}
|
||||
else if (is_npc_emotes) {
|
||||
} else if (is_npc_emotes) {
|
||||
c->Message(Chat::White, "Attempting to reload NPC Emotes globally.");
|
||||
pack = new ServerPacket(ServerOP_ReloadNPCEmotes, 0);
|
||||
}
|
||||
else if (is_objects) {
|
||||
} else if (is_objects) {
|
||||
c->Message(Chat::White, "Attempting to reload Objects globally.");
|
||||
pack = new ServerPacket(ServerOP_ReloadObjects, 0);
|
||||
}
|
||||
else if (is_perl_export) {
|
||||
} else if (is_opcodes) {
|
||||
c->Message(Chat::White, "Attempting to reload Opcodes globally.");
|
||||
pack = new ServerPacket(ServerOP_ReloadOpcodes, 0);
|
||||
} else if (is_perl_export) {
|
||||
c->Message(Chat::White, "Attempting to reload Perl Event Export Settings globally.");
|
||||
pack = new ServerPacket(ServerOP_ReloadPerlExportSettings, 0);
|
||||
}
|
||||
else if (is_quest) {
|
||||
bool stop_timers = false;
|
||||
|
||||
if (sep->IsNumber(2)) {
|
||||
stop_timers = Strings::ToInt(sep->arg[2]) != 0 ? true : false;
|
||||
}
|
||||
|
||||
std::string stop_timers_message = stop_timers ? " and timers stopped" : "";
|
||||
} else if (is_quest) {
|
||||
const auto stop_timers = sep->IsNumber(2) ? Strings::ToBool(sep->arg[2]) : false;
|
||||
|
||||
c->Message(
|
||||
Chat::Yellow,
|
||||
fmt::format(
|
||||
"Quests reloaded{} for {}.",
|
||||
stop_timers_message,
|
||||
stop_timers ? " and timers stopped" : "",
|
||||
zone->GetZoneDescription()
|
||||
).c_str()
|
||||
);
|
||||
|
||||
entity_list.ClearAreas();
|
||||
parse->ReloadQuests(stop_timers);
|
||||
}
|
||||
else if (is_rules) {
|
||||
} else if (is_rules) {
|
||||
c->Message(Chat::White, "Attempting to reload Rules globally.");
|
||||
pack = new ServerPacket(ServerOP_ReloadRules, 0);
|
||||
}
|
||||
else if (is_static) {
|
||||
} else if (is_static) {
|
||||
c->Message(Chat::White, "Attempting to reload Static Zone Data globally.");
|
||||
pack = new ServerPacket(ServerOP_ReloadStaticZoneData, 0);
|
||||
}
|
||||
else if (is_tasks) {
|
||||
} else if (is_tasks) {
|
||||
uint32 task_id = 0;
|
||||
if (!sep->IsNumber(2)) {
|
||||
c->Message(Chat::White, "Attempting to reload Tasks globally.");
|
||||
pack = new ServerPacket(ServerOP_ReloadTasks, sizeof(ReloadTasks_Struct));
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
task_id = Strings::ToUnsignedInt(sep->arg[2]);
|
||||
}
|
||||
|
||||
auto rts = (ReloadTasks_Struct *) pack->pBuffer;
|
||||
rts->reload_type = RELOADTASKS;
|
||||
rts->task_id = task_id;
|
||||
}
|
||||
else if (is_titles) {
|
||||
} else if (is_titles) {
|
||||
c->Message(Chat::White, "Attempting to reload Titles globally.");
|
||||
pack = new ServerPacket(ServerOP_ReloadTitles, 0);
|
||||
}
|
||||
else if (is_traps) {
|
||||
} else if (is_traps) {
|
||||
if (arguments < 2 || !sep->IsNumber(2)) {
|
||||
entity_list.UpdateAllTraps(true, true);
|
||||
c->Message(
|
||||
@@ -191,7 +172,7 @@ void command_reload(Client *c, const Seperator *sep)
|
||||
return;
|
||||
}
|
||||
|
||||
bool global = Strings::ToInt(sep->arg[2]) ? true : false;
|
||||
const auto global = Strings::ToBool(sep->arg[2]);
|
||||
|
||||
if (!global) {
|
||||
entity_list.UpdateAllTraps(true, true);
|
||||
@@ -207,16 +188,13 @@ void command_reload(Client *c, const Seperator *sep)
|
||||
|
||||
c->Message(Chat::White, "Attempting to reload Traps globally.");
|
||||
pack = new ServerPacket(ServerOP_ReloadTraps, 0);
|
||||
}
|
||||
else if (is_variables) {
|
||||
} else if (is_variables) {
|
||||
c->Message(Chat::White, "Attempting to reload Variables globally.");
|
||||
pack = new ServerPacket(ServerOP_ReloadVariables, 0);
|
||||
}
|
||||
else if (is_veteran_rewards) {
|
||||
} else if (is_veteran_rewards) {
|
||||
c->Message(Chat::White, "Attempting to reload Veteran Rewards globally.");
|
||||
pack = new ServerPacket(ServerOP_ReloadVeteranRewards, 0);
|
||||
}
|
||||
else if (is_world) {
|
||||
} else if (is_world) {
|
||||
uint8 global_repop = ReloadWorld::NoRepop;
|
||||
|
||||
if (sep->IsNumber(2)) {
|
||||
@@ -233,12 +211,12 @@ void command_reload(Client *c, const Seperator *sep)
|
||||
"Attempting to reload Quests {}worldwide.",
|
||||
(
|
||||
global_repop ?
|
||||
(
|
||||
global_repop == ReloadWorld::Repop ?
|
||||
"and repop NPCs " :
|
||||
"and forcefully repop NPCs "
|
||||
) :
|
||||
""
|
||||
(
|
||||
global_repop == ReloadWorld::Repop ?
|
||||
"and repop NPCs " :
|
||||
"and forcefully repop NPCs "
|
||||
) :
|
||||
""
|
||||
)
|
||||
).c_str()
|
||||
);
|
||||
@@ -246,8 +224,7 @@ void command_reload(Client *c, const Seperator *sep)
|
||||
pack = new ServerPacket(ServerOP_ReloadWorld, sizeof(ReloadWorld_Struct));
|
||||
auto RW = (ReloadWorld_Struct *) pack->pBuffer;
|
||||
RW->global_repop = global_repop;
|
||||
}
|
||||
else if (is_zone) {
|
||||
} else if (is_zone) {
|
||||
zone_store.LoadZones(content_db);
|
||||
|
||||
if (arguments < 2) {
|
||||
@@ -257,8 +234,8 @@ void command_reload(Client *c, const Seperator *sep)
|
||||
"Zone Header Load {} | Zone: {}",
|
||||
(
|
||||
zone->LoadZoneCFG(zone->GetShortName(), zone->GetInstanceVersion()) ?
|
||||
"Succeeded" :
|
||||
"Failed"
|
||||
"Succeeded" :
|
||||
"Failed"
|
||||
),
|
||||
zone->GetZoneDescription()
|
||||
).c_str()
|
||||
@@ -268,8 +245,8 @@ void command_reload(Client *c, const Seperator *sep)
|
||||
|
||||
auto zone_id = (
|
||||
sep->IsNumber(2) ?
|
||||
Strings::ToUnsignedInt(sep->arg[2]) :
|
||||
ZoneID(sep->arg[2])
|
||||
Strings::ToUnsignedInt(sep->arg[2]) :
|
||||
ZoneID(sep->arg[2])
|
||||
);
|
||||
if (!zone_id) {
|
||||
c->Message(
|
||||
@@ -286,8 +263,8 @@ void command_reload(Client *c, const Seperator *sep)
|
||||
auto zone_long_name = ZoneLongName(zone_id);
|
||||
auto version = (
|
||||
sep->IsNumber(3) ?
|
||||
Strings::ToUnsignedInt(sep->arg[3]) :
|
||||
0
|
||||
Strings::ToUnsignedInt(sep->arg[3]) :
|
||||
0
|
||||
);
|
||||
|
||||
auto outapp = new EQApplicationPacket(OP_NewZone, sizeof(NewZone_Struct));
|
||||
@@ -301,23 +278,22 @@ void command_reload(Client *c, const Seperator *sep)
|
||||
"Zone Header Load {} | Zone: {} ({}){}",
|
||||
(
|
||||
zone->LoadZoneCFG(zone_short_name, version) ?
|
||||
"Succeeded" :
|
||||
"Failed"
|
||||
"Succeeded" :
|
||||
"Failed"
|
||||
),
|
||||
zone_long_name,
|
||||
zone_short_name,
|
||||
(
|
||||
version ?
|
||||
fmt::format(
|
||||
" Version: {}",
|
||||
version
|
||||
) :
|
||||
""
|
||||
fmt::format(
|
||||
" Version: {}",
|
||||
version
|
||||
) :
|
||||
""
|
||||
)
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
else if (is_zone_points) {
|
||||
} else if (is_zone_points) {
|
||||
c->Message(Chat::White, "Attempting to reloading Zone Points globally.");
|
||||
pack = new ServerPacket(ServerOP_ReloadZonePoints, 0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user