mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Core/PacketIO: Implemented CMSG_ENABLE_NAGLE
This commit is contained in:
@@ -805,13 +805,6 @@ void WorldSession::HandleRequestAccountData(WorldPackets::ClientConfig::RequestA
|
||||
SendPacket(data.Write());
|
||||
}
|
||||
|
||||
int32 WorldSession::HandleEnableNagleAlgorithm()
|
||||
{
|
||||
// Instructs the server we wish to receive few amounts of large packets (SMSG_MULTIPLE_PACKETS?)
|
||||
// instead of large amount of small packets
|
||||
return 0;
|
||||
}
|
||||
|
||||
void WorldSession::HandleSetActionButtonOpcode(WorldPackets::Spells::SetActionButton& packet)
|
||||
{
|
||||
uint32 action = ACTION_BUTTON_ACTION(packet.Action);
|
||||
@@ -1132,7 +1125,7 @@ void WorldSession::HandleFarSightOpcode(WorldPacket& recvData)
|
||||
void WorldSession::HandleSetTitleOpcode(WorldPackets::Character::SetTitle& packet)
|
||||
{
|
||||
TC_LOG_DEBUG("network", "CMSG_SET_TITLE");
|
||||
|
||||
|
||||
// -1 at none
|
||||
if (packet.TitleID > 0 && packet.TitleID < MAX_TITLE_INDEX)
|
||||
{
|
||||
|
||||
@@ -1355,8 +1355,6 @@ class WorldSession
|
||||
|
||||
void SendSpellCategoryCooldowns();
|
||||
|
||||
int32 HandleEnableNagleAlgorithm();
|
||||
|
||||
// Compact Unit Frames (4.x)
|
||||
void HandleSaveCUFProfiles(WorldPacket& recvPacket);
|
||||
void SendLoadCUFProfiles();
|
||||
|
||||
@@ -261,10 +261,9 @@ bool WorldSocket::ReadDataHandler()
|
||||
return true;
|
||||
case CMSG_ENABLE_NAGLE:
|
||||
{
|
||||
TC_LOG_DEBUG("network", "%s", GetOpcodeNameForLogging(opcode).c_str());
|
||||
TC_LOG_DEBUG("network", "Client %s requested enabling nagle algorithm", GetRemoteIpAddress().to_string().c_str());
|
||||
sScriptMgr->OnPacketReceive(_worldSession, packet);
|
||||
if (_worldSession)
|
||||
_worldSession->HandleEnableNagleAlgorithm();
|
||||
SetNoDelay(false);
|
||||
break;
|
||||
}
|
||||
case CMSG_CONNECT_TO_FAILED:
|
||||
|
||||
@@ -169,6 +169,15 @@ protected:
|
||||
return false;
|
||||
}
|
||||
|
||||
void SetNoDelay(bool enable)
|
||||
{
|
||||
boost::system::error_code err;
|
||||
_socket.set_option(boost::asio::ip::tcp::no_delay(enable), err);
|
||||
if (err)
|
||||
TC_LOG_DEBUG("network", "Socket::SetNoDelay: failed to set_option(boost::asio::ip::tcp::no_delay) for %s - %d (%s)",
|
||||
GetRemoteIpAddress().to_string().c_str(), err.value(), err.message().c_str());
|
||||
}
|
||||
|
||||
std::mutex _writeLock;
|
||||
std::queue<MessageBuffer> _writeQueue;
|
||||
#ifndef TC_SOCKET_USE_IOCP
|
||||
|
||||
Reference in New Issue
Block a user