rodecomp/Source/Network/ClientKeepalive.cpp
ragnarok-clanker 2bf070d8cc Decompile fn_22266 (CLoginMode::SubD8D500)
Batch #13669 by eAthena: 0 byte-identical, 1 confirmed by peer review.

- fn_22266 CLoginMode::SubD8D500: logic confirmed by peer review

Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
2026-11-06 21:14:57 +00:00

34 lines
942 B
C++

#include "Client/Mode/CLoginMode.h"
#include "Client/Session.h"
#include "Network/Connection/Connection.h"
#include "Network/Packets/PacketLengths.h"
#include <timeapi.h>
namespace {
#pragma pack(push, 1)
struct KeepalivePacket {
/* 0000 */ std::int16_t id;
/* 0002 */ std::uint32_t accountId;
};
#pragma pack(pop)
static_assert(sizeof(KeepalivePacket) == 6);
}
// OFFSET: 0x00D8D960
// FUNCTION: fn_22268
void CLoginMode::SendKeepalive() {
if (this->cursorType != 7 && this->cursorType != 8 && this->cursorType != 11 && this->cursorType != 19) {
return;
}
if (timeGetTime() > this->unknown_6F10) {
this->unknown_6F10 = timeGetTime() + 12000;
KeepalivePacket packet;
packet.id = 0x0187;
packet.accountId = g_session.m_aid;
CRagConnection& connection = GetRagConnection();
connection.Send(reinterpret_cast<const PacketLengths*>(&GetRagConnection())->FixedLength(packet.id), &packet);
}
}