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

View File

@ -39,7 +39,7 @@ int main(int argc, char **argv) {
LogSys.LoadLogSettingsDefaults(); LogSys.LoadLogSettingsDefaults();
set_exception_handler(); set_exception_handler();
Log(Logs::General, Logs::Status, "Client Files Export Utility"); LogInfo("Client Files Export Utility");
if(!EQEmuConfig::LoadConfig()) { if(!EQEmuConfig::LoadConfig()) {
LogError("Unable to load configuration file"); LogError("Unable to load configuration file");
return 1; return 1;
@ -48,7 +48,7 @@ int main(int argc, char **argv) {
auto Config = EQEmuConfig::get(); auto Config = EQEmuConfig::get();
SharedDatabase database; SharedDatabase database;
Log(Logs::General, Logs::Status, "Connecting to database..."); LogInfo("Connecting to database");
if(!database.Connect(Config->DatabaseHost.c_str(), Config->DatabaseUsername.c_str(), if(!database.Connect(Config->DatabaseHost.c_str(), Config->DatabaseUsername.c_str(),
Config->DatabasePassword.c_str(), Config->DatabaseDB.c_str(), Config->DatabasePort)) { Config->DatabasePassword.c_str(), Config->DatabaseDB.c_str(), Config->DatabasePort)) {
LogError("Unable to connect to the database, cannot continue without a database connection"); LogError("Unable to connect to the database, cannot continue without a database connection");
@ -93,7 +93,7 @@ int main(int argc, char **argv) {
} }
void ExportSpells(SharedDatabase *db) { void ExportSpells(SharedDatabase *db) {
Log(Logs::General, Logs::Status, "Exporting Spells..."); LogInfo("Exporting Spells");
FILE *f = fopen("export/spells_us.txt", "w"); FILE *f = fopen("export/spells_us.txt", "w");
if(!f) { if(!f) {
@ -164,7 +164,7 @@ int GetSkill(SharedDatabase *db, int skill_id, int class_id, int level) {
} }
void ExportSkillCaps(SharedDatabase *db) { void ExportSkillCaps(SharedDatabase *db) {
Log(Logs::General, Logs::Status, "Exporting Skill Caps..."); LogInfo("Exporting Skill Caps");
FILE *f = fopen("export/SkillCaps.txt", "w"); FILE *f = fopen("export/SkillCaps.txt", "w");
if(!f) { if(!f) {
@ -193,7 +193,7 @@ void ExportSkillCaps(SharedDatabase *db) {
} }
void ExportBaseData(SharedDatabase *db) { void ExportBaseData(SharedDatabase *db) {
Log(Logs::General, Logs::Status, "Exporting Base Data..."); LogInfo("Exporting Base Data");
FILE *f = fopen("export/BaseData.txt", "w"); FILE *f = fopen("export/BaseData.txt", "w");
if(!f) { if(!f) {
@ -224,7 +224,7 @@ void ExportBaseData(SharedDatabase *db) {
} }
void ExportDBStrings(SharedDatabase *db) { void ExportDBStrings(SharedDatabase *db) {
Log(Logs::General, Logs::Status, "Exporting DB Strings..."); LogInfo("Exporting DB Strings");
FILE *f = fopen("export/dbstr_us.txt", "w"); FILE *f = fopen("export/dbstr_us.txt", "w");
if(!f) { if(!f) {

View File

@ -37,7 +37,7 @@ int main(int argc, char **argv) {
LogSys.LoadLogSettingsDefaults(); LogSys.LoadLogSettingsDefaults();
set_exception_handler(); set_exception_handler();
Log(Logs::General, Logs::Status, "Client Files Import Utility"); LogInfo("Client Files Import Utility");
if(!EQEmuConfig::LoadConfig()) { if(!EQEmuConfig::LoadConfig()) {
LogError("Unable to load configuration file."); LogError("Unable to load configuration file.");
return 1; return 1;
@ -46,7 +46,7 @@ int main(int argc, char **argv) {
auto Config = EQEmuConfig::get(); auto Config = EQEmuConfig::get();
SharedDatabase database; SharedDatabase database;
Log(Logs::General, Logs::Status, "Connecting to database..."); LogInfo("Connecting to database");
if(!database.Connect(Config->DatabaseHost.c_str(), Config->DatabaseUsername.c_str(), if(!database.Connect(Config->DatabaseHost.c_str(), Config->DatabaseUsername.c_str(),
Config->DatabasePassword.c_str(), Config->DatabaseDB.c_str(), Config->DatabasePort)) { Config->DatabasePassword.c_str(), Config->DatabaseDB.c_str(), Config->DatabasePort)) {
LogError("Unable to connect to the database, cannot continue without a " LogError("Unable to connect to the database, cannot continue without a "
@ -97,7 +97,7 @@ bool IsStringField(int i) {
} }
void ImportSpells(SharedDatabase *db) { void ImportSpells(SharedDatabase *db) {
Log(Logs::General, Logs::Status, "Importing Spells..."); LogInfo("Importing Spells");
FILE *f = fopen("import/spells_us.txt", "r"); FILE *f = fopen("import/spells_us.txt", "r");
if(!f) { if(!f) {
LogError("Unable to open import/spells_us.txt to read, skipping."); LogError("Unable to open import/spells_us.txt to read, skipping.");
@ -173,19 +173,19 @@ void ImportSpells(SharedDatabase *db) {
spells_imported++; spells_imported++;
if(spells_imported % 1000 == 0) { if(spells_imported % 1000 == 0) {
Log(Logs::General, Logs::Status, "%d spells imported.", spells_imported); LogInfo("[{}] spells imported", spells_imported);
} }
} }
if(spells_imported % 1000 != 0) { if(spells_imported % 1000 != 0) {
Log(Logs::General, Logs::Status, "%d spells imported.", spells_imported); LogInfo("[{}] spells imported", spells_imported);
} }
fclose(f); fclose(f);
} }
void ImportSkillCaps(SharedDatabase *db) { void ImportSkillCaps(SharedDatabase *db) {
Log(Logs::General, Logs::Status, "Importing Skill Caps..."); LogInfo("Importing Skill Caps");
FILE *f = fopen("import/SkillCaps.txt", "r"); FILE *f = fopen("import/SkillCaps.txt", "r");
if(!f) { if(!f) {
@ -220,7 +220,7 @@ void ImportSkillCaps(SharedDatabase *db) {
} }
void ImportBaseData(SharedDatabase *db) { void ImportBaseData(SharedDatabase *db) {
Log(Logs::General, Logs::Status, "Importing Base Data..."); LogInfo("Importing Base Data");
FILE *f = fopen("import/BaseData.txt", "r"); FILE *f = fopen("import/BaseData.txt", "r");
if(!f) { if(!f) {
@ -265,7 +265,7 @@ void ImportBaseData(SharedDatabase *db) {
} }
void ImportDBStrings(SharedDatabase *db) { void ImportDBStrings(SharedDatabase *db) {
Log(Logs::General, Logs::Status, "Importing DB Strings..."); LogInfo("Importing DB Strings");
FILE *f = fopen("import/dbstr_us.txt", "r"); FILE *f = fopen("import/dbstr_us.txt", "r");
if(!f) { if(!f) {

View File

@ -68,7 +68,7 @@ bool Database::Connect(const char* host, const char* user, const char* passwd, c
return false; return false;
} }
else { else {
Log(Logs::General, Logs::Status, "Using database '%s' at %s:%d", database, host,port); LogInfo("Using database [{}] at [{}]:[{}]", database, host,port);
return true; return true;
} }
} }

View File

@ -93,11 +93,11 @@ MySQLRequestResult DBcore::QueryDatabase(const char *query, uint32 querylen, boo
if (errorNumber == CR_SERVER_LOST || errorNumber == CR_SERVER_GONE_ERROR) { if (errorNumber == CR_SERVER_LOST || errorNumber == CR_SERVER_GONE_ERROR) {
if (retryOnFailureOnce) { if (retryOnFailureOnce) {
Log(Logs::General, Logs::Status, "Database Error: Lost connection, attempting to recover..."); LogInfo("Database Error: Lost connection, attempting to recover");
MySQLRequestResult requestResult = QueryDatabase(query, querylen, false); MySQLRequestResult requestResult = QueryDatabase(query, querylen, false);
if (requestResult.Success()) { if (requestResult.Success()) {
Log(Logs::General, Logs::Status, "Reconnection to database successful"); LogInfo("Reconnection to database successful");
return requestResult; return requestResult;
} }

View File

@ -122,7 +122,7 @@ void EQStreamIdentifier::Process() {
} }
case EQStreamInterface::MatchFailed: case EQStreamInterface::MatchFailed:
//do nothing... //do nothing...
LogNetcode("[StreamIdentify] [{}:{}]: Tried patch [{}] and it did not match", long2ip(r.stream->GetRemoteIP()).c_str(), ntohs(r.stream->GetRemotePort()), p->name.c_str()); LogNetcode("[StreamIdentify] [{}:{}] Tried patch [{}] and it did not match", long2ip(r.stream->GetRemoteIP()).c_str(), ntohs(r.stream->GetRemotePort()), p->name.c_str());
break; break;
} }
} }

View File

@ -76,7 +76,7 @@ bool Database::Connect(const char* host, const char* user, const char* passwd, c
} }
else else
{ {
Log(Logs::General, Logs::Status, "Using database '%s' at %s:%d",database,host,port); LogInfo("Using database [{}] at [{}]:[{}]",database,host,port);
return true; return true;
} }
} }

View File

@ -74,7 +74,7 @@ int main(int argc, char **argv) {
LogSys.LoadLogSettingsDefaults(); LogSys.LoadLogSettingsDefaults();
set_exception_handler(); set_exception_handler();
Log(Logs::General, Logs::Status, "Shared Memory Loader Program"); LogInfo("Shared Memory Loader Program");
if(!EQEmuConfig::LoadConfig()) { if(!EQEmuConfig::LoadConfig()) {
LogError("Unable to load configuration file"); LogError("Unable to load configuration file");
return 1; return 1;
@ -83,7 +83,7 @@ int main(int argc, char **argv) {
auto Config = EQEmuConfig::get(); auto Config = EQEmuConfig::get();
SharedDatabase database; SharedDatabase database;
Log(Logs::General, Logs::Status, "Connecting to database..."); LogInfo("Connecting to database");
if(!database.Connect(Config->DatabaseHost.c_str(), Config->DatabaseUsername.c_str(), if(!database.Connect(Config->DatabaseHost.c_str(), Config->DatabaseUsername.c_str(),
Config->DatabasePassword.c_str(), Config->DatabaseDB.c_str(), Config->DatabasePort)) { Config->DatabasePassword.c_str(), Config->DatabaseDB.c_str(), Config->DatabasePort)) {
LogError("Unable to connect to the database, cannot continue without a database connection"); LogError("Unable to connect to the database, cannot continue without a database connection");
@ -96,7 +96,7 @@ int main(int argc, char **argv) {
std::string shared_mem_directory = Config->SharedMemDir; std::string shared_mem_directory = Config->SharedMemDir;
if (MakeDirectory(shared_mem_directory)) { if (MakeDirectory(shared_mem_directory)) {
Log(Logs::General, Logs::Status, "Shared Memory folder doesn't exist, so we created it... '%s'", shared_mem_directory.c_str()); LogInfo("Shared Memory folder doesn't exist, so we created it [{}]", shared_mem_directory.c_str());
} }
database.LoadVariables(); database.LoadVariables();
@ -105,7 +105,7 @@ int main(int argc, char **argv) {
std::string db_hotfix_name; std::string db_hotfix_name;
if (database.GetVariable("hotfix_name", db_hotfix_name)) { if (database.GetVariable("hotfix_name", db_hotfix_name)) {
if (!db_hotfix_name.empty() && strcasecmp("hotfix_", db_hotfix_name.c_str()) == 0) { if (!db_hotfix_name.empty() && strcasecmp("hotfix_", db_hotfix_name.c_str()) == 0) {
Log(Logs::General, Logs::Status, "Current hotfix in variables is the default %s, clearing out variable", db_hotfix_name.c_str()); LogInfo("Current hotfix in variables is the default [{}], clearing out variable", db_hotfix_name.c_str());
std::string query = StringFormat("UPDATE `variables` SET `value`='' WHERE (`varname`='hotfix_name')"); std::string query = StringFormat("UPDATE `variables` SET `value`='' WHERE (`varname`='hotfix_name')");
database.QueryDatabase(query); database.QueryDatabase(query);
} }
@ -176,11 +176,11 @@ int main(int argc, char **argv) {
} }
if(hotfix_name.length() > 0) { if(hotfix_name.length() > 0) {
Log(Logs::General, Logs::Status, "Writing data for hotfix '%s'", hotfix_name.c_str()); LogInfo("Writing data for hotfix [{}]", hotfix_name.c_str());
} }
if(load_all || load_items) { if(load_all || load_items) {
Log(Logs::General, Logs::Status, "Loading items..."); LogInfo("Loading items");
try { try {
LoadItems(&database, hotfix_name); LoadItems(&database, hotfix_name);
} catch(std::exception &ex) { } catch(std::exception &ex) {
@ -190,7 +190,7 @@ int main(int argc, char **argv) {
} }
if(load_all || load_factions) { if(load_all || load_factions) {
Log(Logs::General, Logs::Status, "Loading factions..."); LogInfo("Loading factions");
try { try {
LoadFactions(&database, hotfix_name); LoadFactions(&database, hotfix_name);
} catch(std::exception &ex) { } catch(std::exception &ex) {
@ -200,7 +200,7 @@ int main(int argc, char **argv) {
} }
if(load_all || load_loot) { if(load_all || load_loot) {
Log(Logs::General, Logs::Status, "Loading loot..."); LogInfo("Loading loot");
try { try {
LoadLoot(&database, hotfix_name); LoadLoot(&database, hotfix_name);
} catch(std::exception &ex) { } catch(std::exception &ex) {
@ -210,7 +210,7 @@ int main(int argc, char **argv) {
} }
if(load_all || load_skill_caps) { if(load_all || load_skill_caps) {
Log(Logs::General, Logs::Status, "Loading skill caps..."); LogInfo("Loading skill caps");
try { try {
LoadSkillCaps(&database, hotfix_name); LoadSkillCaps(&database, hotfix_name);
} catch(std::exception &ex) { } catch(std::exception &ex) {
@ -220,7 +220,7 @@ int main(int argc, char **argv) {
} }
if(load_all || load_spells) { if(load_all || load_spells) {
Log(Logs::General, Logs::Status, "Loading spells..."); LogInfo("Loading spells");
try { try {
LoadSpells(&database, hotfix_name); LoadSpells(&database, hotfix_name);
} catch(std::exception &ex) { } catch(std::exception &ex) {
@ -230,7 +230,7 @@ int main(int argc, char **argv) {
} }
if(load_all || load_bd) { if(load_all || load_bd) {
Log(Logs::General, Logs::Status, "Loading base data..."); LogInfo("Loading base data");
try { try {
LoadBaseData(&database, hotfix_name); LoadBaseData(&database, hotfix_name);
} catch(std::exception &ex) { } catch(std::exception &ex) {

View File

@ -81,7 +81,7 @@ bool Database::Connect(const char* host, const char* user, const char* passwd, c
} }
else else
{ {
Log(Logs::General, Logs::Status, "Using database '%s' at %s:%d",database,host,port); LogInfo("Using database [{}] at [{}]:[{}]",database,host,port);
return true; return true;
} }
} }

View File

@ -1342,7 +1342,7 @@ bool Client::GenPassKey(char* key) {
} }
void Client::QueuePacket(const EQApplicationPacket* app, bool ack_req) { void Client::QueuePacket(const EQApplicationPacket* app, bool ack_req) {
LogInfo("Sending EQApplicationPacket OpCode {:#04x}", app->GetOpcode()); LogNetcode("Sending EQApplicationPacket OpCode {:#04x}", app->GetOpcode());
ack_req = true; // It's broke right now, dont delete this line till fix it. =P ack_req = true; // It's broke right now, dont delete this line till fix it. =P
eqs->QueuePacket(app, ack_req); eqs->QueuePacket(app, ack_req);

View File

@ -366,14 +366,14 @@ bool WorldDatabase::GetStartZone(PlayerProfile_Struct* in_pp, CharCreate_Struct*
return false; return false;
} }
Log(Logs::General, Logs::Status, "SoF Start zone query: %s\n", query.c_str()); LogInfo("SoF Start zone query: [{}]\n", query.c_str());
if (results.RowCount() == 0) { if (results.RowCount() == 0) {
printf("No start_zones entry in database, using defaults\n"); printf("No start_zones entry in database, using defaults\n");
isTitanium ? SetTitaniumDefaultStartZone(in_pp, in_cc) : SetSoFDefaultStartZone(in_pp, in_cc); isTitanium ? SetTitaniumDefaultStartZone(in_pp, in_cc) : SetSoFDefaultStartZone(in_pp, in_cc);
} }
else { else {
Log(Logs::General, Logs::Status, "Found starting location in start_zones"); LogInfo("Found starting location in start_zones");
auto row = results.begin(); auto row = results.begin();
in_pp->x = atof(row[0]); in_pp->x = atof(row[0]);
in_pp->y = atof(row[1]); in_pp->y = atof(row[1]);

View File

@ -1562,17 +1562,17 @@ bool Mob::CanPurchaseAlternateAdvancementRank(AA::Rank *rank, bool check_price,
} }
void Zone::LoadAlternateAdvancement() { void Zone::LoadAlternateAdvancement() {
Log(Logs::General, Logs::Status, "Loading Alternate Advancement Data..."); LogInfo("Loading Alternate Advancement Data");
if(!database.LoadAlternateAdvancementAbilities(aa_abilities, if(!database.LoadAlternateAdvancementAbilities(aa_abilities,
aa_ranks)) aa_ranks))
{ {
aa_abilities.clear(); aa_abilities.clear();
aa_ranks.clear(); aa_ranks.clear();
Log(Logs::General, Logs::Status, "Failed to load Alternate Advancement Data"); LogInfo("Failed to load Alternate Advancement Data");
return; return;
} }
Log(Logs::General, Logs::Status, "Processing Alternate Advancement Data..."); LogInfo("Processing Alternate Advancement Data");
for(const auto &ability : aa_abilities) { for(const auto &ability : aa_abilities) {
ability.second->first = GetAlternateAdvancementRank(ability.second->first_rank_id); 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, bool ZoneDatabase::LoadAlternateAdvancementAbilities(std::unordered_map<int, std::unique_ptr<AA::Ability>> &abilities,
std::unordered_map<int, std::unique_ptr<AA::Rank>> &ranks) 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(); abilities.clear();
std::string query = "SELECT id, name, category, classes, races, deities, drakkin_heritage, status, type, charges, " 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"; "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; 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(); ranks.clear();
query = "SELECT id, upper_hotkey_sid, lower_hotkey_sid, title_sid, desc_sid, cost, level_req, spell, spell_type, recast_time, " 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"; "next_id, expansion FROM aa_ranks";
@ -1694,9 +1694,9 @@ bool ZoneDatabase::LoadAlternateAdvancementAbilities(std::unordered_map<int, std
return false; 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"; query = "SELECT rank_id, slot, effect_id, base1, base2 FROM aa_rank_effects";
results = QueryDatabase(query); results = QueryDatabase(query);
if(results.Success()) { if(results.Success()) {
@ -1721,9 +1721,9 @@ bool ZoneDatabase::LoadAlternateAdvancementAbilities(std::unordered_map<int, std
return false; 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"; query = "SELECT rank_id, aa_id, points FROM aa_rank_prereqs";
results = QueryDatabase(query); results = QueryDatabase(query);
if(results.Success()) { if(results.Success()) {
@ -1746,7 +1746,7 @@ bool ZoneDatabase::LoadAlternateAdvancementAbilities(std::unordered_map<int, std
return false; return false;
} }
Log(Logs::General, Logs::Status, "Loaded Alternate Advancement Ability Rank Prereqs"); LogInfo("Loaded Alternate Advancement Ability Rank Prereqs");
return true; return true;
} }

View File

@ -6199,7 +6199,7 @@ void Client::Handle_OP_GMNameChange(const EQApplicationPacket *app)
return; return;
} }
Client* client = entity_list.GetClientByName(gmn->oldname); 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); bool usedname = database.CheckUsedName((const char*)gmn->newname);
if (client == 0) { if (client == 0) {
Message(Chat::Red, "%s not found for name change. Operation failed!", gmn->oldname); Message(Chat::Red, "%s not found for name change. Operation failed!", gmn->oldname);

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) { 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( std::string query = StringFormat(
" SELECT " " SELECT "

View File

@ -145,7 +145,7 @@ void PerlembParser::ReloadQuests() {
perl = nullptr; perl = nullptr;
} }
Log(Logs::General, Logs::Status, "Error re-initializing perlembed: %s", e.what()); LogInfo("Error re-initializing perlembed: [{}]", e.what());
throw e.what(); throw e.what();
} }

View File

@ -223,7 +223,7 @@ Map *Map::LoadMapFile(std::string file) {
filename += file; filename += file;
filename += ".map"; 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(); auto m = new Map();
if (m->Load(filename)) { if (m->Load(filename)) {
@ -238,7 +238,7 @@ Map *Map::LoadMapFile(std::string file) {
bool Map::Load(std::string filename, bool force_mmf_overwrite) bool Map::Load(std::string filename, bool force_mmf_overwrite)
{ {
if (LoadMMF(filename, 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; return true;
} }
#else #else
@ -255,7 +255,7 @@ bool Map::Load(std::string filename)
} }
if(version == 0x01000000) { 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); bool v = LoadV1(f);
fclose(f); fclose(f);
@ -266,7 +266,7 @@ bool Map::Load(std::string filename)
return v; return v;
} else if(version == 0x02000000) { } 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); bool v = LoadV2(f);
fclose(f); fclose(f);

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); 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());
} }
} }

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))) { 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); 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 { else {
break; break;

View File

@ -45,7 +45,7 @@ WaterMap* WaterMap::LoadWaterMapfile(std::string zone_name) {
wm = nullptr; 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); fclose(f);
return wm; return wm;
@ -56,7 +56,7 @@ WaterMap* WaterMap::LoadWaterMapfile(std::string zone_name) {
wm = nullptr; 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); fclose(f);
return wm; return wm;

View File

@ -92,7 +92,7 @@ bool Zone::Bootup(uint32 iZoneID, uint32 iInstanceID, bool iStaticZone) {
return false; return false;
} }
Log(Logs::General, Logs::Status, "Booting %s (%d:%d)", zonename, iZoneID, iInstanceID); LogInfo("Booting [{}] ([{}]:[{}])", zonename, iZoneID, iInstanceID);
numclients = 0; numclients = 0;
zone = new Zone(iZoneID, iInstanceID, zonename); 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 log_levels[i]=0; //set to zero on a bogue char
} }
zone->loglevelvar = log_levels[0]; 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]; 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]; 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]; zone->lootvar = log_levels[3];
Log(Logs::General, Logs::Status, "Loot logging level: %i", zone->lootvar); LogInfo("Loot logging level: [{}]", zone->lootvar);
} }
else { else {
zone->loglevelvar = uint8(tmp_i); //continue supporting only command logging (for now) 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::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(); parse->Init();
UpdateWindowTitle(); UpdateWindowTitle();
zone->GetTimeSync(); zone->GetTimeSync();
@ -181,7 +181,7 @@ bool Zone::LoadZoneObjects()
return false; 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) { for (auto row = results.begin(); row != results.end(); ++row) {
if (atoi(row[9]) == 0) { if (atoi(row[9]) == 0) {
// Type == 0 - Static Object // Type == 0 - Static Object
@ -300,7 +300,7 @@ bool Zone::LoadGroundSpawns() {
memset(&groundspawn, 0, sizeof(groundspawn)); memset(&groundspawn, 0, sizeof(groundspawn));
int gsindex=0; int gsindex=0;
Log(Logs::General, Logs::Status, "Loading Ground Spawns from DB..."); LogInfo("Loading Ground Spawns from DB");
database.LoadGroundSpawns(zoneid, GetInstanceVersion(), &groundspawn); database.LoadGroundSpawns(zoneid, GetInstanceVersion(), &groundspawn);
uint32 ix=0; uint32 ix=0;
char* name = nullptr; char* name = nullptr;
@ -419,7 +419,7 @@ uint32 Zone::GetTempMerchantQuantity(uint32 NPCID, uint32 Slot) {
} }
void Zone::LoadTempMerchantData() { void Zone::LoadTempMerchantData() {
Log(Logs::General, Logs::Status, "Loading Temporary Merchant Lists..."); LogInfo("Loading Temporary Merchant Lists");
std::string query = StringFormat( std::string query = StringFormat(
"SELECT " "SELECT "
"DISTINCT ml.npcid, " "DISTINCT ml.npcid, "
@ -489,7 +489,7 @@ void Zone::LoadNewMerchantData(uint32 merchantid) {
} }
void Zone::GetMerchantDataForZoneLoad() { void Zone::GetMerchantDataForZoneLoad() {
Log(Logs::General, Logs::Status, "Loading Merchant Lists..."); LogInfo("Loading Merchant Lists");
std::string query = StringFormat( std::string query = StringFormat(
"SELECT " "SELECT "
"DISTINCT ml.merchantid, " "DISTINCT ml.merchantid, "
@ -714,7 +714,7 @@ void Zone::Shutdown(bool quite)
} }
zone->ldon_trap_entry_list.clear(); 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(); petition_list.ClearPetitions();
zone->SetZoneHasCurrentTime(false); zone->SetZoneHasCurrentTime(false);
if (!quite) if (!quite)
@ -732,19 +732,19 @@ void Zone::Shutdown(bool quite)
void Zone::LoadZoneDoors(const char* zone, int16 version) 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; uint32 maxid;
int32 count = database.GetDoorsCount(&maxid, zone, version); int32 count = database.GetDoorsCount(&maxid, zone, version);
if(count < 1) { if(count < 1) {
Log(Logs::General, Logs::Status, "... No doors loaded."); LogInfo("No doors loaded");
return; return;
} }
auto dlist = new Door[count]; auto dlist = new Door[count];
if(!database.LoadDoors(count, dlist, zone, version)) { if(!database.LoadDoors(count, dlist, zone, version)) {
LogError(" Failed to load doors"); LogError("Failed to load doors");
delete[] dlist; delete[] dlist;
return; return;
} }
@ -915,59 +915,59 @@ bool Zone::Init(bool iStaticZone) {
zone->watermap = WaterMap::LoadWaterMapfile(zone->map_name); zone->watermap = WaterMap::LoadWaterMapfile(zone->map_name);
zone->pathing = IPathfinder::Load(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)) { if(!spawn_conditions.LoadSpawnConditions(short_name, instanceid)) {
LogError("Loading spawn conditions failed, continuing without them"); 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())) { if (!database.LoadStaticZonePoints(&zone_point_list, short_name, GetInstanceVersion())) {
LogError("Loading static zone points failed"); LogError("Loading static zone points failed");
return false; return false;
} }
Log(Logs::General, Logs::Status, "Loading spawn groups..."); LogInfo("Loading spawn groups");
if (!database.LoadSpawnGroups(short_name, GetInstanceVersion(), &spawn_group_list)) { if (!database.LoadSpawnGroups(short_name, GetInstanceVersion(), &spawn_group_list)) {
LogError("Loading spawn groups failed"); LogError("Loading spawn groups failed");
return false; return false;
} }
Log(Logs::General, Logs::Status, "Loading spawn2 points..."); LogInfo("Loading spawn2 points");
if (!database.PopulateZoneSpawnList(zoneid, spawn2_list, GetInstanceVersion())) if (!database.PopulateZoneSpawnList(zoneid, spawn2_list, GetInstanceVersion()))
{ {
LogError("Loading spawn2 points failed"); LogError("Loading spawn2 points failed");
return false; return false;
} }
Log(Logs::General, Logs::Status, "Loading player corpses..."); LogInfo("Loading player corpses");
if (!database.LoadCharacterCorpses(zoneid, instanceid)) { if (!database.LoadCharacterCorpses(zoneid, instanceid)) {
LogError("Loading player corpses failed"); LogError("Loading player corpses failed");
return false; return false;
} }
Log(Logs::General, Logs::Status, "Loading traps..."); LogInfo("Loading traps");
if (!database.LoadTraps(short_name, GetInstanceVersion())) if (!database.LoadTraps(short_name, GetInstanceVersion()))
{ {
LogError("Loading traps failed"); LogError("Loading traps failed");
return false; return false;
} }
Log(Logs::General, Logs::Status, "Loading adventure flavor text..."); LogInfo("Loading adventure flavor text");
LoadAdventureFlavor(); LoadAdventureFlavor();
Log(Logs::General, Logs::Status, "Loading ground spawns..."); LogInfo("Loading ground spawns");
if (!LoadGroundSpawns()) if (!LoadGroundSpawns())
{ {
LogError("Loading ground spawns failed. continuing"); LogError("Loading ground spawns failed. continuing");
} }
Log(Logs::General, Logs::Status, "Loading World Objects from DB..."); LogInfo("Loading World Objects from DB");
if (!LoadZoneObjects()) if (!LoadZoneObjects())
{ {
LogError("Loading World Objects failed. continuing"); 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())"); database.QueryDatabase("DELETE FROM `respawn_times` WHERE (`start` + `duration`) < UNIX_TIMESTAMP(NOW())");
//load up the zone's doors (prints inside) //load up the zone's doors (prints inside)
@ -1008,10 +1008,10 @@ bool Zone::Init(bool iStaticZone) {
petition_list.ClearPetitions(); petition_list.ClearPetitions();
petition_list.ReadDatabase(); petition_list.ReadDatabase();
Log(Logs::General, Logs::Status, "Loading timezone data..."); LogInfo("Loading timezone data");
zone->zone_time.setEQTimeZone(database.GetZoneTZ(zoneid, GetInstanceVersion())); 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(); LoadTickItems();
@ -1022,29 +1022,29 @@ bool Zone::Init(bool iStaticZone) {
} }
void Zone::ReloadStaticData() { 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(); zone_point_list.Clear();
if (!database.LoadStaticZonePoints(&zone_point_list, GetShortName(), GetInstanceVersion())) { if (!database.LoadStaticZonePoints(&zone_point_list, GetShortName(), GetInstanceVersion())) {
LogError("Loading static zone points failed"); LogError("Loading static zone points failed");
} }
Log(Logs::General, Logs::Status, "Reloading traps..."); LogInfo("Reloading traps");
entity_list.RemoveAllTraps(); entity_list.RemoveAllTraps();
if (!database.LoadTraps(GetShortName(), GetInstanceVersion())) if (!database.LoadTraps(GetShortName(), GetInstanceVersion()))
{ {
LogError("Reloading traps failed"); LogError("Reloading traps failed");
} }
Log(Logs::General, Logs::Status, "Reloading ground spawns..."); LogInfo("Reloading ground spawns");
if (!LoadGroundSpawns()) if (!LoadGroundSpawns())
{ {
LogError("Reloading ground spawns failed. continuing"); LogError("Reloading ground spawns failed. continuing");
} }
entity_list.RemoveAllObjects(); entity_list.RemoveAllObjects();
Log(Logs::General, Logs::Status, "Reloading World Objects from DB..."); LogInfo("Reloading World Objects from DB");
if (!LoadZoneObjects()) if (!LoadZoneObjects())
{ {
LogError("Reloading World Objects failed. continuing"); LogError("Reloading World Objects failed. continuing");
@ -1063,7 +1063,7 @@ void Zone::ReloadStaticData() {
if (!LoadZoneCFG(zone->GetShortName(), zone->GetInstanceVersion())) // try loading the zone name... 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 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) 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_long_name, GetLongName());
strcpy(newzone_data.zone_short_name2, GetShortName()); strcpy(newzone_data.zone_short_name2, GetShortName());
Log(Logs::General, Logs::Status, "Successfully loaded Zone Config."); LogInfo("Successfully loaded Zone Config");
return true; 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)) if ((zone->HasWaterMap() && !zone->watermap->InZoneLine(glm::vec3(client->GetPosition()))) || (!zone->HasWaterMap() && closest_dist > 400.0f && closest_dist < max_distance2))
{ {
//TODO cheat detection //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); 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);
Log(Logs::General, Logs::Status, "<Real Zone Points>. %s", to_string(location).c_str()); LogInfo("<Real Zone Points>. [{}]", to_string(location).c_str());
} }
if(closest_dist > max_distance2) if(closest_dist > max_distance2)

View File

@ -3461,7 +3461,7 @@ int32 ZoneDatabase::GetBlockedSpellsCount(uint32 zoneid)
bool ZoneDatabase::LoadBlockedSpells(int32 blockedSpellsCount, ZoneSpellsBlocked* into, 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 " 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); "FROM blocked_spells WHERE zoneid = %d ORDER BY id ASC", zoneid);

View File

@ -348,7 +348,7 @@ void Client::DoZoneSuccess(ZoneChange_Struct *zc, uint16 zone_id, uint32 instanc
if(this->GetPet()) if(this->GetPet())
entity_list.RemoveFromHateLists(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 //set the player's coordinates in the new zone so they have them
//when they zone into it //when they zone into it