Move status log calls to use LogInfo

This commit is contained in:
Akkadius
2019-09-01 23:22:40 -05:00
parent 2eb14a5c8a
commit 859252a270
21 changed files with 94 additions and 94 deletions
+12 -12
View File
@@ -1562,17 +1562,17 @@ bool Mob::CanPurchaseAlternateAdvancementRank(AA::Rank *rank, bool check_price,
}
void Zone::LoadAlternateAdvancement() {
Log(Logs::General, Logs::Status, "Loading Alternate Advancement Data...");
LogInfo("Loading Alternate Advancement Data");
if(!database.LoadAlternateAdvancementAbilities(aa_abilities,
aa_ranks))
{
aa_abilities.clear();
aa_ranks.clear();
Log(Logs::General, Logs::Status, "Failed to load Alternate Advancement Data");
LogInfo("Failed to load Alternate Advancement Data");
return;
}
Log(Logs::General, Logs::Status, "Processing Alternate Advancement Data...");
LogInfo("Processing Alternate Advancement Data");
for(const auto &ability : aa_abilities) {
ability.second->first = GetAlternateAdvancementRank(ability.second->first_rank_id);
@@ -1623,13 +1623,13 @@ void Zone::LoadAlternateAdvancement() {
}
}
Log(Logs::General, Logs::Status, "Loaded Alternate Advancement Data");
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)
{
Log(Logs::General, Logs::Status, "Loading Alternate Advancement Abilities...");
LogInfo("Loading Alternate Advancement Abilities");
abilities.clear();
std::string query = "SELECT id, name, category, classes, races, deities, drakkin_heritage, status, type, charges, "
"grant_only, first_rank_id FROM aa_ability WHERE enabled = 1";
@@ -1659,9 +1659,9 @@ bool ZoneDatabase::LoadAlternateAdvancementAbilities(std::unordered_map<int, std
return false;
}
Log(Logs::General, Logs::Status, "Loaded %d Alternate Advancement Abilities", (int)abilities.size());
LogInfo("Loaded [{}] Alternate Advancement Abilities", (int)abilities.size());
Log(Logs::General, Logs::Status, "Loading Alternate Advancement Ability Ranks...");
LogInfo("Loading Alternate Advancement Ability Ranks");
ranks.clear();
query = "SELECT id, upper_hotkey_sid, lower_hotkey_sid, title_sid, desc_sid, cost, level_req, spell, spell_type, recast_time, "
"next_id, expansion FROM aa_ranks";
@@ -1694,9 +1694,9 @@ bool ZoneDatabase::LoadAlternateAdvancementAbilities(std::unordered_map<int, std
return false;
}
Log(Logs::General, Logs::Status, "Loaded %d Alternate Advancement Ability Ranks", (int)ranks.size());
LogInfo("Loaded [{}] Alternate Advancement Ability Ranks", (int)ranks.size());
Log(Logs::General, Logs::Status, "Loading Alternate Advancement Ability Rank Effects...");
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()) {
@@ -1721,9 +1721,9 @@ bool ZoneDatabase::LoadAlternateAdvancementAbilities(std::unordered_map<int, std
return false;
}
Log(Logs::General, Logs::Status, "Loaded Alternate Advancement Ability Rank Effects");
LogInfo("Loaded Alternate Advancement Ability Rank Effects");
Log(Logs::General, Logs::Status, "Loading Alternate Advancement Ability Rank Prereqs...");
LogInfo("Loading Alternate Advancement Ability Rank Prereqs");
query = "SELECT rank_id, aa_id, points FROM aa_rank_prereqs";
results = QueryDatabase(query);
if(results.Success()) {
@@ -1746,7 +1746,7 @@ bool ZoneDatabase::LoadAlternateAdvancementAbilities(std::unordered_map<int, std
return false;
}
Log(Logs::General, Logs::Status, "Loaded Alternate Advancement Ability Rank Prereqs");
LogInfo("Loaded Alternate Advancement Ability Rank Prereqs");
return true;
}
+1 -1
View File
@@ -6199,7 +6199,7 @@ void Client::Handle_OP_GMNameChange(const EQApplicationPacket *app)
return;
}
Client* client = entity_list.GetClientByName(gmn->oldname);
Log(Logs::General, Logs::Status, "GM(%s) changeing players name. Old:%s New:%s", GetName(), gmn->oldname, gmn->newname);
LogInfo("GM([{}]) changeing players name. Old:[{}] New:[{}]", GetName(), gmn->oldname, gmn->newname);
bool usedname = database.CheckUsedName((const char*)gmn->newname);
if (client == 0) {
Message(Chat::Red, "%s not found for name change. Operation failed!", gmn->oldname);
+1 -1
View File
@@ -679,7 +679,7 @@ int32 ZoneDatabase::GetDoorsDBCountPlusOne(const char *zone_name, int16 version)
}
bool ZoneDatabase::LoadDoors(int32 door_count, Door *into, const char *zone_name, int16 version) {
Log(Logs::General, Logs::Status, "Loading Doors from database...");
LogInfo("Loading Doors from database");
std::string query = StringFormat(
" SELECT "
+1 -1
View File
@@ -145,7 +145,7 @@ void PerlembParser::ReloadQuests() {
perl = nullptr;
}
Log(Logs::General, Logs::Status, "Error re-initializing perlembed: %s", e.what());
LogInfo("Error re-initializing perlembed: [{}]", e.what());
throw e.what();
}
+4 -4
View File
@@ -223,7 +223,7 @@ Map *Map::LoadMapFile(std::string file) {
filename += file;
filename += ".map";
Log(Logs::General, Logs::Status, "Attempting to load Map File '%s'", filename.c_str());
LogInfo("Attempting to load Map File [{}]", filename.c_str());
auto m = new Map();
if (m->Load(filename)) {
@@ -238,7 +238,7 @@ Map *Map::LoadMapFile(std::string file) {
bool Map::Load(std::string filename, bool force_mmf_overwrite)
{
if (LoadMMF(filename, force_mmf_overwrite)) {
Log(Logs::General, Logs::Status, "Loaded .MMF Map File in place of '%s'", filename.c_str());
LogInfo("Loaded .MMF Map File in place of [{}]", filename.c_str());
return true;
}
#else
@@ -255,7 +255,7 @@ bool Map::Load(std::string filename)
}
if(version == 0x01000000) {
Log(Logs::General, Logs::Status, "Loaded V1 Map File '%s'", filename.c_str());
LogInfo("Loaded V1 Map File [{}]", filename.c_str());
bool v = LoadV1(f);
fclose(f);
@@ -266,7 +266,7 @@ bool Map::Load(std::string filename)
return v;
} else if(version == 0x02000000) {
Log(Logs::General, Logs::Status, "Loaded V2 Map File '%s'", filename.c_str());
LogInfo("Loaded V2 Map File [{}]", filename.c_str());
bool v = LoadV2(f);
fclose(f);
+1 -1
View File
@@ -475,7 +475,7 @@ void PathfinderNavmesh::Load(const std::string &path)
m_impl->nav_mesh->addTile(data, data_size, DT_TILE_FREE_DATA, tile_ref, 0);
}
Log(Logs::General, Logs::Status, "Loaded Navmesh V%u file %s", version, path.c_str());
LogInfo("Loaded Navmesh V[{}] file [{}]", version, path.c_str());
}
}
+1 -1
View File
@@ -30,7 +30,7 @@ void CullPoints(std::vector<FindPerson_Point> &points) {
if (zone->zonemap->CheckLoS(glm::vec3(p.x, p.y, p.z), glm::vec3(p2.x, p2.y, p2.z))) {
points.erase(points.begin() + i + 1);
Log(Logs::General, Logs::Status, "Culled find path point %u, connecting %u->%u instead.", i + 1, i, i + 2);
LogInfo("Culled find path point [{}], connecting [{}]->[{}] instead", i + 1, i, i + 2);
}
else {
break;
+2 -2
View File
@@ -45,7 +45,7 @@ WaterMap* WaterMap::LoadWaterMapfile(std::string zone_name) {
wm = nullptr;
}
Log(Logs::General, Logs::Status, "Loaded Water Map V%u file %s", version, file_path.c_str());
LogInfo("Loaded Water Map V[{}] file [{}]", version, file_path.c_str());
fclose(f);
return wm;
@@ -56,7 +56,7 @@ WaterMap* WaterMap::LoadWaterMapfile(std::string zone_name) {
wm = nullptr;
}
Log(Logs::General, Logs::Status, "Loaded Water Map V%u file %s", version, file_path.c_str());
LogInfo("Loaded Water Map V[{}] file [{}]", version, file_path.c_str());
fclose(f);
return wm;
+35 -35
View File
@@ -92,7 +92,7 @@ bool Zone::Bootup(uint32 iZoneID, uint32 iInstanceID, bool iStaticZone) {
return false;
}
Log(Logs::General, Logs::Status, "Booting %s (%d:%d)", zonename, iZoneID, iInstanceID);
LogInfo("Booting [{}] ([{}]:[{}])", zonename, iZoneID, iInstanceID);
numclients = 0;
zone = new Zone(iZoneID, iInstanceID, zonename);
@@ -117,13 +117,13 @@ bool Zone::Bootup(uint32 iZoneID, uint32 iInstanceID, bool iStaticZone) {
log_levels[i]=0; //set to zero on a bogue char
}
zone->loglevelvar = log_levels[0];
Log(Logs::General, Logs::Status, "General logging level: %i", zone->loglevelvar);
LogInfo("General logging level: [{}]", zone->loglevelvar);
zone->merchantvar = log_levels[1];
Log(Logs::General, Logs::Status, "Merchant logging level: %i", zone->merchantvar);
LogInfo("Merchant logging level: [{}]", zone->merchantvar);
zone->tradevar = log_levels[2];
Log(Logs::General, Logs::Status, "Trade logging level: %i", zone->tradevar);
LogInfo("Trade logging level: [{}]", zone->tradevar);
zone->lootvar = log_levels[3];
Log(Logs::General, Logs::Status, "Loot logging level: %i", zone->lootvar);
LogInfo("Loot logging level: [{}]", zone->lootvar);
}
else {
zone->loglevelvar = uint8(tmp_i); //continue supporting only command logging (for now)
@@ -145,7 +145,7 @@ bool Zone::Bootup(uint32 iZoneID, uint32 iInstanceID, bool iStaticZone) {
}
Log(Logs::General, Logs::Normal, "---- Zone server %s, listening on port:%i ----", zonename, ZoneConfig::get()->ZonePort);
Log(Logs::General, Logs::Status, "Zone Bootup: %s (%i: %i)", zonename, iZoneID, iInstanceID);
LogInfo("Zone Bootup: [{}] ([{}]: [{}])", zonename, iZoneID, iInstanceID);
parse->Init();
UpdateWindowTitle();
zone->GetTimeSync();
@@ -181,7 +181,7 @@ bool Zone::LoadZoneObjects()
return false;
}
Log(Logs::General, Logs::Status, "Loading Objects from DB...");
LogInfo("Loading Objects from DB");
for (auto row = results.begin(); row != results.end(); ++row) {
if (atoi(row[9]) == 0) {
// Type == 0 - Static Object
@@ -300,7 +300,7 @@ bool Zone::LoadGroundSpawns() {
memset(&groundspawn, 0, sizeof(groundspawn));
int gsindex=0;
Log(Logs::General, Logs::Status, "Loading Ground Spawns from DB...");
LogInfo("Loading Ground Spawns from DB");
database.LoadGroundSpawns(zoneid, GetInstanceVersion(), &groundspawn);
uint32 ix=0;
char* name = nullptr;
@@ -419,7 +419,7 @@ uint32 Zone::GetTempMerchantQuantity(uint32 NPCID, uint32 Slot) {
}
void Zone::LoadTempMerchantData() {
Log(Logs::General, Logs::Status, "Loading Temporary Merchant Lists...");
LogInfo("Loading Temporary Merchant Lists");
std::string query = StringFormat(
"SELECT "
"DISTINCT ml.npcid, "
@@ -489,7 +489,7 @@ void Zone::LoadNewMerchantData(uint32 merchantid) {
}
void Zone::GetMerchantDataForZoneLoad() {
Log(Logs::General, Logs::Status, "Loading Merchant Lists...");
LogInfo("Loading Merchant Lists");
std::string query = StringFormat(
"SELECT "
"DISTINCT ml.merchantid, "
@@ -714,7 +714,7 @@ void Zone::Shutdown(bool quite)
}
zone->ldon_trap_entry_list.clear();
Log(Logs::General, Logs::Status, "Zone Shutdown: %s (%i)", zone->GetShortName(), zone->GetZoneID());
LogInfo("Zone Shutdown: [{}] ([{}])", zone->GetShortName(), zone->GetZoneID());
petition_list.ClearPetitions();
zone->SetZoneHasCurrentTime(false);
if (!quite)
@@ -732,19 +732,19 @@ void Zone::Shutdown(bool quite)
void Zone::LoadZoneDoors(const char* zone, int16 version)
{
Log(Logs::General, Logs::Status, "Loading doors for %s ...", zone);
LogInfo("Loading doors for [{}] ", zone);
uint32 maxid;
int32 count = database.GetDoorsCount(&maxid, zone, version);
if(count < 1) {
Log(Logs::General, Logs::Status, "... No doors loaded.");
LogInfo("No doors loaded");
return;
}
auto dlist = new Door[count];
if(!database.LoadDoors(count, dlist, zone, version)) {
LogError(" Failed to load doors");
LogError("Failed to load doors");
delete[] dlist;
return;
}
@@ -915,59 +915,59 @@ bool Zone::Init(bool iStaticZone) {
zone->watermap = WaterMap::LoadWaterMapfile(zone->map_name);
zone->pathing = IPathfinder::Load(zone->map_name);
Log(Logs::General, Logs::Status, "Loading spawn conditions...");
LogInfo("Loading spawn conditions");
if(!spawn_conditions.LoadSpawnConditions(short_name, instanceid)) {
LogError("Loading spawn conditions failed, continuing without them");
}
Log(Logs::General, Logs::Status, "Loading static zone points...");
LogInfo("Loading static zone points");
if (!database.LoadStaticZonePoints(&zone_point_list, short_name, GetInstanceVersion())) {
LogError("Loading static zone points failed");
return false;
}
Log(Logs::General, Logs::Status, "Loading spawn groups...");
LogInfo("Loading spawn groups");
if (!database.LoadSpawnGroups(short_name, GetInstanceVersion(), &spawn_group_list)) {
LogError("Loading spawn groups failed");
return false;
}
Log(Logs::General, Logs::Status, "Loading spawn2 points...");
LogInfo("Loading spawn2 points");
if (!database.PopulateZoneSpawnList(zoneid, spawn2_list, GetInstanceVersion()))
{
LogError("Loading spawn2 points failed");
return false;
}
Log(Logs::General, Logs::Status, "Loading player corpses...");
LogInfo("Loading player corpses");
if (!database.LoadCharacterCorpses(zoneid, instanceid)) {
LogError("Loading player corpses failed");
return false;
}
Log(Logs::General, Logs::Status, "Loading traps...");
LogInfo("Loading traps");
if (!database.LoadTraps(short_name, GetInstanceVersion()))
{
LogError("Loading traps failed");
return false;
}
Log(Logs::General, Logs::Status, "Loading adventure flavor text...");
LogInfo("Loading adventure flavor text");
LoadAdventureFlavor();
Log(Logs::General, Logs::Status, "Loading ground spawns...");
LogInfo("Loading ground spawns");
if (!LoadGroundSpawns())
{
LogError("Loading ground spawns failed. continuing");
}
Log(Logs::General, Logs::Status, "Loading World Objects from DB...");
LogInfo("Loading World Objects from DB");
if (!LoadZoneObjects())
{
LogError("Loading World Objects failed. continuing");
}
Log(Logs::General, Logs::Status, "Flushing old respawn timers...");
LogInfo("Flushing old respawn timers");
database.QueryDatabase("DELETE FROM `respawn_times` WHERE (`start` + `duration`) < UNIX_TIMESTAMP(NOW())");
//load up the zone's doors (prints inside)
@@ -1008,10 +1008,10 @@ bool Zone::Init(bool iStaticZone) {
petition_list.ClearPetitions();
petition_list.ReadDatabase();
Log(Logs::General, Logs::Status, "Loading timezone data...");
LogInfo("Loading timezone data");
zone->zone_time.setEQTimeZone(database.GetZoneTZ(zoneid, GetInstanceVersion()));
Log(Logs::General, Logs::Status, "Init Finished: ZoneID = %d, Time Offset = %d", zoneid, zone->zone_time.getEQTimeZone());
LogInfo("Init Finished: ZoneID = [{}], Time Offset = [{}]", zoneid, zone->zone_time.getEQTimeZone());
LoadTickItems();
@@ -1022,29 +1022,29 @@ bool Zone::Init(bool iStaticZone) {
}
void Zone::ReloadStaticData() {
Log(Logs::General, Logs::Status, "Reloading Zone Static Data...");
LogInfo("Reloading Zone Static Data");
Log(Logs::General, Logs::Status, "Reloading static zone points...");
LogInfo("Reloading static zone points");
zone_point_list.Clear();
if (!database.LoadStaticZonePoints(&zone_point_list, GetShortName(), GetInstanceVersion())) {
LogError("Loading static zone points failed");
}
Log(Logs::General, Logs::Status, "Reloading traps...");
LogInfo("Reloading traps");
entity_list.RemoveAllTraps();
if (!database.LoadTraps(GetShortName(), GetInstanceVersion()))
{
LogError("Reloading traps failed");
}
Log(Logs::General, Logs::Status, "Reloading ground spawns...");
LogInfo("Reloading ground spawns");
if (!LoadGroundSpawns())
{
LogError("Reloading ground spawns failed. continuing");
}
entity_list.RemoveAllObjects();
Log(Logs::General, Logs::Status, "Reloading World Objects from DB...");
LogInfo("Reloading World Objects from DB");
if (!LoadZoneObjects())
{
LogError("Reloading World Objects failed. continuing");
@@ -1063,7 +1063,7 @@ void Zone::ReloadStaticData() {
if (!LoadZoneCFG(zone->GetShortName(), zone->GetInstanceVersion())) // try loading the zone name...
LoadZoneCFG(zone->GetFileName(), zone->GetInstanceVersion()); // if that fails, try the file name, then load defaults
Log(Logs::General, Logs::Status, "Zone Static Data Reloaded.");
LogInfo("Zone Static Data Reloaded");
}
bool Zone::LoadZoneCFG(const char* filename, uint16 instance_id)
@@ -1093,7 +1093,7 @@ bool Zone::LoadZoneCFG(const char* filename, uint16 instance_id)
strcpy(newzone_data.zone_long_name, GetLongName());
strcpy(newzone_data.zone_short_name2, GetShortName());
Log(Logs::General, Logs::Status, "Successfully loaded Zone Config.");
LogInfo("Successfully loaded Zone Config");
return true;
}
@@ -1668,8 +1668,8 @@ 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
Log(Logs::General, Logs::Status, "WARNING: Closest zone point for zone id %d is %f, you might need to update your zone_points table if you dont arrive at the right spot.", to, closest_dist);
Log(Logs::General, Logs::Status, "<Real Zone Points>. %s", to_string(location).c_str());
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("<Real Zone Points>. [{}]", to_string(location).c_str());
}
if(closest_dist > max_distance2)
+1 -1
View File
@@ -3461,7 +3461,7 @@ int32 ZoneDatabase::GetBlockedSpellsCount(uint32 zoneid)
bool ZoneDatabase::LoadBlockedSpells(int32 blockedSpellsCount, ZoneSpellsBlocked* into, uint32 zoneid)
{
Log(Logs::General, Logs::Status, "Loading Blocked Spells from database...");
LogInfo("Loading Blocked Spells from database");
std::string query = StringFormat("SELECT id, spellid, type, x, y, z, x_diff, y_diff, z_diff, message "
"FROM blocked_spells WHERE zoneid = %d ORDER BY id ASC", zoneid);
+1 -1
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());
Log(Logs::General, Logs::Status, "Zoning '%s' to: %s (%i) - (%i) 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=%f, y=%f, z=%f", 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