Fix log calls that either didn't carry over or were using newer aliases that weren't converted to FMT prior to migration

This commit is contained in:
Akkadius 2019-09-17 00:18:07 -05:00
parent 9a7ecb4e8d
commit 96ef76847b
16 changed files with 36 additions and 37 deletions

View File

@ -976,7 +976,7 @@ EQRawApplicationPacket *p=nullptr;
if(OpMgr != nullptr && *OpMgr != nullptr) {
EmuOpcode emu_op = (*OpMgr)->EQToEmu(p->opcode);
if(emu_op == OP_Unknown) {
LogNetcode("Unable to convert EQ opcode 0x%.4x to an Application opcode", p->opcode);
LogNetcode("Unable to convert EQ opcode {:#04x} to an Application opcode", p->opcode);
}
p->SetOpcode(emu_op);
@ -1417,19 +1417,19 @@ EQStream::MatchState EQStream::CheckSignature(const Signature *sig) {
} else if(p->opcode == sig->first_eq_opcode) {
//opcode matches, check length..
if(p->size == sig->first_length) {
LogNetcode("[StreamIdentify] [{}]:[{}]: First opcode matched 0x%x and length matched [{}]", long2ip(GetRemoteIP()).c_str(), ntohs(GetRemotePort()), sig->first_eq_opcode, p->size);
LogNetcode("[StreamIdentify] [{}]:[{}]: First opcode matched {:#04x} and length matched [{}]", long2ip(GetRemoteIP()).c_str(), ntohs(GetRemotePort()), sig->first_eq_opcode, p->size);
res = MatchSuccessful;
} else if(sig->first_length == 0) {
LogNetcode("[StreamIdentify] [{}]:[{}]: First opcode matched 0x%x and length ([{}]) is ignored", long2ip(GetRemoteIP()).c_str(), ntohs(GetRemotePort()), sig->first_eq_opcode, p->size);
LogNetcode("[StreamIdentify] [{}]:[{}]: First opcode matched {:#04x} and length ([{}]) is ignored", long2ip(GetRemoteIP()).c_str(), ntohs(GetRemotePort()), sig->first_eq_opcode, p->size);
res = MatchSuccessful;
} else {
//opcode matched but length did not.
LogNetcode("[StreamIdentify] [{}]:[{}]: First opcode matched 0x%x, but length [{}] did not match expected [{}]", long2ip(GetRemoteIP()).c_str(), ntohs(GetRemotePort()), sig->first_eq_opcode, p->size, sig->first_length);
LogNetcode("[StreamIdentify] [{}]:[{}]: First opcode matched {:#04x}, but length [{}] did not match expected [{}]", long2ip(GetRemoteIP()).c_str(), ntohs(GetRemotePort()), sig->first_eq_opcode, p->size, sig->first_length);
res = MatchFailed;
}
} else {
//first opcode did not match..
LogNetcode("[StreamIdentify] [{}]:[{}]: First opcode 0x%x did not match expected 0x%x", long2ip(GetRemoteIP()).c_str(), ntohs(GetRemotePort()), p->opcode, sig->first_eq_opcode);
LogNetcode("[StreamIdentify] [{}]:[{}]: First opcode {:#04x} did not match expected {:#04x}", long2ip(GetRemoteIP()).c_str(), ntohs(GetRemotePort()), p->opcode, sig->first_eq_opcode);
res = MatchFailed;
}
}

View File

@ -1479,9 +1479,8 @@ bool SharedDatabase::UpdateInjectedCommandSettings(const std::vector<std::pair<s
}
LogInfo(
"%u New Command%s Added",
injected.size(),
(injected.size() == 1 ? "" : "s")
"[{0}] New Command(s) Added",
injected.size()
);
}

View File

@ -850,7 +850,7 @@ DmgShieldType GetDamageShieldType(uint16 spell_id, int32 DSType)
// If we have a DamageShieldType for this spell from the damageshieldtypes table, return that,
// else, make a guess, based on the resist type. Default return value is DS_THORNS
if (IsValidSpell(spell_id)) {
LogSpells("DamageShieldType for spell [{}] ([{}]) is %X\n", spell_id,
LogSpells("DamageShieldType for spell [{}] ([{}]) is [{}]", spell_id,
spells[spell_id].name, spells[spell_id].DamageShieldType);
if (spells[spell_id].DamageShieldType)

View File

@ -106,7 +106,7 @@ bool Client::Process()
if (LogSys.log_settings[Logs::PacketClientServerUnhandled].is_category_enabled == 1) {
char dump[64];
app->build_header_dump(dump);
LogError("Recieved unhandled application packet from the client: %s.", dump);
LogError("Recieved unhandled application packet from the client: [{}]", dump);
}
}
}

View File

@ -643,7 +643,7 @@ void Clientlist::Process()
MailBox, Key);
if (!database.VerifyMailKey(CharacterName, (*it)->ClientStream->GetRemoteIP(), Key)) {
LogError("Chat Key for %s does not match, closing connection.", MailBox);
LogError("Chat Key for [{}] does not match, closing connection.", MailBox);
KeyValid = false;
break;
}
@ -668,7 +668,7 @@ void Clientlist::Process()
}
default: {
LogInfo("Unhandled chat opcode %8X", opcode);
LogInfo("Unhandled chat opcode {:#04x}", opcode);
break;
}
}

View File

@ -327,7 +327,7 @@ int main(int argc, char** argv) {
std::string hotfix_name;
if (database.GetVariable("hotfix_name", hotfix_name)) {
if (!hotfix_name.empty()) {
LogInfo("Current hotfix in use: '%s'", hotfix_name.c_str());
LogInfo("Current hotfix in use: [{}]", hotfix_name.c_str());
}
}

View File

@ -1439,7 +1439,7 @@ int bot_command_init(void)
orphaned_bot_command_settings.push_back(bcs_iter.first);
LogInfo(
"Bot Command '%s' no longer exists... Deleting orphaned entry from `bot_command_settings` table...",
"Bot Command [{}] no longer exists... Deleting orphaned entry from `bot_command_settings` table",
bcs_iter.first.c_str()
);
}
@ -1459,14 +1459,14 @@ int bot_command_init(void)
injected_bot_command_settings.push_back(std::pair<std::string, uint8>(working_bcl_iter.first, working_bcl_iter.second->access));
LogInfo(
"New Bot Command '%s' found... Adding to `bot_command_settings` table with access '%u'...",
"New Bot Command [{}] found... Adding to `bot_command_settings` table with access [{}]",
working_bcl_iter.first.c_str(),
working_bcl_iter.second->access
);
if (working_bcl_iter.second->access == 0) {
LogCommands(
"bot_command_init(): Warning: Bot Command '%s' defaulting to access level 0!",
"bot_command_init(): Warning: Bot Command [{}] defaulting to access level 0!",
working_bcl_iter.first.c_str()
);
}
@ -1476,7 +1476,7 @@ int bot_command_init(void)
working_bcl_iter.second->access = bcs_iter->second.first;
LogCommands(
"bot_command_init(): - Bot Command '%s' set to access level %d.",
"bot_command_init(): - Bot Command [{}] set to access level [{}]",
working_bcl_iter.first.c_str(),
bcs_iter->second.first
);
@ -1492,7 +1492,7 @@ int bot_command_init(void)
if (bot_command_list.find(alias_iter) != bot_command_list.end()) {
LogCommands(
"bot_command_init(): Warning: Alias '%s' already exists as a bot command - skipping!",
"bot_command_init(): Warning: Alias [{}] already exists as a bot command - skipping!",
alias_iter.c_str()
);
@ -1503,7 +1503,7 @@ int bot_command_init(void)
bot_command_aliases[alias_iter] = working_bcl_iter.first;
LogCommands(
"bot_command_init(): - Alias '%s' added to bot command '%s'.",
"bot_command_init(): - Alias [{}] added to bot command [{}]",
alias_iter.c_str(),
bot_command_aliases[alias_iter].c_str()
);

View File

@ -2423,10 +2423,10 @@ bool Client::CheckIncreaseSkill(EQEmu::skills::SkillType skillid, Mob *against_w
if(zone->random.Real(0, 99) < Chance)
{
SetSkill(skillid, GetRawSkill(skillid) + 1);
LogSkills("Skill [{}] at value [{}] successfully gain with [{}]%[{}]hance (mod [{}])", skillid, skillval, Chance, chancemodi);
LogSkills("Skill [{}] at value [{}] successfully gain with [{}]% chance (mod [{}])", skillid, skillval, Chance, chancemodi);
return true;
} else {
LogSkills("Skill [{}] at value [{}] failed to gain with [{}]%[{}]hance (mod [{}])", skillid, skillval, Chance, chancemodi);
LogSkills("Skill [{}] at value [{}] failed to gain with [{}]% chance (mod [{}])", skillid, skillval, Chance, chancemodi);
}
} else {
LogSkills("Skill [{}] at value [{}] cannot increase due to maxmum [{}]", skillid, skillval, maxskill);
@ -2450,10 +2450,10 @@ void Client::CheckLanguageSkillIncrease(uint8 langid, uint8 TeacherSkill) {
if(zone->random.Real(0,100) < Chance) { // if they make the roll
IncreaseLanguageSkill(langid); // increase the language skill by 1
LogSkills("Language [{}] at value [{}] successfully gain with %.4f%[{}]hance", langid, LangSkill, Chance);
LogSkills("Language [{}] at value [{}] successfully gain with [{}] % chance", langid, LangSkill, Chance);
}
else
LogSkills("Language [{}] at value [{}] failed to gain with %.4f%[{}]hance", langid, LangSkill, Chance);
LogSkills("Language [{}] at value [{}] failed to gain with [{}] % chance", langid, LangSkill, Chance);
}
}

View File

@ -4029,7 +4029,7 @@ void Client::Handle_OP_CastSpell(const EQApplicationPacket *app)
m_TargetRing = glm::vec3(castspell->x_pos, castspell->y_pos, castspell->z_pos);
LogSpells("OP CastSpell: slot=[{}], spell=[{}], target=[{}], inv=%lx", castspell->slot, castspell->spell_id, castspell->target_id, (unsigned long)castspell->inventoryslot);
LogSpells("OP CastSpell: slot [{}] spell [{}] target [{}] inv [{}]", castspell->slot, castspell->spell_id, castspell->target_id, (unsigned long)castspell->inventoryslot);
CastingSlot slot = static_cast<CastingSlot>(castspell->slot);
/* Memorized Spell */

View File

@ -464,7 +464,7 @@ int command_init(void)
orphaned_command_settings.push_back(cs_iter.first);
LogInfo(
"Command '%s' no longer exists... Deleting orphaned entry from `command_settings` table...",
"Command [{}] no longer exists... Deleting orphaned entry from `command_settings` table...",
cs_iter.first.c_str()
);
}
@ -484,14 +484,14 @@ int command_init(void)
injected_command_settings.push_back(std::pair<std::string, uint8>(working_cl_iter.first, working_cl_iter.second->access));
LogInfo(
"New Command '%s' found... Adding to `command_settings` table with access '%u'...",
"New Command [{}] found... Adding to `command_settings` table with access [{}]...",
working_cl_iter.first.c_str(),
working_cl_iter.second->access
);
if (working_cl_iter.second->access == 0) {
LogCommands(
"command_init(): Warning: Command '%s' defaulting to access level 0!",
"command_init(): Warning: Command [{}] defaulting to access level 0!",
working_cl_iter.first.c_str()
);
}
@ -501,7 +501,7 @@ int command_init(void)
working_cl_iter.second->access = cs_iter->second.first;
LogCommands(
"command_init(): - Command '%s' set to access level %d.",
"command_init(): - Command [{}] set to access level [{}]",
working_cl_iter.first.c_str(),
cs_iter->second.first
);
@ -517,7 +517,7 @@ int command_init(void)
if (commandlist.find(alias_iter) != commandlist.end()) {
LogCommands(
"command_init(): Warning: Alias '%s' already exists as a command - skipping!",
"command_init(): Warning: Alias [{}] already exists as a command - skipping!",
alias_iter.c_str()
);
@ -528,7 +528,7 @@ int command_init(void)
commandaliases[alias_iter] = working_cl_iter.first;
LogCommands(
"command_init(): - Alias '%s' added to command '%s'.",
"command_init(): - Alias [{}] added to command [{}]",
alias_iter.c_str(),
commandaliases[alias_iter].c_str()
);

View File

@ -906,7 +906,7 @@ void HealRotation::bias_targets()
for (auto tlist_iter : m_target_pool) {
if (!tlist_iter) { continue; }
LogError("([{}]) [{}] (hp: %3.1f%%, at: [{}], dontheal: [{}], crit(base): [{}]([{}]), safe(base): [{}]([{}]), hcnt(ext): [{}]([{}]), hfreq(ext): [{}]([{}]))",
LogError("([{}]) [{}] (hp: [{}], at: [{}], dontheal: [{}], crit(base): [{}]([{}]), safe(base): [{}]([{}]), hcnt(ext): [{}]([{}]), hfreq(ext): [{}]([{}]))",
(++target_index), tlist_iter->GetCleanName(),
tlist_iter->GetHPRatio(),
ClassArmorType(tlist_iter->GetClass()),

View File

@ -810,7 +810,7 @@ bool Client::CheckFizzle(uint16 spell_id)
float fizzle_roll = zone->random.Real(0, 100);
LogSpells("Check Fizzle [{}] spell [{}] fizzlechance: %0.2f%% diff: %0.2f roll: %0.2f", GetName(), spell_id, fizzlechance, diff, fizzle_roll);
LogSpells("Check Fizzle [{}] spell [{}] fizzlechance: [{}] diff: [{}] roll: [{}]", GetName(), spell_id, fizzlechance, diff, fizzle_roll);
if(fizzle_roll > fizzlechance)
return(true);

View File

@ -601,7 +601,7 @@ void Mob::SendToFixZ(float new_x, float new_y, float new_z) {
float newz = zone->zonemap->FindBestZ(dest, nullptr);
LogPathing("BestZ returned %4.3f at %4.3f, %4.3f, %4.3f", newz, m_Position.x, m_Position.y, m_Position.z);
LogPathing("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;

View File

@ -1671,7 +1671,7 @@ ZonePoint* Zone::GetClosestZonePoint(const glm::vec3& location, uint32 to, Clien
if ((zone->HasWaterMap() && !zone->watermap->InZoneLine(glm::vec3(client->GetPosition()))) || (!zone->HasWaterMap() && closest_dist > 400.0f && closest_dist < max_distance2))
{
//TODO cheat detection
LogInfo("WARNING: Closest zone point for zone id [{}] is %f, you might need to update your zone_points table if you dont arrive at the right spot", to, closest_dist);
LogInfo("WARNING: Closest zone point for zone id [{}] is [{}], you might need to update your zone_points table if you dont arrive at the right spot", to, closest_dist);
LogInfo("<Real Zone Points>. [{}]", to_string(location).c_str());
}

View File

@ -4176,10 +4176,10 @@ bool ZoneDatabase::LoadFactionData()
faction_array[index]->mods[mr_row[2]] = atoi(mr_row[1]);
}
Log(Logs::General, Logs::Status, "%u Faction Modifier%s loaded...", modifier_results.RowCount(), (modifier_results.RowCount() == 1 ? "" : "s"));
LogInfo("[{}] Faction Modifier(s) loaded", modifier_results.RowCount());
}
else {
Log(Logs::General, Logs::Status, "Unable to load Faction Modifier data...");
LogError("Unable to load Faction Modifier data");
}
return true;

View File

@ -348,7 +348,7 @@ void Client::DoZoneSuccess(ZoneChange_Struct *zc, uint16 zone_id, uint32 instanc
if(this->GetPet())
entity_list.RemoveFromHateLists(this->GetPet());
LogInfo("Zoning [{}] to: [{}] ([{}]) - ([{}]) x=%f, y=%f, z=%f", m_pp.name, database.GetZoneName(zone_id), zone_id, instance_id, dest_x, dest_y, dest_z);
LogInfo("Zoning [{}] to: [{}] ([{}]) - ([{}]) x [{}] y [{}] z [{}]", m_pp.name, database.GetZoneName(zone_id), zone_id, instance_id, dest_x, dest_y, dest_z);
//set the player's coordinates in the new zone so they have them
//when they zone into it