Maintenance: Add mandatory field offset markers /* XXXX */ and assertions to Network headers (ConnectionBuffer, CURLMgr, PacketLength

Batch #1058 by ragnarok-clanker: no function's compiled code changes; checked with 28 compiled unit(s), including every includer of Source/Network/Connection/ConnectionBuffer.h, Source/Network/Http/CURLMgr.h, Source/Network/Packets/PacketLengths.h.
This commit is contained in:
ragnarok-clanker 2026-10-27 13:41:30 +00:00
commit bed005bc9d
3 changed files with 45 additions and 22 deletions

View file

@ -1,17 +1,18 @@
#ifndef RAGNAROK_SOURCE_NETWORK_PACKETS_PACKETLENGTHS_H
#define RAGNAROK_SOURCE_NETWORK_PACKETS_PACKETLENGTHS_H
#include <cstddef>
#include <map>
struct PacketLengthValue {
int length;
int variable;
int record;
/* 0000 */ int length;
/* 0004 */ int variable;
/* 0008 */ int record;
};
struct PacketLengthResult {
int kind;
int length;
/* 0000 */ int kind;
/* 0004 */ int length;
};
struct PacketLengths {
@ -22,4 +23,12 @@ struct PacketLengths {
static void Initialize(std::map<int, PacketLengthValue>& values);
};
#if defined(_WIN32) && !defined(_WIN64)
static_assert(sizeof(PacketLengthValue) == 0x0C);
static_assert(offsetof(PacketLengthValue, variable) == 0x04);
static_assert(offsetof(PacketLengthValue, record) == 0x08);
static_assert(sizeof(PacketLengthResult) == 0x08);
static_assert(offsetof(PacketLengthResult, length) == 0x04);
#endif
#endif