Advertisement
Guest User

Untitled

a guest
Oct 8th, 2018
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. const packet_type = @intToPtr(*PacketType, @ptrToInt(packet.ptr)).*;
  2. const packet_data_ptr = &packet[@sizeOf(PacketType)];
  3. const ThisPacketType = switch (packet_type) {
  4. PacketType.AuthTokenPacket => net.packet.AuthTokenPacket,
  5. else => @panic("Unexpected packet\n"),
  6. };
  7. const packet_data = @intToPtr(*ThisPacketType, @ptrToInt(packet_data_ptr));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement