diff options
| author | Spp <spp@jorge.gr> | 2013-11-08 11:12:17 +0100 |
|---|---|---|
| committer | Spp <spp@jorge.gr> | 2013-11-08 11:12:17 +0100 |
| commit | ab2d26cb910ea9d24ae87d6342f0cbc264fc16cf (patch) | |
| tree | 87c7ff135e2c45773a25a900d1872aa6fa8afd08 /src/server/authserver | |
| parent | 990e4c78514e3a3f8e8905cf22dfacbb0c4fba67 (diff) | |
| parent | 94e2b9332a1f6ceec024338b8f41cd3dca099a40 (diff) | |
Merge branch 'master' into 4.3.4
Conflicts:
src/server/game/AI/EventAI/CreatureEventAI.cpp
src/server/game/AI/EventAI/CreatureEventAIMgr.cpp
src/server/game/Achievements/AchievementMgr.cpp
src/server/game/Battlegrounds/ArenaTeam.cpp
src/server/game/Battlegrounds/BattlegroundMgr.cpp
src/server/game/Conditions/ConditionMgr.cpp
src/server/game/DataStores/DBCStores.cpp
src/server/game/DungeonFinding/LFGMgr.cpp
src/server/game/Entities/DynamicObject/DynamicObject.cpp
src/server/game/Entities/Object/Object.cpp
src/server/game/Entities/Object/Updates/UpdateData.cpp
src/server/game/Entities/Player/Player.cpp
src/server/game/Entities/Unit/Unit.cpp
src/server/game/Globals/ObjectMgr.cpp
src/server/game/Guilds/Guild.cpp
src/server/game/Guilds/GuildMgr.cpp
src/server/game/Handlers/AuctionHouseHandler.cpp
src/server/game/Handlers/BattleGroundHandler.cpp
src/server/game/Handlers/BattlefieldHandler.cpp
src/server/game/Handlers/CalendarHandler.cpp
src/server/game/Handlers/CharacterHandler.cpp
src/server/game/Handlers/ChatHandler.cpp
src/server/game/Handlers/GroupHandler.cpp
src/server/game/Handlers/GuildHandler.cpp
src/server/game/Handlers/ItemHandler.cpp
src/server/game/Handlers/LFGHandler.cpp
src/server/game/Handlers/MailHandler.cpp
src/server/game/Handlers/MiscHandler.cpp
src/server/game/Handlers/MovementHandler.cpp
src/server/game/Handlers/NPCHandler.cpp
src/server/game/Handlers/PetitionsHandler.cpp
src/server/game/Handlers/QuestHandler.cpp
src/server/game/Handlers/SpellHandler.cpp
src/server/game/Handlers/TradeHandler.cpp
src/server/game/Instances/InstanceScript.cpp
src/server/game/Server/WorldSession.cpp
src/server/game/Server/WorldSocket.cpp
src/server/game/Spells/Auras/SpellAuraEffects.cpp
src/server/game/Spells/Auras/SpellAuras.cpp
src/server/game/Spells/Spell.cpp
src/server/game/Spells/SpellEffects.cpp
src/server/game/Spells/SpellMgr.cpp
src/server/game/Tools/PlayerDump.cpp
src/server/game/World/World.cpp
src/server/scripts/Commands/cs_modify.cpp
src/server/scripts/Commands/cs_reload.cpp
src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp
src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp
src/server/scripts/EasternKingdoms/zone_silverpine_forest.cpp
src/server/scripts/Spells/spell_warlock.cpp
src/server/worldserver/worldserver.conf.dist
Diffstat (limited to 'src/server/authserver')
| -rw-r--r-- | src/server/authserver/Main.cpp | 54 | ||||
| -rw-r--r-- | src/server/authserver/Realms/RealmList.cpp | 4 | ||||
| -rw-r--r-- | src/server/authserver/Server/AuthSocket.cpp | 94 | ||||
| -rw-r--r-- | src/server/authserver/Server/RealmAcceptor.h | 4 | ||||
| -rw-r--r-- | src/server/authserver/Server/RealmSocket.cpp | 2 |
5 files changed, 79 insertions, 79 deletions
diff --git a/src/server/authserver/Main.cpp b/src/server/authserver/Main.cpp index b16e86a7f9f..80a810e4ce1 100644 --- a/src/server/authserver/Main.cpp +++ b/src/server/authserver/Main.cpp @@ -77,7 +77,7 @@ public: /// Print out the usage string for this program on the console. void usage(const char* prog) { - TC_LOG_INFO(LOG_FILTER_AUTHSERVER, "Usage: \n %s [<options>]\n" + TC_LOG_INFO("server.authserver", "Usage: \n %s [<options>]\n" " -c config_file use config_file as configuration file\n\r", prog); } @@ -111,11 +111,11 @@ extern int main(int argc, char** argv) return 1; } - TC_LOG_INFO(LOG_FILTER_AUTHSERVER, "%s (authserver)", _FULLVERSION); - TC_LOG_INFO(LOG_FILTER_AUTHSERVER, "<Ctrl-C> to stop.\n"); - TC_LOG_INFO(LOG_FILTER_AUTHSERVER, "Using configuration file %s.", configFile); + TC_LOG_INFO("server.authserver", "%s (authserver)", _FULLVERSION); + TC_LOG_INFO("server.authserver", "<Ctrl-C> to stop.\n"); + TC_LOG_INFO("server.authserver", "Using configuration file %s.", configFile); - TC_LOG_WARN(LOG_FILTER_AUTHSERVER, "%s (Library: %s)", OPENSSL_VERSION_TEXT, SSLeay_version(SSLEAY_VERSION)); + TC_LOG_WARN("server.authserver", "%s (Library: %s)", OPENSSL_VERSION_TEXT, SSLeay_version(SSLEAY_VERSION)); #if defined (ACE_HAS_EVENT_POLL) || defined (ACE_HAS_DEV_POLL) ACE_Reactor::instance(new ACE_Reactor(new ACE_Dev_Poll_Reactor(ACE::max_handles(), 1), 1), true); @@ -123,17 +123,17 @@ extern int main(int argc, char** argv) ACE_Reactor::instance(new ACE_Reactor(new ACE_TP_Reactor(), true), true); #endif - TC_LOG_DEBUG(LOG_FILTER_AUTHSERVER, "Max allowed open files is %d", ACE::max_handles()); + TC_LOG_DEBUG("server.authserver", "Max allowed open files is %d", ACE::max_handles()); // authserver PID file creation std::string pidFile = sConfigMgr->GetStringDefault("PidFile", ""); if (!pidFile.empty()) { if (uint32 pid = CreatePIDFile(pidFile)) - TC_LOG_INFO(LOG_FILTER_AUTHSERVER, "Daemon PID: %u\n", pid); + TC_LOG_INFO("server.authserver", "Daemon PID: %u\n", pid); else { - TC_LOG_ERROR(LOG_FILTER_AUTHSERVER, "Cannot create PID file %s.\n", pidFile.c_str()); + TC_LOG_ERROR("server.authserver", "Cannot create PID file %s.\n", pidFile.c_str()); return 1; } } @@ -146,7 +146,7 @@ extern int main(int argc, char** argv) sRealmList->Initialize(sConfigMgr->GetIntDefault("RealmsStateUpdateDelay", 20)); if (sRealmList->size() == 0) { - TC_LOG_ERROR(LOG_FILTER_AUTHSERVER, "No valid realms specified."); + TC_LOG_ERROR("server.authserver", "No valid realms specified."); return 1; } @@ -156,7 +156,7 @@ extern int main(int argc, char** argv) int32 rmport = sConfigMgr->GetIntDefault("RealmServerPort", 3724); if (rmport < 0 || rmport > 0xFFFF) { - TC_LOG_ERROR(LOG_FILTER_AUTHSERVER, "Specified port out of allowed range (1-65535)"); + TC_LOG_ERROR("server.authserver", "Specified port out of allowed range (1-65535)"); return 1; } @@ -166,7 +166,7 @@ extern int main(int argc, char** argv) if (acceptor.open(bind_addr, ACE_Reactor::instance(), ACE_NONBLOCK) == -1) { - TC_LOG_ERROR(LOG_FILTER_AUTHSERVER, "Auth server can not bind to %s:%d", bind_ip.c_str(), rmport); + TC_LOG_ERROR("server.authserver", "Auth server can not bind to %s:%d", bind_ip.c_str(), rmport); return 1; } @@ -196,20 +196,20 @@ extern int main(int argc, char** argv) ULONG_PTR currentAffinity = affinity & appAff; // remove non accessible processors if (!currentAffinity) - TC_LOG_ERROR(LOG_FILTER_AUTHSERVER, "Processors marked in UseProcessors bitmask (hex) %x are not accessible for the authserver. Accessible processors bitmask (hex): %x", affinity, appAff); + TC_LOG_ERROR("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)) - TC_LOG_INFO(LOG_FILTER_AUTHSERVER, "Using processors (bitmask, hex): %x", currentAffinity); + TC_LOG_INFO("server.authserver", "Using processors (bitmask, hex): %x", currentAffinity); else - TC_LOG_ERROR(LOG_FILTER_AUTHSERVER, "Can't set used processors (hex): %x", currentAffinity); + TC_LOG_ERROR("server.authserver", "Can't set used processors (hex): %x", currentAffinity); } } if (highPriority) { if (SetPriorityClass(hProcess, HIGH_PRIORITY_CLASS)) - TC_LOG_INFO(LOG_FILTER_AUTHSERVER, "authserver process priority class set to HIGH"); + TC_LOG_INFO("server.authserver", "authserver process priority class set to HIGH"); else - TC_LOG_ERROR(LOG_FILTER_AUTHSERVER, "Can't set authserver process priority class."); + TC_LOG_ERROR("server.authserver", "Can't set authserver process priority class."); } } #elif __linux__ // Linux @@ -224,21 +224,21 @@ extern int main(int argc, char** argv) CPU_SET(i, &mask); if (sched_setaffinity(0, sizeof(mask), &mask)) - TC_LOG_ERROR(LOG_FILTER_AUTHSERVER, "Can't set used processors (hex): %x, error: %s", affinity, strerror(errno)); + TC_LOG_ERROR("server.authserver", "Can't set used processors (hex): %x, error: %s", affinity, strerror(errno)); else { CPU_ZERO(&mask); sched_getaffinity(0, sizeof(mask), &mask); - TC_LOG_INFO(LOG_FILTER_AUTHSERVER, "Using processors (bitmask, hex): %x", *(uint32*)(&mask)); + TC_LOG_INFO("server.authserver", "Using processors (bitmask, hex): %x", *(uint32*)(&mask)); } } if (highPriority) { if (setpriority(PRIO_PROCESS, 0, PROCESS_HIGH_PRIORITY)) - TC_LOG_ERROR(LOG_FILTER_AUTHSERVER, "Can't set authserver process priority class, error: %s", strerror(errno)); + TC_LOG_ERROR("server.authserver", "Can't set authserver process priority class, error: %s", strerror(errno)); else - TC_LOG_INFO(LOG_FILTER_AUTHSERVER, "authserver process priority class set to %i", getpriority(PRIO_PROCESS, 0)); + TC_LOG_INFO("server.authserver", "authserver process priority class set to %i", getpriority(PRIO_PROCESS, 0)); } #endif @@ -259,7 +259,7 @@ extern int main(int argc, char** argv) if ((++loopCounter) == numLoops) { loopCounter = 0; - TC_LOG_INFO(LOG_FILTER_AUTHSERVER, "Ping MySQL to keep connection alive"); + TC_LOG_INFO("server.authserver", "Ping MySQL to keep connection alive"); LoginDatabase.KeepAlive(); } } @@ -267,7 +267,7 @@ extern int main(int argc, char** argv) // Close the Database Pool and library StopDB(); - TC_LOG_INFO(LOG_FILTER_AUTHSERVER, "Halting process..."); + TC_LOG_INFO("server.authserver", "Halting process..."); return 0; } @@ -279,32 +279,32 @@ bool StartDB() std::string dbstring = sConfigMgr->GetStringDefault("LoginDatabaseInfo", ""); if (dbstring.empty()) { - TC_LOG_ERROR(LOG_FILTER_AUTHSERVER, "Database not specified"); + TC_LOG_ERROR("server.authserver", "Database not specified"); return false; } int32 worker_threads = sConfigMgr->GetIntDefault("LoginDatabase.WorkerThreads", 1); if (worker_threads < 1 || worker_threads > 32) { - TC_LOG_ERROR(LOG_FILTER_AUTHSERVER, "Improper value specified for LoginDatabase.WorkerThreads, defaulting to 1."); + TC_LOG_ERROR("server.authserver", "Improper value specified for LoginDatabase.WorkerThreads, defaulting to 1."); worker_threads = 1; } int32 synch_threads = sConfigMgr->GetIntDefault("LoginDatabase.SynchThreads", 1); if (synch_threads < 1 || synch_threads > 32) { - TC_LOG_ERROR(LOG_FILTER_AUTHSERVER, "Improper value specified for LoginDatabase.SynchThreads, defaulting to 1."); + TC_LOG_ERROR("server.authserver", "Improper value specified for LoginDatabase.SynchThreads, defaulting to 1."); synch_threads = 1; } // NOTE: While authserver is singlethreaded you should keep synch_threads == 1. Increasing it is just silly since only 1 will be used ever. if (!LoginDatabase.Open(dbstring, uint8(worker_threads), uint8(synch_threads))) { - TC_LOG_ERROR(LOG_FILTER_AUTHSERVER, "Cannot connect to database"); + TC_LOG_ERROR("server.authserver", "Cannot connect to database"); return false; } - TC_LOG_INFO(LOG_FILTER_AUTHSERVER, "Started auth database connection pool."); + TC_LOG_INFO("server.authserver", "Started auth database connection pool."); sLog->SetRealmId(0); // Enables DB appenders when realm is set. return true; } diff --git a/src/server/authserver/Realms/RealmList.cpp b/src/server/authserver/Realms/RealmList.cpp index 0d8764a61c0..34120f75e88 100644 --- a/src/server/authserver/Realms/RealmList.cpp +++ b/src/server/authserver/Realms/RealmList.cpp @@ -68,7 +68,7 @@ void RealmList::UpdateIfNeed() void RealmList::UpdateRealms(bool init) { - TC_LOG_INFO(LOG_FILTER_AUTHSERVER, "Updating Realm List..."); + TC_LOG_INFO("server.authserver", "Updating Realm List..."); PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_REALMLIST); PreparedQueryResult result = LoginDatabase.Query(stmt); @@ -99,7 +99,7 @@ void RealmList::UpdateRealms(bool init) UpdateRealm(realmId, name, externalAddr, localAddr, submask, icon, flag, timezone, (allowedSecurityLevel <= SEC_ADMINISTRATOR ? AccountTypes(allowedSecurityLevel) : SEC_ADMINISTRATOR), pop, build); if (init) - TC_LOG_INFO(LOG_FILTER_AUTHSERVER, "Added realm \"%s\" at %s:%u.", name.c_str(), m_realms[name].ExternalAddress.get_host_addr(), port); + TC_LOG_INFO("server.authserver", "Added realm \"%s\" at %s:%u.", name.c_str(), m_realms[name].ExternalAddress.get_host_addr(), port); } while (result->NextRow()); } diff --git a/src/server/authserver/Server/AuthSocket.cpp b/src/server/authserver/Server/AuthSocket.cpp index 4312548116a..15077dc920d 100644 --- a/src/server/authserver/Server/AuthSocket.cpp +++ b/src/server/authserver/Server/AuthSocket.cpp @@ -211,12 +211,12 @@ AuthSocket::~AuthSocket(void) { } // Accept the connection void AuthSocket::OnAccept(void) { - TC_LOG_DEBUG(LOG_FILTER_AUTHSERVER, "'%s:%d' Accepting connection", socket().getRemoteAddress().c_str(), socket().getRemotePort()); + TC_LOG_DEBUG("server.authserver", "'%s:%d' Accepting connection", socket().getRemoteAddress().c_str(), socket().getRemotePort()); } void AuthSocket::OnClose(void) { - TC_LOG_DEBUG(LOG_FILTER_AUTHSERVER, "AuthSocket::OnClose"); + TC_LOG_DEBUG("server.authserver", "AuthSocket::OnClose"); } // Read the packet from the client @@ -235,7 +235,7 @@ void AuthSocket::OnRead() ++challengesInARow; if (challengesInARow == MAX_AUTH_LOGON_CHALLENGES_IN_A_ROW) { - TC_LOG_WARN(LOG_FILTER_AUTHSERVER, "Got %u AUTH_LOGON_CHALLENGE in a row from '%s', possible ongoing DoS", challengesInARow, socket().getRemoteAddress().c_str()); + TC_LOG_WARN("server.authserver", "Got %u AUTH_LOGON_CHALLENGE in a row from '%s', possible ongoing DoS", challengesInARow, socket().getRemoteAddress().c_str()); socket().shutdown(); return; } @@ -248,11 +248,11 @@ void AuthSocket::OnRead() { if ((uint8)table[i].cmd == _cmd && (table[i].status == STATUS_CONNECTED || (_authed && table[i].status == STATUS_AUTHED))) { - TC_LOG_DEBUG(LOG_FILTER_AUTHSERVER, "Got data for cmd %u recv length %u", (uint32)_cmd, (uint32)socket().recv_len()); + TC_LOG_DEBUG("server.authserver", "Got data for cmd %u recv length %u", (uint32)_cmd, (uint32)socket().recv_len()); if (!(*this.*table[i].handler)()) { - TC_LOG_DEBUG(LOG_FILTER_AUTHSERVER, "Command handler failed for cmd %u recv length %u", (uint32)_cmd, (uint32)socket().recv_len()); + TC_LOG_DEBUG("server.authserver", "Command handler failed for cmd %u recv length %u", (uint32)_cmd, (uint32)socket().recv_len()); return; } break; @@ -262,7 +262,7 @@ void AuthSocket::OnRead() // Report unknown packets in the error log if (i == AUTH_TOTAL_COMMANDS) { - TC_LOG_ERROR(LOG_FILTER_AUTHSERVER, "Got unknown packet from '%s'", socket().getRemoteAddress().c_str()); + TC_LOG_ERROR("server.authserver", "Got unknown packet from '%s'", socket().getRemoteAddress().c_str()); socket().shutdown(); return; } @@ -311,7 +311,7 @@ void AuthSocket::_SetVSFields(const std::string& rI) // Logon Challenge command handler bool AuthSocket::_HandleLogonChallenge() { - TC_LOG_DEBUG(LOG_FILTER_AUTHSERVER, "Entering _HandleLogonChallenge"); + TC_LOG_DEBUG("server.authserver", "Entering _HandleLogonChallenge"); if (socket().recv_len() < sizeof(sAuthLogonChallenge_C)) return false; @@ -326,7 +326,7 @@ bool AuthSocket::_HandleLogonChallenge() #endif uint16 remaining = ((sAuthLogonChallenge_C *)&buf[0])->size; - TC_LOG_DEBUG(LOG_FILTER_AUTHSERVER, "[AuthChallenge] got header, body is %#04x bytes", remaining); + TC_LOG_DEBUG("server.authserver", "[AuthChallenge] got header, body is %#04x bytes", remaining); if ((remaining < sizeof(sAuthLogonChallenge_C) - buf.size()) || (socket().recv_len() < remaining)) return false; @@ -338,8 +338,8 @@ bool AuthSocket::_HandleLogonChallenge() // Read the remaining of the packet socket().recv((char *)&buf[4], remaining); - TC_LOG_DEBUG(LOG_FILTER_AUTHSERVER, "[AuthChallenge] got full packet, %#04x bytes", ch->size); - TC_LOG_DEBUG(LOG_FILTER_AUTHSERVER, "[AuthChallenge] name(%d): '%s'", ch->I_len, ch->I); + TC_LOG_DEBUG("server.authserver", "[AuthChallenge] got full packet, %#04x bytes", ch->size); + TC_LOG_DEBUG("server.authserver", "[AuthChallenge] name(%d): '%s'", ch->I_len, ch->I); // BigEndian code, nop in little endian case // size already converted @@ -379,7 +379,7 @@ bool AuthSocket::_HandleLogonChallenge() if (result) { pkt << uint8(WOW_FAIL_BANNED); - TC_LOG_DEBUG(LOG_FILTER_AUTHSERVER, "'%s:%d' [AuthChallenge] Banned ip tries to login!", socket().getRemoteAddress().c_str(), socket().getRemotePort()); + TC_LOG_DEBUG("server.authserver", "'%s:%d' [AuthChallenge] Banned ip tries to login!", socket().getRemoteAddress().c_str(), socket().getRemotePort()); } else { @@ -397,24 +397,24 @@ bool AuthSocket::_HandleLogonChallenge() bool locked = false; if (fields[2].GetUInt8() == 1) // if ip is locked { - TC_LOG_DEBUG(LOG_FILTER_AUTHSERVER, "[AuthChallenge] Account '%s' is locked to IP - '%s'", _login.c_str(), fields[3].GetCString()); - TC_LOG_DEBUG(LOG_FILTER_AUTHSERVER, "[AuthChallenge] Player address is '%s'", ip_address.c_str()); + TC_LOG_DEBUG("server.authserver", "[AuthChallenge] Account '%s' is locked to IP - '%s'", _login.c_str(), fields[3].GetCString()); + TC_LOG_DEBUG("server.authserver", "[AuthChallenge] Player address is '%s'", ip_address.c_str()); if (strcmp(fields[4].GetCString(), ip_address.c_str()) != 0) { - TC_LOG_DEBUG(LOG_FILTER_AUTHSERVER, "[AuthChallenge] Account IP differs"); + TC_LOG_DEBUG("server.authserver", "[AuthChallenge] Account IP differs"); pkt << uint8(WOW_FAIL_LOCKED_ENFORCED); locked = true; } else - TC_LOG_DEBUG(LOG_FILTER_AUTHSERVER, "[AuthChallenge] Account IP matches"); + TC_LOG_DEBUG("server.authserver", "[AuthChallenge] Account IP matches"); } else { - TC_LOG_DEBUG(LOG_FILTER_AUTHSERVER, "[AuthChallenge] Account '%s' is not locked to ip", _login.c_str()); + TC_LOG_DEBUG("server.authserver", "[AuthChallenge] Account '%s' is not locked to ip", _login.c_str()); std::string accountCountry = fields[3].GetString(); if (accountCountry.empty() || accountCountry == "00") - TC_LOG_DEBUG(LOG_FILTER_AUTHSERVER, "[AuthChallenge] Account '%s' is not locked to country", _login.c_str()); + TC_LOG_DEBUG("server.authserver", "[AuthChallenge] Account '%s' is not locked to country", _login.c_str()); else if (!accountCountry.empty()) { uint32 ip = inet_addr(ip_address.c_str()); @@ -425,18 +425,18 @@ bool AuthSocket::_HandleLogonChallenge() if (PreparedQueryResult sessionCountryQuery = LoginDatabase.Query(stmt)) { std::string loginCountry = (*sessionCountryQuery)[0].GetString(); - TC_LOG_DEBUG(LOG_FILTER_AUTHSERVER, "[AuthChallenge] Account '%s' is locked to country: '%s' Player country is '%s'", _login.c_str(), accountCountry.c_str(), loginCountry.c_str()); + TC_LOG_DEBUG("server.authserver", "[AuthChallenge] Account '%s' is locked to country: '%s' Player country is '%s'", _login.c_str(), accountCountry.c_str(), loginCountry.c_str()); if (loginCountry != accountCountry) { - TC_LOG_DEBUG(LOG_FILTER_AUTHSERVER, "[AuthChallenge] Account country differs."); + TC_LOG_DEBUG("server.authserver", "[AuthChallenge] Account country differs."); pkt << uint8(WOW_FAIL_UNLOCKABLE_LOCK); locked = true; } else - TC_LOG_DEBUG(LOG_FILTER_AUTHSERVER, "[AuthChallenge] Account country matches"); + TC_LOG_DEBUG("server.authserver", "[AuthChallenge] Account country matches"); } else - TC_LOG_DEBUG(LOG_FILTER_AUTHSERVER, "[AuthChallenge] IP2NATION Table empty"); + TC_LOG_DEBUG("server.authserver", "[AuthChallenge] IP2NATION Table empty"); } } @@ -454,12 +454,12 @@ bool AuthSocket::_HandleLogonChallenge() if ((*banresult)[0].GetUInt32() == (*banresult)[1].GetUInt32()) { pkt << uint8(WOW_FAIL_BANNED); - TC_LOG_DEBUG(LOG_FILTER_AUTHSERVER, "'%s:%d' [AuthChallenge] Banned account %s tried to login!", socket().getRemoteAddress().c_str(), socket().getRemotePort(), _login.c_str ()); + TC_LOG_DEBUG("server.authserver", "'%s:%d' [AuthChallenge] Banned account %s tried to login!", socket().getRemoteAddress().c_str(), socket().getRemotePort(), _login.c_str ()); } else { pkt << uint8(WOW_FAIL_SUSPENDED); - TC_LOG_DEBUG(LOG_FILTER_AUTHSERVER, "'%s:%d' [AuthChallenge] Temporarily banned account %s tried to login!", socket().getRemoteAddress().c_str(), socket().getRemotePort(), _login.c_str ()); + TC_LOG_DEBUG("server.authserver", "'%s:%d' [AuthChallenge] Temporarily banned account %s tried to login!", socket().getRemoteAddress().c_str(), socket().getRemotePort(), _login.c_str ()); } } else @@ -471,7 +471,7 @@ bool AuthSocket::_HandleLogonChallenge() std::string databaseV = fields[6].GetString(); std::string databaseS = fields[7].GetString(); - TC_LOG_DEBUG(LOG_FILTER_NETWORKIO, "database authentication values: v='%s' s='%s'", databaseV.c_str(), databaseS.c_str()); + TC_LOG_DEBUG("network", "database authentication values: v='%s' s='%s'", databaseV.c_str(), databaseS.c_str()); // multiply with 2 since bytes are stored as hexstring if (databaseV.size() != s_BYTE_SIZE * 2 || databaseS.size() != s_BYTE_SIZE * 2) @@ -539,7 +539,7 @@ bool AuthSocket::_HandleLogonChallenge() for (int i = 0; i < 4; ++i) _localizationName[i] = ch->country[4-i-1]; - TC_LOG_DEBUG(LOG_FILTER_AUTHSERVER, "'%s:%d' [AuthChallenge] account %s is using '%c%c%c%c' locale (%u)", socket().getRemoteAddress().c_str(), socket().getRemotePort(), + TC_LOG_DEBUG("server.authserver", "'%s:%d' [AuthChallenge] account %s is using '%c%c%c%c' locale (%u)", socket().getRemoteAddress().c_str(), socket().getRemotePort(), _login.c_str (), ch->country[3], ch->country[2], ch->country[1], ch->country[0], GetLocaleByName(_localizationName) ); } @@ -556,7 +556,7 @@ bool AuthSocket::_HandleLogonChallenge() // Logon Proof command handler bool AuthSocket::_HandleLogonProof() { - TC_LOG_DEBUG(LOG_FILTER_AUTHSERVER, "Entering _HandleLogonProof"); + TC_LOG_DEBUG("server.authserver", "Entering _HandleLogonProof"); // Read the packet sAuthLogonProof_C lp; @@ -567,7 +567,7 @@ bool AuthSocket::_HandleLogonProof() if (_expversion == NO_VALID_EXP_FLAG) { // Check if we have the appropriate patch on the disk - TC_LOG_DEBUG(LOG_FILTER_NETWORKIO, "Client with invalid version, patching is not implemented"); + TC_LOG_DEBUG("network", "Client with invalid version, patching is not implemented"); socket().shutdown(); return true; } @@ -651,7 +651,7 @@ bool AuthSocket::_HandleLogonProof() // Check if SRP6 results match (password is correct), else send an error if (!memcmp(M.AsByteArray().get(), lp.M1, 20)) { - TC_LOG_DEBUG(LOG_FILTER_AUTHSERVER, "'%s:%d' User '%s' successfully authenticated", socket().getRemoteAddress().c_str(), socket().getRemotePort(), _login.c_str()); + TC_LOG_DEBUG("server.authserver", "'%s:%d' User '%s' successfully authenticated", socket().getRemoteAddress().c_str(), socket().getRemotePort(), _login.c_str()); // Update the sessionkey, last_ip, last login time and reset number of failed logins in the account table for this account // No SQL injection (escaped user name) and IP address as received by socket @@ -719,7 +719,7 @@ bool AuthSocket::_HandleLogonProof() char data[4] = { AUTH_LOGON_PROOF, WOW_FAIL_UNKNOWN_ACCOUNT, 3, 0 }; socket().send(data, sizeof(data)); - TC_LOG_DEBUG(LOG_FILTER_AUTHSERVER, "'%s:%d' [AuthChallenge] account %s tried to login with invalid password!", socket().getRemoteAddress().c_str(), socket().getRemotePort(), _login.c_str ()); + TC_LOG_DEBUG("server.authserver", "'%s:%d' [AuthChallenge] account %s tried to login with invalid password!", socket().getRemoteAddress().c_str(), socket().getRemotePort(), _login.c_str ()); uint32 MaxWrongPassCount = sConfigMgr->GetIntDefault("WrongPass.MaxCount", 0); if (MaxWrongPassCount > 0) @@ -749,7 +749,7 @@ bool AuthSocket::_HandleLogonProof() stmt->setUInt32(1, WrongPassBanTime); LoginDatabase.Execute(stmt); - TC_LOG_DEBUG(LOG_FILTER_AUTHSERVER, "'%s:%d' [AuthChallenge] account %s got banned for '%u' seconds because it failed to authenticate '%u' times", + TC_LOG_DEBUG("server.authserver", "'%s:%d' [AuthChallenge] account %s got banned for '%u' seconds because it failed to authenticate '%u' times", socket().getRemoteAddress().c_str(), socket().getRemotePort(), _login.c_str(), WrongPassBanTime, failed_logins); } else @@ -759,7 +759,7 @@ bool AuthSocket::_HandleLogonProof() stmt->setUInt32(1, WrongPassBanTime); LoginDatabase.Execute(stmt); - TC_LOG_DEBUG(LOG_FILTER_AUTHSERVER, "'%s:%d' [AuthChallenge] IP %s got banned for '%u' seconds because account %s failed to authenticate '%u' times", + TC_LOG_DEBUG("server.authserver", "'%s:%d' [AuthChallenge] IP %s got banned for '%u' seconds because account %s failed to authenticate '%u' times", socket().getRemoteAddress().c_str(), socket().getRemotePort(), socket().getRemoteAddress().c_str(), WrongPassBanTime, _login.c_str(), failed_logins); } } @@ -773,7 +773,7 @@ bool AuthSocket::_HandleLogonProof() // Reconnect Challenge command handler bool AuthSocket::_HandleReconnectChallenge() { - TC_LOG_DEBUG(LOG_FILTER_AUTHSERVER, "Entering _HandleReconnectChallenge"); + TC_LOG_DEBUG("server.authserver", "Entering _HandleReconnectChallenge"); if (socket().recv_len() < sizeof(sAuthLogonChallenge_C)) return false; @@ -788,7 +788,7 @@ bool AuthSocket::_HandleReconnectChallenge() #endif uint16 remaining = ((sAuthLogonChallenge_C *)&buf[0])->size; - TC_LOG_DEBUG(LOG_FILTER_AUTHSERVER, "[ReconnectChallenge] got header, body is %#04x bytes", remaining); + TC_LOG_DEBUG("server.authserver", "[ReconnectChallenge] got header, body is %#04x bytes", remaining); if ((remaining < sizeof(sAuthLogonChallenge_C) - buf.size()) || (socket().recv_len() < remaining)) return false; @@ -800,8 +800,8 @@ bool AuthSocket::_HandleReconnectChallenge() // Read the remaining of the packet socket().recv((char *)&buf[4], remaining); - TC_LOG_DEBUG(LOG_FILTER_AUTHSERVER, "[ReconnectChallenge] got full packet, %#04x bytes", ch->size); - TC_LOG_DEBUG(LOG_FILTER_AUTHSERVER, "[ReconnectChallenge] name(%d): '%s'", ch->I_len, ch->I); + TC_LOG_DEBUG("server.authserver", "[ReconnectChallenge] got full packet, %#04x bytes", ch->size); + TC_LOG_DEBUG("server.authserver", "[ReconnectChallenge] name(%d): '%s'", ch->I_len, ch->I); _login = (const char*)ch->I; @@ -812,7 +812,7 @@ bool AuthSocket::_HandleReconnectChallenge() // Stop if the account is not found if (!result) { - TC_LOG_ERROR(LOG_FILTER_AUTHSERVER, "'%s:%d' [ERROR] user %s tried to login and we cannot find his session key in the database.", socket().getRemoteAddress().c_str(), socket().getRemotePort(), _login.c_str()); + TC_LOG_ERROR("server.authserver", "'%s:%d' [ERROR] user %s tried to login and we cannot find his session key in the database.", socket().getRemoteAddress().c_str(), socket().getRemotePort(), _login.c_str()); socket().shutdown(); return false; } @@ -848,7 +848,7 @@ bool AuthSocket::_HandleReconnectChallenge() // Reconnect Proof command handler bool AuthSocket::_HandleReconnectProof() { - TC_LOG_DEBUG(LOG_FILTER_AUTHSERVER, "Entering _HandleReconnectProof"); + TC_LOG_DEBUG("server.authserver", "Entering _HandleReconnectProof"); // Read the packet sAuthReconnectProof_C lp; if (!socket().recv((char *)&lp, sizeof(sAuthReconnectProof_C))) @@ -879,7 +879,7 @@ bool AuthSocket::_HandleReconnectProof() } else { - TC_LOG_ERROR(LOG_FILTER_AUTHSERVER, "'%s:%d' [ERROR] user %s tried to login, but session is invalid.", socket().getRemoteAddress().c_str(), socket().getRemotePort(), _login.c_str()); + TC_LOG_ERROR("server.authserver", "'%s:%d' [ERROR] user %s tried to login, but session is invalid.", socket().getRemoteAddress().c_str(), socket().getRemotePort(), _login.c_str()); socket().shutdown(); return false; } @@ -910,7 +910,7 @@ ACE_INET_Addr const& AuthSocket::GetAddressForClient(Realm const& realm, ACE_INE // Realm List command handler bool AuthSocket::_HandleRealmList() { - TC_LOG_DEBUG(LOG_FILTER_AUTHSERVER, "Entering _HandleRealmList"); + TC_LOG_DEBUG("server.authserver", "Entering _HandleRealmList"); if (socket().recv_len() < 5) return false; @@ -923,7 +923,7 @@ bool AuthSocket::_HandleRealmList() PreparedQueryResult result = LoginDatabase.Query(stmt); if (!result) { - TC_LOG_ERROR(LOG_FILTER_AUTHSERVER, "'%s:%d' [ERROR] user %s tried to login but we cannot find him in the database.", socket().getRemoteAddress().c_str(), socket().getRemotePort(), _login.c_str()); + TC_LOG_ERROR("server.authserver", "'%s:%d' [ERROR] user %s tried to login but we cannot find him in the database.", socket().getRemoteAddress().c_str(), socket().getRemotePort(), _login.c_str()); socket().shutdown(); return false; } @@ -1040,11 +1040,11 @@ bool AuthSocket::_HandleRealmList() // Resume patch transfer bool AuthSocket::_HandleXferResume() { - TC_LOG_DEBUG(LOG_FILTER_AUTHSERVER, "Entering _HandleXferResume"); + TC_LOG_DEBUG("server.authserver", "Entering _HandleXferResume"); // Check packet length and patch existence if (socket().recv_len() < 9 || !pPatch) // FIXME: pPatch is never used { - TC_LOG_ERROR(LOG_FILTER_AUTHSERVER, "Error while resuming patch transfer (wrong packet)"); + TC_LOG_ERROR("server.authserver", "Error while resuming patch transfer (wrong packet)"); return false; } @@ -1061,7 +1061,7 @@ bool AuthSocket::_HandleXferResume() // Cancel patch transfer bool AuthSocket::_HandleXferCancel() { - TC_LOG_DEBUG(LOG_FILTER_AUTHSERVER, "Entering _HandleXferCancel"); + TC_LOG_DEBUG("server.authserver", "Entering _HandleXferCancel"); // Close and delete the socket socket().recv_skip(1); //clear input buffer @@ -1073,12 +1073,12 @@ bool AuthSocket::_HandleXferCancel() // Accept patch transfer bool AuthSocket::_HandleXferAccept() { - TC_LOG_DEBUG(LOG_FILTER_AUTHSERVER, "Entering _HandleXferAccept"); + TC_LOG_DEBUG("server.authserver", "Entering _HandleXferAccept"); // Check packet length and patch existence if (!pPatch) { - TC_LOG_ERROR(LOG_FILTER_AUTHSERVER, "Error while accepting patch transfer (wrong packet)"); + TC_LOG_ERROR("server.authserver", "Error while accepting patch transfer (wrong packet)"); return false; } @@ -1159,11 +1159,11 @@ void Patcher::LoadPatchMD5(char *szFileName) std::string path = "./patches/"; path += szFileName; FILE* pPatch = fopen(path.c_str(), "rb"); - TC_LOG_DEBUG(LOG_FILTER_NETWORKIO, "Loading patch info from %s\n", path.c_str()); + TC_LOG_DEBUG("network", "Loading patch info from %s\n", path.c_str()); if (!pPatch) { - TC_LOG_ERROR(LOG_FILTER_AUTHSERVER, "Error loading patch %s\n", path.c_str()); + TC_LOG_ERROR("server.authserver", "Error loading patch %s\n", path.c_str()); return; } diff --git a/src/server/authserver/Server/RealmAcceptor.h b/src/server/authserver/Server/RealmAcceptor.h index a982417c3d6..39877f71538 100644 --- a/src/server/authserver/Server/RealmAcceptor.h +++ b/src/server/authserver/Server/RealmAcceptor.h @@ -48,7 +48,7 @@ protected: virtual int handle_timeout(const ACE_Time_Value& /*current_time*/, const void* /*act = 0*/) { - TC_LOG_DEBUG(LOG_FILTER_AUTHSERVER, "Resuming acceptor"); + TC_LOG_DEBUG("server.authserver", "Resuming acceptor"); reactor()->cancel_timer(this, 1); return reactor()->register_handler(this, ACE_Event_Handler::ACCEPT_MASK); } @@ -58,7 +58,7 @@ protected: #if defined(ENFILE) && defined(EMFILE) if (errno == ENFILE || errno == EMFILE) { - TC_LOG_ERROR(LOG_FILTER_AUTHSERVER, "Out of file descriptors, suspending incoming connections for 10 seconds"); + TC_LOG_ERROR("server.authserver", "Out of file descriptors, suspending incoming connections for 10 seconds"); reactor()->remove_handler(this, ACE_Event_Handler::ACCEPT_MASK | ACE_Event_Handler::DONT_CALL); reactor()->schedule_timer(this, NULL, ACE_Time_Value(10)); } diff --git a/src/server/authserver/Server/RealmSocket.cpp b/src/server/authserver/Server/RealmSocket.cpp index acefa4b1af7..13bc71f99a4 100644 --- a/src/server/authserver/Server/RealmSocket.cpp +++ b/src/server/authserver/Server/RealmSocket.cpp @@ -56,7 +56,7 @@ int RealmSocket::open(void * arg) if (peer().get_remote_addr(addr) == -1) { - TC_LOG_ERROR(LOG_FILTER_AUTHSERVER, "Error %s while opening realm socket!", ACE_OS::strerror(errno)); + TC_LOG_ERROR("server.authserver", "Error %s while opening realm socket!", ACE_OS::strerror(errno)); return -1; } |
