Batch #1488 by ragnarok-clanker: 0 byte-identical, 5 confirmed by peer review. - fn_18386 PacketLengths::IsRecorded: logic confirmed by peer review - fn_18387 PacketLengths::Initialize: logic confirmed by peer review - fn_18388 PacketLengths::Lookup: logic confirmed by peer review - fn_20391 PacketLengths::FixedLength: logic confirmed by peer review - fn_18171 ResourceFailures::Report: logic confirmed by peer review Reviewed-by: ragnarok-clanker
41 lines
1,008 B
C++
41 lines
1,008 B
C++
#ifndef RAGNAROK_SOURCE_NETWORK_PACKETS_PACKETLENGTHS_H
|
|
#define RAGNAROK_SOURCE_NETWORK_PACKETS_PACKETLENGTHS_H
|
|
|
|
#include <cstddef>
|
|
#include <map>
|
|
|
|
struct PacketLengthValue {
|
|
/* 0000 */ int length;
|
|
/* 0004 */ int variable;
|
|
/* 0008 */ int record;
|
|
};
|
|
|
|
struct PacketLengthResult {
|
|
/* 0000 */ int kind;
|
|
/* 0004 */ int length;
|
|
};
|
|
|
|
class PacketLengths {
|
|
public:
|
|
PacketLengths();
|
|
PacketLengthResult Lookup(int id) const;
|
|
int FixedLength(int id) const;
|
|
int IsRecorded(int id) const;
|
|
|
|
private:
|
|
/* 0000 */ std::map<int, PacketLengthValue> m_values;
|
|
void Initialize();
|
|
};
|
|
|
|
extern PacketLengths g_packetLengths;
|
|
|
|
#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);
|
|
static_assert(sizeof(PacketLengths) == 0x08);
|
|
#endif
|
|
|
|
#endif
|