Sorressean's blog

skelmud update:player file corruption

by Sorressean on Nov.22, 2009, under skelmud

One of the recent issues I’ve noticed while working on Skelmud, is that the player data may or may not have been saved between the last time it was modified, and the current time of the shutdown. My solution to this was two-fold.

First, I defined a signal handler, and set the callback for the signals used to kill applications. The signal basically sets a “running flag” to false. This means that the game loop will stop after its current iteration. After the body of the loop the gameloop calls server->Shutdown, which is where the fun comes in. The idea is to go through all the player objects, and save them, then kill their associated socket. After that is done, the zones can be saved. To avoid needlessly saving zones, I have built a “modified” flag into the zones, which should be set if the room is edited via OLC, and removed when the room is saved.


Leave a Reply

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...

    Archives

    All entries, chronologically...