Administrative source import: native x86 compilation passed for 423 authored units. Source placement and submission states are migrated separately; this commit does not imply peer acceptance.
Previous head: 35d2a8cb36
Payload SHA256: 592f016d2730c5593bb653aa054c1e5f76a6df72c8f5a09e66f74876e2e33dee
31 lines
844 B
C++
31 lines
844 B
C++
#include "Contents/World/WorldProximity.h"
|
|
#include "Network/Connection/Connection.h"
|
|
#include "Network/Packets/PacketLengths.h"
|
|
|
|
#include <cstring>
|
|
|
|
// OFFSET: 0x00AC93C0
|
|
// FUNCTION: fn_17683
|
|
void UpdateWorldProximityNotification(
|
|
unsigned char& notified, std::function<bool()> nearby, CConnection& connection, const PacketLengths& lengths, const std::uint32_t& accountId
|
|
) {
|
|
if (notified == 1) {
|
|
if (!nearby()) {
|
|
notified = 0;
|
|
}
|
|
|
|
return;
|
|
}
|
|
|
|
if (nearby()) {
|
|
unsigned char packet[9];
|
|
const std::uint16_t id = 0x0BB0;
|
|
const std::uint16_t enabled = 1;
|
|
std::memcpy(packet, &id, sizeof(id));
|
|
std::memcpy(packet + 2, &accountId, sizeof(accountId));
|
|
std::memcpy(packet + 6, &enabled, sizeof(enabled));
|
|
packet[8] = 1;
|
|
connection.Send(lengths.FixedLength(id), packet);
|
|
notified = 1;
|
|
}
|
|
}
|