Eve-common.html

From EVEmu Wiki
Jump to navigation Jump to search

The eve-common project handles these major pieces of the EVEmu server:

The eve-common project is necessary for the eve-server project to function as a server. It contains almost all of the support functions that allow the eve-server project to handle calls from the client, along with how to format responses, manage cached objects, and talk with the database. As explained in the The EVEmu Guide main article, the eve-server receives a call from the client, and from that call sends the arguments off to the correct service manager which calls the appropriate service, does whatever it needs to do, and returns the response to the client. However, there is a lot that goes on between the call being received and the arguments being sent to the appropriate service manager.

Before that can be done, the information that the client has sent has to be decoded, as the client sends the service data in the form of objects. The server is coded in C++, which is an Object-Oriented language and you *MUST* think in that manner in able to code efficiently. Essentially the objects are structures that contain all the data necessary and follow a pre-determined organizational hierarchy. As we understand this hierarchy, we are able to successfully decode the information packets that the client sends us, and do what we're supposed to with them. In this regard, EVEmu's implementation of EVE Online's received and transmitted packets are static, in that all packets' structures are pre-determined and stored in XMLP files using XML formatting. See the XML Packet Generator article for more information on specific packets and how the xmlp files are formatted.

The eve-common project handles all of those decoding functions, along with many others. Every time you see something like args.Decode(), what is really happening is that a variable named args is being declared as some class from the eve-common project. For instance, CallJoinArgs? is a class that is contained in eve-common. It handles the decoding and encoding of all packets necessary to join a channel in the chat. Basically it knows how the data for that call is formatted, and pulls out specific things, and sets variables from that information so that we can work with it. As you can imagine, being able to decode all of the data structures of any call that the client can make to the server requires a LOT of code, which is why we have the XML Packet Generator project.