• Advertisement
Sign in to follow this  
  • entries
    8
  • comments
    6
  • views
    7477

SDL_net chat server

Sign in to follow this  

491 views

Ok. I am going to try to get this right this time.

I am a big fan of text based MUDs. I got my start playing ROM based MUDs when I was about 17 (over 12 years ago!). There have been many improvements made to IDE's and compilers along with their free availability which helped decreased the need to have a remote host that had all of the build tools. The broadband boom has made it cheap and convenient to develop and test MUDs on a home computer through either a cable or DSL connection where traditionally they were hosted on college servers and low cost commercial servers because broadband in the home was pretty expensive.

I wanted to see how difficult/easy it would be to re-write one of these monsters from the ground up. Most of the popular hack n' slash style MUDs I have played are based on the Diku->Merc->ROM family which are written in C. Most have had so many different programmers that they have become a mass of spaghetti code that requires an in depth knowledge of the code in order to add or modify some of the simplest things. I hope to change that.

Starting off last night because of a post in the beginners forum regarding a simple chat server I began writing some code.

Here is what I wrote down as some needs:
1. cross platform code to be run on the major platforms of Windows, Mac and *nix.

2. C++ standard library containers and strings need to be utilized instead of the traditional home brew versions. Save on some time and bugs.

3. An embeded database system instead of flat files. Not everyone has access to or wants to set up and maintain MS SQL Server or MySQL and flat files turn out to be very cumbersome when adding fields to objects.

With that in mind I came up with these solutions:
1. SDL and the SDL_net library. SDL and it's add-on libraries are proven to be cross platform and pretty solid and best of all the S in SDL stands for "Simple". Why look any further.

2. Nothing here to explain. This is the reason STL became a standard in the first place.

3. SQLite3 is actively being developed and I have had some success converting older ROM based MUD flat files to this embeded database system in the past. A giant side bonus to this is that newer versions of PHP have a built in interface to the SQLite3 library to easily integrate game information into your web pages. A thin wrapper around this will need to be developed.

So... last night I wrote a simple multi-user chat server using SDL_net. The code is linked here.

Next is to add some more functionality like loging in and password recognition.
Sign in to follow this  


0 Comments


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement