Old Wiki:EVE Protocol

From EVEmu Wiki
Jump to navigation Jump to search

EVE Protocol

Information about the EVE network protocol.

Basic Protocol

Because they use TCP as the network transport, the on-wire protocol is rather trivial. Basically the stream is made up of 4 bytes of packet length (little endian), followed by that many bytes of packet data.

The packet data may be compressed with gzip at this point, and basically you just look at the first byte, and if it is not their "stream marker", then you feed it to gzip and see if you get the stream marker then. The stream marker is a ~ (0x7E). Once extracted, there are four bytes the first of which is a counter used during unmarshaling (so it could be a little endian 4-byte counter, havent seen any evidence either way). After that, you get a "blue" marshaled stream.

Marshaling

The marshaling scheme is a recursive system basically geared towards taking an arbitrarily complex python object/variable and turning it into a byte stream. This is similar in idea to the binary format Pickling in native python, without the complexities of their mini-machine language stuff, and with special support for a few things.

each marshaled "packet" consists of exactly one thing in it, and because of that, the "root" object is almost exclusively some sort of container object, and the contents of that container SHOULD consume all of the remaining bytes in the packet.

The EVE client calls some embedded python stuff in blue.dll to do the marshaling/unmarshaling and gets back the python object and does as much as they can in python. EVEmu is currently not going to take this approach, as there is currently no embedded python or anything else in the server.

The details of the marshaling strategy are in the code, its not really worth duplicating them here.