mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-15 10:00:28 +00:00
feat(Core/PacketIO): correct parsing some opcodes (#6051)
This commit is contained in:
@@ -184,9 +184,14 @@ std::string WorldSession::GetPlayerInfo() const
|
||||
{
|
||||
std::ostringstream ss;
|
||||
|
||||
ss << "[Player: " << GetPlayerName()
|
||||
<< " (Guid: " << (_player != nullptr ? _player->GetGUID() : 0)
|
||||
<< ", Account: " << GetAccountId() << ")]";
|
||||
ss << "[Player: ";
|
||||
|
||||
if (!m_playerLoading && _player)
|
||||
{
|
||||
ss << _player->GetName() << ' ' << _player->GetGUID().ToString() << ", ";
|
||||
}
|
||||
|
||||
ss << "Account: " << GetAccountId() << "]";
|
||||
|
||||
return ss.str();
|
||||
}
|
||||
@@ -202,7 +207,7 @@ void WorldSession::SendPacket(WorldPacket const* packet)
|
||||
{
|
||||
if (packet->GetOpcode() == NULL_OPCODE)
|
||||
{
|
||||
LOG_ERROR("server", "WorldSession::SendPacket(packet) called, but packet->GetOpcode() was NULL_OPCODE");
|
||||
LOG_ERROR("network.opcode", "%s send NULL_OPCODE", GetPlayerInfo().c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -252,6 +257,8 @@ void WorldSession::SendPacket(WorldPacket const* packet)
|
||||
return;
|
||||
#endif
|
||||
|
||||
LOG_TRACE("network.opcode", "S->C: %s %s", GetPlayerInfo().c_str(), GetOpcodeNameForLogging(static_cast<OpcodeServer>(packet->GetOpcode())).c_str());
|
||||
|
||||
if (m_Socket->SendPacket(*packet) == -1)
|
||||
m_Socket->CloseSocket("m_Socket->SendPacket(*packet) == -1");
|
||||
}
|
||||
@@ -399,7 +406,7 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater)
|
||||
|
||||
deletePacket = true;
|
||||
|
||||
#define MAX_PROCESSED_PACKETS_IN_SAME_WORLDSESSION_UPDATE 100
|
||||
#define MAX_PROCESSED_PACKETS_IN_SAME_WORLDSESSION_UPDATE 150
|
||||
processedPackets++;
|
||||
|
||||
//process only a max amout of packets in 1 Update() call.
|
||||
|
||||
Reference in New Issue
Block a user