MCPcopy Create free account
hub / github.com/GlobedGD/globed2 / decode

Method decode

src/core/data/Event.cpp:13–23  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11// In n out events
12
13Result<CounterChangeEvent> CounterChangeEvent::decode(ByteReader& reader) {
14 uint64_t rawData = READER_UNWRAP(reader.readU64());
15
16 uint8_t rawType = (rawData >> 56) & 0xff;
17 uint32_t itemId = (rawData >> 32) & 0x00fffff;
18 uint32_t value = static_cast<uint32_t>(rawData & 0xffffffffULL);
19
20 return Ok(CounterChangeEvent {
21 rawType, itemId, value
22 });
23}
24
25Result<> CounterChangeEvent::encode(HeapByteWriter& writer) {
26 writer.writeU16(EVENT_COUNTER_CHANGE);

Callers

nothing calls this directly

Calls 7

decodeSpawnDataFunction · 0.85
decodeSetItemDataFunction · 0.85
decodeMoveGroupDataFunction · 0.85
decodeFollowPlayerDataFunction · 0.85
decodeFollowAbsoluteDataFunction · 0.85
decodeFollowRotationDataFunction · 0.85
TypeEnum · 0.50

Tested by

no test coverage detected