From 480be601a004d331b6f80eb93ebc30cb4a3ea886 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Sat, 31 Oct 2026 03:45:58 +0000 Subject: [PATCH] Decompile fn_19330 (Replay::RecordCachedPackets) Batch #7073 by aDw: 0 byte-identical, 1 confirmed by peer review. - fn_19330 Replay::RecordCachedPackets: logic confirmed by peer review Peer-reviewed-by: eAthena, Lumen Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/Client/Replay.h | 1 + Source/Client/ReplayPacketRecorder.cpp | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/Source/Client/Replay.h b/Source/Client/Replay.h index ed807798..52e95655 100644 --- a/Source/Client/Replay.h +++ b/Source/Client/Replay.h @@ -126,6 +126,7 @@ public: void UpdateDuration(); bool WriteFinalSection(); bool RecordPacket(const std::vector& packet, int event, std::uint32_t delay); + void RecordCachedPackets(); bool MatchesService(int mode) const; int AdvanceFrame(); void ResetPlayback(); diff --git a/Source/Client/ReplayPacketRecorder.cpp b/Source/Client/ReplayPacketRecorder.cpp index 56156081..03699f6b 100644 --- a/Source/Client/ReplayPacketRecorder.cpp +++ b/Source/Client/ReplayPacketRecorder.cpp @@ -1,6 +1,7 @@ #include "Client/Mode/ModeDragState.h" #include "Client/Replay.h" #include "Client/ReplayPacketRecorder.h" +#include "Client/Session.h" #include "Network/Packets/PacketLengths.h" #include "Network/Packets/PacketId.h" #include "UI/Window/WindowPolicy.h" @@ -193,6 +194,31 @@ bool Replay::RecordPacket(const std::vector& packet, int event, s return true; } +// OFFSET: 0x00B86500 +// FUNCTION: fn_19330 +void Replay::RecordCachedPackets() { + ReplayCachedPacket* packets = this->cachedPackets.data(); + Replay::Instance().RecordPacket(packets[2459].bytes, 41, 0); + Replay::Instance().RecordPacket(packets[470].bytes, 41, 0); + + { + std::vector packet = g_session.BuildSkillListReplayPacket(0x10F); + Replay::Instance().RecordPacket(packet, 41, 0); + } + { + std::vector packet = g_session.BuildSkillListReplayPacket(0x235); + Replay::Instance().RecordPacket(packet, 41, 0); + } + { + std::vector packet = g_session.BuildSkillListReplayPacket(0x29D); + Replay::Instance().RecordPacket(packet, 41, 0); + } + if (g_session.unknown_5C1C != 0) { + std::vector packet = g_session.BuildStatusReplayPacket(); + Replay::Instance().RecordPacket(packet, 41, 0); + } +} + namespace { #pragma pack(push, 1) struct DropRecord {