View Single Post
Cpp Cpp's Avatar

JCF Member

Joined: Mar 2001

Posts: 1,557

Cpp is doing well so far

Aug 24, 2006, 09:39 AM
Cpp is offline
Reply With Quote
I have made a short description of how I imagine the project to be structured. This doesn't mean that the final server will be structured exactly like this, but it gives a general idea of how things should be. Basically there are many pieces of code that the server could use, but I have listed only the most basic.

Quote:
Fileworks
The module for handling the jj2 file formats. This one should be able to load all jj2 files needed to run the server such as levels, tilesets and maybe some other data, if needed. It should import them into a readable format for the server so that it can do various things needed to operate - such as extract tile masks and generate a mask level map for collision detection, enum the level events, etc.

Networking
The basic networking module is a must for every network game. This is where all the network traffic is handled (tcp and udp) - downloads, player info interchange, chat, ping, listing/updating/delisting server, etc. Also, bad traffic is dropped.

Engine
The core of the project. Here is where most of the calculations take place.
server side trajectory calculation, collision, object respawns, game status, level changes when game finishes, etc. Graphical output will probably not be needed, but can be used as a plugin.

Interface
The basic way where a server admin can communicate to the server, allowing him to load new plugins (at runtime), unload old ones, configure the server, administrate the game, ban/unban players, etc. I don't know whether this should look like a w32console or a GUI window, I'd prefer the gui tho.

Logger
A kind of jj2spy-like module where user can see the history of the server. Some things that can be logged are server status, player chat, player joins/leaves, level switches, warnings/errors (such as bad j2l/j2t), etc. Should also be able to save the log to text files.

Plugin manager
Manages available plugins during runtime and loads them automatically when executable loads. The plugins can be DLL's in the plugin folder for example. It's not neccessary that all plugins come with an interface of their own, some plugins can offer extended functionality for the server (like runtime libraries for other plugins that rely on them)... which is why they should be visible to the othes. Plugin manager would maintain a list of loaded plugins so they may see each other. There are many ideas, but I'll keep this brief.
Personally I'd let the server use only the most basic code it needs to operate, most of other stuff should be done through plugins. Please comment.
__________________
<a href="http://nmap.org/"><img border="0" alt="Nmap Security Scanner" src="http://images.insecure.org/nmap/images/prop/nmap_bnr_matrix_pfos.gif"/></a>