[Re: [CF-Devel] Re: [CF List] Reliable saving of players/unique-items]

DAVID DELBECQ david.delbecq at usa.net
Tue May 15 01:57:18 CDT 2001


A good solution to resolve this problem is to allow the server to create a 
emergency save space. Let's say we create at installation time an empty file
of about 2 or 3 Mb. This could be enough to emergency save players and their
modified unique maps. (I think 1Mb is already enough since file only weight
several Kbs)

We don't need to save a lot of maps since each change in a unique map is
immediately reported on the disk (this first map/player to fail enable an
emergency save...). When the server detects an out of space problem, it open
the emergency space (which already is 3 Mb length so there is enough space)
and opens the file so to not delete or reset it (e.g. doing a rw).

Inside the file it saves the various actual players, the unique maps and stop
the server after sending an emergency message to all players. The server will
then refuse to restart until enough space as been freed on media.

Next time the server starts, it detects some things were saved in the
emergency file, it restore the maps and the player (moving them to their bed
before). Now the out of disk space problem has been resolved transparently and
doesn't need any os specific function. For player, it was just a bug like
another (except the server didn't restart immediatly after hang-up). And for
the host, it doesn't need so much space.


Mark Wedel <
     
     mwedel at scruznet.com
     
     > wrote:
On Mon, 14 May 2001, Peter Mardahl wrote:

 Why checking for success on write is not to hard to do (note an
alternate method which may actually be better is to rename the original to
a backup, and if the save files, rename back again.  If it succeeds, you
could either delete the backup, or keep it around in case somethign else
trashes the player file). But a bigger question is
what to do when the write does fail.

 Because at that point, there really isn't much crossfire can do. 
Presumably,
it should probably just exit, or at minimum, warn all the people playing that
writes are failing, and they are likely to lose anything they are doing.
Granted, if the admin of the machine notices, they can fix the space issue,
but the likelihood/ability for that to happen is certainly not guaranteed.

 The unique player maps are probably a little more dangerous in that regard
than the player files, as once the server tries to write them out, they are
lost from memory.  At least the player data persists in server memory,
so if the problem is later corrected, nothing is really lost.

 Note that if a player has a way to cause write failures, I can think of
several exploits right away.  This is probably not a likely situation -
such a situation would presume that the server is a public machine
(ie, work or university server for example), and chances are the admins
would not likely kindly on people filling up disks to cheat at a game.


>
     
     
     >
     
      This is an excellent suggesstion.
     
     >
     
      I have referred it to the crossfire development list.
     
     >
     
     
     >
     
      PeterM
     
     >
     
     
     >
     
      > Hi,
     
     >
     
      >
     
     >
     
      > I have just lost my apartments again, because of full filesystem (BTW it
     
     >
     
      > was filled by crashed crossfire). I have never lost the player the same
     
     >
     
      > way, but if player files are created the same way as unique-items file
     
     >
     
      > it can always happen.
     
     >
     
      >
     
     >
     
      > Maybe those files should be created more reliably. Eg. by writting
     
     >
     
      > file.new first, and only if it succeeds the file would be renamed to
     
     >
     
      > proper name. It can "save some lives".
     
     >
     
      >
     
     >
     
      > Greets,
     
     >
     
      >         Jacek
     
     >
     
      > _______________________________________________
     
     >
     
      > crossfire-list mailing list
     
     >
     
      > 
      
      crossfire-list at lists.real-time.com
      
      
     >
     
      > 
      
      https://mailman.real-time.com/mailman/listinfo/crossfire-list
      
      
     >
     
      _______________________________________________
     
     >
     
      crossfire-devel mailing list
     
     >
     
     
      crossfire-devel at lists.real-time.com
      
      
     >
     
     
      https://mailman.real-time.com/mailman/listinfo/crossfire-devel
      
      
     >
     
     
     
_______________________________________________
crossfire-devel mailing list
     
     crossfire-devel at lists.real-time.com
     
     
     https://mailman.real-time.com/mailman/listinfo/crossfire-devel
     
     




David Delbecq
     
     David.delbecq at usa.net
     
     

____________________________________________________________________
Get free email and a permanent address at 
     
     http://www.netaddress.com/?N=1
     
     
    


More information about the crossfire mailing list