mirror of
https://github.com/EQEmu/Server.git
synced 2026-09-04 14:36:37 +00:00
[Logging] Logging Improvements (#2755)
* Console logging improvements * stderr handling * Add origination information * Formatting * Update zoneserver.cpp * Update eqemu_logsys.cpp * Remove semicolon from MySQLQuery log output * Remove IsRfc5424LogCategory * Remove no longer used functions * Remove definition BUILD_LOGGING * Deprecate categories UCSServer & WorldServer * Deprecate UCS / World Server / Zone Server categories * Deprecate Status, QSServer, Normal * Update login_server.cpp * Deprecate Emergency, Alert, Critical, Notice * Deprecate Alert * Fix terminal color resetting * Deprecate headless client * Move LogAIModerate to Detail * Deprecate moderate logging level for detail * Update logs.cpp * Logs list simplify * Update logs.cpp * Add discord to log command * Remove unused headers * Windows fix * Error in world when zones fail to load * Show warning color properly * Keep loginserver thread log from colliding with other logs during startup * Deprecate Loginserver category
This commit is contained in:
+4
-12
@@ -1700,7 +1700,6 @@ bool Mob::CanPurchaseAlternateAdvancementRank(AA::Rank *rank, bool check_price,
|
||||
}
|
||||
|
||||
void Zone::LoadAlternateAdvancement() {
|
||||
LogInfo("Loading Alternate Advancement Data");
|
||||
if(!content_db.LoadAlternateAdvancementAbilities(aa_abilities,
|
||||
aa_ranks))
|
||||
{
|
||||
@@ -1710,7 +1709,6 @@ void Zone::LoadAlternateAdvancement() {
|
||||
return;
|
||||
}
|
||||
|
||||
LogInfo("Processing Alternate Advancement Data");
|
||||
for(const auto &ability : aa_abilities) {
|
||||
ability.second->first = GetAlternateAdvancementRank(ability.second->first_rank_id);
|
||||
|
||||
@@ -1760,14 +1758,11 @@ void Zone::LoadAlternateAdvancement() {
|
||||
current = current->next;
|
||||
}
|
||||
}
|
||||
|
||||
LogInfo("Loaded Alternate Advancement Data");
|
||||
}
|
||||
|
||||
bool ZoneDatabase::LoadAlternateAdvancementAbilities(std::unordered_map<int, std::unique_ptr<AA::Ability>> &abilities,
|
||||
std::unordered_map<int, std::unique_ptr<AA::Rank>> &ranks)
|
||||
{
|
||||
LogInfo("Loading Alternate Advancement Abilities");
|
||||
abilities.clear();
|
||||
std::string query = "SELECT id, name, category, classes, races, deities, drakkin_heritage, status, type, charges, "
|
||||
"grant_only, reset_on_death, first_rank_id FROM aa_ability WHERE enabled = 1";
|
||||
@@ -1798,11 +1793,10 @@ bool ZoneDatabase::LoadAlternateAdvancementAbilities(std::unordered_map<int, std
|
||||
return false;
|
||||
}
|
||||
|
||||
LogInfo("Loaded [{}] Alternate Advancement Abilities", (int)abilities.size());
|
||||
LogInfo("Loaded [{}] Alternate Advancement Abilities", Strings::Commify((int)abilities.size()));
|
||||
int expansion = RuleI(Expansion, CurrentExpansion);
|
||||
bool use_expansion_aa = RuleB(Expansion, UseCurrentExpansionAAOnly);
|
||||
|
||||
LogInfo("Loading Alternate Advancement Ability Ranks");
|
||||
ranks.clear();
|
||||
if (use_expansion_aa && expansion >= 0) {
|
||||
query = fmt::format("SELECT id, upper_hotkey_sid, lower_hotkey_sid, title_sid, desc_sid, cost, level_req, spell, spell_type, recast_time, "
|
||||
@@ -1840,9 +1834,8 @@ bool ZoneDatabase::LoadAlternateAdvancementAbilities(std::unordered_map<int, std
|
||||
return false;
|
||||
}
|
||||
|
||||
LogInfo("Loaded [{}] Alternate Advancement Ability Ranks", (int)ranks.size());
|
||||
LogInfo("Loaded [{}] Alternate Advancement Ability Ranks", Strings::Commify((int)ranks.size()));
|
||||
|
||||
LogInfo("Loading Alternate Advancement Ability Rank Effects");
|
||||
query = "SELECT rank_id, slot, effect_id, base1, base2 FROM aa_rank_effects";
|
||||
results = QueryDatabase(query);
|
||||
if(results.Success()) {
|
||||
@@ -1867,9 +1860,8 @@ bool ZoneDatabase::LoadAlternateAdvancementAbilities(std::unordered_map<int, std
|
||||
return false;
|
||||
}
|
||||
|
||||
LogInfo("Loaded Alternate Advancement Ability Rank Effects");
|
||||
LogInfo("Loaded [{}] Alternate Advancement Ability Rank Effects", Strings::Commify(results.RowCount()));
|
||||
|
||||
LogInfo("Loading Alternate Advancement Ability Rank Prereqs");
|
||||
query = "SELECT rank_id, aa_id, points FROM aa_rank_prereqs";
|
||||
results = QueryDatabase(query);
|
||||
if(results.Success()) {
|
||||
@@ -1892,7 +1884,7 @@ bool ZoneDatabase::LoadAlternateAdvancementAbilities(std::unordered_map<int, std
|
||||
return false;
|
||||
}
|
||||
|
||||
LogInfo("Loaded Alternate Advancement Ability Rank Prereqs");
|
||||
LogInfo("Loaded [{}] Alternate Advancement Ability Rank Prereqs", Strings::Commify(results.RowCount()));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
+10
-10
@@ -2332,21 +2332,21 @@ void Bot::BotRangedAttack(Mob* other) {
|
||||
|
||||
//break invis when you attack
|
||||
if(invisible) {
|
||||
LogCombatModerate("[Bot::BotRangedAttack] Removing invisibility due to melee attack");
|
||||
LogCombatDetail("Removing invisibility due to melee attack");
|
||||
BuffFadeByEffect(SE_Invisibility);
|
||||
BuffFadeByEffect(SE_Invisibility2);
|
||||
invisible = false;
|
||||
}
|
||||
|
||||
if(invisible_undead) {
|
||||
LogCombatModerate("[Bot::BotRangedAttack] Removing invisibility vs. undead due to melee attack");
|
||||
LogCombatDetail("Removing invisibility vs. undead due to melee attack");
|
||||
BuffFadeByEffect(SE_InvisVsUndead);
|
||||
BuffFadeByEffect(SE_InvisVsUndead2);
|
||||
invisible_undead = false;
|
||||
}
|
||||
|
||||
if(invisible_animals) {
|
||||
LogCombatModerate("[Bot::BotRangedAttack] Removing invisibility vs. animals due to melee attack");
|
||||
LogCombatDetail("Removing invisibility vs. animals due to melee attack");
|
||||
BuffFadeByEffect(SE_InvisVsAnimals);
|
||||
invisible_animals = false;
|
||||
}
|
||||
@@ -5330,7 +5330,7 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b
|
||||
|
||||
if ((GetHP() <= 0) || (GetAppearance() == eaDead)) {
|
||||
SetTarget(nullptr);
|
||||
LogCombatModerate("[Bot::Attack] Attempted to attack [{}] while unconscious or, otherwise, appearing dead", other->GetCleanName());
|
||||
LogCombatDetail("Attempted to attack [{}] while unconscious or, otherwise, appearing dead", other->GetCleanName());
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -6498,7 +6498,7 @@ bool Bot::CastSpell(
|
||||
(IsSilenced() && !IsDiscipline(spell_id)) ||
|
||||
(IsAmnesiad() && IsDiscipline(spell_id))
|
||||
) {
|
||||
LogSpellsModerate("[Bot::CastSpell] Spell casting canceled: not able to cast now. Valid? [{}] casting [{}] waiting? [{}] spellend? [{}] stunned? [{}] feared? [{}] mezed? [{}] silenced? [{}]",
|
||||
LogSpellsDetail("Spell casting canceled: not able to cast now. Valid? [{}] casting [{}] waiting? [{}] spellend? [{}] stunned? [{}] feared? [{}] mezed? [{}] silenced? [{}]",
|
||||
IsValidSpell(spell_id), casting_spell_id, delaytimer, spellend_timer.Enabled(), IsStunned(), IsFeared(), IsMezzed(), IsSilenced()
|
||||
);
|
||||
if (IsSilenced() && !IsDiscipline(spell_id)) {
|
||||
@@ -6537,7 +6537,7 @@ bool Bot::CastSpell(
|
||||
InterruptSpell(fizzle_msg, 0x121, spell_id);
|
||||
|
||||
uint32 use_mana = ((spells[spell_id].mana) / 4);
|
||||
LogSpellsModerate("[Bot::CastSpell] Spell casting canceled: fizzled. [{}] mana has been consumed", use_mana);
|
||||
LogSpellsDetail("Spell casting canceled: fizzled. [{}] mana has been consumed", use_mana);
|
||||
SetMana(GetMana() - use_mana);
|
||||
return false;
|
||||
}
|
||||
@@ -6595,19 +6595,19 @@ bool Bot::IsImmuneToSpell(uint16 spell_id, Mob *caster) {
|
||||
if(caster->IsBot()) {
|
||||
if(spells[spell_id].target_type == ST_Undead) {
|
||||
if((GetBodyType() != BT_SummonedUndead) && (GetBodyType() != BT_Undead) && (GetBodyType() != BT_Vampire)) {
|
||||
LogSpellsModerate("[Bot::IsImmuneToSpell] Bot's target is not an undead");
|
||||
LogSpellsDetail("Bot's target is not an undead");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if(spells[spell_id].target_type == ST_Summoned) {
|
||||
if((GetBodyType() != BT_SummonedUndead) && (GetBodyType() != BT_Summoned) && (GetBodyType() != BT_Summoned2) && (GetBodyType() != BT_Summoned3)) {
|
||||
LogSpellsModerate("[Bot::IsImmuneToSpell] Bot's target is not a summoned creature");
|
||||
LogSpellsDetail("Bot's target is not a summoned creature");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
LogSpellsModerate("[Bot::IsImmuneToSpell] No bot immunities to spell [{}] found", spell_id);
|
||||
LogSpellsDetail("No bot immunities to spell [{}] found", spell_id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8712,7 +8712,7 @@ void EntityList::ScanCloseClientMobs(std::unordered_map<uint16, Mob*>& close_mob
|
||||
}
|
||||
}
|
||||
|
||||
LogAIScanCloseModerate("[EntityList::ScanCloseClientMobs] Close Client Mob List Size [{}] for mob [{}]", close_mobs.size(), scanning_mob->GetCleanName());
|
||||
LogAIScanCloseDetail("Close Client Mob List Size [{}] for mob [{}]", close_mobs.size(), scanning_mob->GetCleanName());
|
||||
}
|
||||
|
||||
uint8 Bot::GetNumberNeedingHealedInGroup(uint8 hpr, bool includePets) {
|
||||
|
||||
@@ -76,9 +76,8 @@ bool BotDatabase::UpdateInjectedBotCommandSettings(const std::vector<std::pair<s
|
||||
return false;
|
||||
}
|
||||
|
||||
Log(Logs::General,
|
||||
Logs::Status,
|
||||
"%u New Bot Command%s Added",
|
||||
LogInfo(
|
||||
"[{}] New Bot Command{} Added",
|
||||
injected.size(),
|
||||
(injected.size() == 1 ? "" : "s")
|
||||
);
|
||||
@@ -100,9 +99,8 @@ bool BotDatabase::UpdateOrphanedBotCommandSettings(const std::vector<std::string
|
||||
return false;
|
||||
}
|
||||
|
||||
Log(Logs::General,
|
||||
Logs::Status,
|
||||
"%u Orphaned Bot Command%s Deleted",
|
||||
LogInfo(
|
||||
"[{}] Orphaned Bot Command{} Deleted",
|
||||
orphaned.size(),
|
||||
(orphaned.size() == 1 ? "" : "s")
|
||||
);
|
||||
|
||||
@@ -1751,7 +1751,7 @@ bool Bot::AIHealRotation(Mob* tar, bool useFastHeals) {
|
||||
}
|
||||
}
|
||||
|
||||
LogAIModerate("[Bot::AIHealRotation] heal spellid [{}] fastheals [{}] casterlevel [{}]",
|
||||
LogAIDetail("[Bot::AIHealRotation] heal spellid [{}] fastheals [{}] casterlevel [{}]",
|
||||
botSpell.SpellId, ((useFastHeals) ? ('T') : ('F')), GetLevel());
|
||||
|
||||
LogAIDetail("[Bot::AIHealRotation] target [{}] current_time [{}] donthealmebefore [{}]", tar->GetCleanName(), Timer::GetCurrentTime(), tar->DontHealMeBefore());
|
||||
|
||||
@@ -430,6 +430,8 @@ void MapOpcodes()
|
||||
ConnectedOpcodes[OP_SharedTaskAcceptNew] = &Client::Handle_OP_SharedTaskAccept;
|
||||
ConnectedOpcodes[OP_SharedTaskQuit] = &Client::Handle_OP_SharedTaskQuit;
|
||||
ConnectedOpcodes[OP_SharedTaskPlayerList] = &Client::Handle_OP_SharedTaskPlayerList;
|
||||
|
||||
LogInfo("Mapped [{}] client opcode handlers", _maxEmuOpcode);
|
||||
}
|
||||
|
||||
void ClearMappedOpcode(EmuOpcode op)
|
||||
|
||||
+1
-3
@@ -718,14 +718,12 @@ int ZoneDatabase::GetDoorsDBCountPlusOne(std::string zone_short_name, int16 vers
|
||||
|
||||
std::vector<DoorsRepository::Doors> ZoneDatabase::LoadDoors(const std::string &zone_name, int16 version)
|
||||
{
|
||||
LogInfo("Loading Doors from database");
|
||||
|
||||
auto door_entries = DoorsRepository::GetWhere(
|
||||
*this, fmt::format(
|
||||
"zone = '{}' AND (version = {} OR version = -1) {} ORDER BY doorid ASC",
|
||||
zone_name, version, ContentFilterCriteria::apply()));
|
||||
|
||||
LogDoors("Loaded [{}] doors for [{}] version [{}]", door_entries.size(), zone_name, version);
|
||||
LogDoors("Loaded [{}] doors for [{}] version [{}]", Strings::Commify(door_entries.size()), zone_name, version);
|
||||
|
||||
return door_entries;
|
||||
}
|
||||
|
||||
@@ -145,6 +145,7 @@ void DynamicZone::CacheAllFromDatabase()
|
||||
zone->dynamic_zone_cache.emplace(dz_id, std::move(dz));
|
||||
}
|
||||
|
||||
LogInfo("Loaded [{}] dynamic zone(s)", Strings::Commify(zone->dynamic_zone_cache.size()));
|
||||
LogDynamicZones("Caching [{}] dynamic zone(s) took [{}s]", zone->dynamic_zone_cache.size(), bench.elapsed());
|
||||
}
|
||||
|
||||
@@ -240,7 +241,7 @@ void DynamicZone::HandleWorldMessage(ServerPacket* pack)
|
||||
auto expedition = Expedition::FindCachedExpeditionByDynamicZoneID(dz->GetID());
|
||||
if (expedition)
|
||||
{
|
||||
LogExpeditionsModerate("Deleting expedition [{}] from zone cache", expedition->GetID());
|
||||
LogExpeditionsDetail("Deleting expedition [{}] from zone cache", expedition->GetID());
|
||||
zone->expedition_cache.erase(expedition->GetID());
|
||||
}
|
||||
}
|
||||
|
||||
+4
-4
@@ -697,12 +697,12 @@ void EntityList::AddNPC(NPC *npc, bool send_spawn_packet, bool dont_queue)
|
||||
owner->SetPetID(npc->GetID());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
npc_list.insert(std::pair<uint16, NPC *>(npc->GetID(), npc));
|
||||
mob_list.insert(std::pair<uint16, Mob *>(npc->GetID(), npc));
|
||||
|
||||
|
||||
parse->EventNPC(EVENT_SPAWN, npc, nullptr, "", 0);
|
||||
|
||||
|
||||
const auto emote_id = npc->GetEmoteID();
|
||||
if (emote_id != 0) {
|
||||
npc->DoNPCEmote(EQ::constants::EmoteEventTypes::OnSpawn, emote_id);
|
||||
@@ -2956,7 +2956,7 @@ void EntityList::ScanCloseMobs(
|
||||
}
|
||||
}
|
||||
|
||||
LogAIScanCloseModerate(
|
||||
LogAIScanCloseDetail(
|
||||
"[{}] Scanning Close List | list_size [{}] moving [{}]",
|
||||
scanning_mob->GetCleanName(),
|
||||
close_mobs.size(),
|
||||
|
||||
+6
-4
@@ -92,7 +92,7 @@ Expedition* Expedition::TryCreate(Client* requester, DynamicZone& dz_request, bo
|
||||
// request parses leader, members list, and lockouts while validating
|
||||
if (!request.Validate(requester))
|
||||
{
|
||||
LogExpeditionsModerate("[{}] request by [{}] denied", request.GetExpeditionName(), requester->GetName());
|
||||
LogExpeditionsDetail("[{}] request by [{}] denied", request.GetExpeditionName(), requester->GetName());
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -231,6 +231,8 @@ bool Expedition::CacheAllFromDatabase()
|
||||
|
||||
CacheExpeditions(std::move(expeditions));
|
||||
|
||||
LogInfo("Loaded [{}] expedition(s)", Strings::Commify(zone->expedition_cache.size()));
|
||||
|
||||
LogExpeditions("Caching [{}] expedition(s) took [{}s]", zone->expedition_cache.size(), benchmark.elapsed());
|
||||
|
||||
return true;
|
||||
@@ -430,7 +432,7 @@ void Expedition::SendClientExpeditionInvite(
|
||||
return;
|
||||
}
|
||||
|
||||
LogExpeditionsModerate(
|
||||
LogExpeditionsDetail(
|
||||
"Sending expedition [{}] invite to player [{}] inviter [{}] swap name [{}]",
|
||||
m_id, client->GetName(), inviter_name, swap_remove_name
|
||||
);
|
||||
@@ -575,7 +577,7 @@ void Expedition::DzInviteResponse(Client* add_client, bool accepted, const std::
|
||||
return;
|
||||
}
|
||||
|
||||
LogExpeditionsModerate("Invite response by [{}] accepted [{}] swap_name [{}]",
|
||||
LogExpeditionsDetail("Invite response by [{}] accepted [{}] swap_name [{}]",
|
||||
add_client->GetName(), accepted, swap_remove_name);
|
||||
|
||||
// a null leader_client is handled by SendLeaderMessage fallbacks
|
||||
@@ -681,7 +683,7 @@ void Expedition::TryAddClient(
|
||||
return;
|
||||
}
|
||||
|
||||
LogExpeditionsModerate(
|
||||
LogExpeditionsDetail(
|
||||
"Add player request for expedition [{}] by inviter [{}] add name [{}] swap name [{}]",
|
||||
m_id, inviter_name, add_client->GetName(), swap_remove_name
|
||||
);
|
||||
|
||||
+31
-43
@@ -3,10 +3,6 @@
|
||||
|
||||
extern WorldServer worldserver;
|
||||
|
||||
inline void print_legend(Client *c) {
|
||||
c->Message(Chat::White, "[Legend] [G = GM Say] [F = File] [C = Console] [D = Discord]");
|
||||
}
|
||||
|
||||
void command_logs(Client *c, const Seperator *sep)
|
||||
{
|
||||
int arguments = sep->argnum;
|
||||
@@ -30,9 +26,9 @@ void command_logs(Client *c, const Seperator *sep)
|
||||
return;
|
||||
}
|
||||
|
||||
bool is_list = !strcasecmp(sep->arg[1], "list");
|
||||
bool is_list = !strcasecmp(sep->arg[1], "list");
|
||||
bool is_reload = !strcasecmp(sep->arg[1], "reload");
|
||||
bool is_set = !strcasecmp(sep->arg[1], "set");
|
||||
bool is_set = !strcasecmp(sep->arg[1], "set");
|
||||
|
||||
if (!is_list && !is_reload && !is_set) {
|
||||
c->Message(
|
||||
@@ -62,7 +58,6 @@ void command_logs(Client *c, const Seperator *sep)
|
||||
|
||||
uint32 max_category_id = (start_category_id + 49);
|
||||
|
||||
print_legend(c);
|
||||
c->Message(Chat::White, "------------------------------------------------");
|
||||
|
||||
for (int index = start_category_id; index <= max_category_id; index++) {
|
||||
@@ -71,16 +66,16 @@ void command_logs(Client *c, const Seperator *sep)
|
||||
break;
|
||||
}
|
||||
|
||||
bool is_deprecated_category = Strings::Contains(fmt::format("{}", Logs::LogCategoryName[index]), "Deprecated");
|
||||
bool is_deprecated_category = Strings::Contains(
|
||||
fmt::format("{}", Logs::LogCategoryName[index]),
|
||||
"Deprecated"
|
||||
);
|
||||
if (is_deprecated_category) {
|
||||
continue;
|
||||
}
|
||||
|
||||
std::vector<std::string> gmsay;
|
||||
for (int i = 0; i <= 3; i++) {
|
||||
if (i == 2) {
|
||||
continue;
|
||||
}
|
||||
for (int i = 0; i <= 2; i++) {
|
||||
if (LogSys.log_settings[index].log_to_gmsay == i) {
|
||||
gmsay.emplace_back(std::to_string(i));
|
||||
continue;
|
||||
@@ -94,10 +89,7 @@ void command_logs(Client *c, const Seperator *sep)
|
||||
}
|
||||
|
||||
std::vector<std::string> file;
|
||||
for (int i = 0; i <= 3; i++) {
|
||||
if (i == 2) {
|
||||
continue;
|
||||
}
|
||||
for (int i = 0; i <= 2; i++) {
|
||||
if (LogSys.log_settings[index].log_to_file == i) {
|
||||
file.emplace_back(std::to_string(i));
|
||||
continue;
|
||||
@@ -111,10 +103,7 @@ void command_logs(Client *c, const Seperator *sep)
|
||||
}
|
||||
|
||||
std::vector<std::string> console;
|
||||
for (int i = 0; i <= 3; i++) {
|
||||
if (i == 2) {
|
||||
continue;
|
||||
}
|
||||
for (int i = 0; i <= 2; i++) {
|
||||
if (LogSys.log_settings[index].log_to_console == i) {
|
||||
console.emplace_back(std::to_string(i));
|
||||
continue;
|
||||
@@ -128,10 +117,7 @@ void command_logs(Client *c, const Seperator *sep)
|
||||
}
|
||||
|
||||
std::vector<std::string> discord;
|
||||
for (int i = 0; i <= 3; i++) {
|
||||
if (i == 2) {
|
||||
continue;
|
||||
}
|
||||
for (int i = 0; i <= 2; i++) {
|
||||
if (LogSys.log_settings[index].log_to_discord == i) {
|
||||
discord.emplace_back(std::to_string(i));
|
||||
continue;
|
||||
@@ -144,29 +130,23 @@ void command_logs(Client *c, const Seperator *sep)
|
||||
);
|
||||
}
|
||||
|
||||
std::string gmsay_string = Strings::Join(gmsay, "-");
|
||||
std::string gmsay_string = Strings::Join(gmsay, "-");
|
||||
std::string console_string = Strings::Join(console, "-");
|
||||
std::string file_string = Strings::Join(file, "-");
|
||||
std::string file_string = Strings::Join(file, "-");
|
||||
std::string discord_string = Strings::Join(discord, "-");
|
||||
|
||||
c->Message(
|
||||
0,
|
||||
fmt::format(
|
||||
"G [{}] C [{}] F [{}] D [{}] [{}] [{}] ",
|
||||
"[{}] GM [{}] Console [{}] File [{}] Discord [{}] [{}] ",
|
||||
index,
|
||||
Strings::RTrim(gmsay_string, "-"),
|
||||
Strings::RTrim(console_string, "-"),
|
||||
Strings::RTrim(file_string, "-"),
|
||||
Strings::RTrim(discord_string, "-"),
|
||||
index,
|
||||
Logs::LogCategoryName[index]
|
||||
).c_str()
|
||||
);
|
||||
|
||||
if (index % 10 == 0) {
|
||||
c->Message(Chat::White, "------------------------------------------------");
|
||||
print_legend(c);
|
||||
c->Message(Chat::White, "------------------------------------------------");
|
||||
}
|
||||
}
|
||||
|
||||
c->Message(Chat::White, "------------------------------------------------");
|
||||
@@ -199,18 +179,21 @@ void command_logs(Client *c, const Seperator *sep)
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
} else if (is_reload) {
|
||||
}
|
||||
else if (is_reload) {
|
||||
c->Message(Chat::White, "Attempting to reload Log Settings globally.");
|
||||
auto pack = new ServerPacket(ServerOP_ReloadLogs, 0);
|
||||
worldserver.SendPacket(pack);
|
||||
safe_delete(pack);
|
||||
} else if (is_set && sep->IsNumber(3)) {
|
||||
auto logs_set = false;
|
||||
}
|
||||
else if (is_set && sep->IsNumber(3)) {
|
||||
auto logs_set = false;
|
||||
bool is_console = !strcasecmp(sep->arg[2], "console");
|
||||
bool is_file = !strcasecmp(sep->arg[2], "file");
|
||||
bool is_gmsay = !strcasecmp(sep->arg[2], "gmsay");
|
||||
bool is_file = !strcasecmp(sep->arg[2], "file");
|
||||
bool is_gmsay = !strcasecmp(sep->arg[2], "gmsay");
|
||||
bool is_discord = !strcasecmp(sep->arg[2], "discord");
|
||||
|
||||
if (!sep->IsNumber(4) || (!is_console && !is_file && !is_gmsay)) {
|
||||
if (!sep->IsNumber(4) || (!is_console && !is_file && !is_gmsay && !is_discord)) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
"#logs set [console|file|gmsay] [Category ID] [Debug Level (1-3)] - Sets log settings during the lifetime of the zone"
|
||||
@@ -222,15 +205,20 @@ void command_logs(Client *c, const Seperator *sep)
|
||||
logs_set = true;
|
||||
|
||||
auto category_id = std::stoul(sep->arg[3]);
|
||||
auto setting = std::stoul(sep->arg[4]);
|
||||
auto setting = std::stoul(sep->arg[4]);
|
||||
|
||||
if (is_console) {
|
||||
LogSys.log_settings[category_id].log_to_console = setting;
|
||||
} else if (is_file) {
|
||||
}
|
||||
else if (is_file) {
|
||||
LogSys.log_settings[category_id].log_to_file = setting;
|
||||
} else if (is_gmsay) {
|
||||
}
|
||||
else if (is_gmsay) {
|
||||
LogSys.log_settings[category_id].log_to_gmsay = setting;
|
||||
}
|
||||
else if (is_discord) {
|
||||
LogSys.log_settings[category_id].log_to_discord = setting;
|
||||
}
|
||||
|
||||
if (logs_set) {
|
||||
c->Message(
|
||||
|
||||
@@ -618,6 +618,8 @@ void ZoneDatabase::LoadGlobalLoot()
|
||||
return;
|
||||
}
|
||||
|
||||
LogInfo("Loaded [{}] global loot entries", Strings::Commify(results.RowCount()));
|
||||
|
||||
// we might need this, lets not keep doing it in a loop
|
||||
auto zoneid = std::to_string(zone->GetZoneID());
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
|
||||
+50
-62
@@ -151,7 +151,7 @@ int main(int argc, char** argv) {
|
||||
|
||||
QServ = new QueryServ;
|
||||
|
||||
LogInfo("Loading server configuration..");
|
||||
LogInfo("Loading server configuration");
|
||||
if (!ZoneConfig::LoadConfig()) {
|
||||
LogError("Loading server configuration failed");
|
||||
return 1;
|
||||
@@ -231,7 +231,7 @@ int main(int argc, char** argv) {
|
||||
worldserver.SetLauncherName("NONE");
|
||||
}
|
||||
|
||||
LogInfo("Connecting to MySQL... ");
|
||||
LogInfo("Connecting to MySQL");
|
||||
if (!database.Connect(
|
||||
Config->DatabaseHost.c_str(),
|
||||
Config->DatabaseUsername.c_str(),
|
||||
@@ -276,7 +276,7 @@ int main(int argc, char** argv) {
|
||||
_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
|
||||
#endif
|
||||
|
||||
LogInfo("CURRENT_VERSION: {}", CURRENT_VERSION);
|
||||
LogInfo("CURRENT_VERSION [{}]", CURRENT_VERSION);
|
||||
|
||||
/*
|
||||
* Setup nice signal handlers
|
||||
@@ -296,10 +296,8 @@ int main(int argc, char** argv) {
|
||||
}
|
||||
#endif
|
||||
|
||||
LogInfo("Mapping Incoming Opcodes");
|
||||
MapOpcodes();
|
||||
|
||||
LogInfo("Loading Variables");
|
||||
database.LoadVariables();
|
||||
|
||||
std::string hotfix_name;
|
||||
@@ -309,40 +307,10 @@ int main(int argc, char** argv) {
|
||||
}
|
||||
}
|
||||
|
||||
LogInfo("Loading zone names");
|
||||
|
||||
zone_store.LoadZones(content_db);
|
||||
|
||||
LogInfo("Loading items");
|
||||
if (!database.LoadItems(hotfix_name)) {
|
||||
LogError("Loading items failed!");
|
||||
LogError("Failed. But ignoring error and going on..");
|
||||
}
|
||||
|
||||
LogInfo("Loading npc faction lists");
|
||||
if (!content_db.LoadNPCFactionLists(hotfix_name)) {
|
||||
LogError("Loading npcs faction lists failed!");
|
||||
return 1;
|
||||
}
|
||||
LogInfo("Loading faction association hits");
|
||||
if (!content_db.LoadFactionAssociation(hotfix_name)) {
|
||||
LogError("Loading faction association hits failed!");
|
||||
return 1;
|
||||
}
|
||||
LogInfo("Loading loot tables");
|
||||
if (!database.LoadLoot(hotfix_name)) {
|
||||
LogError("Loading loot failed!");
|
||||
return 1;
|
||||
}
|
||||
LogInfo("Loading skill caps");
|
||||
if (!content_db.LoadSkillCaps(std::string(hotfix_name))) {
|
||||
LogError("Loading skill caps failed!");
|
||||
return 1;
|
||||
}
|
||||
|
||||
LogInfo("Loading spells");
|
||||
if (!database.LoadSpells(hotfix_name, &SPDAT_RECORDS, &spells)) {
|
||||
LogError("Loading spells failed!");
|
||||
if (zone_store.GetZones().empty()) {
|
||||
LogError("Failed to load zones data, check your schema for possible errors");
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -350,37 +318,55 @@ int main(int argc, char** argv) {
|
||||
database.SetSharedItemsCount(content_db.GetItemsCount());
|
||||
database.SetSharedSpellsCount(content_db.GetSpellsCount());
|
||||
|
||||
LogInfo("Loading base data");
|
||||
if (!database.LoadItems(hotfix_name)) {
|
||||
LogError("Loading items failed!");
|
||||
LogError("Failed. But ignoring error and going on..");
|
||||
}
|
||||
|
||||
if (!content_db.LoadNPCFactionLists(hotfix_name)) {
|
||||
LogError("Loading npcs faction lists failed!");
|
||||
return 1;
|
||||
}
|
||||
if (!content_db.LoadFactionAssociation(hotfix_name)) {
|
||||
LogError("Loading faction association hits failed!");
|
||||
return 1;
|
||||
}
|
||||
if (!database.LoadLoot(hotfix_name)) {
|
||||
LogError("Loading loot failed!");
|
||||
return 1;
|
||||
}
|
||||
if (!content_db.LoadSkillCaps(std::string(hotfix_name))) {
|
||||
LogError("Loading skill caps failed!");
|
||||
return 1;
|
||||
}
|
||||
if (!database.LoadSpells(hotfix_name, &SPDAT_RECORDS, &spells)) {
|
||||
LogError("Loading spells failed!");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (!database.LoadBaseData(hotfix_name)) {
|
||||
LogError("Loading base data failed!");
|
||||
return 1;
|
||||
}
|
||||
|
||||
LogInfo("Loading guilds");
|
||||
guild_mgr.LoadGuilds();
|
||||
|
||||
LogInfo("Loading factions");
|
||||
content_db.LoadFactionData();
|
||||
|
||||
LogInfo("Loading titles");
|
||||
title_manager.LoadTitles();
|
||||
|
||||
LogInfo("Loading tributes");
|
||||
content_db.LoadTributes();
|
||||
|
||||
LogInfo("Loading corpse timers");
|
||||
database.GetDecayTimes(npcCorpseDecayTimes);
|
||||
|
||||
LogInfo("Loading profanity list");
|
||||
if (!EQ::ProfanityManager::LoadProfanityList(&database))
|
||||
if (!EQ::ProfanityManager::LoadProfanityList(&database)) {
|
||||
LogError("Loading profanity list failed!");
|
||||
}
|
||||
|
||||
LogInfo("Loading commands");
|
||||
int retval = command_init();
|
||||
if (retval < 0)
|
||||
if (retval < 0) {
|
||||
LogError("Command loading failed");
|
||||
else
|
||||
LogInfo("{} commands loaded", retval);
|
||||
}
|
||||
else {
|
||||
LogInfo("Loaded [{}] commands loaded", Strings::Commify(std::to_string(retval)));
|
||||
}
|
||||
|
||||
//rules:
|
||||
{
|
||||
@@ -395,13 +381,9 @@ int main(int argc, char** argv) {
|
||||
if (!RuleManager::Instance()->LoadRules(&database, "default", false)) {
|
||||
LogInfo("No rule set configured, using default rules");
|
||||
}
|
||||
else {
|
||||
LogInfo("Loaded default rule set 'default'");
|
||||
}
|
||||
}
|
||||
|
||||
EQ::InitializeDynamicLookups();
|
||||
LogInfo("Initialized dynamic dictionary entries");
|
||||
}
|
||||
|
||||
content_service.SetDatabase(&database)
|
||||
@@ -509,7 +491,7 @@ int main(int argc, char** argv) {
|
||||
* Websocket server
|
||||
*/
|
||||
if (!websocker_server_opened && Config->ZonePort != 0) {
|
||||
LogInfo("Websocket Server listener started ([{}]:[{}])", Config->TelnetIP.c_str(), Config->ZonePort);
|
||||
LogInfo("Websocket Server listener started on address [{}] port [{}]", Config->TelnetIP.c_str(), Config->ZonePort);
|
||||
ws_server = std::make_unique<EQ::Net::WebsocketServer>(Config->TelnetIP, Config->ZonePort);
|
||||
RegisterApiService(ws_server);
|
||||
websocker_server_opened = true;
|
||||
@@ -519,7 +501,7 @@ int main(int argc, char** argv) {
|
||||
* EQStreamManager
|
||||
*/
|
||||
if (!eqsf_open && Config->ZonePort != 0) {
|
||||
LogInfo("Starting EQ Network server on port {}", Config->ZonePort);
|
||||
LogInfo("Starting EQ Network server on port [{}]", Config->ZonePort);
|
||||
|
||||
EQStreamManagerInterfaceOptions opts(Config->ZonePort, false, RuleB(Network, CompressZoneStream));
|
||||
opts.daybreak_options.resend_delay_ms = RuleI(Network, ResendDelayBaseMS);
|
||||
@@ -530,10 +512,16 @@ int main(int argc, char** argv) {
|
||||
eqsm = std::make_unique<EQ::Net::EQStreamManager>(opts);
|
||||
eqsf_open = true;
|
||||
|
||||
eqsm->OnNewConnection([&stream_identifier](std::shared_ptr<EQ::Net::EQStream> stream) {
|
||||
stream_identifier.AddStream(stream);
|
||||
LogInfo("New connection from IP {}:{}", long2ip(stream->GetRemoteIP()), ntohs(stream->GetRemotePort()));
|
||||
});
|
||||
eqsm->OnNewConnection(
|
||||
[&stream_identifier](std::shared_ptr<EQ::Net::EQStream> stream) {
|
||||
stream_identifier.AddStream(stream);
|
||||
LogInfo(
|
||||
"New connection from address [{}] port [{}]",
|
||||
long2ip(stream->GetRemoteIP()),
|
||||
ntohs(stream->GetRemotePort())
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
//give the stream identifier a chance to do its work....
|
||||
|
||||
+6
-6
@@ -6047,7 +6047,7 @@ void Client::SendMercMerchantResponsePacket(int32 response_type) {
|
||||
MercenaryMerchantResponse_Struct* mmr = (MercenaryMerchantResponse_Struct*)outapp->pBuffer;
|
||||
mmr->ResponseType = response_type; // send specified response type
|
||||
FastQueuePacket(&outapp);
|
||||
Log(Logs::Moderate, Logs::Mercenaries, "Sent SendMercMerchantResponsePacket ResponseType: %i, Client: %s.", response_type, GetName());
|
||||
Log(Logs::Detail, Logs::Mercenaries, "Sent SendMercMerchantResponsePacket ResponseType: %i, Client: %s.", response_type, GetName());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6056,7 +6056,7 @@ void Client::SendMercenaryUnknownPacket(uint8 type) {
|
||||
auto outapp = new EQApplicationPacket(OP_MercenaryUnknown1, 1);
|
||||
outapp->WriteUInt8(type);
|
||||
FastQueuePacket(&outapp);
|
||||
Log(Logs::Moderate, Logs::Mercenaries, "Sent SendMercenaryUnknownPacket Type: %i, Client: %s.", type, GetName());
|
||||
Log(Logs::Detail, Logs::Mercenaries, "Sent SendMercenaryUnknownPacket Type: %i, Client: %s.", type, GetName());
|
||||
|
||||
}
|
||||
|
||||
@@ -6065,7 +6065,7 @@ void Client::SendMercenaryUnsuspendPacket(uint8 type) {
|
||||
auto outapp = new EQApplicationPacket(OP_MercenaryUnsuspendResponse, 1);
|
||||
outapp->WriteUInt8(type);
|
||||
FastQueuePacket(&outapp);
|
||||
Log(Logs::Moderate, Logs::Mercenaries, "Sent SendMercenaryUnsuspendPacket Type: %i, Client: %s.", type, GetName());
|
||||
Log(Logs::Detail, Logs::Mercenaries, "Sent SendMercenaryUnsuspendPacket Type: %i, Client: %s.", type, GetName());
|
||||
|
||||
}
|
||||
|
||||
@@ -6075,7 +6075,7 @@ void Client::SendMercSuspendResponsePacket(uint32 suspended_time) {
|
||||
SuspendMercenaryResponse_Struct* smr = (SuspendMercenaryResponse_Struct*)outapp->pBuffer;
|
||||
smr->SuspendTime = suspended_time; // Seen 0 (not suspended) or c9 c2 64 4f (suspended on Sat Mar 17 11:58:49 2012) - Unix Timestamp
|
||||
FastQueuePacket(&outapp);
|
||||
Log(Logs::Moderate, Logs::Mercenaries, "Sent SendMercSuspendResponsePacket Time: %i, Client: %s.", suspended_time, GetName());
|
||||
Log(Logs::Detail, Logs::Mercenaries, "Sent SendMercSuspendResponsePacket Time: %i, Client: %s.", suspended_time, GetName());
|
||||
|
||||
}
|
||||
|
||||
@@ -6090,7 +6090,7 @@ void Client::SendMercTimerPacket(int32 entity_id, int32 merc_state, int32 suspen
|
||||
mss->UpdateInterval = update_interval; // Seen 900000 - 15 minutes in ms
|
||||
mss->MercUnk01 = unk01; // Seen 180000 - 3 minutes in ms - Used for the unsuspend button refresh timer
|
||||
FastQueuePacket(&outapp);
|
||||
Log(Logs::Moderate, Logs::Mercenaries, "Sent SendMercTimerPacket EndID: %i, State: %i, SuspendTime: %i, Interval: %i, Unk1: %i, Client: %s.", entity_id, merc_state, suspended_time, update_interval, unk01, GetName());
|
||||
Log(Logs::Detail, Logs::Mercenaries, "Sent SendMercTimerPacket EndID: %i, State: %i, SuspendTime: %i, Interval: %i, Unk1: %i, Client: %s.", entity_id, merc_state, suspended_time, update_interval, unk01, GetName());
|
||||
|
||||
}
|
||||
|
||||
@@ -6101,7 +6101,7 @@ void Client::SendMercAssignPacket(uint32 entityID, uint32 unk01, uint32 unk02) {
|
||||
mas->MercUnk01 = unk01;
|
||||
mas->MercUnk02 = unk02;
|
||||
FastQueuePacket(&outapp);
|
||||
Log(Logs::Moderate, Logs::Mercenaries, "Sent SendMercAssignPacket EndID: %i, Unk1: %i, Unk2: %i, Client: %s.", entityID, unk01, unk02, GetName());
|
||||
Log(Logs::Detail, Logs::Mercenaries, "Sent SendMercAssignPacket EndID: %i, Unk1: %i, Unk2: %i, Client: %s.", entityID, unk01, unk02, GetName());
|
||||
}
|
||||
|
||||
void NPC::LoadMercTypes() {
|
||||
|
||||
@@ -179,7 +179,8 @@ void NpcScaleManager::ResetNPCScaling(NPC *npc)
|
||||
|
||||
bool NpcScaleManager::LoadScaleData()
|
||||
{
|
||||
for (auto &s: NpcScaleGlobalBaseRepository::All(content_db)) {
|
||||
auto rows = NpcScaleGlobalBaseRepository::All(content_db);
|
||||
for (auto &s: rows) {
|
||||
global_npc_scale scale_data;
|
||||
|
||||
scale_data.type = s.type;
|
||||
@@ -222,7 +223,7 @@ bool NpcScaleManager::LoadScaleData()
|
||||
);
|
||||
}
|
||||
|
||||
LogNPCScaling("Global Base Scaling Data Loaded");
|
||||
LogInfo("Loaded [{}] global scaling data entries", Strings::Commify(rows.size()));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -575,6 +575,8 @@ bool ZoneDatabase::PopulateZoneSpawnList(uint32 zoneid, LinkedList<Spawn2*> &spa
|
||||
}
|
||||
}
|
||||
|
||||
LogInfo("Loaded [{}] respawn timer(s)", Strings::Commify(results.RowCount()));
|
||||
|
||||
const char *zone_name = ZoneName(zoneid);
|
||||
std::string query = StringFormat(
|
||||
"SELECT "
|
||||
@@ -634,6 +636,8 @@ bool ZoneDatabase::PopulateZoneSpawnList(uint32 zoneid, LinkedList<Spawn2*> &spa
|
||||
spawn2_list.Insert(new_spawn);
|
||||
}
|
||||
|
||||
LogInfo("Loaded [{}] spawn2 entries", Strings::Commify(results.RowCount()));
|
||||
|
||||
NPC::SpawnZoneController();
|
||||
|
||||
return true;
|
||||
@@ -1006,6 +1010,8 @@ bool SpawnConditionManager::LoadSpawnConditions(const char* zone_name, uint32 in
|
||||
LogSpawns("Loaded spawn condition [{}] with value [{}] and on_change [{}]", cond.condition_id, cond.value, cond.on_change);
|
||||
}
|
||||
|
||||
LogInfo("Loaded [{}] spawn_conditions", Strings::Commify(std::to_string(results.RowCount())));
|
||||
|
||||
//load values
|
||||
query = StringFormat("SELECT id, value FROM spawn_condition_values "
|
||||
"WHERE zone = '%s' AND instance_id = %u",
|
||||
@@ -1032,6 +1038,8 @@ bool SpawnConditionManager::LoadSpawnConditions(const char* zone_name, uint32 in
|
||||
return false;
|
||||
}
|
||||
|
||||
LogInfo("Loaded [{}] spawn_events", Strings::Commify(std::to_string(results.RowCount())));
|
||||
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
SpawnEvent event;
|
||||
|
||||
|
||||
@@ -225,6 +225,8 @@ bool ZoneDatabase::LoadSpawnGroups(const char *zone_name, uint16 version, SpawnG
|
||||
spawn_group_list->AddSpawnGroup(new_spawn_group);
|
||||
}
|
||||
|
||||
LogInfo("Loaded [{}] spawn group(s)", Strings::Commify(results.RowCount()));
|
||||
|
||||
query = fmt::format(
|
||||
SQL(
|
||||
SELECT
|
||||
@@ -273,6 +275,9 @@ bool ZoneDatabase::LoadSpawnGroups(const char *zone_name, uint16 version, SpawnG
|
||||
spawn_group->AddSpawnEntry(new_spawn_entry);
|
||||
}
|
||||
|
||||
LogInfo("Loaded [{}] spawn entries", Strings::Commify(results.RowCount()));
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+8
-5
@@ -3481,7 +3481,7 @@ int Mob::CanBuffStack(uint16 spellid, uint8 caster_level, bool iFailIfOverwrite)
|
||||
{
|
||||
int i, ret, firstfree = -2;
|
||||
|
||||
LogAIModerate("Checking if buff [{}] cast at level [{}] can stack on me.[{}]", spellid, caster_level, iFailIfOverwrite?" failing if we would overwrite something":"");
|
||||
LogAIDetail("Checking if buff [{}] cast at level [{}] can stack on me.[{}]", spellid, caster_level, iFailIfOverwrite?" failing if we would overwrite something":"");
|
||||
|
||||
int buff_count = GetMaxTotalSlots();
|
||||
for (i=0; i < buff_count; i++)
|
||||
@@ -3518,7 +3518,7 @@ int Mob::CanBuffStack(uint16 spellid, uint8 caster_level, bool iFailIfOverwrite)
|
||||
}
|
||||
}
|
||||
|
||||
LogAIModerate("Reporting that buff [{}] could successfully be placed into slot [{}]", spellid, firstfree);
|
||||
LogAIDetail("Reporting that buff [{}] could successfully be placed into slot [{}]", spellid, firstfree);
|
||||
|
||||
return firstfree;
|
||||
}
|
||||
@@ -5901,9 +5901,12 @@ bool Mob::FindType(uint16 type, bool bOffensive, uint16 threshold) {
|
||||
spells[buffs[i].spellid].base_value[j],
|
||||
spells[buffs[i].spellid].max_value[j],
|
||||
buffs[i].casterlevel, buffs[i].spellid);
|
||||
Log(Logs::General, Logs::Normal,
|
||||
"FindType: type = %d; value = %d; threshold = %d",
|
||||
type, value, threshold);
|
||||
LogSpells(
|
||||
"FindType type [{}] value [{}] threshold [{}]",
|
||||
type,
|
||||
value,
|
||||
threshold
|
||||
);
|
||||
if (value < threshold)
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -64,6 +64,8 @@ bool TitleManager::LoadTitles()
|
||||
titles.push_back(title);
|
||||
}
|
||||
|
||||
LogInfo("Loaded [{}] titles", Strings::Commify(std::to_string(results.RowCount())));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -495,6 +495,8 @@ bool ZoneDatabase::LoadTraps(const char* zonename, int16 version) {
|
||||
Log(Logs::General, Logs::Traps, "Trap %d successfully loaded.", trap->trap_id);
|
||||
}
|
||||
|
||||
LogInfo("Loaded [{}] trap(s)", Strings::Commify(results.RowCount()));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -403,6 +403,8 @@ bool ZoneDatabase::LoadTributes() {
|
||||
tribute_list[id] = tributeData;
|
||||
}
|
||||
|
||||
LogInfo("Loaded [{}] tributes", Strings::Commify(results.RowCount()));
|
||||
|
||||
const std::string query2 = "SELECT tribute_id, level, cost, item_id FROM tribute_levels ORDER BY tribute_id, level";
|
||||
results = QueryDatabase(query2);
|
||||
if (!results.Success()) {
|
||||
@@ -432,6 +434,8 @@ bool ZoneDatabase::LoadTributes() {
|
||||
cur.tier_count++;
|
||||
}
|
||||
|
||||
LogInfo("Loaded [{}] tribute levels", Strings::Commify(results.RowCount()));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+4
-4
@@ -239,7 +239,7 @@ void NPC::MoveTo(const glm::vec4 &position, bool saveguardspot)
|
||||
if (m_GuardPoint.w == -1)
|
||||
m_GuardPoint.w = CalculateHeadingToTarget(position.x, position.y);
|
||||
|
||||
LogAIModerate("Setting guard position to [{}]", to_string(static_cast<glm::vec3>(m_GuardPoint)).c_str());
|
||||
LogAIDetail("Setting guard position to [{}]", to_string(static_cast<glm::vec3>(m_GuardPoint)).c_str());
|
||||
}
|
||||
|
||||
cur_wp_pause = 0;
|
||||
@@ -261,7 +261,7 @@ void NPC::UpdateWaypoint(int wp_index)
|
||||
|
||||
m_CurrentWayPoint = glm::vec4(cur->x, cur->y, cur->z, cur->heading);
|
||||
cur_wp_pause = cur->pause;
|
||||
LogAIModerate("Next waypoint [{}]: ({}, {}, {}, {})", wp_index, m_CurrentWayPoint.x, m_CurrentWayPoint.y, m_CurrentWayPoint.z, m_CurrentWayPoint.w);
|
||||
LogAIDetail("Next waypoint [{}]: ({}, {}, {}, {})", wp_index, m_CurrentWayPoint.x, m_CurrentWayPoint.y, m_CurrentWayPoint.z, m_CurrentWayPoint.w);
|
||||
|
||||
}
|
||||
|
||||
@@ -559,7 +559,7 @@ void NPC::SetWaypointPause()
|
||||
|
||||
void NPC::SaveGuardSpot(bool ClearGuardSpot) {
|
||||
if (ClearGuardSpot) {
|
||||
LogAIModerate("Clearing guard order.");
|
||||
LogAIDetail("Clearing guard order.");
|
||||
m_GuardPoint = glm::vec4();
|
||||
} else {
|
||||
m_GuardPoint = m_Position;
|
||||
@@ -728,7 +728,7 @@ void Mob::SendTo(float new_x, float new_y, float new_z) {
|
||||
|
||||
float newz = zone->zonemap->FindBestZ(dest, nullptr);
|
||||
|
||||
LogAIModerate("BestZ returned {} at {}, {}, {}", newz, m_Position.x, m_Position.y, m_Position.z);
|
||||
LogAIDetail("BestZ returned {} at {}, {}, {}", newz, m_Position.x, m_Position.y, m_Position.z);
|
||||
|
||||
if ((newz > -2000) && std::abs(newz - dest.z) < RuleR(Map, FixPathingZMaxDeltaSendTo)) // Sanity check.
|
||||
m_Position.z = newz + 1;
|
||||
|
||||
@@ -204,11 +204,11 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
|
||||
ServerConnectInfo* sci = (ServerConnectInfo*)pack->pBuffer;
|
||||
|
||||
if (sci->port == 0) {
|
||||
LogCritical("World did not have a port to assign from this server, the port range was not large enough.");
|
||||
LogError("World did not have a port to assign from this server, the port range was not large enough.");
|
||||
Shutdown();
|
||||
}
|
||||
else {
|
||||
LogInfo("World assigned Port: [{}] for this zone", sci->port);
|
||||
LogInfo("World assigned Port [{}] for this zone", sci->port);
|
||||
ZoneConfig::SetZonePort(sci->port);
|
||||
|
||||
LogSys.SetDiscordHandler(&Zone::DiscordWebhookMessageHandler);
|
||||
@@ -3305,7 +3305,7 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
LogInfo("[HandleMessage] Unknown ZS Opcode [{}] size [{}]", (int)pack->opcode, pack->size);
|
||||
LogInfo("Unknown ZS Opcode [{}] size [{}]", (int)pack->opcode, pack->size);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
+35
-27
@@ -151,8 +151,8 @@ bool Zone::Bootup(uint32 iZoneID, uint32 iInstanceID, bool is_static) {
|
||||
delete pack;
|
||||
}
|
||||
|
||||
LogInfo("---- Zone server [{}], listening on port:[{}] ----", zonename, ZoneConfig::get()->ZonePort);
|
||||
LogInfo("Zone Bootup: [{}] [{}] ([{}]: [{}])",
|
||||
LogInfo("Zone server [{}] listening on port [{}]", zonename, ZoneConfig::get()->ZonePort);
|
||||
LogInfo("Zone bootup type [{}] short_name [{}] zone_id [{}] instance_id [{}]",
|
||||
(is_static) ? "Static" : "Dynamic", zonename, iZoneID, iInstanceID);
|
||||
parse->Init();
|
||||
UpdateWindowTitle(nullptr);
|
||||
@@ -193,7 +193,6 @@ bool Zone::LoadZoneObjects()
|
||||
return false;
|
||||
}
|
||||
|
||||
LogInfo("Loading Objects from DB");
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
if (atoi(row[9]) == 0) {
|
||||
// Type == 0 - Static Object
|
||||
@@ -316,6 +315,8 @@ bool Zone::LoadZoneObjects()
|
||||
safe_delete(inst);
|
||||
}
|
||||
|
||||
LogInfo("Loaded [{}] world objects", Strings::Commify(results.RowCount()));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -325,11 +326,11 @@ bool Zone::LoadGroundSpawns() {
|
||||
|
||||
memset(&groundspawn, 0, sizeof(groundspawn));
|
||||
int gsindex=0;
|
||||
LogInfo("Loading Ground Spawns from DB");
|
||||
content_db.LoadGroundSpawns(zoneid, GetInstanceVersion(), &groundspawn);
|
||||
uint32 ix=0;
|
||||
char* name = nullptr;
|
||||
uint32 gsnumber=0;
|
||||
int added = 0;
|
||||
for(gsindex=0;gsindex<50;gsindex++){
|
||||
if(groundspawn.spawn[gsindex].item>0 && groundspawn.spawn[gsindex].item<SAYLINK_ITEM_ID){
|
||||
EQ::ItemInstance* inst = nullptr;
|
||||
@@ -346,11 +347,15 @@ bool Zone::LoadGroundSpawns() {
|
||||
groundspawn.spawn[gsindex].heading,
|
||||
groundspawn.spawn[gsindex].respawntimer); // new object with id of 10000+
|
||||
entity_list.AddObject(object, false);
|
||||
added++;
|
||||
}
|
||||
safe_delete(inst);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
LogInfo("Loaded [{}] ground spawns", Strings::Commify(added));
|
||||
|
||||
return(true);
|
||||
}
|
||||
|
||||
@@ -521,8 +526,6 @@ uint32 Zone::GetTempMerchantQuantity(uint32 NPCID, uint32 Slot) {
|
||||
|
||||
void Zone::LoadTempMerchantData()
|
||||
{
|
||||
LogInfo("Loading Temporary Merchant Lists");
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
fmt::format(
|
||||
SQL(
|
||||
@@ -568,6 +571,8 @@ void Zone::LoadTempMerchantData()
|
||||
)
|
||||
);
|
||||
|
||||
LogInfo("Loaded [{}] temporary merchant entries", Strings::Commify(results.RowCount()));
|
||||
|
||||
std::map<uint32, std::list<TempMerchantList> >::iterator temp_merchant_table_entry;
|
||||
|
||||
uint32 npc_id = 0;
|
||||
@@ -652,8 +657,6 @@ void Zone::LoadNewMerchantData(uint32 merchantid) {
|
||||
}
|
||||
|
||||
void Zone::GetMerchantDataForZoneLoad() {
|
||||
LogInfo("Loading Merchant Lists");
|
||||
|
||||
auto query = fmt::format(
|
||||
SQL (
|
||||
SELECT
|
||||
@@ -686,6 +689,8 @@ void Zone::GetMerchantDataForZoneLoad() {
|
||||
|
||||
auto results = content_db.QueryDatabase(query);
|
||||
|
||||
LogInfo("Loaded [{}] merchant lists", Strings::Commify(results.RowCount()));
|
||||
|
||||
std::map<uint32, std::list<MerchantList> >::iterator merchant_list;
|
||||
|
||||
uint32 npc_id = 0;
|
||||
@@ -935,8 +940,6 @@ void Zone::Shutdown(bool quiet)
|
||||
|
||||
void Zone::LoadZoneDoors()
|
||||
{
|
||||
LogInfo("Loading doors for [{}] ", GetShortName());
|
||||
|
||||
auto door_entries = content_db.LoadDoors(GetShortName(), GetInstanceVersion());
|
||||
if (door_entries.empty()) {
|
||||
LogInfo("No doors loaded");
|
||||
@@ -1124,37 +1127,31 @@ bool Zone::Init(bool is_static) {
|
||||
watermap = WaterMap::LoadWaterMapfile(map_name);
|
||||
pathing = IPathfinder::Load(map_name);
|
||||
|
||||
LogInfo("Loading spawn conditions");
|
||||
if(!spawn_conditions.LoadSpawnConditions(short_name, instanceid)) {
|
||||
LogError("Loading spawn conditions failed, continuing without them");
|
||||
}
|
||||
|
||||
LogInfo("Loading static zone points");
|
||||
if (!content_db.LoadStaticZonePoints(&zone_point_list, short_name, GetInstanceVersion())) {
|
||||
LogError("Loading static zone points failed");
|
||||
return false;
|
||||
}
|
||||
|
||||
LogInfo("Loading spawn groups");
|
||||
if (!content_db.LoadSpawnGroups(short_name, GetInstanceVersion(), &spawn_group_list)) {
|
||||
LogError("Loading spawn groups failed");
|
||||
return false;
|
||||
}
|
||||
|
||||
LogInfo("Loading spawn2 points");
|
||||
if (!content_db.PopulateZoneSpawnList(zoneid, spawn2_list, GetInstanceVersion()))
|
||||
{
|
||||
LogError("Loading spawn2 points failed");
|
||||
return false;
|
||||
}
|
||||
|
||||
LogInfo("Loading player corpses");
|
||||
if (!database.LoadCharacterCorpses(zoneid, instanceid)) {
|
||||
LogError("Loading player corpses failed");
|
||||
return false;
|
||||
}
|
||||
|
||||
LogInfo("Loading traps");
|
||||
if (!content_db.LoadTraps(short_name, GetInstanceVersion()))
|
||||
{
|
||||
LogError("Loading traps failed");
|
||||
@@ -1164,19 +1161,16 @@ bool Zone::Init(bool is_static) {
|
||||
LogInfo("Loading adventure flavor text");
|
||||
LoadAdventureFlavor();
|
||||
|
||||
LogInfo("Loading ground spawns");
|
||||
if (!LoadGroundSpawns())
|
||||
{
|
||||
LogError("Loading ground spawns failed. continuing");
|
||||
}
|
||||
|
||||
LogInfo("Loading World Objects from DB");
|
||||
if (!LoadZoneObjects())
|
||||
{
|
||||
LogError("Loading World Objects failed. continuing");
|
||||
}
|
||||
|
||||
LogInfo("Flushing old respawn timers");
|
||||
database.QueryDatabase("DELETE FROM `respawn_times` WHERE (`start` + `duration`) < UNIX_TIMESTAMP(NOW())");
|
||||
|
||||
LoadZoneDoors();
|
||||
@@ -1219,16 +1213,13 @@ bool Zone::Init(bool is_static) {
|
||||
|
||||
LoadDynamicZoneTemplates();
|
||||
|
||||
LogInfo("Loading dynamic zones");
|
||||
DynamicZone::CacheAllFromDatabase();
|
||||
|
||||
LogInfo("Loading active Expeditions");
|
||||
Expedition::CacheAllFromDatabase();
|
||||
|
||||
LogInfo("Loading timezone data");
|
||||
zone_time.setEQTimeZone(content_db.GetZoneTZ(zoneid, GetInstanceVersion()));
|
||||
|
||||
LogInfo("Init Finished: ZoneID = [{}], Time Offset = [{}]", zoneid, zone_time.getEQTimeZone());
|
||||
LogInfo("Zone booted successfully zone_id [{}] time_offset [{}]", zoneid, zone_time.getEQTimeZone());
|
||||
|
||||
LoadGrids();
|
||||
LoadTickItems();
|
||||
@@ -1247,7 +1238,6 @@ bool Zone::Init(bool is_static) {
|
||||
void Zone::ReloadStaticData() {
|
||||
LogInfo("Reloading Zone Static Data");
|
||||
|
||||
LogInfo("Reloading static zone points");
|
||||
if (!content_db.LoadStaticZonePoints(&zone_point_list, GetShortName(), GetInstanceVersion())) {
|
||||
LogError("Loading static zone points failed");
|
||||
}
|
||||
@@ -1421,7 +1411,7 @@ bool Zone::LoadZoneCFG(const char* filename, uint16 instance_version)
|
||||
strcpy(newzone_data.zone_short_name2, GetShortName());
|
||||
|
||||
LogInfo(
|
||||
"Successfully loaded Zone Config for Zone [{}] ({}) Version [{}] Instance ID [{}]",
|
||||
"Successfully loaded zone headers for zone [{}] long_name [{}] version [{}] instance_id [{}]",
|
||||
GetShortName(),
|
||||
GetLongName(),
|
||||
GetInstanceVersion(),
|
||||
@@ -1836,7 +1826,7 @@ void Zone::StartShutdownTimer(uint32 set_time)
|
||||
|
||||
if (set_time != autoshutdown_timer.GetDuration()) {
|
||||
LogInfo(
|
||||
"[StartShutdownTimer] Reset to [{}] {} from original remaining time [{}] duration [{}] zone [{}]",
|
||||
"Reset to [{}] {} from original remaining time [{}] duration [{}] zone [{}]",
|
||||
Strings::SecondsToTime(set_time, true),
|
||||
!loaded_from.empty() ? fmt::format("(Loaded from [{}])", loaded_from) : "",
|
||||
Strings::SecondsToTime(autoshutdown_timer.GetRemainingTime(), true),
|
||||
@@ -1930,7 +1920,6 @@ void Zone::Repop()
|
||||
LogError("Loading spawn groups failed");
|
||||
}
|
||||
|
||||
LogInfo("Loading spawn conditions");
|
||||
if (!spawn_conditions.LoadSpawnConditions(short_name, instanceid)) {
|
||||
LogError("Loading spawn conditions failed, continuing without them");
|
||||
}
|
||||
@@ -2173,6 +2162,8 @@ bool ZoneDatabase::LoadStaticZonePoints(LinkedList<ZonePoint *> *zone_point_list
|
||||
zone->numzonepoints++;
|
||||
}
|
||||
|
||||
LogInfo("Loaded [{}] zone_points", Strings::Commify(std::to_string(zone_points.size())));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -2193,6 +2184,8 @@ bool ZoneDatabase::GetDecayTimes(npcDecayTimes_Struct *npcCorpseDecayTimes)
|
||||
npcCorpseDecayTimes[index].seconds = std::min(24 * 60 * 60, atoi(row[1]));
|
||||
}
|
||||
|
||||
LogInfo("Loaded [{}] decay timers", Strings::Commify(results.RowCount()));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -2241,6 +2234,8 @@ void Zone::LoadZoneBlockedSpells()
|
||||
ClearBlockedSpells();
|
||||
}
|
||||
}
|
||||
|
||||
LogInfo("Loaded [{}] blocked spells(s)", Strings::Commify(zone_total_blocked_spells));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2414,6 +2409,8 @@ void Zone::LoadVeteranRewards()
|
||||
return;
|
||||
}
|
||||
|
||||
LogInfo("Loaded [{}] veteran reward(s)", Strings::Commify(results.RowCount()));
|
||||
|
||||
int index = 0;
|
||||
for (auto row = results.begin(); row != results.end(); ++row, ++index)
|
||||
{
|
||||
@@ -2465,6 +2462,7 @@ void Zone::LoadAlternateCurrencies()
|
||||
AlternateCurrencies.push_back(current_currency);
|
||||
}
|
||||
|
||||
LogInfo("Loaded [{}] alternate currencies", Strings::Commify(results.RowCount()));
|
||||
}
|
||||
|
||||
void Zone::UpdateQGlobal(uint32 qid, QGlobal newGlobal)
|
||||
@@ -2510,6 +2508,7 @@ void Zone::LoadAdventureFlavor()
|
||||
adventure_entry_list_flavor[id] = row[1];
|
||||
}
|
||||
|
||||
LogInfo("Loaded [{}] adventure text entries", Strings::Commify(results.RowCount()));
|
||||
}
|
||||
|
||||
void Zone::DoAdventureCountIncrease()
|
||||
@@ -2595,6 +2594,8 @@ void Zone::LoadNPCEmotes(LinkedList<NPC_Emote_Struct*>* NPCEmoteList)
|
||||
NPCEmoteList->Insert(nes);
|
||||
}
|
||||
|
||||
LogInfo("Loaded [{}] npc emotes", Strings::Commify(results.RowCount()));
|
||||
|
||||
}
|
||||
|
||||
void Zone::ReloadWorld(uint8 global_repop)
|
||||
@@ -2684,6 +2685,7 @@ void Zone::LoadTickItems()
|
||||
|
||||
}
|
||||
|
||||
LogInfo("Loaded [{}] item_tick entries", Strings::Commify(results.RowCount()));
|
||||
}
|
||||
|
||||
uint32 Zone::GetSpawnKillCount(uint32 in_spawnid) {
|
||||
@@ -2796,6 +2798,12 @@ void Zone::LoadGrids()
|
||||
{
|
||||
zone_grids = GridRepository::GetZoneGrids(content_db, GetZoneID());
|
||||
zone_grid_entries = GridEntriesRepository::GetZoneGridEntries(content_db, GetZoneID());
|
||||
|
||||
LogInfo(
|
||||
"Loaded [{}] grids and [{}] grid_entries",
|
||||
Strings::Commify(zone_grids.size()),
|
||||
Strings::Commify(zone_grid_entries.size())
|
||||
);
|
||||
}
|
||||
|
||||
Timer Zone::GetInitgridsTimer()
|
||||
|
||||
+5
-3
@@ -3689,7 +3689,7 @@ bool ZoneDatabase::LoadFactionData()
|
||||
faction_ids.push_back(fr_row[0]);
|
||||
}
|
||||
|
||||
LogInfo("[{}] Faction(s) loaded...", faction_ids.size());
|
||||
LogInfo("Loaded [{}] faction(s)", Strings::Commify(std::to_string(faction_ids.size())));
|
||||
|
||||
const std::string faction_id_criteria(Strings::Implode(",", faction_ids));
|
||||
|
||||
@@ -3716,7 +3716,7 @@ bool ZoneDatabase::LoadFactionData()
|
||||
faction_array[index]->max = atoi(br_row[2]);
|
||||
}
|
||||
|
||||
LogInfo("[{}] Faction Base(s) loaded...", base_results.RowCount());
|
||||
LogInfo("Loaded [{}] faction base(s)", Strings::Commify(std::to_string(base_results.RowCount())));
|
||||
}
|
||||
else {
|
||||
LogInfo("Unable to load Faction Base data...");
|
||||
@@ -3744,7 +3744,7 @@ bool ZoneDatabase::LoadFactionData()
|
||||
faction_array[index]->mods[mr_row[2]] = atoi(mr_row[1]);
|
||||
}
|
||||
|
||||
LogInfo("[{}] Faction Modifier(s) loaded", modifier_results.RowCount());
|
||||
LogInfo("Loaded [{}] faction modifier(s)", Strings::Commify(std::to_string(modifier_results.RowCount())));
|
||||
}
|
||||
else {
|
||||
LogError("Unable to load Faction Modifier data");
|
||||
@@ -4370,6 +4370,8 @@ bool ZoneDatabase::LoadCharacterCorpses(uint32 zone_id, uint16 instance_id) {
|
||||
);
|
||||
}
|
||||
|
||||
LogInfo("Loaded [{}] player corpse(s)", Strings::Commify(results.RowCount()));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user