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

Mark Wedel mwedel at scruznet.com
Mon May 14 17:40:21 CDT 2001


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
      
      
     >
     
     
     
    


More information about the crossfire mailing list