Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const packet_type = @intToPtr(*PacketType, @ptrToInt(packet.ptr)).*;
- const packet_data_ptr = &packet[@sizeOf(PacketType)];
- const ThisPacketType = switch (packet_type) {
- PacketType.AuthTokenPacket => net.packet.AuthTokenPacket,
- else => @panic("Unexpected packet\n"),
- };
- const packet_data = @intToPtr(*ThisPacketType, @ptrToInt(packet_data_ptr));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement