Skip to content

Instantly share code, notes, and snippets.

@benvanstaveren
Created December 3, 2012 20:14
Show Gist options
  • Save benvanstaveren/4197666 to your computer and use it in GitHub Desktop.
Save benvanstaveren/4197666 to your computer and use it in GitHub Desktop.
# the 0x67 message def
$srv_msg->[0x67] = def_msg(0x67, 'Set Slot', [
pair(window_id => MC_byte),
pair(slot => MC_short),
slotupdate('slot_data'),
]);
# MC_byte and MC_short reader implementations
sub read_byte { return unpack('c', shift->read(1)) }
sub read_short { return unpack('s>', shift->read(2)) }
# unpack documentation says for 'c' and 's':
# c A signed char (8-bit) value.
# s A signed short (16-bit) value.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment