client misc test
This commit is contained in:
@@ -752,9 +752,16 @@ void WorldSession::HandleUpdateAccountData(WorldPackets::ClientConfig::UserClien
|
||||
return;
|
||||
}
|
||||
|
||||
if (packet.Size > 0xFFFF)
|
||||
if (packet.Size > MAX_ACCOUNT_DATA_SIZE)
|
||||
{
|
||||
TC_LOG_ERROR("network", "UAD: Account data packet too big, size {}", packet.Size);
|
||||
TC_LOG_WARN("network", "UAD: Account data packet too big, size {} (compressed {}), type {} - not stored",
|
||||
packet.Size, packet.CompressedData.size(), packet.DataType);
|
||||
|
||||
WorldPackets::ClientConfig::UpdateAccountDataComplete updateAccountDataComplete;
|
||||
updateAccountDataComplete.Player = packet.PlayerGuid;
|
||||
updateAccountDataComplete.DataType = packet.DataType;
|
||||
updateAccountDataComplete.Result = 0;
|
||||
SendPacket(updateAccountDataComplete.Write());
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1328,6 +1328,10 @@ enum AccountDataType
|
||||
|
||||
#define NUM_ACCOUNT_DATA_TYPES 20
|
||||
|
||||
// decompressed size accepted for a single client account cache
|
||||
// (edit mode layouts grow past 64 KB, keep the `data` columns above BLOB if you raise this)
|
||||
#define MAX_ACCOUNT_DATA_SIZE 0x20000
|
||||
|
||||
#define ALL_ACCOUNT_DATA_CACHE_MASK 0x000FFFFFu
|
||||
#define GLOBAL_CACHE_MASK 0x000BA515u
|
||||
#define PER_CHARACTER_CACHE_MASK 0x00045AEAu
|
||||
|
||||
@@ -345,7 +345,11 @@ bool WorldSocket::ReadHeaderHandler()
|
||||
_authCrypt.PeekDecryptRecv(reinterpret_cast<uint8*>(&header->EncryptedOpcode), sizeof(encryptedOpcode));
|
||||
|
||||
// CMSG_HOTFIX_REQUEST can be much larger than normal packets, allow receiving it once per session
|
||||
if (header->EncryptedOpcode != CMSG_HOTFIX_REQUEST || header->Size > 0x100000 || !_canRequestHotfixes)
|
||||
bool const isHotfixRequest = header->EncryptedOpcode == CMSG_HOTFIX_REQUEST && header->Size <= 0x100000 && _canRequestHotfixes;
|
||||
// the client uploads large account caches (edit mode layouts) on logout, do not kill the socket for them
|
||||
bool const isAccountData = header->EncryptedOpcode == CMSG_UPDATE_ACCOUNT_DATA && header->Size <= 0x800000;
|
||||
|
||||
if (!isHotfixRequest && !isAccountData)
|
||||
{
|
||||
TC_LOG_ERROR("network", "WorldSocket::ReadHeaderHandler(): client {} sent malformed packet (size: {}, opcode {})",
|
||||
GetRemoteIpAddress(), header->Size, uint32(header->EncryptedOpcode));
|
||||
|
||||
Reference in New Issue
Block a user