Realm of the Mad God Network Protocol

	RotMG uses a TCP connection on port 2050. Data is sent in the form of Messages, and primitives are typically sent in Big Endian.
	Messages (blocks of data, that could be sent over multiple tcp packets) are sent on this layer in this format:
	HEADER + BODY
	
	A message header is: uint32 length, uint8 id
	Length includes the body, so a bodyless message will be 5 bytes.
	Once you have enough data in the tcp socket to read length, you can create a message based on the id.
	
	  >> means outgoing
	<<   means incoming

	The connection handshake is:
	  >> HELLO (account accessToken, portal info)
	<<   MAPINFO (map name, dimensions)
	  >> CREATE or LOAD (character type or id)
	<<   CREATESUCCESS (object id)
	
	Once connected, you then need to send a variety of response/acknowledgement messages, most notably:
	<<   UPDATE
	  >> UPDATEACK
	<<   NEWTICK
	  >> MOVE
	
	Other examples:
	<<   GOTO
	  >> GOTOACK
	<<   ENEMYSHOOT
	<<   SERVERPLAYERSHOOT
	  >> SHOOTACK
	
	UPDATE is where new tiles, new entities, and dropped entities arrive. Entities are sent as an array of Status structures (wrapped). NEWTICK gives you entity updates, also as an array of Status structures.
	Inside a Status is an object id, world position, and StatData array.

	Primitive types:
	Most ints and floats are sent big endian. Sometimes ints are sent as a "compressed int" aka VLQ. 
	Strings are character arrays. Most arrays are prefixed with a uint16, but sometimes by a compressed int.

	Some fields have conditional reads. Only if there is remaining data in the message buffer, then read it. Otherwise set the field to a default value.
	For example, in MAPINFO, MaxScore and RealmScore are conditional:
	if (r.HasMore()) //buffer position < buffer length
		MaxScore = r.ReadInt32();
	if (r.HasMore())
		RealmScore = r.ReadInt32();
	//no else, they default to zero anyways
	
	That's a simplified overview.
	Up to date protocol constants are found here.