FEDERATION 2 DESIGNER'S NOTES
by Alan Lenton

13 December 2003

Arrgh! I feel like I haven't got anything done today.

We upgraded the Linux distribution we use from SuSE 7.1 to SuSE 9.00 for this project, so that we are using the 2.4 kernel instead of the old 2.2 kernel. SuSE 7.1 is over two years old, so a lot of the libraries and utilities have been upgraded. In particular I wanted version 3.3.xx of the GNU C++ compiler and the libraries that support the string class properly.

Last year we commissioned a new accounts program, which was intended for use with all future games, like Age and Barbarossa. The first thing that needed doing was to move this program over to the new distribution. That was when the problems started. The program uses SleepyCat Software's Berkeley DB as its built-in database to store accounts. The DB library was one major version and several minor versions further on, and the signatures of a number of the functions had changed. So I had to plow through the code looking up the new stuff on SleepyCat's web site and making the necessary changes.

Once I'd done that, I discovered changes to the MD5 security library. Player passwords are stored as an MD5 hash. (That's a large number calculated from the characters making up the password.) MD5 is a one-way function. That is, you can get an MD5 hash from a password, but it's not reversible. You can't take an MD5 hash and turn it back into the original password. When a player sends in a password we calculate the MD5 hash of the password just sent and compare it with the one we stored when the account was set up.

This, incidentally is why we can't tell people what their passwords are when they forget - it's because we don't know what the original password was, only its hash.

But I digress. The Berkeley DB stuff was fairly straightforward, but the MD5 stuff took somewhat longer, because I'm not all that familiar with the library. Eventually I narrowed the problem down to one remaining call, in a function that I finally discovered was currently being used by the accounts program. At this stage I cheated and commented out the offending code. :)

By this time it was late afternoon, but I'd finally got the accounts program running and was able to telnet to it and run testing routines.

The rest of the day was taken up with setting up version control for both the accounts program and ready for the new fed2 server program. I'm using CVS, because it's one of the most widely used open source version control systems, and, more to the point, I have a decent book on how to use it!

Maybe tomorrow I will actually get round to writing some server code...

<< Previous
Designer's Notes Intro
Next >>