Core/Misc: Code style and remove unused define.
Signed-off-by: Gyx <2359980687@qq.com>
This commit is contained in:
1 parent
e77f51df5d
commit
5b7493fc66
21 files changed
+86
-88
No files matched your search
@@ -152,7 +152,7 @@ const std::string& WorldSocket::GetRemoteAddress (void) const
|
||||
return m_Address;
|
||||
}
|
||||
|
||||
int WorldSocket::SendPacket (const WorldPacket& pct)
|
||||
int WorldSocket::SendPacket(const WorldPacket& pct)
|
||||
{
|
||||
ACE_GUARD_RETURN (LockType, Guard, m_OutBufferLock, -1);
|
||||
|
||||
@@ -252,7 +252,7 @@ int WorldSocket::open (void *a)
|
||||
|
||||
if (peer().get_remote_addr(remote_addr) == -1)
|
||||
{
|
||||
sLog->outError ("WorldSocket::open: peer().get_remote_addr errno = %s", ACE_OS::strerror (errno));
|
||||
sLog->outError("WorldSocket::open: peer().get_remote_addr errno = %s", ACE_OS::strerror (errno));
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -277,7 +277,7 @@ int WorldSocket::open (void *a)
|
||||
// Register with ACE Reactor
|
||||
if (reactor()->register_handler(this, ACE_Event_Handler::READ_MASK | ACE_Event_Handler::WRITE_MASK) == -1)
|
||||
{
|
||||
sLog->outError ("WorldSocket::open: unable to register client handler errno = %s", ACE_OS::strerror (errno));
|
||||
sLog->outError("WorldSocket::open: unable to register client handler errno = %s", ACE_OS::strerror (errno));
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -496,7 +496,7 @@ int WorldSocket::handle_input_header (void)
|
||||
if ((header.size < 4) || (header.size > 10240) || (header.cmd > 10240))
|
||||
{
|
||||
Player* _player = m_Session ? m_Session->GetPlayer() : NULL;
|
||||
sLog->outError ("WorldSocket::handle_input_header(): client (account: %u, char [GUID: %u, name: %s]) sent malformed packet (size: %d, cmd: %d)",
|
||||
sLog->outError("WorldSocket::handle_input_header(): client (account: %u, char [GUID: %u, name: %s]) sent malformed packet (size: %d, cmd: %d)",
|
||||
m_Session ? m_Session->GetAccountId() : 0,
|
||||
_player ? _player->GetGUIDLow() : 0,
|
||||
_player ? _player->GetName() : "<none>",
|
||||
@@ -602,7 +602,7 @@ int WorldSocket::handle_input_missing_data (void)
|
||||
// hope this is not hack, as proper m_RecvWPct is asserted around
|
||||
if (!m_RecvWPct)
|
||||
{
|
||||
sLog->outError ("Forcing close on input m_RecvWPct = NULL");
|
||||
sLog->outError("Forcing close on input m_RecvWPct = NULL");
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
}
|
||||
@@ -648,7 +648,7 @@ int WorldSocket::cancel_wakeup_output (GuardType& g)
|
||||
(this, ACE_Event_Handler::WRITE_MASK) == -1)
|
||||
{
|
||||
// would be good to store errno from reactor with errno guard
|
||||
sLog->outError ("WorldSocket::cancel_wakeup_output");
|
||||
sLog->outError("WorldSocket::cancel_wakeup_output");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -667,7 +667,7 @@ int WorldSocket::schedule_wakeup_output (GuardType& g)
|
||||
if (reactor()->schedule_wakeup
|
||||
(this, ACE_Event_Handler::WRITE_MASK) == -1)
|
||||
{
|
||||
sLog->outError ("WorldSocket::schedule_wakeup_output");
|
||||
sLog->outError("WorldSocket::schedule_wakeup_output");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -715,7 +715,7 @@ int WorldSocket::ProcessIncoming (WorldPacket* new_pct)
|
||||
case CMSG_AUTH_SESSION:
|
||||
if (m_Session)
|
||||
{
|
||||
sLog->outError ("WorldSocket::ProcessIncoming: Player send CMSG_AUTH_SESSION again");
|
||||
sLog->outError("WorldSocket::ProcessIncoming: Player send CMSG_AUTH_SESSION again");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -744,7 +744,7 @@ int WorldSocket::ProcessIncoming (WorldPacket* new_pct)
|
||||
}
|
||||
else
|
||||
{
|
||||
sLog->outError ("WorldSocket::ProcessIncoming: Client not authed opcode = %u", uint32(opcode));
|
||||
sLog->outError("WorldSocket::ProcessIncoming: Client not authed opcode = %u", uint32(opcode));
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@@ -788,9 +788,9 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket)
|
||||
{
|
||||
packet.Initialize(SMSG_AUTH_RESPONSE, 1);
|
||||
packet << uint8(AUTH_REJECT);
|
||||
SendPacket (packet);
|
||||
SendPacket(packet);
|
||||
|
||||
sLog->outError ("WorldSocket::HandleAuthSession: World closed, denying client (%s).", GetRemoteAddress().c_str());
|
||||
sLog->outError("WorldSocket::HandleAuthSession: World closed, denying client (%s).", GetRemoteAddress().c_str());
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -824,9 +824,9 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket)
|
||||
packet.Initialize (SMSG_AUTH_RESPONSE, 1);
|
||||
packet << uint8 (AUTH_UNKNOWN_ACCOUNT);
|
||||
|
||||
SendPacket (packet);
|
||||
SendPacket(packet);
|
||||
|
||||
sLog->outError ("WorldSocket::HandleAuthSession: Sent Auth Response (unknown account).");
|
||||
sLog->outError("WorldSocket::HandleAuthSession: Sent Auth Response (unknown account).");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -860,7 +860,7 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket)
|
||||
{
|
||||
packet.Initialize (SMSG_AUTH_RESPONSE, 1);
|
||||
packet << uint8 (AUTH_FAILED);
|
||||
SendPacket (packet);
|
||||
SendPacket(packet);
|
||||
|
||||
sLog->outBasic ("WorldSocket::HandleAuthSession: Sent Auth Response (Account IP differs).");
|
||||
return -1;
|
||||
@@ -924,9 +924,9 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket)
|
||||
{
|
||||
packet.Initialize (SMSG_AUTH_RESPONSE, 1);
|
||||
packet << uint8 (AUTH_BANNED);
|
||||
SendPacket (packet);
|
||||
SendPacket(packet);
|
||||
|
||||
sLog->outError ("WorldSocket::HandleAuthSession: Sent Auth Response (Account banned).");
|
||||
sLog->outError("WorldSocket::HandleAuthSession: Sent Auth Response (Account banned).");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -938,9 +938,9 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket)
|
||||
WorldPacket Packet (SMSG_AUTH_RESPONSE, 1);
|
||||
Packet << uint8 (AUTH_UNAVAILABLE);
|
||||
|
||||
SendPacket (packet);
|
||||
SendPacket(packet);
|
||||
|
||||
sLog->outDetail ("WorldSocket::HandleAuthSession: User tries to login but his security level is not enough");
|
||||
sLog->outDetail("WorldSocket::HandleAuthSession: User tries to login but his security level is not enough");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -960,9 +960,9 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket)
|
||||
packet.Initialize (SMSG_AUTH_RESPONSE, 1);
|
||||
packet << uint8 (AUTH_FAILED);
|
||||
|
||||
SendPacket (packet);
|
||||
SendPacket(packet);
|
||||
|
||||
sLog->outError ("WorldSocket::HandleAuthSession: Sent Auth Response (authentification failed).");
|
||||
sLog->outError("WorldSocket::HandleAuthSession: Sent Auth Response (authentification failed).");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -1067,7 +1067,7 @@ int WorldSocket::HandlePing (WorldPacket& recvPacket)
|
||||
m_Session->SetLatency (latency);
|
||||
else
|
||||
{
|
||||
sLog->outError ("WorldSocket::HandlePing: peer sent CMSG_PING, "
|
||||
sLog->outError("WorldSocket::HandlePing: peer sent CMSG_PING, "
|
||||
"but is not authenticated or got recently kicked, "
|
||||
" address = %s",
|
||||
GetRemoteAddress().c_str());
|
||||
@@ -1077,5 +1077,5 @@ int WorldSocket::HandlePing (WorldPacket& recvPacket)
|
||||
|
||||
WorldPacket packet (SMSG_PONG, 4);
|
||||
packet << ping;
|
||||
return SendPacket (packet);
|
||||
return SendPacket(packet);
|
||||
}
|
||||
Reference in new issue
Block a user