2 require 'stringio_utils'
3 require 'tabletoptwo_msgtypes'
7 # String -> (Symbol, [String])
9 # Unpacks a Tabletop2 message into an array containing one symbol, and an
12 strio = StringIO.new(msgstr)
13 return [INTMSGTYPE[strio.getint()], lstr_array_unpack(strio)]
16 # StringIO -> [String]
18 # Unpack an array of LStrs
19 def lstr_array_unpack(strio)
20 return [strio.readlstr()] + lstr_array_unpack(strio) unless strio.eof?