mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 22:58:34 +00:00
Simplify log calls
This commit is contained in:
+1
-1
@@ -57,7 +57,7 @@ void Mob::TemporaryPets(uint16 spell_id, Mob *targ, const char *name_override, u
|
||||
PetRecord record;
|
||||
if (!database.GetPoweredPetEntry(spells[spell_id].teleport_zone, act_power, &record))
|
||||
{
|
||||
Log(Logs::General, Logs::Error, "Unknown swarm pet spell id: %d, check pets table", spell_id);
|
||||
LogError("Unknown swarm pet spell id: {}, check pets table", spell_id);
|
||||
Message(Chat::Red, "Unable to find data for pet %s", spells[spell_id].teleport_zone);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -559,7 +559,7 @@ bool Client::Process() {
|
||||
|
||||
if (client_state != CLIENT_LINKDEAD && !eqs->CheckState(ESTABLISHED)) {
|
||||
OnDisconnect(true);
|
||||
Log(Logs::General, Logs::ZoneServer, "Client linkdead: %s", name);
|
||||
LogInfo("Client linkdead: {}", name);
|
||||
|
||||
if (Admin() > 100) {
|
||||
if (GetMerc()) {
|
||||
|
||||
+2
-2
@@ -5819,7 +5819,7 @@ void command_time(Client *c, const Seperator *sep)
|
||||
}
|
||||
c->Message(Chat::Red, "Setting world time to %s:%i (Timezone: 0)...", sep->arg[1], minutes);
|
||||
zone->SetTime(atoi(sep->arg[1])+1, minutes);
|
||||
Log(Logs::General, Logs::ZoneServer, "%s :: Setting world time to %s:%i (Timezone: 0)...", c->GetCleanName(), sep->arg[1], minutes);
|
||||
LogInfo("{} :: Setting world time to {}:{} (Timezone: 0)...", c->GetCleanName(), sep->arg[1], minutes);
|
||||
}
|
||||
else {
|
||||
c->Message(Chat::Red, "To set the Time: #time HH [MM]");
|
||||
@@ -5834,7 +5834,7 @@ void command_time(Client *c, const Seperator *sep)
|
||||
zone->zone_time.getEQTimeZoneMin()
|
||||
);
|
||||
c->Message(Chat::Red, "It is now %s.", timeMessage);
|
||||
Log(Logs::General, Logs::ZoneServer, "Current Time is: %s", timeMessage);
|
||||
LogInfo("Current Time is: {}", timeMessage);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+30
-30
@@ -145,7 +145,7 @@ int main(int argc, char** argv) {
|
||||
|
||||
QServ = new QueryServ;
|
||||
|
||||
Log(Logs::General, Logs::ZoneServer, "Loading server configuration..");
|
||||
LogInfo("Loading server configuration..");
|
||||
if (!ZoneConfig::LoadConfig()) {
|
||||
Log(Logs::General, Logs::Error, "Loading server configuration failed.");
|
||||
return 1;
|
||||
@@ -225,7 +225,7 @@ int main(int argc, char** argv) {
|
||||
worldserver.SetLauncherName("NONE");
|
||||
}
|
||||
|
||||
Log(Logs::General, Logs::ZoneServer, "Connecting to MySQL... ");
|
||||
LogInfo("Connecting to MySQL... ");
|
||||
if (!database.Connect(
|
||||
Config->DatabaseHost.c_str(),
|
||||
Config->DatabaseUsername.c_str(),
|
||||
@@ -255,7 +255,7 @@ int main(int argc, char** argv) {
|
||||
_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
|
||||
#endif
|
||||
|
||||
Log(Logs::General, Logs::ZoneServer, "CURRENT_VERSION: %s", CURRENT_VERSION);
|
||||
LogInfo("CURRENT_VERSION: {}", CURRENT_VERSION);
|
||||
|
||||
/*
|
||||
* Setup nice signal handlers
|
||||
@@ -275,102 +275,102 @@ int main(int argc, char** argv) {
|
||||
}
|
||||
#endif
|
||||
|
||||
Log(Logs::General, Logs::ZoneServer, "Mapping Incoming Opcodes");
|
||||
LogInfo("Mapping Incoming Opcodes");
|
||||
MapOpcodes();
|
||||
|
||||
Log(Logs::General, Logs::ZoneServer, "Loading Variables");
|
||||
LogInfo("Loading Variables");
|
||||
database.LoadVariables();
|
||||
|
||||
std::string hotfix_name;
|
||||
if (database.GetVariable("hotfix_name", hotfix_name)) {
|
||||
if (!hotfix_name.empty()) {
|
||||
Log(Logs::General, Logs::ZoneServer, "Current hotfix in use: '%s'", hotfix_name.c_str());
|
||||
LogInfo("Current hotfix in use: [{}]", hotfix_name.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
Log(Logs::General, Logs::ZoneServer, "Loading zone names");
|
||||
LogInfo("Loading zone names");
|
||||
database.LoadZoneNames();
|
||||
|
||||
Log(Logs::General, Logs::ZoneServer, "Loading items");
|
||||
LogInfo("Loading items");
|
||||
if (!database.LoadItems(hotfix_name)) {
|
||||
Log(Logs::General, Logs::Error, "Loading items FAILED!");
|
||||
Log(Logs::General, Logs::Error, "Failed. But ignoring error and going on...");
|
||||
}
|
||||
|
||||
Log(Logs::General, Logs::ZoneServer, "Loading npc faction lists");
|
||||
LogInfo("Loading npc faction lists");
|
||||
if (!database.LoadNPCFactionLists(hotfix_name)) {
|
||||
Log(Logs::General, Logs::Error, "Loading npcs faction lists FAILED!");
|
||||
return 1;
|
||||
}
|
||||
Log(Logs::General, Logs::ZoneServer, "Loading loot tables");
|
||||
LogInfo("Loading loot tables");
|
||||
if (!database.LoadLoot(hotfix_name)) {
|
||||
Log(Logs::General, Logs::Error, "Loading loot FAILED!");
|
||||
return 1;
|
||||
}
|
||||
Log(Logs::General, Logs::ZoneServer, "Loading skill caps");
|
||||
LogInfo("Loading skill caps");
|
||||
if (!database.LoadSkillCaps(std::string(hotfix_name))) {
|
||||
Log(Logs::General, Logs::Error, "Loading skill caps FAILED!");
|
||||
return 1;
|
||||
}
|
||||
|
||||
Log(Logs::General, Logs::ZoneServer, "Loading spells");
|
||||
LogInfo("Loading spells");
|
||||
if (!database.LoadSpells(hotfix_name, &SPDAT_RECORDS, &spells)) {
|
||||
Log(Logs::General, Logs::Error, "Loading spells FAILED!");
|
||||
return 1;
|
||||
}
|
||||
|
||||
Log(Logs::General, Logs::ZoneServer, "Loading base data");
|
||||
LogInfo("Loading base data");
|
||||
if (!database.LoadBaseData(hotfix_name)) {
|
||||
Log(Logs::General, Logs::Error, "Loading base data FAILED!");
|
||||
return 1;
|
||||
}
|
||||
|
||||
Log(Logs::General, Logs::ZoneServer, "Loading guilds");
|
||||
LogInfo("Loading guilds");
|
||||
guild_mgr.LoadGuilds();
|
||||
|
||||
Log(Logs::General, Logs::ZoneServer, "Loading factions");
|
||||
LogInfo("Loading factions");
|
||||
database.LoadFactionData();
|
||||
|
||||
Log(Logs::General, Logs::ZoneServer, "Loading titles");
|
||||
LogInfo("Loading titles");
|
||||
title_manager.LoadTitles();
|
||||
|
||||
Log(Logs::General, Logs::ZoneServer, "Loading tributes");
|
||||
LogInfo("Loading tributes");
|
||||
database.LoadTributes();
|
||||
|
||||
Log(Logs::General, Logs::ZoneServer, "Loading corpse timers");
|
||||
LogInfo("Loading corpse timers");
|
||||
database.GetDecayTimes(npcCorpseDecayTimes);
|
||||
|
||||
Log(Logs::General, Logs::ZoneServer, "Loading profanity list");
|
||||
LogInfo("Loading profanity list");
|
||||
if (!EQEmu::ProfanityManager::LoadProfanityList(&database))
|
||||
Log(Logs::General, Logs::Error, "Loading profanity list FAILED!");
|
||||
|
||||
Log(Logs::General, Logs::ZoneServer, "Loading commands");
|
||||
LogInfo("Loading commands");
|
||||
int retval = command_init();
|
||||
if (retval<0)
|
||||
Log(Logs::General, Logs::Error, "Command loading FAILED");
|
||||
else
|
||||
Log(Logs::General, Logs::ZoneServer, "%d commands loaded", retval);
|
||||
LogInfo("{} commands loaded", retval);
|
||||
|
||||
//rules:
|
||||
{
|
||||
std::string tmp;
|
||||
if (database.GetVariable("RuleSet", tmp)) {
|
||||
Log(Logs::General, Logs::ZoneServer, "Loading rule set '%s'", tmp.c_str());
|
||||
LogInfo("Loading rule set [{}]", tmp.c_str());
|
||||
if (!RuleManager::Instance()->LoadRules(&database, tmp.c_str(), false)) {
|
||||
Log(Logs::General, Logs::Error, "Failed to load ruleset '%s', falling back to defaults.", tmp.c_str());
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (!RuleManager::Instance()->LoadRules(&database, "default", false)) {
|
||||
Log(Logs::General, Logs::ZoneServer, "No rule set configured, using default rules");
|
||||
LogInfo("No rule set configured, using default rules");
|
||||
}
|
||||
else {
|
||||
Log(Logs::General, Logs::ZoneServer, "Loaded default rule set 'default'", tmp.c_str());
|
||||
LogInfo("Loaded default rule set 'default'");
|
||||
}
|
||||
}
|
||||
|
||||
EQEmu::InitializeDynamicLookups();
|
||||
Log(Logs::General, Logs::ZoneServer, "Initialized dynamic dictionary entries");
|
||||
LogInfo("Initialized dynamic dictionary entries");
|
||||
}
|
||||
|
||||
#ifdef BOTS
|
||||
@@ -407,7 +407,7 @@ int main(int argc, char** argv) {
|
||||
#endif
|
||||
|
||||
//now we have our parser, load the quests
|
||||
Log(Logs::General, Logs::ZoneServer, "Loading quests");
|
||||
LogInfo("Loading quests");
|
||||
parse->ReloadQuests();
|
||||
|
||||
worldserver.Connect();
|
||||
@@ -420,7 +420,7 @@ int main(int argc, char** argv) {
|
||||
#endif
|
||||
#endif
|
||||
if (!strlen(zone_name) || !strcmp(zone_name, ".")) {
|
||||
Log(Logs::General, Logs::ZoneServer, "Entering sleep mode");
|
||||
LogInfo("Entering sleep mode");
|
||||
}
|
||||
else if (!Zone::Bootup(database.GetZoneID(zone_name), instance_id, true)) {
|
||||
Log(Logs::General, Logs::Error, "Zone Bootup failed :: Zone::Bootup");
|
||||
@@ -478,7 +478,7 @@ int main(int argc, char** argv) {
|
||||
* EQStreamManager
|
||||
*/
|
||||
if (!eqsf_open && Config->ZonePort != 0) {
|
||||
Log(Logs::General, Logs::ZoneServer, "Starting EQ Network server on port %d", 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);
|
||||
@@ -607,7 +607,7 @@ int main(int argc, char** argv) {
|
||||
bot_command_deinit();
|
||||
#endif
|
||||
safe_delete(parse);
|
||||
Log(Logs::General, Logs::ZoneServer, "Proper zone shutdown complete.");
|
||||
LogInfo("Proper zone shutdown complete.");
|
||||
LogSys.CloseFileLogs();
|
||||
return 0;
|
||||
}
|
||||
@@ -623,7 +623,7 @@ void Shutdown()
|
||||
{
|
||||
Zone::Shutdown(true);
|
||||
RunLoops = false;
|
||||
Log(Logs::General, Logs::ZoneServer, "Shutting down...");
|
||||
LogInfo("Shutting down...");
|
||||
LogSys.CloseFileLogs();
|
||||
}
|
||||
|
||||
|
||||
@@ -1050,7 +1050,7 @@ int QuestParserCollection::DispatchEventSpell(QuestEventID evt, NPC* npc, Client
|
||||
|
||||
void QuestParserCollection::LoadPerlEventExportSettings(PerlEventExportSettings* perl_event_export_settings) {
|
||||
|
||||
Log(Logs::General, Logs::ZoneServer, "Loading Perl Event Export Settings...");
|
||||
LogInfo("Loading Perl Event Export Settings...");
|
||||
|
||||
/* Write Defaults First (All Enabled) */
|
||||
for (int i = 0; i < _LargestEventID; i++){
|
||||
|
||||
@@ -816,12 +816,12 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
|
||||
(eq_time.hour >= 13) ? "pm" : "am"
|
||||
);
|
||||
|
||||
Log(Logs::General, Logs::ZoneServer, "Time Broadcast Packet: %s", time_message);
|
||||
LogInfo("Time Broadcast Packet: {}", time_message);
|
||||
zone->SetZoneHasCurrentTime(true);
|
||||
|
||||
}
|
||||
if (zone && zone->is_zone_time_localized) {
|
||||
Log(Logs::General, Logs::ZoneServer, "Received request to sync time from world, but our time is localized currently");
|
||||
LogInfo("Received request to sync time from world, but our time is localized currently");
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -1942,32 +1942,32 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
|
||||
case ServerOP_ChangeSharedMem:
|
||||
{
|
||||
std::string hotfix_name = std::string((char*)pack->pBuffer);
|
||||
Log(Logs::General, Logs::ZoneServer, "Loading items");
|
||||
LogInfo("Loading items");
|
||||
if (!database.LoadItems(hotfix_name)) {
|
||||
Log(Logs::General, Logs::Error, "Loading items FAILED!");
|
||||
}
|
||||
|
||||
Log(Logs::General, Logs::ZoneServer, "Loading npc faction lists");
|
||||
LogInfo("Loading npc faction lists");
|
||||
if (!database.LoadNPCFactionLists(hotfix_name)) {
|
||||
Log(Logs::General, Logs::Error, "Loading npcs faction lists FAILED!");
|
||||
}
|
||||
|
||||
Log(Logs::General, Logs::ZoneServer, "Loading loot tables");
|
||||
LogInfo("Loading loot tables");
|
||||
if (!database.LoadLoot(hotfix_name)) {
|
||||
Log(Logs::General, Logs::Error, "Loading loot FAILED!");
|
||||
}
|
||||
|
||||
Log(Logs::General, Logs::ZoneServer, "Loading skill caps");
|
||||
LogInfo("Loading skill caps");
|
||||
if (!database.LoadSkillCaps(std::string(hotfix_name))) {
|
||||
Log(Logs::General, Logs::Error, "Loading skill caps FAILED!");
|
||||
}
|
||||
|
||||
Log(Logs::General, Logs::ZoneServer, "Loading spells");
|
||||
LogInfo("Loading spells");
|
||||
if (!database.LoadSpells(hotfix_name, &SPDAT_RECORDS, &spells)) {
|
||||
Log(Logs::General, Logs::Error, "Loading spells FAILED!");
|
||||
}
|
||||
|
||||
Log(Logs::General, Logs::ZoneServer, "Loading base data");
|
||||
LogInfo("Loading base data");
|
||||
if (!database.LoadBaseData(hotfix_name)) {
|
||||
Log(Logs::General, Logs::Error, "Loading base data FAILED!");
|
||||
}
|
||||
|
||||
+3
-3
@@ -1459,7 +1459,7 @@ void Zone::StartShutdownTimer(uint32 set_time) {
|
||||
set_time = static_cast<uint32>(database.getZoneShutDownDelay(GetZoneID(), GetInstanceVersion()));
|
||||
}
|
||||
autoshutdown_timer.SetTimer(set_time);
|
||||
Log(Logs::General, Logs::ZoneServer, "Zone::StartShutdownTimer set to %u", set_time);
|
||||
LogInfo("Zone::StartShutdownTimer set to {}", set_time);
|
||||
}
|
||||
|
||||
Log(Logs::Detail, Logs::ZoneServer,
|
||||
@@ -1606,7 +1606,7 @@ void Zone::SetTime(uint8 hour, uint8 minute, bool update_world /*= true*/)
|
||||
|
||||
/* By Default we update worlds time, but we can optionally no update world which updates the rest of the zone servers */
|
||||
if (update_world){
|
||||
Log(Logs::General, Logs::ZoneServer, "Setting master time on world server to: %d:%d (%d)\n", hour, minute, (int)eq_time_of_day->start_realtime);
|
||||
LogInfo("Setting master time on world server to: {}:{} ({})\n", hour, minute, (int)eq_time_of_day->start_realtime);
|
||||
worldserver.SendPacket(pack);
|
||||
|
||||
/* Set Time Localization Flag */
|
||||
@@ -1615,7 +1615,7 @@ void Zone::SetTime(uint8 hour, uint8 minute, bool update_world /*= true*/)
|
||||
/* When we don't update world, we are localizing ourselves, we become disjointed from normal syncs and set time locally */
|
||||
else{
|
||||
|
||||
Log(Logs::General, Logs::ZoneServer, "Setting zone localized time...");
|
||||
LogInfo("Setting zone localized time...");
|
||||
|
||||
zone->zone_time.SetCurrentEQTimeOfDay(eq_time_of_day->start_eqtime, eq_time_of_day->start_realtime);
|
||||
auto outapp = new EQApplicationPacket(OP_TimeOfDay, sizeof(TimeOfDay_Struct));
|
||||
|
||||
Reference in New Issue
Block a user