Decompile 5 functions in Source/Client/ReplayPacketRecorder.h, Source/Contents/Emblems/EmblemUpload.h, ...

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
This commit is contained in:
ragnarok-clanker 2026-10-28 16:45:10 +00:00
commit 63b1377599
13 changed files with 60 additions and 34 deletions

View file

@ -2,11 +2,14 @@
#include <algorithm>
// GLOBAL: gl_24489
PacketLengths g_packetLengths;
// OFFSET: 0x00B09E50
// FUNCTION: fn_18388
PacketLengthResult PacketLengths::Lookup(int id) const {
const auto entry = this->values.find(id);
if (entry == this->values.end()) {
const auto entry = this->m_values.find(id);
if (entry == this->m_values.end()) {
return {-1, 4};
}
@ -32,7 +35,7 @@ int PacketLengths::FixedLength(int id) const {
return 4;
}
return std::max(this->Lookup(id).length, 2);
return std::max(g_packetLengths.Lookup(id).length, 2);
}
namespace {
@ -51,15 +54,21 @@ namespace {
// OFFSET: 0x00B02260
// FUNCTION: fn_18387
void PacketLengths::Initialize(std::map<int, PacketLengthValue>& values) {
void PacketLengths::Initialize() {
for (const PacketRegistration& value : registrations) {
values.try_emplace(value.id, PacketLengthValue{value.length, value.variable, value.record});
this->m_values.try_emplace(value.id, PacketLengthValue{value.length, value.variable, value.record});
}
}
// OFFSET: 0x00B01E70
// FUNCTION: fn_18383
PacketLengths::PacketLengths() {
this->Initialize();
}
// OFFSET: 0x00B02210
// FUNCTION: fn_18386
int PacketLengths::IsRecorded(int id) const {
const auto entry = this->values.find(id);
return entry == this->values.end() ? 0 : entry->second.record;
const auto entry = this->m_values.find(id);
return entry == this->m_values.end() ? 0 : entry->second.record;
}