mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2026-01-12 11:30:06 +00:00
[refactor] Implement generic, validating sendPacket() wrapper
This commit is contained in:
@@ -28,6 +28,11 @@
|
||||
#define INITSTRUCT(T, x) T x; \
|
||||
memset(&x, 0, sizeof(T));
|
||||
|
||||
#define INITVARPACKET(_buf, _Pkt, _pkt, _Trailer, _trailer) uint8_t _buf[CN_PACKET_BUFFER_SIZE]; \
|
||||
memset(&_buf, 0, CN_PACKET_BUFFER_SIZE); \
|
||||
auto _pkt = (_Pkt*)_buf; \
|
||||
auto _trailer = (_Trailer*)(_pkt + 1);
|
||||
|
||||
// macros to extract fields from instanceIDs
|
||||
#define MAPNUM(x) ((x) & 0xffffffff)
|
||||
#define PLAYERID(x) ((x) >> 32)
|
||||
|
||||
Reference in New Issue
Block a user