Crossfire Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Checkpoints [was: Re: Apartments?]



Jan Echternach wrote:
> I think the best solution would be to put the player on a safe place
> after the server crash.  This is related to the problem of players
> saving in a treasure room, killing the client and waiting until the
> room resets.

 It depends on why the server is exiting.

 If we just got hit by a signal from the admin, it should be safe to do lots of
work in terms of saving stuff.

 However, if we get a segfault, we really want to try to do a minimum amount of
processing.

 There is code in the server to do emergency saves for the player.  This is
disabled, because in more cases than not, saving the player would result in
another fault, at which point we die, and leave a corrupted player file (no
inventory or the like).

 So any plan can't rely/expect that all data will get properly saved out.

 At the bottom of the config.h file (not sure why it is at the bottom), there is
a BACKUP_SAVE_AT_HOME directive which will make the server save all backup
copies at the emergency save location.  The disadvantage of using that is it
gives you a free word of recall, and in some maps that can be a big advantage.

> 
> Checkpoints could be beds to reality and map exits.  When entering a
> map, the map could specify the position where the player should wake up
> after a server or client crash.  There could also be map squares with a
> special marker object that updates the position, necessary for maps
> that don't want the player to easily get out of a part of the map.

 Yes - dealing with saving players needs to be better done.  I don't know how
complicated it should get - I would rather keep it faily simple:  1) a map can
specify where the backup/emergency save position will be (could be a different
map) 2) individual spaces can override that above value

 Presumably, only those values get called into action if the player returns
after the map has reset.  IF the player returns before the map resets, they
resume play in the same location.