mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-17 08:00:48 +01:00
Core: Fix more warnings, add new function sLog.outStaticDebug() that replaces DEBUG_LOG
--HG-- branch : trunk
This commit is contained in:
@@ -248,11 +248,11 @@ void AuthSocket::OnRead()
|
||||
(table[i].status == STATUS_CONNECTED ||
|
||||
(_authed && table[i].status == STATUS_AUTHED)))
|
||||
{
|
||||
DEBUG_LOG("[Auth] got data for cmd %u recv length %u", (uint32)_cmd, (uint32)socket().recv_len());
|
||||
sLog.outStaticDebug("[Auth] got data for cmd %u recv length %u", (uint32)_cmd, (uint32)socket().recv_len());
|
||||
|
||||
if (!(*this.*table[i].handler)())
|
||||
{
|
||||
DEBUG_LOG("Command handler failed for cmd %u recv length %u", (uint32)_cmd, (uint32)socket().recv_len());
|
||||
sLog.outStaticDebug("Command handler failed for cmd %u recv length %u", (uint32)_cmd, (uint32)socket().recv_len());
|
||||
return;
|
||||
}
|
||||
break;
|
||||
@@ -304,7 +304,7 @@ void AuthSocket::_SetVSFields(const std::string& rI)
|
||||
/// Logon Challenge command handler
|
||||
bool AuthSocket::_HandleLogonChallenge()
|
||||
{
|
||||
DEBUG_LOG("Entering _HandleLogonChallenge");
|
||||
sLog.outStaticDebug("Entering _HandleLogonChallenge");
|
||||
if (socket().recv_len() < sizeof(sAuthLogonChallenge_C))
|
||||
return false;
|
||||
|
||||
@@ -316,7 +316,7 @@ bool AuthSocket::_HandleLogonChallenge()
|
||||
|
||||
EndianConvert(*((uint16*)(buf[0])));
|
||||
uint16 remaining = ((sAuthLogonChallenge_C *)&buf[0])->size;
|
||||
DEBUG_LOG("[AuthChallenge] got header, body is %#04x bytes", remaining);
|
||||
sLog.outStaticDebug("[AuthChallenge] got header, body is %#04x bytes", remaining);
|
||||
|
||||
if ((remaining < sizeof(sAuthLogonChallenge_C) - buf.size()) || (socket().recv_len() < remaining))
|
||||
return false;
|
||||
@@ -328,8 +328,8 @@ bool AuthSocket::_HandleLogonChallenge()
|
||||
|
||||
///- Read the remaining of the packet
|
||||
socket().recv((char *)&buf[4], remaining);
|
||||
DEBUG_LOG("[AuthChallenge] got full packet, %#04x bytes", ch->size);
|
||||
DEBUG_LOG("[AuthChallenge] name(%d): '%s'", ch->I_len, ch->I);
|
||||
sLog.outStaticDebug("[AuthChallenge] got full packet, %#04x bytes", ch->size);
|
||||
sLog.outStaticDebug("[AuthChallenge] name(%d): '%s'", ch->I_len, ch->I);
|
||||
|
||||
// BigEndian code, nop in little endian case
|
||||
// size already converted
|
||||
@@ -388,19 +388,19 @@ bool AuthSocket::_HandleLogonChallenge()
|
||||
bool locked = false;
|
||||
if ((*result)[2].GetUInt8() == 1) // if ip is locked
|
||||
{
|
||||
DEBUG_LOG("[AuthChallenge] Account '%s' is locked to IP - '%s'", _login.c_str(), (*result)[3].GetString());
|
||||
DEBUG_LOG("[AuthChallenge] Player address is '%s'", socket().get_remote_address().c_str());
|
||||
sLog.outStaticDebug("[AuthChallenge] Account '%s' is locked to IP - '%s'", _login.c_str(), (*result)[3].GetString());
|
||||
sLog.outStaticDebug("[AuthChallenge] Player address is '%s'", socket().get_remote_address().c_str());
|
||||
if (strcmp((*result)[3].GetString(),socket().get_remote_address().c_str()))
|
||||
{
|
||||
DEBUG_LOG("[AuthChallenge] Account IP differs");
|
||||
sLog.outStaticDebug("[AuthChallenge] Account IP differs");
|
||||
pkt << (uint8) WOW_FAIL_SUSPENDED;
|
||||
locked=true;
|
||||
}
|
||||
else
|
||||
DEBUG_LOG("[AuthChallenge] Account IP matches");
|
||||
sLog.outStaticDebug("[AuthChallenge] Account IP matches");
|
||||
}
|
||||
else
|
||||
DEBUG_LOG("[AuthChallenge] Account '%s' is not locked to ip", _login.c_str());
|
||||
sLog.outStaticDebug("[AuthChallenge] Account '%s' is not locked to ip", _login.c_str());
|
||||
|
||||
if (!locked)
|
||||
{
|
||||
@@ -506,7 +506,7 @@ bool AuthSocket::_HandleLogonChallenge()
|
||||
/// Logon Proof command handler
|
||||
bool AuthSocket::_HandleLogonProof()
|
||||
{
|
||||
DEBUG_LOG("Entering _HandleLogonProof");
|
||||
sLog.outStaticDebug("Entering _HandleLogonProof");
|
||||
///- Read the packet
|
||||
sAuthLogonProof_C lp;
|
||||
|
||||
@@ -693,7 +693,7 @@ bool AuthSocket::_HandleLogonProof()
|
||||
/// Reconnect Challenge command handler
|
||||
bool AuthSocket::_HandleReconnectChallenge()
|
||||
{
|
||||
DEBUG_LOG("Entering _HandleReconnectChallenge");
|
||||
sLog.outStaticDebug("Entering _HandleReconnectChallenge");
|
||||
if (socket().recv_len() < sizeof(sAuthLogonChallenge_C))
|
||||
return false;
|
||||
|
||||
@@ -705,7 +705,7 @@ bool AuthSocket::_HandleReconnectChallenge()
|
||||
|
||||
EndianConvert(*((uint16*)(buf[0])));
|
||||
uint16 remaining = ((sAuthLogonChallenge_C *)&buf[0])->size;
|
||||
DEBUG_LOG("[ReconnectChallenge] got header, body is %#04x bytes", remaining);
|
||||
sLog.outStaticDebug("[ReconnectChallenge] got header, body is %#04x bytes", remaining);
|
||||
|
||||
if ((remaining < sizeof(sAuthLogonChallenge_C) - buf.size()) || (socket().recv_len() < remaining))
|
||||
return false;
|
||||
@@ -717,8 +717,8 @@ bool AuthSocket::_HandleReconnectChallenge()
|
||||
|
||||
///- Read the remaining of the packet
|
||||
socket().recv((char *)&buf[4], remaining);
|
||||
DEBUG_LOG("[ReconnectChallenge] got full packet, %#04x bytes", ch->size);
|
||||
DEBUG_LOG("[ReconnectChallenge] name(%d): '%s'", ch->I_len, ch->I);
|
||||
sLog.outStaticDebug("[ReconnectChallenge] got full packet, %#04x bytes", ch->size);
|
||||
sLog.outStaticDebug("[ReconnectChallenge] name(%d): '%s'", ch->I_len, ch->I);
|
||||
|
||||
_login = (const char*)ch->I;
|
||||
_safelogin = _login;
|
||||
@@ -750,7 +750,7 @@ bool AuthSocket::_HandleReconnectChallenge()
|
||||
/// Reconnect Proof command handler
|
||||
bool AuthSocket::_HandleReconnectProof()
|
||||
{
|
||||
DEBUG_LOG("Entering _HandleReconnectProof");
|
||||
sLog.outStaticDebug("Entering _HandleReconnectProof");
|
||||
///- Read the packet
|
||||
sAuthReconnectProof_C lp;
|
||||
if (!socket().recv((char *)&lp, sizeof(sAuthReconnectProof_C)))
|
||||
@@ -793,7 +793,7 @@ bool AuthSocket::_HandleReconnectProof()
|
||||
/// %Realm List command handler
|
||||
bool AuthSocket::_HandleRealmList()
|
||||
{
|
||||
DEBUG_LOG("Entering _HandleRealmList");
|
||||
sLog.outStaticDebug("Entering _HandleRealmList");
|
||||
if (socket().recv_len() < 5)
|
||||
return false;
|
||||
|
||||
@@ -895,7 +895,7 @@ bool AuthSocket::_HandleRealmList()
|
||||
/// Resume patch transfer
|
||||
bool AuthSocket::_HandleXferResume()
|
||||
{
|
||||
DEBUG_LOG("Entering _HandleXferResume");
|
||||
sLog.outStaticDebug("Entering _HandleXferResume");
|
||||
///- Check packet length and patch existence
|
||||
if (socket().recv_len() < 9 || !pPatch)
|
||||
{
|
||||
@@ -916,7 +916,7 @@ bool AuthSocket::_HandleXferResume()
|
||||
/// Cancel patch transfer
|
||||
bool AuthSocket::_HandleXferCancel()
|
||||
{
|
||||
DEBUG_LOG("Entering _HandleXferCancel");
|
||||
sLog.outStaticDebug("Entering _HandleXferCancel");
|
||||
|
||||
///- Close and delete the socket
|
||||
socket().recv_skip(1); //clear input buffer
|
||||
@@ -929,7 +929,7 @@ bool AuthSocket::_HandleXferCancel()
|
||||
/// Accept patch transfer
|
||||
bool AuthSocket::_HandleXferAccept()
|
||||
{
|
||||
DEBUG_LOG("Entering _HandleXferAccept");
|
||||
sLog.outStaticDebug("Entering _HandleXferAccept");
|
||||
|
||||
///- Check packet length and patch existence
|
||||
if (!pPatch)
|
||||
|
||||
Reference in New Issue
Block a user