View Single Post
Old 11-09-2009, 04:38 PM   #2
Hephos
Senior Member
 
Join Date: Feb 2003
Location: Sweden
Home MUD: www.sharune.com
Posts: 359
Hephos is on a distinguished road
Re: Persistence in a MUD server

We used Java Serialization for the java server we made for "Aeonfalls". Due to lack of players and builders we did never put the game live however. But the server is fully functional.

Serialization worked okay. Remember to give the classes a serialization id (so it is static if you change the class). Then in the deserialization methods (cant remember the name correctly) you can just initialize any new values you have added to the class that is not in the saved object. So we never had any problems adding or removing fields. The problems are that the saved objects are not easily readable, which is the only drawback i can think of (and that you can't access it with queries like in a database). Or easily modify large chunks of stuff (like in a database).

If i were to do it again, i would probably look up hibernate and saving the stuff into a mysql database instead. So much easier to have everything in a real database.
Hephos is offline   Reply With Quote