[Commands] #reload Command Overhaul. (#2162)

* [Commands] #reload Command Overhaul.
- Consolidated #reloadaa, #reloadallrules, #reloadcontentflags, #reloademote, #reloadlevelmods, #reloadmerchants, #reloadperlexportsettings, #reloadqst, #reloadstatic, #reloadtitles, #relaodtraps, #reloadworld, and #reloadzps in to one command.
- #reload has 15 different sub commands you may use, including Log Settings and Tasks reloading.
- All the reload commands are a part of the Developer Tools Menu messages now, as well as part of the documentation.
- Fixes the commands that weren't actually sending their packet to zone server to globally reload stuff.
- Added Variables table reloading to command.

* Consistency.

* Hot reload.

* Final big push.
This commit is contained in:
Kinglykrab 2022-05-10 06:19:07 -04:00 committed by GitHub
parent 209b0eb273
commit d120cf8a40
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
29 changed files with 1083 additions and 525 deletions

View File

@ -83,17 +83,15 @@
#define ServerOP_UpdateSpawn 0x003f
#define ServerOP_SpawnStatusChange 0x0040
#define ServerOP_DropClient 0x0041 // DropClient
#define ServerOP_ReloadTasks 0x0060
#define ServerOP_DepopAllPlayersCorpses 0x0061
#define ServerOP_ReloadTitles 0x0062
#define ServerOP_QGlobalUpdate 0x0063
#define ServerOP_QGlobalDelete 0x0064
#define ServerOP_DepopPlayerCorpse 0x0065
#define ServerOP_RequestTellQueue 0x0066 // client asks for it's tell queues
#define ServerOP_ChangeSharedMem 0x0067
#define ServerOP_WebInterfaceEvent 0x0068
#define ServerOP_WebInterfaceSubscribe 0x0069
#define ServerOP_WebInterfaceUnsubscribe 0x0070
#define ServerOP_DepopAllPlayersCorpses 0x0060
#define ServerOP_QGlobalUpdate 0x0061
#define ServerOP_QGlobalDelete 0x0062
#define ServerOP_DepopPlayerCorpse 0x0063
#define ServerOP_RequestTellQueue 0x0064 // client asks for it's tell queues
#define ServerOP_ChangeSharedMem 0x0065
#define ServerOP_WebInterfaceEvent 0x0066
#define ServerOP_WebInterfaceSubscribe 0x0067
#define ServerOP_WebInterfaceUnsubscribe 0x0068
#define ServerOP_RaidAdd 0x0100 //in use
#define ServerOP_RaidRemove 0x0101 //in use
@ -213,27 +211,36 @@
#define ServerOP_LauncherZoneStatus 0x3002
#define ServerOP_DoZoneCommand 0x3003
#define ServerOP_UCSMessage 0x4000
#define ServerOP_UCSMailMessage 0x4001
#define ServerOP_ReloadRules 0x4002
#define ServerOP_ReloadRulesWorld 0x4003
#define ServerOP_CameraShake 0x4004
#define ServerOP_QueryServGeneric 0x4005
#define ServerOP_ReloadWorld 0x4006
#define ServerOP_ReloadLogs 0x4007
#define ServerOP_ReloadPerlExportSettings 0x4008
#define ServerOP_UCSServerStatusRequest 0x4009
#define ServerOP_UCSServerStatusReply 0x4010
#define ServerOP_HotReloadQuests 0x4011
#define ServerOP_UpdateSchedulerEvents 0x4012
#define ServerOP_ReloadContentFlags 0x4013
#define ServerOP_ReloadVariablesWorld 0x4014
#define ServerOP_ReloadLevelEXPMods 0x4015
#define ServerOP_ReloadMerchants 0x4016
#define ServerOP_ReloadAAData 0x4017
#define ServerOP_ReloadTraps 0x4018
#define ServerOP_ReloadZonePoints 0x4019
#define ServerOP_ReloadStaticZoneData 0x4020
#define ServerOP_CameraShake 0x4000
#define ServerOP_HotReloadQuests 0x4001
#define ServerOP_QueryServGeneric 0x4002
#define ServerOP_UCSMailMessage 0x4003
#define ServerOP_UCSMessage 0x4004
#define ServerOP_UCSServerStatusReply 0x4005
#define ServerOP_UCSServerStatusRequest 0x4006
#define ServerOP_UpdateSchedulerEvents 0x4007
#define ServerOP_ReloadAAData 0x4100
#define ServerOP_ReloadAlternateCurrencies 0x4101
#define ServerOP_ReloadBlockedSpells 0x4102
#define ServerOP_ReloadContentFlags 0x4103
#define ServerOP_ReloadDoors 0x4104
#define ServerOP_ReloadGroundSpawns 0x4105
#define ServerOP_ReloadLevelEXPMods 0x4106
#define ServerOP_ReloadLogs 0x4107
#define ServerOP_ReloadMerchants 0x4108
#define ServerOP_ReloadNPCEmotes 0x4109
#define ServerOP_ReloadObjects 0x4110
#define ServerOP_ReloadPerlExportSettings 0x4111
#define ServerOP_ReloadRules 0x4112
#define ServerOP_ReloadStaticZoneData 0x4113
#define ServerOP_ReloadTasks 0x4114
#define ServerOP_ReloadTitles 0x4115
#define ServerOP_ReloadTraps 0x4116
#define ServerOP_ReloadVariables 0x4117
#define ServerOP_ReloadVeteranRewards 0x4118
#define ServerOP_ReloadWorld 0x4119
#define ServerOP_ReloadZonePoints 0x4120
#define ServerOP_CZDialogueWindow 0x4500
#define ServerOP_CZLDoNUpdate 0x4501
@ -1012,8 +1019,8 @@ struct ServerOP_Consent_Struct {
};
struct ReloadTasks_Struct {
uint32 Command;
uint32 Parameter;
uint8 reload_type;
uint32 task_id;
};
struct ServerDepopAllPlayersCorpses_Struct

View File

@ -876,29 +876,6 @@ void ZoneServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p) {
client_list.SendClientVersionSummary(srcvss->Name);
break;
}
case ServerOP_ReloadLogs: {
zoneserver_list.SendPacket(pack);
LogSys.LoadLogDatabaseSettings();
break;
}
case ServerOP_ReloadRules: {
zoneserver_list.SendPacket(pack);
RuleManager::Instance()->LoadRules(&database, "default", true);
break;
}
case ServerOP_ReloadContentFlags: {
zoneserver_list.SendPacket(pack);
content_service.SetExpansionContext()->ReloadContentFlags();
break;
}
case ServerOP_ReloadRulesWorld: {
RuleManager::Instance()->LoadRules(&database, "default", true);
break;
}
case ServerOP_ReloadVariablesWorld: {
database.LoadVariables();
break;
}
case ServerOP_FriendsWho: {
auto sfw = (ServerFriendsWho_Struct*) pack->pBuffer;
client_list.SendFriendsWho(sfw, this);
@ -1327,11 +1304,21 @@ void ZoneServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p) {
case ServerOP_RaidSay:
case ServerOP_RefreshCensorship:
case ServerOP_ReloadAAData:
case ServerOP_ReloadAlternateCurrencies:
case ServerOP_ReloadBlockedSpells:
case ServerOP_ReloadDoors:
case ServerOP_ReloadGroundSpawns:
case ServerOP_ReloadLevelEXPMods:
case ServerOP_ReloadMerchants:
case ServerOP_ReloadNPCEmotes:
case ServerOP_ReloadObjects:
case ServerOP_ReloadPerlExportSettings:
case ServerOP_ReloadRules:
case ServerOP_ReloadStaticZoneData:
case ServerOP_ReloadTitles:
case ServerOP_ReloadTraps:
case ServerOP_ReloadVariables:
case ServerOP_ReloadVeteranRewards:
case ServerOP_ReloadWorld:
case ServerOP_ReloadZonePoints:
case ServerOP_RezzPlayerAccept:
@ -1350,6 +1337,16 @@ void ZoneServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p) {
zoneserver_list.SendPacket(pack);
break;
}
case ServerOP_ReloadContentFlags: {
zoneserver_list.SendPacket(pack);
content_service.SetExpansionContext()->ReloadContentFlags();
break;
}
case ServerOP_ReloadLogs: {
zoneserver_list.SendPacket(pack);
LogSys.LoadLogDatabaseSettings();
break;
}
case ServerOP_ReloadTasks: {
shared_task_manager.LoadTaskData();
zoneserver_list.SendPacket(pack);

View File

@ -9514,63 +9514,202 @@ void Client::CheckVirtualZoneLines()
void Client::ShowDevToolsMenu()
{
std::string menu_commands_search;
std::string menu_commands_show;
std::string reload_commands_show;
std::string devtools_toggle;
std::string menu_search;
std::string menu_show;
std::string menu_reload_one;
std::string menu_reload_two;
std::string menu_reload_three;
std::string menu_reload_four;
std::string menu_reload_five;
std::string menu_reload_six;
std::string menu_reload_seven;
std::string menu_reload_eight;
std::string menu_toggle;
/**
* Search entity commands
*/
menu_commands_search += "[" + EQ::SayLinkEngine::GenerateQuestSaylink("#list npcs", false, "NPC") + "] ";
menu_commands_search += "[" + EQ::SayLinkEngine::GenerateQuestSaylink("#list players", false, "Players") + "] ";
menu_commands_search += "[" + EQ::SayLinkEngine::GenerateQuestSaylink("#list corpses", false, "Corpses") + "] ";
menu_commands_search += "[" + EQ::SayLinkEngine::GenerateQuestSaylink("#list doors", false, "Doors") + "] ";
menu_commands_search += "[" + EQ::SayLinkEngine::GenerateQuestSaylink("#list objects", false, "Objects") + "] ";
menu_commands_search += "[" + EQ::SayLinkEngine::GenerateQuestSaylink("#fz", false, "Zones") + "] ";
menu_commands_search += "[" + EQ::SayLinkEngine::GenerateQuestSaylink("#fi", false, "Items") + "] ";
menu_search += EQ::SayLinkEngine::GenerateQuestSaylink("#list corpses", false, "Corpses");
menu_search += " | " + EQ::SayLinkEngine::GenerateQuestSaylink("#list doors", false, "Doors");
menu_search += " | " + EQ::SayLinkEngine::GenerateQuestSaylink("#finditem", false, "Items");
menu_search += " | " + EQ::SayLinkEngine::GenerateQuestSaylink("#list npcs", false, "NPC");
menu_search += " | " + EQ::SayLinkEngine::GenerateQuestSaylink("#list objects", false, "Objects");
menu_search += " | " + EQ::SayLinkEngine::GenerateQuestSaylink("#list players", false, "Players");
menu_search += " | " + EQ::SayLinkEngine::GenerateQuestSaylink("#findzone", false, "Zones");
/**
* Show
*/
menu_commands_show += "[" + EQ::SayLinkEngine::GenerateQuestSaylink("#showzonepoints", false, "Zone Points") + "] ";
menu_commands_show += "[" + EQ::SayLinkEngine::GenerateQuestSaylink("#showzonegloballoot", false, "Zone Global Loot") + "] ";
menu_show += EQ::SayLinkEngine::GenerateQuestSaylink("#showzonepoints", false, "Zone Points");
menu_show += " | " + EQ::SayLinkEngine::GenerateQuestSaylink("#showzonegloballoot", false, "Zone Global Loot");
/**
* Reload
*/
reload_commands_show += "[" + EQ::SayLinkEngine::GenerateQuestSaylink("#rq", false, "Quests") + "] ";
reload_commands_show += "[" + EQ::SayLinkEngine::GenerateQuestSaylink("#reloadmerchants", false, "Merchants") + "] ";
reload_commands_show += "[" + EQ::SayLinkEngine::GenerateQuestSaylink("#reloadallrules", false, "Rules Globally") + "] ";
reload_commands_show += "[" + EQ::SayLinkEngine::GenerateQuestSaylink("#reloadstatic", false, "Ground Spawns") + "] ";
reload_commands_show += "[" + EQ::SayLinkEngine::GenerateQuestSaylink("#reloadstatic", false, "Alternate Currencies") + "] ";
reload_commands_show += "[" + EQ::SayLinkEngine::GenerateQuestSaylink("#reloadstatic", false, "DB Emotes") + "] ";
reload_commands_show += "[" + EQ::SayLinkEngine::GenerateQuestSaylink("#reloadstatic", false, "Doors") + "] ";
reload_commands_show += "[" + EQ::SayLinkEngine::GenerateQuestSaylink("#reloadtraps", false, "Traps") + "] ";
reload_commands_show += "[" + EQ::SayLinkEngine::GenerateQuestSaylink("#reloadzps", false, "Zone Points") + "] ";
menu_reload_one += EQ::SayLinkEngine::GenerateQuestSaylink("#reload aa", false, "AAs");
menu_reload_one += " | " + EQ::SayLinkEngine::GenerateQuestSaylink("#reload alternate_currencies", false, "Alternate Currencies");
menu_reload_one += " | " + EQ::SayLinkEngine::GenerateQuestSaylink("#reload blocked_spells", false, "Blocked Spells");
menu_reload_one += " | " + EQ::SayLinkEngine::GenerateQuestSaylink("#reload content_flags", false, "Content Flags");
menu_reload_two += EQ::SayLinkEngine::GenerateQuestSaylink("#reload doors", false, "Doors");
menu_reload_two += " | " + EQ::SayLinkEngine::GenerateQuestSaylink("#reload ground_spawns", false, "Ground Spawns");
menu_reload_three += EQ::SayLinkEngine::GenerateQuestSaylink("#reload logs", false, "Level Based Experience Modifiers");
menu_reload_three += " | " + EQ::SayLinkEngine::GenerateQuestSaylink("#reload logs", false, "Log Settings");
menu_reload_four += EQ::SayLinkEngine::GenerateQuestSaylink("#reload merchants", false, "Merchants");
menu_reload_four += " | " + EQ::SayLinkEngine::GenerateQuestSaylink("#reload npc_emotes", false, "NPC Emotes");
menu_reload_four += " | " + EQ::SayLinkEngine::GenerateQuestSaylink("#reload objects", false, "Objects");
menu_reload_five += EQ::SayLinkEngine::GenerateQuestSaylink("#reload perl_export", false, "Perl Event Export Settings");
menu_reload_five += " | " + EQ::SayLinkEngine::GenerateQuestSaylink("#reload quest", false, "Quests");
menu_reload_six += EQ::SayLinkEngine::GenerateQuestSaylink("#reload rules", false, "Rules");
menu_reload_six += " | " + EQ::SayLinkEngine::GenerateQuestSaylink("#reload static", false, "Static Zone Data");
menu_reload_six += " | " + EQ::SayLinkEngine::GenerateQuestSaylink("#reload tasks", false, "Tasks");
menu_reload_seven += EQ::SayLinkEngine::GenerateQuestSaylink("#reload titles", false, "Titles");
menu_reload_seven += " | " + EQ::SayLinkEngine::GenerateQuestSaylink("#reload traps 1", false, "Traps");
menu_reload_seven += " | " + EQ::SayLinkEngine::GenerateQuestSaylink("#reload variables", false, "Variables");
menu_reload_seven += " | " + EQ::SayLinkEngine::GenerateQuestSaylink("#reload veteran_rewards", false, "Veteran Rewards");
menu_reload_eight += EQ::SayLinkEngine::GenerateQuestSaylink("#reload world", false, "World");
menu_reload_eight += " | " + EQ::SayLinkEngine::GenerateQuestSaylink("#reload zone", false, "Zone");
menu_reload_eight += " | " + EQ::SayLinkEngine::GenerateQuestSaylink("#reload zone_points", false, "Zone Points");
/**
* Show window status
*/
devtools_toggle = "Disabled [" + EQ::SayLinkEngine::GenerateQuestSaylink("#devtools enable", false, "Enable") + "] ";
menu_toggle = EQ::SayLinkEngine::GenerateQuestSaylink("#devtools enable", false, "Enable");
if (IsDevToolsEnabled()) {
devtools_toggle = "Enabled [" + EQ::SayLinkEngine::GenerateQuestSaylink("#devtools disable", false, "Disable") + "] ";
menu_toggle = EQ::SayLinkEngine::GenerateQuestSaylink("#devtools disable", false, "Disable");
}
/**
* Print menu
*/
SendChatLineBreak();
Message(Chat::White, "Developer Tools Menu");
Message(
Chat::White, "| [Devtools] %s Show this menu with %s | Current expansion [%s]",
devtools_toggle.c_str(),
EQ::SayLinkEngine::GenerateQuestSaylink("#dev", false, "#dev").c_str(),
content_service.GetCurrentExpansionName().c_str()
Chat::White,
fmt::format(
"Current Expansion | {}",
content_service.GetCurrentExpansionName()
).c_str()
);
Message(Chat::White, "| [Devtools] Search %s", menu_commands_search.c_str());
Message(Chat::White, "| [Devtools] Show %s", menu_commands_show.c_str());
Message(Chat::White, "| [Devtools] Reload %s", reload_commands_show.c_str());
Message(Chat::White, "| [Devtools] Search commands with #help <search>");
Message(
Chat::White,
fmt::format(
"Show Menu | {}",
EQ::SayLinkEngine::GenerateQuestSaylink("#dev", false, "#dev")
).c_str()
);
Message(
Chat::White,
fmt::format(
"Toggle | {}",
menu_toggle
).c_str()
);
Message(
Chat::White,
fmt::format(
"Search | {}",
menu_search
).c_str()
);
Message(
Chat::White,
fmt::format(
"Show | {}",
menu_show
).c_str()
);
Message(
Chat::White,
fmt::format(
"Reload | {}",
menu_reload_one
).c_str()
);
Message(
Chat::White,
fmt::format(
"Reload | {}",
menu_reload_two
).c_str()
);
Message(
Chat::White,
fmt::format(
"Reload | {}",
menu_reload_three
).c_str()
);
Message(
Chat::White,
fmt::format(
"Reload | {}",
menu_reload_four
).c_str()
);
Message(
Chat::White,
fmt::format(
"Reload | {}",
menu_reload_five
).c_str()
);
Message(
Chat::White,
fmt::format(
"Reload | {}",
menu_reload_six
).c_str()
);
Message(
Chat::White,
fmt::format(
"Reload | {}",
menu_reload_seven
).c_str()
);
Message(
Chat::White,
fmt::format(
"Reload | {}",
menu_reload_eight
).c_str()
);
auto help_link = EQ::SayLinkEngine::GenerateQuestSaylink(
"#help",
false,
"#help"
);
Message(
Chat::White,
fmt::format(
"Note: You can search for commands with {} [Search String]",
help_link
).c_str()
);
SendChatLineBreak();
}
@ -11049,6 +11188,383 @@ void Client::ReconnectUCS()
safe_delete(outapp);
}
void Client::SendReloadCommandMessages() {
SendChatLineBreak();
auto aa_link = EQ::SayLinkEngine::GenerateQuestSaylink(
"#reload aa",
false,
"#reload aa"
);
Message(
Chat::White,
fmt::format(
"Usage: {} - Reloads Alternate Advancement Data globally",
aa_link
).c_str()
);
auto alternate_currencies_link = EQ::SayLinkEngine::GenerateQuestSaylink(
"#reload alternate_currencies",
false,
"#reload alternate_currencies"
);
Message(
Chat::White,
fmt::format(
"Usage: {} - Reloads Alternate Currencies globally",
alternate_currencies_link
).c_str()
);
auto blocked_spells_link = EQ::SayLinkEngine::GenerateQuestSaylink(
"#reload blocked_spells",
false,
"#reload blocked_spells"
);
Message(
Chat::White,
fmt::format(
"Usage: {} - Reloads Blocked Spells globally",
blocked_spells_link
).c_str()
);
auto content_flags_link = EQ::SayLinkEngine::GenerateQuestSaylink(
"#reload content_flags",
false,
"#reload content_flags"
);
Message(
Chat::White,
fmt::format(
"Usage: {} - Reloads Content Flags globally",
content_flags_link
).c_str()
);
auto doors_link = EQ::SayLinkEngine::GenerateQuestSaylink(
"#reload doors",
false,
"#reload doors"
);
Message(
Chat::White,
fmt::format(
"Usage: {} - Reloads Doors globally",
doors_link
).c_str()
);
auto ground_spawns_link = EQ::SayLinkEngine::GenerateQuestSaylink(
"#reload ground_spawns",
false,
"#reload ground_spawns"
);
Message(
Chat::White,
fmt::format(
"Usage: {} - Reloads Ground Spawns globally",
ground_spawns_link
).c_str()
);
auto level_mods_link = EQ::SayLinkEngine::GenerateQuestSaylink(
"#reload level_mods",
false,
"#reload level_mods"
);
Message(
Chat::White,
fmt::format(
"Usage: {} - Reloads Level Based Experience Modifiers globally",
level_mods_link
).c_str()
);
auto logs_link = EQ::SayLinkEngine::GenerateQuestSaylink(
"#reload logs",
false,
"#reload logs"
);
Message(
Chat::White,
fmt::format(
"Usage: {} - Reloads Log Settings globally",
logs_link
).c_str()
);
auto merchants_link = EQ::SayLinkEngine::GenerateQuestSaylink(
"#reload merchants",
false,
"#reload merchants"
);
Message(
Chat::White,
fmt::format(
"Usage: {} - Reloads Merchants globally",
merchants_link
).c_str()
);
auto npc_emotes_link = EQ::SayLinkEngine::GenerateQuestSaylink(
"#reload npc_emotes",
false,
"#reload npc_emotes"
);
Message(
Chat::White,
fmt::format(
"Usage: {} - Reloads NPC Emotes globally",
npc_emotes_link
).c_str()
);
auto objects_link = EQ::SayLinkEngine::GenerateQuestSaylink(
"#reload objects",
false,
"#reload objects"
);
Message(
Chat::White,
fmt::format(
"Usage: {} - Reloads Objects globally",
objects_link
).c_str()
);
auto perl_export_link = EQ::SayLinkEngine::GenerateQuestSaylink(
"#reload perl_export",
false,
"#reload perl_export"
);
Message(
Chat::White,
fmt::format(
"Usage: {} - Reloads Perl Event Export Settings globally",
perl_export_link
).c_str()
);
auto quest_link_one = EQ::SayLinkEngine::GenerateQuestSaylink(
"#reload quest",
false,
"#reload quest"
);
auto quest_link_two = EQ::SayLinkEngine::GenerateQuestSaylink(
"#reload quest",
false,
"0"
);
auto quest_link_three = EQ::SayLinkEngine::GenerateQuestSaylink(
"#reload quest 1",
false,
"1"
);
Message(
Chat::White,
fmt::format(
"Usage: {} [{}|{}] - Reloads Quests and Timers in your current zone if specified (0 = Do Not Reload Timers, 1 = Reload Timers)",
quest_link_one,
quest_link_two,
quest_link_three
).c_str()
);
auto rules_link = EQ::SayLinkEngine::GenerateQuestSaylink(
"#reload rules",
false,
"#reload rules"
);
Message(
Chat::White,
fmt::format(
"Usage: {} - Reloads Rules globally",
rules_link
).c_str()
);
auto static_link = EQ::SayLinkEngine::GenerateQuestSaylink(
"#reload static",
false,
"#reload static"
);
Message(
Chat::White,
fmt::format(
"Usage: {} - Reloads Static Zone Data globally",
static_link
).c_str()
);
auto tasks_link = EQ::SayLinkEngine::GenerateQuestSaylink(
"#reload tasks",
false,
"#reload tasks"
);
Message(
Chat::White,
fmt::format(
"Usage: {} [Task ID] - Reloads Tasks globally or by ID if specified",
tasks_link
).c_str()
);
auto titles_link = EQ::SayLinkEngine::GenerateQuestSaylink(
"#reload titles",
false,
"#reload titles"
);
Message(
Chat::White,
fmt::format(
"Usage: {} - Reloads Titles globally",
titles_link
).c_str()
);
auto traps_link_one = EQ::SayLinkEngine::GenerateQuestSaylink(
"#reload traps",
false,
"#reload traps"
);
auto traps_link_two = EQ::SayLinkEngine::GenerateQuestSaylink(
"#reload traps",
false,
"0"
);
auto traps_link_three = EQ::SayLinkEngine::GenerateQuestSaylink(
"#reload traps 1",
false,
"1"
);
Message(
Chat::White,
fmt::format(
"Usage: {} [{}|{}] - Reloads Traps in your current zone or globally if specified",
traps_link_one,
traps_link_two,
traps_link_three
).c_str()
);
auto variables_link = EQ::SayLinkEngine::GenerateQuestSaylink(
"#reload variables",
false,
"#reload variables"
);
Message(
Chat::White,
fmt::format(
"Usage: {} - Reloads Variables globally",
variables_link
).c_str()
);
auto veteran_rewards_link = EQ::SayLinkEngine::GenerateQuestSaylink(
"#reload veteran_rewards",
false,
"#reload veteran_rewards"
);
Message(
Chat::White,
fmt::format(
"Usage: {} - Reloads Veteran Rewards globally",
veteran_rewards_link
).c_str()
);
auto world_link_one = EQ::SayLinkEngine::GenerateQuestSaylink(
"#reload world",
false,
"#reload world"
);
auto world_link_two = EQ::SayLinkEngine::GenerateQuestSaylink(
"#reload world",
false,
"0"
);
auto world_link_three = EQ::SayLinkEngine::GenerateQuestSaylink(
"#reload world 1",
false,
"1"
);
auto world_link_four = EQ::SayLinkEngine::GenerateQuestSaylink(
"#reload world 2",
false,
"2"
);
Message(
Chat::White,
fmt::format(
"Usage: {} [{}|{}|{}] - Reloads Quests and repops globally if specified (0 = No Repop, 1 = Repop, 2 = Force Repop)",
world_link_one,
world_link_two,
world_link_three,
world_link_four
).c_str()
);
auto zone_link = EQ::SayLinkEngine::GenerateQuestSaylink(
"#reload zone",
false,
"#reload zone"
);
Message(
Chat::White,
fmt::format(
"Usage: {} [Zone ID] [Version] - Reloads Zone configuration for your current zone, can load another Zone's configuration if specified",
zone_link
).c_str()
);
auto zone_points_link = EQ::SayLinkEngine::GenerateQuestSaylink(
"#reload zone_points",
false,
"#reload zone_points"
);
Message(
Chat::White,
fmt::format(
"Usage: {} - Reloads Zone Points globally",
zone_points_link
).c_str()
);
SendChatLineBreak();
}
bool Client::CheckMerchantDataBucket(uint8 bucket_comparison, std::string bucket_value, std::string player_value)
{
std::vector<std::string> bucket_checks;

View File

@ -1503,6 +1503,8 @@ public:
bool GroupFollow(Client* inviter);
inline bool GetRunMode() const { return runmode; }
void SendReloadCommandMessages();
void SendItemRecastTimer(int32 recast_type, uint32 recast_delay = 0);
void SetItemRecastTimer(int32 spell_id, uint32 inventory_slot);
bool HasItemRecastTimer(int32 spell_id, uint32 inventory_slot);

View File

@ -283,20 +283,7 @@ int command_init(void)
command_add("raidloot", "[All|GroupLeader|RaidLeader|Selected] - Sets your Raid Loot Type if you have permission to do so.", AccountStatus::Player, command_raidloot) ||
command_add("randomfeatures", "- Temporarily randomizes the Facial Features of your target", AccountStatus::QuestTroupe, command_randomfeatures) ||
command_add("refreshgroup", "- Refreshes Group for you or your player target.", AccountStatus::Player, command_refreshgroup) ||
command_add("reloadaa", "Reloads Alternate Advancement data globally", AccountStatus::GMMgmt, command_reloadaa) ||
command_add("reloadallrules", "Executes a reload of all rules globally.", AccountStatus::QuestTroupe, command_reloadallrules) ||
command_add("reloadcontentflags", "Executes a reload of all expansion and content flags", AccountStatus::QuestTroupe, command_reloadcontentflags) ||
command_add("reloademote", "Reloads NPC Emotes", AccountStatus::QuestTroupe, command_reloademote) ||
command_add("reloadlevelmods", "Reloads level based experience modifiers globally", AccountStatus::Max, command_reloadlevelmods) ||
command_add("reloadmerchants", "Reloads merchant lists globally", AccountStatus::Max, command_reloadmerchants) ||
command_add("reloadperlexportsettings", "Reloads Perl event export settings globally", AccountStatus::Max, command_reloadperlexportsettings) ||
command_add("reloadqst", " - Clear quest cache (any argument causes it to also stop all timers)", AccountStatus::GMLeadAdmin, command_reloadqst) ||
command_add("reloadrulesworld", "Executes a reload of all rules in world specifically.", AccountStatus::QuestTroupe, command_reloadworldrules) ||
command_add("reloadstatic", "- Reload Static Zone Data globally", AccountStatus::GMLeadAdmin, command_reloadstatic) ||
command_add("reloadtraps", "[0|1] - Reloads and repops traps, globally if specified (1 = global)", AccountStatus::QuestTroupe, command_reloadtraps) ||
command_add("reloadtitles", "- Reload player titles from the database", AccountStatus::GMLeadAdmin, command_reloadtitles) ||
command_add("reloadworld", "[0|1|2] - Reload quests global and repop NPCs if specified (0 = No Repop, 1 = Repop, 2 = Force Repop)", AccountStatus::Max, command_reloadworld) ||
command_add("reloadzps", "- Reload zone points from database globally", AccountStatus::GMLeadAdmin, command_reloadzps) ||
command_add("reload", "Reloads different types of server data globally, use no argument for help menu.", AccountStatus::GMMgmt, command_reload) ||
command_add("removeitem", "[Item ID] [Amount] - Removes the specified Item ID by Amount from you or your player target's inventory (Amount defaults to 1 if not used)", AccountStatus::GMAdmin, command_removeitem) ||
command_add("repop", "[Force] - Repop the zone with optional force repop", AccountStatus::GMAdmin, command_repop) ||
command_add("resetaa", "- Resets a Player's AA in their profile and refunds spent AA's to unspent, may disconnect player.", AccountStatus::GMMgmt, command_resetaa) ||
@ -1311,20 +1298,7 @@ void command_bot(Client *c, const Seperator *sep)
#include "gm_commands/raidloot.cpp"
#include "gm_commands/randomfeatures.cpp"
#include "gm_commands/refreshgroup.cpp"
#include "gm_commands/reloadaa.cpp"
#include "gm_commands/reloadallrules.cpp"
#include "gm_commands/reloadcontentflags.cpp"
#include "gm_commands/reloademote.cpp"
#include "gm_commands/reloadlevelmods.cpp"
#include "gm_commands/reloadmerchants.cpp"
#include "gm_commands/reloadperlexportsettings.cpp"
#include "gm_commands/reloadqst.cpp"
#include "gm_commands/reloadstatic.cpp"
#include "gm_commands/reloadtitles.cpp"
#include "gm_commands/reloadtraps.cpp"
#include "gm_commands/reloadworld.cpp"
#include "gm_commands/reloadworldrules.cpp"
#include "gm_commands/reloadzps.cpp"
#include "gm_commands/reload.cpp"
#include "gm_commands/removeitem.cpp"
#include "gm_commands/repop.cpp"
#include "gm_commands/resetaa.cpp"

View File

@ -204,20 +204,7 @@ void command_race(Client *c, const Seperator *sep);
void command_raidloot(Client *c, const Seperator *sep);
void command_randomfeatures(Client *c, const Seperator *sep);
void command_refreshgroup(Client *c, const Seperator *sep);
void command_reloadaa(Client *c, const Seperator *sep);
void command_reloadallrules(Client *c, const Seperator *sep);
void command_reloadcontentflags(Client *c, const Seperator *sep);
void command_reloademote(Client *c, const Seperator *sep);
void command_reloadlevelmods(Client *c, const Seperator *sep);
void command_reloadmerchants(Client *c, const Seperator *sep);
void command_reloadperlexportsettings(Client *c, const Seperator *sep);
void command_reloadqst(Client *c, const Seperator *sep);
void command_reloadstatic(Client *c, const Seperator *sep);
void command_reloadtitles(Client *c, const Seperator *sep);
void command_reloadtraps(Client *c, const Seperator *sep);
void command_reloadworld(Client *c, const Seperator *sep);
void command_reloadworldrules(Client *c, const Seperator *sep);
void command_reloadzps(Client *c, const Seperator *sep);
void command_reload(Client *c, const Seperator *sep);
void command_removeitem(Client *c, const Seperator *sep);
void command_repop(Client *c, const Seperator *sep);
void command_resetaa(Client *c, const Seperator *sep);

View File

@ -4614,7 +4614,7 @@ uint16 EntityList::CreateDoor(const char *model, const glm::vec4& position, uint
auto door = new Doors(model, position, opentype, size);
RemoveAllDoors();
zone->LoadZoneDoors(zone->GetShortName(), zone->GetInstanceVersion());
zone->LoadZoneDoors();
entity_list.AddDoor(door);
entity_list.RespawnAllDoors();

View File

@ -130,12 +130,9 @@ void command_logs(Client *c, const Seperator *sep)
);
}
} else if (is_reload) {
c->Message(Chat::White, "Attempting to reload Log Settings globally.");
auto pack = new ServerPacket(ServerOP_ReloadLogs, 0);
worldserver.SendPacket(pack);
c->Message(
Chat::White,
"Reloaded log settings worldwide."
);
safe_delete(pack);
} else if (is_set && sep->IsNumber(3)) {
auto logs_set = false;

290
zone/gm_commands/reload.cpp Normal file
View File

@ -0,0 +1,290 @@
#include "../client.h"
void command_reload(Client *c, const Seperator *sep)
{
int arguments = sep->argnum;
if (!arguments) {
c->SendReloadCommandMessages();
return;
}
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");
bool is_content_flags = !strcasecmp(sep->arg[1], "content_flags");
bool is_doors = !strcasecmp(sep->arg[1], "doors");
bool is_ground_spawns = !strcasecmp(sep->arg[1], "ground_spawns");
bool is_level_mods = !strcasecmp(sep->arg[1], "level_mods");
bool is_logs = !strcasecmp(sep->arg[1], "logs");
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_perl_export = !strcasecmp(sep->arg[1], "perl_export");
bool is_quest = !strcasecmp(sep->arg[1], "quest");
bool is_rules = !strcasecmp(sep->arg[1], "rules");
bool is_static = !strcasecmp(sep->arg[1], "static");
bool is_tasks = !strcasecmp(sep->arg[1], "tasks");
bool is_titles = !strcasecmp(sep->arg[1], "titles");
bool is_traps = !strcasecmp(sep->arg[1], "traps");
bool is_variables = !strcasecmp(sep->arg[1], "variables");
bool is_veteran_rewards = !strcasecmp(sep->arg[1], "veteran_rewards");
bool is_world = !strcasecmp(sep->arg[1], "world");
bool is_zone = !strcasecmp(sep->arg[1], "zone");
bool is_zone_points = !strcasecmp(sep->arg[1], "zone_points");
if (
!is_aa &&
!is_alternate_currencies &&
!is_blocked_spells &&
!is_content_flags &&
!is_doors &&
!is_ground_spawns &&
!is_level_mods &&
!is_logs &&
!is_merchants &&
!is_npc_emotes &&
!is_objects &&
!is_perl_export &&
!is_quest &&
!is_rules &&
!is_static &&
!is_tasks &&
!is_titles &&
!is_traps &&
!is_variables &&
!is_veteran_rewards &&
!is_world &&
!is_zone &&
!is_zone_points
) {
c->SendReloadCommandMessages();
return;
}
auto pack = new ServerPacket;
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) {
c->Message(Chat::White, "Attempting to reload Alternate Currencies globally.");
pack = new ServerPacket(ServerOP_ReloadAlternateCurrencies, 0);
} else if (is_blocked_spells) {
c->Message(Chat::White, "Attempting to reload Blocked Spells globally.");
pack = new ServerPacket(ServerOP_ReloadBlockedSpells, 0);
} 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) {
c->Message(Chat::White, "Attempting to reload Doors globally.");
pack = new ServerPacket(ServerOP_ReloadDoors, 0);
} 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) {
if (!RuleB(Zone, LevelBasedEXPMods)) {
c->Message(Chat::White, "Level Based Experience Modifiers are disabled.");
return;
}
c->Message(Chat::White, "Attempting to reload Level Based Experience Modifiers globally.");
pack = new ServerPacket(ServerOP_ReloadLevelEXPMods, 0);
} else if (is_logs) {
c->Message(Chat::White, "Attempting to reload Log Settings globally.");
pack = new ServerPacket(ServerOP_ReloadLogs, 0);
} else if (is_merchants) {
c->Message(Chat::White, "Attempting to reload Merchants globally.");
pack = new ServerPacket(ServerOP_ReloadMerchants, 0);
} 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) {
c->Message(Chat::White, "Attempting to reload Objects globally.");
pack = new ServerPacket(ServerOP_ReloadObjects, 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 = std::stoi(sep->arg[2]) != 0 ? true : false;
}
std::string stop_timers_message = stop_timers ? " and timers stopped" : "";
c->Message(
Chat::Yellow,
fmt::format(
"Quests reloaded{} for {}.",
stop_timers_message,
zone->GetZoneDescription()
).c_str()
);
entity_list.ClearAreas();
parse->ReloadQuests(stop_timers);
} else if (is_rules) {
c->Message(Chat::White, "Attempting to reload Rules globally.");
pack = new ServerPacket(ServerOP_ReloadRules, 0);
} 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) {
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 {
task_id = std::stoul(sep->arg[2]);
}
auto rts = (ReloadTasks_Struct*) pack->pBuffer;
rts->reload_type = RELOADTASKS;
rts->task_id = task_id;
} else if (is_titles) {
c->Message(Chat::White, "Attempting to reload Titles globally.");
pack = new ServerPacket(ServerOP_ReloadTitles, 0);
} else if (is_traps) {
if (arguments < 2 || !sep->IsNumber(2)) {
entity_list.UpdateAllTraps(true, true);
c->Message(
Chat::Yellow,
fmt::format(
"Traps reloaded for {}.",
zone->GetZoneDescription()
).c_str()
);
return;
}
bool global = std::stoi(sep->arg[2]) ? true : false;
if (!global) {
entity_list.UpdateAllTraps(true, true);
c->Message(
Chat::Yellow,
fmt::format(
"Traps reloaded for {}.",
zone->GetZoneDescription()
).c_str()
);
return;
}
c->Message(Chat::White, "Attempting to reload Traps globally.");
pack = new ServerPacket(ServerOP_ReloadTraps, 0);
} else if (is_variables) {
c->Message(Chat::White, "Attempting to reload Variables globally.");
pack = new ServerPacket(ServerOP_ReloadVariables, 0);
} 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) {
uint8 global_repop = ReloadWorld::NoRepop;
if (sep->IsNumber(2)) {
global_repop = static_cast<uint8>(std::stoul(sep->arg[2]));
if (global_repop > ReloadWorld::ForceRepop) {
global_repop = ReloadWorld::ForceRepop;
}
}
c->Message(
Chat::White,
fmt::format(
"Attempting to reload Quests {}worldwide.",
(
global_repop ?
(
global_repop == ReloadWorld::Repop ?
"and repop NPCs " :
"and forcefully repop NPCs "
) :
""
)
).c_str()
);
pack = new ServerPacket(ServerOP_ReloadWorld, sizeof(ReloadWorld_Struct));
auto RW = (ReloadWorld_Struct *) pack->pBuffer;
RW->global_repop = global_repop;
} else if (is_zone) {
if (arguments < 2) {
c->Message(
Chat::White,
fmt::format(
"Zone Header Load {} | Zone: {}",
(
zone->LoadZoneCFG(zone->GetShortName(), zone->GetInstanceVersion()) ?
"Suceeded" :
"Failed"
),
zone->GetZoneDescription()
).c_str()
);
return;
}
auto zone_id = (
sep->IsNumber(2) ?
std::stoul(sep->arg[2]) :
ZoneID(sep->arg[2])
);
if (!zone_id) {
c->Message(
Chat::White,
fmt::format(
"Zone ID {} could not be found.",
zone_id
).c_str()
);
return;
}
auto zone_short_name = ZoneName(zone_id);
auto zone_long_name = ZoneLongName(zone_id);
auto version = (
sep->IsNumber(3) ?
std::stoul(sep->arg[3]) :
0
);
auto outapp = new EQApplicationPacket(OP_NewZone, sizeof(NewZone_Struct));
memcpy(outapp->pBuffer, &zone->newzone_data, outapp->size);
entity_list.QueueClients(c, outapp);
safe_delete(outapp);
c->Message(
Chat::White,
fmt::format(
"Zone Header Load {} | Zone: {} ({}){}",
(
zone->LoadZoneCFG(zone_short_name, version) ?
"Suceeded" :
"Failed"
),
zone_long_name,
zone_short_name,
(
version ?
fmt::format(
" Version: {}",
version
) :
""
)
).c_str()
);
} else if (is_zone_points) {
c->Message(Chat::White, "Attempting to reloading Zone Points globally.");
pack = new ServerPacket(ServerOP_ReloadZonePoints, 0);
}
if (pack->opcode) {
worldserver.SendPacket(pack);
}
safe_delete(pack);
}

View File

@ -1,11 +0,0 @@
#include "../client.h"
#include "../../common/file_util.h"
void command_reloadaa(Client *c, const Seperator *sep)
{
c->Message(Chat::White, "Attempted to reload Alternate Advancement data globally.");
auto pack = new ServerPacket(ServerOP_ReloadAAData, 0);
worldserver.SendPacket(pack);
safe_delete(pack);
}

View File

@ -1,13 +0,0 @@
#include "../client.h"
#include "../worldserver.h"
extern WorldServer worldserver;
void command_reloadallrules(Client *c, const Seperator *sep)
{
c->Message(Chat::White, "Attempting to reload all rules globally.");
auto pack = new ServerPacket(ServerOP_ReloadRules, 0);
worldserver.SendPacket(pack);
safe_delete(pack);
}

View File

@ -1,15 +0,0 @@
#include "../client.h"
#include "../worldserver.h"
extern WorldServer worldserver;
void command_reloadcontentflags(Client *c, const Seperator *sep)
{
if (c) {
auto pack = new ServerPacket(ServerOP_ReloadContentFlags, 0);
worldserver.SendPacket(pack);
c->Message(Chat::Red, "Successfully sent the packet to world to reload content flags globally.");
safe_delete(pack);
}
}

View File

@ -1,9 +0,0 @@
#include "../client.h"
void command_reloademote(Client *c, const Seperator *sep)
{
zone->NPCEmoteList.Clear();
zone->LoadNPCEmotes(&zone->NPCEmoteList);
c->Message(Chat::White, "NPC emotes reloaded.");
}

View File

@ -1,15 +0,0 @@
#include "../client.h"
void command_reloadlevelmods(Client *c, const Seperator *sep)
{
if (!RuleB(Zone, LevelBasedEXPMods)) {
c->Message(Chat::White, "Level based experience modifiers are disabled.");
return;
}
c->Message(Chat::White, "Attempted to reload level based experience modifiers globally.");
auto pack = new ServerPacket(ServerOP_ReloadLevelEXPMods, 0);
worldserver.SendPacket(pack);
safe_delete(pack);
}

View File

@ -1,10 +0,0 @@
#include "../client.h"
void command_reloadmerchants(Client *c, const Seperator *sep)
{
c->Message(Chat::White, "Attempting to reload merchants globally.");
auto pack = new ServerPacket(ServerOP_ReloadMerchants, 0);
worldserver.SendPacket(pack);
safe_delete(pack);
}

View File

@ -1,13 +0,0 @@
#include "../client.h"
#include "../worldserver.h"
extern WorldServer worldserver;
void command_reloadperlexportsettings(Client *c, const Seperator *sep)
{
c->Message(Chat::White, "Attempting to reload Perl event export settings globally.");
auto pack = new ServerPacket(ServerOP_ReloadPerlExportSettings, 0);
worldserver.SendPacket(pack);
safe_delete(pack);
}

View File

@ -1,23 +0,0 @@
#include "../client.h"
#include "../quest_parser_collection.h"
void command_reloadqst(Client *c, const Seperator *sep)
{
bool stop_timers = false;
if (sep->IsNumber(1)) {
stop_timers = std::stoi(sep->arg[1]) != 0 ? true : false;
}
std::string stop_timers_message = stop_timers ? " and stopping timers" : "";
c->Message(
Chat::White,
fmt::format(
"Clearing quest memory cache{}.",
stop_timers_message
).c_str()
);
entity_list.ClearAreas();
parse->ReloadQuests(stop_timers);
}

View File

@ -1,10 +0,0 @@
#include "../client.h"
void command_reloadstatic(Client *c, const Seperator *sep)
{
c->Message(Chat::White, "Attempting to reload static zone data globally.");
auto pack = new ServerPacket(ServerOP_ReloadStaticZoneData, 0);
worldserver.SendPacket(pack);
safe_delete(pack);
}

View File

@ -1,13 +0,0 @@
#include "../client.h"
#include "../worldserver.h"
extern WorldServer worldserver;
void command_reloadtitles(Client *c, const Seperator *sep)
{
c->Message(Chat::White, "Attempting to reload titles globally.");
auto pack = new ServerPacket(ServerOP_ReloadTitles, 0);
worldserver.SendPacket(pack);
safe_delete(pack);
}

View File

@ -1,65 +0,0 @@
#include "../client.h"
void command_reloadtraps(Client *c, const Seperator *sep)
{
int arguments = sep->argnum;
if (!arguments) {
entity_list.UpdateAllTraps(true, true);
c->Message(
Chat::Yellow,
fmt::format(
"Traps reloaded for {}{}.",
fmt::format(
"{} ({})",
zone->GetLongName(),
zone->GetZoneID()
),
(
zone->GetInstanceID() ?
fmt::format(
" (Instance ID {})",
zone->GetInstanceID()
) :
""
)
).c_str()
);
return;
}
bool global = false;
if (sep->IsNumber(1)) {
global = std::stoi(sep->arg[1]) ? true : false;
}
if (!global) {
entity_list.UpdateAllTraps(true, true);
c->Message(
Chat::Yellow,
fmt::format(
"Traps reloaded for {}{}.",
fmt::format(
"{} ({})",
zone->GetLongName(),
zone->GetZoneID()
),
(
zone->GetInstanceID() ?
fmt::format(
" (Instance ID {})",
zone->GetInstanceID()
) :
""
)
).c_str()
);
return;
}
c->Message(Chat::White, "Attempting to reload traps globally.");
auto pack = new ServerPacket(ServerOP_ReloadTraps, 0);
worldserver.SendPacket(pack);
safe_delete(pack);
}

View File

@ -1,40 +0,0 @@
#include "../client.h"
#include "../worldserver.h"
extern WorldServer worldserver;
void command_reloadworld(Client *c, const Seperator *sep)
{
uint8 global_repop = ReloadWorld::NoRepop;
if (sep->IsNumber(1)) {
global_repop = static_cast<uint8>(std::stoul(sep->arg[1]));
if (global_repop > ReloadWorld::ForceRepop) {
global_repop = ReloadWorld::ForceRepop;
}
}
c->Message(
Chat::White,
fmt::format(
"Attempting to reload quests {}worldwide.",
(
global_repop ?
(
global_repop == ReloadWorld::Repop ?
"and repop NPCs " :
"and forcefully repop NPCs "
) :
""
)
).c_str()
);
auto pack = new ServerPacket(ServerOP_ReloadWorld, sizeof(ReloadWorld_Struct));
ReloadWorld_Struct *RW = (ReloadWorld_Struct *) pack->pBuffer;
RW->global_repop = global_repop;
worldserver.SendPacket(pack);
safe_delete(pack);
}

View File

@ -1,13 +0,0 @@
#include "../client.h"
#include "../worldserver.h"
extern WorldServer worldserver;
void command_reloadworldrules(Client *c, const Seperator *sep)
{
c->Message(Chat::White, "Attempting to reload world only rules.");
auto pack = new ServerPacket(ServerOP_ReloadRulesWorld, 0);
worldserver.SendPacket(pack);
safe_delete(pack);
}

View File

@ -1,10 +0,0 @@
#include "../client.h"
void command_reloadzps(Client *c, const Seperator *sep)
{
c->Message(Chat::White, "Attempting to reloading server zone points globally.");
auto pack = new ServerPacket(ServerOP_ReloadZonePoints, 0);
worldserver.SendPacket(pack);
safe_delete(pack);
}

View File

@ -6,30 +6,23 @@ extern WorldServer worldserver;
void command_updatechecksum(Client *c, const Seperator *sep)
{
if (c) {
// if account found
auto account = AccountRepository::FindOne(database, c->AccountID());
if (account.id > 0) {
database.SetVariable("crc_eqgame", account.crc_eqgame);
database.SetVariable("crc_skillcaps", account.crc_skillcaps);
database.SetVariable("crc_basedata", account.crc_basedata);
// reload rules (world)
auto pack = new ServerPacket(ServerOP_ReloadRulesWorld, 0);
worldserver.SendPacket(pack);
c->Message(Chat::Red, "Successfully sent the packet to world to reload rules. (only world)");
safe_delete(pack);
// reload variables (world)
pack = new ServerPacket(ServerOP_ReloadVariablesWorld, 0);
worldserver.SendPacket(pack);
c->Message(Chat::Red, "Successfully sent the packet to world to reload variables. (only world)");
safe_delete(pack);
return;
}
// we should never see this
c->Message(Chat::Red, "Error: Your account was not found!");
auto account = AccountRepository::FindOne(database, c->AccountID());
if (!account.id) {
c->Message(Chat::White, "Your account was not found!");
return;
}
database.SetVariable("crc_eqgame", account.crc_eqgame);
database.SetVariable("crc_skillcaps", account.crc_skillcaps);
database.SetVariable("crc_basedata", account.crc_basedata);
c->Message(Chat::White, "Attempting to reload Rules globally.");
auto pack = new ServerPacket(ServerOP_ReloadRules, 0);
worldserver.SendPacket(pack);
safe_delete(pack);
c->Message(Chat::White, "Attempting to reload Variables globally.");
pack = new ServerPacket(ServerOP_ReloadVariables, 0);
worldserver.SendPacket(pack);
safe_delete(pack);
}

View File

@ -9,9 +9,9 @@ void command_zheader(Client *c, const Seperator *sep)
}
auto zone_id = (
sep->IsNumber(1) ?
std::stoul(sep->arg[1]) :
ZoneID(sep->arg[1])
sep->IsNumber(2) ?
std::stoul(sep->arg[2]) :
ZoneID(sep->arg[2])
);
if (!zone_id) {
c->Message(
@ -27,8 +27,8 @@ void command_zheader(Client *c, const Seperator *sep)
auto zone_short_name = ZoneName(zone_id);
auto zone_long_name = ZoneLongName(zone_id);
auto version = (
sep->IsNumber(2) ?
std::stoul(sep->arg[2]) :
sep->IsNumber(3) ?
std::stoul(sep->arg[3]) :
0
);

View File

@ -1894,17 +1894,43 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
break;
}
case ServerOP_ReloadAAData:
{
{
zone->SendReloadMessage("Alternate Advancement Data");
zone->LoadAlternateAdvancement();
break;
}
case ServerOP_ReloadAlternateCurrencies:
{
zone->SendReloadMessage("Alternate Currencies");
zone->LoadAlternateCurrencies();
break;
}
case ServerOP_ReloadBlockedSpells:
{
zone->SendReloadMessage("Blocked Spells");
zone->LoadZoneBlockedSpells();
break;
}
case ServerOP_ReloadContentFlags:
{
zone->SendReloadMessage("Content Flags");
content_service.SetExpansionContext()->ReloadContentFlags();
break;
}
case ServerOP_ReloadDoors:
{
zone->SendReloadMessage("Doors");
entity_list.RemoveAllDoors();
zone->LoadZoneDoors();
entity_list.RespawnAllDoors();
break;
}
case ServerOP_ReloadGroundSpawns:
{
zone->SendReloadMessage("Ground Spawns");
zone->LoadGroundSpawns();
break;
}
case ServerOP_ReloadLevelEXPMods:
{
zone->SendReloadMessage("Level Based Experience Modifiers");
@ -1922,6 +1948,19 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
entity_list.ReloadMerchants();
break;
}
case ServerOP_ReloadNPCEmotes:
{
zone->SendReloadMessage("NPC Emotes");
zone->LoadNPCEmotes(&zone->NPCEmoteList);
break;
}
case ServerOP_ReloadObjects:
{
zone->SendReloadMessage("Objects");
entity_list.RemoveAllObjects();
zone->LoadZoneObjects();
break;
}
case ServerOP_ReloadPerlExportSettings:
{
zone->SendReloadMessage("Perl Event Export Settings");
@ -1960,6 +1999,18 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
entity_list.UpdateAllTraps(true, true);
break;
}
case ServerOP_ReloadVariables:
{
zone->SendReloadMessage("Variables");
database.LoadVariables();
break;
}
case ServerOP_ReloadVeteranRewards:
{
zone->SendReloadMessage("Veteran Rewards");
zone->LoadVeteranRewards();
break;
}
case ServerOP_ReloadWorld:
{
auto* reload_world = (ReloadWorld_Struct*)pack->pBuffer;
@ -3084,12 +3135,12 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
zone->SetQuestHotReloadQueued(true);
} else if (request_zone_short_name == "all") {
std::string reload_quest_saylink = EQ::SayLinkEngine::GenerateQuestSaylink(
"#reloadquest",
"#reload quest",
false,
"Locally"
);
std::string reload_world_saylink = EQ::SayLinkEngine::GenerateQuestSaylink(
"#reloadworld",
"#reload world",
false,
"Globally"
);
@ -3353,69 +3404,75 @@ bool WorldServer::RezzPlayer(EQApplicationPacket* rpack, uint32 rezzexp, uint32
return ret;
}
void WorldServer::SendReloadTasks(int Command, int TaskID) {
void WorldServer::SendReloadTasks(uint8 reload_type, uint32 task_id) {
auto pack = new ServerPacket(ServerOP_ReloadTasks, sizeof(ReloadTasks_Struct));
ReloadTasks_Struct* rts = (ReloadTasks_Struct*)pack->pBuffer;
auto rts = (ReloadTasks_Struct*) pack->pBuffer;
rts->Command = Command;
rts->Parameter = TaskID;
rts->reload_type = reload_type;
rts->task_id = task_id;
SendPacket(pack);
}
void WorldServer::HandleReloadTasks(ServerPacket *pack)
{
ReloadTasks_Struct* rts = (ReloadTasks_Struct*)pack->pBuffer;
auto rts = (ReloadTasks_Struct*) pack->pBuffer;
Log(Logs::General, Logs::Tasks, "[GLOBALLOAD] Zone received ServerOP_ReloadTasks from World, Command %i", rts->Command);
LogTasks("Global reload of tasks received with Reload Type [{}] Task ID [{}]", rts->reload_type, rts->task_id);
switch (rts->Command) {
case RELOADTASKS:
entity_list.SaveAllClientsTaskState();
switch (rts->reload_type) {
case RELOADTASKS:
{
entity_list.SaveAllClientsTaskState();
// TODO: Reload at the world level for shared tasks
// TODO: Reload at the world level for shared tasks
if (rts->Parameter == 0) {
Log(Logs::General, Logs::Tasks, "[GLOBALLOAD] Reload ALL tasks");
safe_delete(task_manager);
task_manager = new TaskManager;
task_manager->LoadTasks();
if (!rts->task_id) {
LogTasks("Global reload of all Tasks");
safe_delete(task_manager);
task_manager = new TaskManager;
task_manager->LoadTasks();
if (zone) {
task_manager->LoadProximities(zone->GetZoneID());
}
entity_list.ReloadAllClientsTaskState();
} else {
LogTasks("Global reload of Task ID [{}]", rts->task_id);
task_manager->LoadTasks(rts->task_id);
entity_list.ReloadAllClientsTaskState(rts->task_id);
}
break;
}
case RELOADTASKPROXIMITIES:
{
if (zone) {
LogTasks("Global reload of all Task Proximities");
task_manager->LoadProximities(zone->GetZoneID());
}
entity_list.ReloadAllClientsTaskState();
break;
}
else {
Log(Logs::General, Logs::Tasks, "[GLOBALLOAD] Reload only task %i", rts->Parameter);
task_manager->LoadTasks(rts->Parameter);
entity_list.ReloadAllClientsTaskState(rts->Parameter);
case RELOADTASKGOALLISTS:
{
LogTasks("Global reload of all Task Goal Lists");
task_manager->ReloadGoalLists();
break;
}
break;
case RELOADTASKPROXIMITIES:
if (zone) {
Log(Logs::General, Logs::Tasks, "[GLOBALLOAD] Reload task proximities");
task_manager->LoadProximities(zone->GetZoneID());
case RELOADTASKSETS:
{
LogTasks("Global reload of all Task Sets");
task_manager->LoadTaskSets();
break;
}
default:
{
LogTasks("Unhandled global reload of Tasks Reload Type [{}] Task ID [{}]", rts->reload_type, rts->task_id);
break;
}
break;
case RELOADTASKGOALLISTS:
Log(Logs::General, Logs::Tasks, "[GLOBALLOAD] Reload task goal lists");
task_manager->ReloadGoalLists();
break;
case RELOADTASKSETS:
Log(Logs::General, Logs::Tasks, "[GLOBALLOAD] Reload task sets");
task_manager->LoadTaskSets();
break;
default:
Log(Logs::General, Logs::Tasks, "[GLOBALLOAD] Unhandled ServerOP_ReloadTasks command %i", rts->Command);
}
}

View File

@ -51,7 +51,7 @@ public:
void SetLaunchedName(const char *n) { m_launchedName = n; }
void SetLauncherName(const char *n) { m_launcherName = n; }
void SendReloadTasks(int Command, int TaskID=0);
void SendReloadTasks(uint8 reload_type, uint32 task_id = 0);
void HandleReloadTasks(ServerPacket *pack);
void UpdateLFP(uint32 LeaderID, uint8 Action, uint8 MatchFilter, uint32 FromLevel, uint32 ToLevel, uint32 Classes, const char *Comments,
GroupLFPMemberEntry *LFPMembers);

View File

@ -86,7 +86,7 @@ Zone* zone = 0;
void UpdateWindowTitle(char* iNewTitle);
bool Zone::Bootup(uint32 iZoneID, uint32 iInstanceID, bool iStaticZone) {
bool Zone::Bootup(uint32 iZoneID, uint32 iInstanceID, bool is_static) {
const char* zonename = ZoneName(iZoneID);
if (iZoneID == 0 || zonename == 0)
@ -103,7 +103,7 @@ bool Zone::Bootup(uint32 iZoneID, uint32 iInstanceID, bool iStaticZone) {
zone = new Zone(iZoneID, iInstanceID, zonename);
//init the zone, loads all the data, etc
if (!zone->Init(iStaticZone)) {
if (!zone->Init(is_static)) {
safe_delete(zone);
std::cerr << "Zone->Init failed" << std::endl;
worldserver.SetZoneData(0);
@ -151,14 +151,14 @@ bool Zone::Bootup(uint32 iZoneID, uint32 iInstanceID, bool iStaticZone) {
LogInfo("---- Zone server [{}], listening on port:[{}] ----", zonename, ZoneConfig::get()->ZonePort);
LogInfo("Zone Bootup: [{}] [{}] ([{}]: [{}])",
(iStaticZone) ? "Static" : "Dynamic", zonename, iZoneID, iInstanceID);
(is_static) ? "Static" : "Dynamic", zonename, iZoneID, iInstanceID);
parse->Init();
UpdateWindowTitle(nullptr);
// Dynamic zones need to Sync here.
// Static zones sync when they connect in worldserver.cpp.
// Static zones cannot sync here as request is ignored by worldserver.
if (!iStaticZone)
if (!is_static)
{
zone->GetTimeSync();
}
@ -925,21 +925,19 @@ void Zone::Shutdown(bool quiet)
}
}
void Zone::LoadZoneDoors(const char* zone, int16 version)
void Zone::LoadZoneDoors()
{
LogInfo("Loading doors for [{}] ", zone);
LogInfo("Loading doors for [{}] ", GetShortName());
auto door_entries = content_db.LoadDoors(zone, version);
if (door_entries.empty())
{
auto door_entries = content_db.LoadDoors(GetShortName(), GetInstanceVersion());
if (door_entries.empty()) {
LogInfo("No doors loaded");
return;
}
for (const auto& entry : door_entries)
{
auto newdoor = new Doors(entry);
entity_list.AddDoor(newdoor);
for (const auto &entry : door_entries) {
auto d = new Doors(entry);
entity_list.AddDoor(d);
LogDoorsDetail("Door added to entity list, db id: [{}], door_id: [{}]", entry.id, entry.doorid);
}
}
@ -1081,14 +1079,14 @@ Zone::~Zone() {
}
//Modified for timezones.
bool Zone::Init(bool iStaticZone) {
SetStaticZone(iStaticZone);
bool Zone::Init(bool is_static) {
SetStaticZone(is_static);
//load the zone config file.
if (!LoadZoneCFG(zone->GetShortName(), zone->GetInstanceVersion())) { // try loading the zone name...
if (!LoadZoneCFG(GetShortName(), GetInstanceVersion())) { // try loading the zone name...
LoadZoneCFG(
zone->GetFileName(),
zone->GetInstanceVersion()
GetFileName(),
GetInstanceVersion()
);
} // if that fails, try the file name, then load defaults
@ -1099,9 +1097,9 @@ bool Zone::Init(bool iStaticZone) {
}
}
zone->zonemap = Map::LoadMapFile(zone->map_name);
zone->watermap = WaterMap::LoadWaterMapfile(zone->map_name);
zone->pathing = IPathfinder::Load(zone->map_name);
zonemap = Map::LoadMapFile(map_name);
watermap = WaterMap::LoadWaterMapfile(map_name);
pathing = IPathfinder::Load(map_name);
LogInfo("Loading spawn conditions");
if(!spawn_conditions.LoadSpawnConditions(short_name, instanceid)) {
@ -1158,8 +1156,8 @@ bool Zone::Init(bool iStaticZone) {
LogInfo("Flushing old respawn timers");
database.QueryDatabase("DELETE FROM `respawn_times` WHERE (`start` + `duration`) < UNIX_TIMESTAMP(NOW())");
zone->LoadZoneDoors(zone->GetShortName(), zone->GetInstanceVersion());
zone->LoadZoneBlockedSpells(zone->GetZoneID());
LoadZoneDoors();
LoadZoneBlockedSpells();
//clear trader items if we are loading the bazaar
if (strncasecmp(short_name, "bazaar", 6) == 0) {
@ -1167,30 +1165,31 @@ bool Zone::Init(bool iStaticZone) {
database.DeleteBuyLines(0);
}
zone->LoadLDoNTraps();
zone->LoadLDoNTrapEntries();
zone->LoadVeteranRewards();
zone->LoadAlternateCurrencies();
zone->LoadNPCEmotes(&NPCEmoteList);
LoadLDoNTraps();
LoadLDoNTrapEntries();
LoadVeteranRewards();
LoadAlternateCurrencies();
LoadNPCEmotes(&NPCEmoteList);
LoadAlternateAdvancement();
content_db.LoadGlobalLoot();
//Load merchant data
zone->GetMerchantDataForZoneLoad();
GetMerchantDataForZoneLoad();
//Load temporary merchant data
zone->LoadTempMerchantData();
LoadTempMerchantData();
// Merc data
if (RuleB(Mercs, AllowMercs)) {
zone->LoadMercTemplates();
zone->LoadMercSpells();
LoadMercTemplates();
LoadMercSpells();
}
if (RuleB(Zone, LevelBasedEXPMods))
zone->LoadLevelEXPMods();
if (RuleB(Zone, LevelBasedEXPMods)) {
LoadLevelEXPMods();
}
petition_list.ClearPetitions();
petition_list.ReadDatabase();
@ -1202,9 +1201,9 @@ bool Zone::Init(bool iStaticZone) {
Expedition::CacheAllFromDatabase();
LogInfo("Loading timezone data");
zone->zone_time.setEQTimeZone(content_db.GetZoneTZ(zoneid, GetInstanceVersion()));
zone_time.setEQTimeZone(content_db.GetZoneTZ(zoneid, GetInstanceVersion()));
LogInfo("Init Finished: ZoneID = [{}], Time Offset = [{}]", zoneid, zone->zone_time.getEQTimeZone());
LogInfo("Init Finished: ZoneID = [{}], Time Offset = [{}]", zoneid, zone_time.getEQTimeZone());
LoadGrids();
LoadTickItems();
@ -1219,7 +1218,6 @@ void Zone::ReloadStaticData() {
LogInfo("Reloading Zone Static Data");
LogInfo("Reloading static zone points");
zone_point_list.Clear();
if (!content_db.LoadStaticZonePoints(&zone_point_list, GetShortName(), GetInstanceVersion())) {
LogError("Loading static zone points failed");
}
@ -1245,19 +1243,19 @@ void Zone::ReloadStaticData() {
}
entity_list.RemoveAllDoors();
zone->LoadZoneDoors(zone->GetShortName(), zone->GetInstanceVersion());
LoadZoneDoors();
entity_list.RespawnAllDoors();
zone->LoadVeteranRewards();
zone->LoadAlternateCurrencies();
LoadVeteranRewards();
LoadAlternateCurrencies();
NPCEmoteList.Clear();
zone->LoadNPCEmotes(&NPCEmoteList);
LoadNPCEmotes(&NPCEmoteList);
//load the zone config file.
if (!LoadZoneCFG(zone->GetShortName(), zone->GetInstanceVersion())) { // try loading the zone name...
if (!LoadZoneCFG(GetShortName(), GetInstanceVersion())) { // try loading the zone name...
LoadZoneCFG(
zone->GetFileName(),
zone->GetInstanceVersion()
GetFileName(),
GetInstanceVersion()
);
} // if that fails, try the file name, then load defaults
@ -2101,13 +2099,13 @@ void Zone::SetGraveyard(uint32 zoneid, const glm::vec4& graveyardPosition) {
m_Graveyard = graveyardPosition;
}
void Zone::LoadZoneBlockedSpells(uint32 zone_id)
void Zone::LoadZoneBlockedSpells()
{
if (!blocked_spells) {
zone_total_blocked_spells = content_db.GetBlockedSpellsCount(zone_id);
zone_total_blocked_spells = content_db.GetBlockedSpellsCount(GetZoneID());
if (zone_total_blocked_spells > 0) {
blocked_spells = new ZoneSpellsBlocked[zone_total_blocked_spells];
if (!content_db.LoadBlockedSpells(zone_total_blocked_spells, blocked_spells, zone_id)) {
if (!content_db.LoadBlockedSpells(zone_total_blocked_spells, blocked_spells, GetZoneID())) {
LogError(" Failed to load blocked spells");
ClearBlockedSpells();
}

View File

@ -94,7 +94,7 @@ class MobMovementManager;
class Zone {
public:
static bool Bootup(uint32 iZoneID, uint32 iInstanceID, bool iStaticZone = false);
static bool Bootup(uint32 iZoneID, uint32 iInstanceID, bool is_static = false);
static void Shutdown(bool quiet = false);
Zone(uint32 in_zoneid, uint32 in_instanceid, const char *in_short_name);
@ -125,7 +125,7 @@ public:
);
bool HasGraveyard();
bool HasWeather();
bool Init(bool iStaticZone);
bool Init(bool is_static);
bool IsCity() const { return (is_city); }
bool IsHotzone() const { return (is_hotzone); }
bool IsLoaded();
@ -264,7 +264,7 @@ public:
void LoadAdventureFlavor();
void LoadAlternateAdvancement();
void LoadAlternateCurrencies();
void LoadZoneBlockedSpells(uint32 zone_id);
void LoadZoneBlockedSpells();
void LoadLDoNTrapEntries();
void LoadLDoNTraps();
void LoadLevelEXPMods();
@ -276,7 +276,7 @@ public:
void LoadTempMerchantData();
void LoadTickItems();
void LoadVeteranRewards();
void LoadZoneDoors(const char *zone, int16 version);
void LoadZoneDoors();
void ReloadStaticData();
void ReloadWorld(uint8 global_repop);
void RemoveAuth(const char *iCharName, const char *iLSKey);