Main /

Tech Server


  • START


  • VARG


  • WETARDS


  • COMMANDS


  • ROOM COMMANDS


  • VILLE


  • PROFILE


  • FUTURE


  • BONUS

edit SideBar

Tech Server

Server Technology

Lua and its libraries are used to run the server. This server is tested and used under *nix and also locally under windows for debugging. It is very simple to install and run and is designed with the possibility of easily running a server at home.

The main advantages of Lua are of course ease to write, update and maintain. Server updates are applied regularly without disconnecting the current clients or interrupting those in the middle of games. I don't see any need to overly optimize most of this code but should such a need prove necessary then the ease with which Lua integrates with C functions and libraries means that faster code paths can be provided simply by adding some custom low level libraries.

The lua socket library is used server side to communicate with the client using simple text TCP packets with an even simpler basic compression scheme. Each packet is a single line of text, a query string in fact with no ? but beginning and ending with a & and also terminated by a \n\0 this gives us compatibility with the idiosyncrasies of flash and its xmlsockets without resorting to xml data.

The basic compression is simply handled by keeping a state and only sending changes in the msg. EG suppose we wanted to send the following msgs, each line being a separate msg.

&cmd=msg&arg=1&var=3&txt=hello&
&cmd=msg&arg=1&var=3&txt=world&
&cmd=msg&arg=1&var=3&txt=how&
&cmd=msg&arg=1&var=3&txt=are&
&cmd=msg&arg=1&var=3&txt=you&

the actual data sent would be

&cmd=msg&arg=1&var=3&txt=hello&
&txt=world&
&txt=how&
&txt=are&
&txt=you&

Simple but effective when we send multiple similar msgs with only a small client and server overhead for tracking active connections.

Any data we wish to send that may need to use the special chars, &=\n\0 are just url escaped and Base64 encoding is used for some larger game data .

This seems to be enough compression and flexibility but as the client is always loaded from the server rather than being embedded in the games we can update this format at anytime however the basic simple design of these packets will probably remain the same.

This server also handles the new icky security in flash 9+ and runs a server at port 843 to say we are allowed to run a server on other ports. Yay for annoying flash "security".

A minimum amount of user state data is maintained, a very small amount is guaranteed persistent but some of it is built around the idea that it will get reset at the end of each day and most of it, even long term IP bans, will be lost on server reboots.

We refer to this lifting of bans as a Royal Pardon, some users pray for a server reboot rather than dreading it as it means a Royal Pardon for one of their wayward alts.

Server Users/logins are shared with a fud forum, so the forums pages are simply linked to from the chat for most user administration tasks. Signup, adding buddies, simple mail system and so on.

Recent Changes (All) | Edit SideBar Page last modified on July 21, 2008, at 12:42 PM Edit Page | Page History
Powered by PmWiki