Dasyne Network Messages

UDP: All messages have a 4-byte ASCII header followed by a 2-byte message length. UDP messages
include a 4-byte UDP ID immediately after the message length, intended to prevent spoofing attacks.
The UDP ID is sent to each client in the Handshake ACK message.

*** Join Request ***

DASYBB VVVV

DASY is the header (ASCII)
BB is the number of bytes in this message (binary)
VVVV is the client's Dasyne version (ASCII)

*** Handshake ACK ***

HACKBB PPEESSBBBBMMMMUOOIIIINN

HACK is the header (ASCII)
BB is the number of bytes in this message (binary)
PP is the speck size (binary)
EE is the segment size (binary)
SS is the number of segments in the data map (binary)
BBBB is the number of bytes in the data map, should be segment size * number of segments (binary)
MMMM is the number of bytes that are used in the map, equal to server's syncIndex (binary)
U is 0 if UDP is disabled, 1 if it's enabled (binary)
OOOO is the port number, will be zero if UDP not enabled (binary)
IIII is the client's UDP identifier, zero if UDP not enabled (binary)
NN is this client's Dasyne index

*** User Message ***

USERBB <the data>

USER is the header (ASCII)
BB is the number of bytes in this message (binary)
<the data> is whatever the programmer sent

*** Data Flush ***

FLSHBB C SSNNIIBBBBIIBBBB ... SSNNIIBBBBIIBBBB

FLSH is the header (ASCII)
BB is the number of bytes in this message (binary)
C is 0 if the rest of the message is uncompressed, 1 if it is compressed (binary)
SS is the segment index (binary)
NN is the number of changed specks in this segment (binary)
II is the speck index (binary)
BBBB is the speck data. Note that the number of bytes will vary depending on speck size. (binary)

*** CRC Query ***

CRCQBB IIVVVV ... VVVV ... VVVV

CRCQ is the header (ASCII)
BB is the number of bytes in this message (binary)
II is the index of the first segment to verify (binary)
VVVV is a 32-bit CRC value to verify (binary)

*** CRC Reply ***

CRCRBB NIIZBBBB

CRCR is the header (ASCII)
BB is the number of bytes in this message (binary)
N is the number of segments we're sending, 0 if no mismatches were detected. (binary)
II is the index of the first mismatched segment. If there were no mismatches,
  it's the index of the next segment the client should request. (binary)
Z is 0 if the <chunk data> will be uncompressed, 1 if it's compressed with zlib (binary)
BBBB is the total number of bytes in the <chunk data> sections we'll be sending (binary)

*** Chunk Series ***

CHNKBB NN <chunk data>

CHNK is the header (ASCII)
NN is the chunk number. Start counting at 1, with 0 for the last chunk in a series
<chunk data> is a portion of the segment data we're sending. Append all the <chunk data> portions
  together to extract the segment info.
