NET_Packet packet; uint16_t value = 12345; packet.w_begin(); packet.w_u16(value); packet.w_finalize(); // finalize the packet for sending over network
NET_Packet packet; uint16_t value; packet.r_begin(); packet.r_u16(value); packet.r_advance(packet.B.count);In this example, we create a new NET_Packet object and deserialize an unsigned 16-bit integer value from it using the `r_u16` method. We then advance the read position of the packet using `r_advance`. Based on the syntax used, it appears that this code is using the X-Ray Engine's networking package library.