mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-29 16:43:47 +00:00
fix(core): Improve output for 2 small errors (#2549)
This commit is contained in:
@@ -141,10 +141,10 @@ extern int main(int argc, char** argv)
|
||||
if (!pidFile.empty())
|
||||
{
|
||||
if (uint32 pid = CreatePIDFile(pidFile))
|
||||
sLog->outError("Daemon PID: %u\n", pid);
|
||||
sLog->outError("Daemon PID: %u\n", pid); // outError for red color in console
|
||||
else
|
||||
{
|
||||
sLog->outError("Cannot create PID file %s.\n", pidFile.c_str());
|
||||
sLog->outError("Cannot create PID file %s (possible error: permission)\n", pidFile.c_str());
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@@ -181,7 +181,7 @@ extern int main(int argc, char** argv)
|
||||
|
||||
if (acceptor.open(bind_addr, ACE_Reactor::instance(), ACE_NONBLOCK) == -1)
|
||||
{
|
||||
sLog->outError("Auth server can not bind to %s:%d", bind_ip.c_str(), rmport);
|
||||
sLog->outError("Auth server can not bind to %s:%d (possible error: port already in use)", bind_ip.c_str(), rmport);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -196,24 +196,24 @@ extern int main(int argc, char** argv)
|
||||
Handler.register_handler(SIGTERM, &SignalTERM);
|
||||
|
||||
#if defined(_WIN32) || defined(__linux__)
|
||||
|
||||
|
||||
///- Handle affinity for multiple processors and process priority
|
||||
uint32 affinity = sConfigMgr->GetIntDefault("UseProcessors", 0);
|
||||
bool highPriority = sConfigMgr->GetBoolDefault("ProcessPriority", false);
|
||||
|
||||
#ifdef _WIN32 // Windows
|
||||
|
||||
|
||||
HANDLE hProcess = GetCurrentProcess();
|
||||
if (affinity > 0)
|
||||
{
|
||||
ULONG_PTR appAff;
|
||||
ULONG_PTR sysAff;
|
||||
|
||||
|
||||
if (GetProcessAffinityMask(hProcess, &appAff, &sysAff))
|
||||
{
|
||||
// remove non accessible processors
|
||||
ULONG_PTR currentAffinity = affinity & appAff;
|
||||
|
||||
|
||||
if (!currentAffinity)
|
||||
sLog->outError("server.authserver", "Processors marked in UseProcessors bitmask (hex) %x are not accessible for the authserver. Accessible processors bitmask (hex): %x", affinity, appAff);
|
||||
else if (SetProcessAffinityMask(hProcess, currentAffinity))
|
||||
@@ -222,7 +222,7 @@ extern int main(int argc, char** argv)
|
||||
sLog->outError("server.authserver", "Can't set used processors (hex): %x", currentAffinity);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (highPriority)
|
||||
{
|
||||
if (SetPriorityClass(hProcess, HIGH_PRIORITY_CLASS))
|
||||
@@ -230,9 +230,9 @@ extern int main(int argc, char** argv)
|
||||
else
|
||||
sLog->outError("server.authserver", "Can't set authserver process priority class.");
|
||||
}
|
||||
|
||||
|
||||
#else // Linux
|
||||
|
||||
|
||||
if (affinity > 0)
|
||||
{
|
||||
cpu_set_t mask;
|
||||
@@ -259,7 +259,7 @@ extern int main(int argc, char** argv)
|
||||
else
|
||||
sLog->outString("authserver process priority class set to %i", getpriority(PRIO_PROCESS, 0));
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
@@ -188,7 +188,7 @@ bool World::IsClosed() const
|
||||
{
|
||||
return m_isClosed;
|
||||
}
|
||||
|
||||
|
||||
void World::SetClosed(bool val)
|
||||
{
|
||||
m_isClosed = val;
|
||||
@@ -730,7 +730,7 @@ void World::LoadConfigSettings(bool reload)
|
||||
m_int_configs[CONFIG_STRICT_CHARTER_NAMES] = sConfigMgr->GetIntDefault ("StrictCharterNames", 0);
|
||||
m_int_configs[CONFIG_STRICT_CHANNEL_NAMES] = sConfigMgr->GetIntDefault ("StrictChannelNames", 0);
|
||||
m_int_configs[CONFIG_STRICT_PET_NAMES] = sConfigMgr->GetIntDefault ("StrictPetNames", 0);
|
||||
|
||||
|
||||
m_bool_configs[CONFIG_ALLOW_TWO_SIDE_ACCOUNTS] = sConfigMgr->GetBoolDefault("AllowTwoSide.Accounts", true);
|
||||
m_bool_configs[CONFIG_ALLOW_TWO_SIDE_INTERACTION_CALENDAR]= sConfigMgr->GetBoolDefault("AllowTwoSide.Interaction.Calendar", false);
|
||||
m_bool_configs[CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHAT] = sConfigMgr->GetBoolDefault("AllowTwoSide.Interaction.Chat", false);
|
||||
@@ -743,7 +743,7 @@ void World::LoadConfigSettings(bool reload)
|
||||
m_bool_configs[CONFIG_ALLOW_TWO_SIDE_ADD_FRIEND] = sConfigMgr->GetBoolDefault("AllowTwoSide.AddFriend", false);
|
||||
m_bool_configs[CONFIG_ALLOW_TWO_SIDE_TRADE] = sConfigMgr->GetBoolDefault("AllowTwoSide.trade", false);
|
||||
m_bool_configs[CONFIG_ALLOW_TWO_SIDE_INTERACTION_EMOTE] = sConfigMgr->GetBoolDefault("AllowTwoSide.Interaction.Emote", false);
|
||||
|
||||
|
||||
m_int_configs[CONFIG_MIN_PLAYER_NAME] = sConfigMgr->GetIntDefault ("MinPlayerName", 2);
|
||||
if (m_int_configs[CONFIG_MIN_PLAYER_NAME] < 1 || m_int_configs[CONFIG_MIN_PLAYER_NAME] > MAX_PLAYER_NAME)
|
||||
{
|
||||
@@ -1049,7 +1049,7 @@ void World::LoadConfigSettings(bool reload)
|
||||
m_int_configs[CONFIG_WORLD_BOSS_LEVEL_DIFF] = sConfigMgr->GetIntDefault("WorldBossLevelDiff", 3);
|
||||
|
||||
m_bool_configs[CONFIG_QUEST_ENABLE_QUEST_TRACKER] = sConfigMgr->GetBoolDefault("Quests.EnableQuestTracker", false);
|
||||
|
||||
|
||||
// note: disable value (-1) will assigned as 0xFFFFFFF, to prevent overflow at calculations limit it to max possible player level MAX_LEVEL(100)
|
||||
m_int_configs[CONFIG_QUEST_LOW_LEVEL_HIDE_DIFF] = sConfigMgr->GetIntDefault("Quests.LowLevelHideDiff", 4);
|
||||
if (m_int_configs[CONFIG_QUEST_LOW_LEVEL_HIDE_DIFF] > MAX_LEVEL)
|
||||
@@ -1363,7 +1363,7 @@ void World::SetInitialWorldSettings()
|
||||
|
||||
///- Initialize detour memory management
|
||||
dtAllocSetCustom(dtCustomAlloc, dtCustomFree);
|
||||
|
||||
|
||||
sLog->outString("Initializing Scripts...");
|
||||
sScriptMgr->Initialize();
|
||||
|
||||
@@ -1828,8 +1828,8 @@ void World::SetInitialWorldSettings()
|
||||
///- Handle outdated emails (delete/return)
|
||||
sLog->outString("Returning old mails...");
|
||||
sObjectMgr->ReturnOrDeleteOldMails(false);
|
||||
|
||||
///- Load AutoBroadCast
|
||||
|
||||
///- Load AutoBroadCast
|
||||
sLog->outString("Loading Autobroadcasts...");
|
||||
LoadAutobroadcasts();
|
||||
|
||||
@@ -1837,7 +1837,7 @@ void World::SetInitialWorldSettings()
|
||||
sObjectMgr->LoadSpellScripts(); // must be after load Creature/Gameobject(Template/Data)
|
||||
sObjectMgr->LoadEventScripts(); // must be after load Creature/Gameobject(Template/Data)
|
||||
sObjectMgr->LoadWaypointScripts();
|
||||
|
||||
|
||||
sLog->outString("Loading spell script names...");
|
||||
sObjectMgr->LoadSpellScriptNames();
|
||||
|
||||
@@ -1999,10 +1999,10 @@ void World::SetInitialWorldSettings()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
uint32 startupDuration = GetMSTimeDiffToNow(startupBegin);
|
||||
sLog->outString();
|
||||
sLog->outError("WORLD: World initialized in %u minutes %u seconds", (startupDuration / 60000), ((startupDuration % 60000) / 1000));
|
||||
sLog->outError("WORLD: World initialized in %u minutes %u seconds", (startupDuration / 60000), ((startupDuration % 60000) / 1000)); // outError for red color in console
|
||||
sLog->outString();
|
||||
|
||||
// possibly enable db logging; avoid massive startup spam by doing it here.
|
||||
@@ -2048,7 +2048,7 @@ void World::DetectDBCLang()
|
||||
{
|
||||
default_locale = m_lang_confid;
|
||||
}
|
||||
|
||||
|
||||
if (default_locale >= TOTAL_LOCALES)
|
||||
{
|
||||
sLog->outError("Unable to determine your DBC Locale! (corrupt DBC?)");
|
||||
@@ -2160,7 +2160,7 @@ void World::Update(uint32 diff)
|
||||
// so we don't have to do it in every packet that modifies auctions
|
||||
AsyncAuctionListingMgr::SetAuctionListingAllowed(false);
|
||||
{
|
||||
ACORE_GUARD(ACE_Thread_Mutex, AsyncAuctionListingMgr::GetLock());
|
||||
ACORE_GUARD(ACE_Thread_Mutex, AsyncAuctionListingMgr::GetLock());
|
||||
|
||||
// pussywizard: handle auctions when the timer has passed
|
||||
if (m_timers[WUPDATE_AUCTIONS].Passed())
|
||||
@@ -2180,7 +2180,7 @@ void World::Update(uint32 diff)
|
||||
}
|
||||
|
||||
UpdateSessions(diff);
|
||||
}
|
||||
}
|
||||
// end of section with mutex
|
||||
AsyncAuctionListingMgr::SetAuctionListingAllowed(true);
|
||||
|
||||
@@ -2230,25 +2230,25 @@ void World::Update(uint32 diff)
|
||||
|
||||
// execute callbacks from sql queries that were queued recently
|
||||
ProcessQueryCallbacks();
|
||||
|
||||
|
||||
/// <li> Update uptime table
|
||||
if (m_timers[WUPDATE_UPTIME].Passed())
|
||||
{
|
||||
uint32 tmpDiff = uint32(m_gameTime - m_startTime);
|
||||
uint32 maxOnlinePlayers = GetMaxPlayerCount();
|
||||
|
||||
|
||||
m_timers[WUPDATE_UPTIME].Reset();
|
||||
|
||||
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_UPTIME_PLAYERS);
|
||||
|
||||
|
||||
stmt->setUInt32(0, tmpDiff);
|
||||
stmt->setUInt16(1, uint16(maxOnlinePlayers));
|
||||
stmt->setUInt32(2, realmID);
|
||||
stmt->setUInt32(3, uint32(m_startTime));
|
||||
|
||||
|
||||
LoginDatabase.Execute(stmt);
|
||||
}
|
||||
|
||||
|
||||
///- Erase corpses once every 20 minutes
|
||||
if (m_timers[WUPDATE_CORPSES].Passed())
|
||||
{
|
||||
@@ -2700,7 +2700,7 @@ void World::SendAutoBroadcast()
|
||||
{
|
||||
if (m_Autobroadcasts.empty())
|
||||
return;
|
||||
|
||||
|
||||
uint32 weight = 0;
|
||||
AutobroadcastsWeightMap selectionWeights;
|
||||
|
||||
|
||||
@@ -141,10 +141,10 @@ int Master::Run()
|
||||
if (!pidFile.empty())
|
||||
{
|
||||
if (uint32 pid = CreatePIDFile(pidFile))
|
||||
sLog->outString("Daemon PID: %u\n", pid);
|
||||
sLog->outError("Daemon PID: %u\n", pid); // outError for red color in console
|
||||
else
|
||||
{
|
||||
sLog->outString("Cannot create PID file %s.\n", pidFile.c_str());
|
||||
sLog->outError("Cannot create PID file %s (possible error: permission)\n", pidFile.c_str());
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ void RARunnable::run()
|
||||
|
||||
if (acceptor.open(listenAddress, m_Reactor) == -1)
|
||||
{
|
||||
sLog->outError("Trinity RA can not bind to port %d on %s", raPort, stringIp.c_str());
|
||||
sLog->outError("Trinity RA can not bind to port %d on %s (possible error: port already in use)", raPort, stringIp.c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user