mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-20 01:15:35 +01:00
Merge branch 'master' of https://github.com/TrinityCore/TrinityCore into 4.3.4
Conflicts: src/server/game/Server/WorldSocket.h
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
--
|
||||
UPDATE `gameobject_template` SET `flags`=4 WHERE `entry`=201937; -- Light's Vengeance
|
||||
UPDATE `gameobject_template` SET `flags`=32 WHERE `entry`=201759; -- The Forge of Souls Portcullis
|
||||
@@ -131,7 +131,7 @@ bool WorldSocket::ReadHeaderHandler()
|
||||
EndianConvertReverse(header->size);
|
||||
EndianConvert(header->cmd);
|
||||
|
||||
if (!header->IsValid())
|
||||
if (!header->IsValidSize() || !header->IsValidOpcode())
|
||||
{
|
||||
if (_worldSession)
|
||||
{
|
||||
@@ -141,7 +141,7 @@ bool WorldSocket::ReadHeaderHandler()
|
||||
}
|
||||
else
|
||||
TC_LOG_ERROR("network", "WorldSocket::ReadHeaderHandler(): client %s sent malformed packet (size: %hu, cmd: %u)",
|
||||
GetRemoteIpAddress().to_string().c_str(), header->size, header->cmd);
|
||||
GetRemoteIpAddress().to_string().c_str(), header->size, header->cmd);
|
||||
|
||||
CloseSocket();
|
||||
return false;
|
||||
|
||||
@@ -39,7 +39,8 @@ struct ClientPktHeader
|
||||
uint16 size;
|
||||
uint32 cmd;
|
||||
|
||||
bool IsValid() const { return size >= 4 && size < 10240 && cmd < NUM_OPCODE_HANDLERS; }
|
||||
bool IsValidSize() const { return size >= 4 && size < 10240; }
|
||||
bool IsValidOpcode() const { return cmd < NUM_OPCODE_HANDLERS; }
|
||||
};
|
||||
|
||||
#pragma pack(pop)
|
||||
|
||||
@@ -81,7 +81,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void Write(void* data, std::size_t size)
|
||||
void Write(void const* data, std::size_t size)
|
||||
{
|
||||
if (size)
|
||||
{
|
||||
|
||||
@@ -111,11 +111,12 @@ public:
|
||||
|
||||
void QueuePacket(MessageBuffer&& buffer, std::unique_lock<std::mutex>& guard)
|
||||
{
|
||||
|
||||
_writeQueue.push(std::move(buffer));
|
||||
|
||||
#ifdef BOOST_ASIO_HAS_IOCP
|
||||
AsyncProcessQueue(guard);
|
||||
#else
|
||||
(void)guard;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user