[CF-Devel] unique-items question (repost)

Mark Wedel mwedel at sonic.net
Fri Oct 4 01:36:12 CDT 2002


Rick Tanner wrote:
>
     
      ----- Original Message -----
     
     >
     
      From: "Todd Mitchell"
     
     >
     
     
     >
     
      I have mostly finished the realestate scripts I was doing to allow buying
     
     >
     
      and selling of houses but have one outstanding issue. When a lot is sold
     
     >
     
      or a player quits the lot(s) they own are recycled (the lot file updated
     
     >
     
      to vacant status, the maps removed from unique-items) but if the lot maps
     
     >
     
      are in memory (or temp maps or whatever e.g. '
      
      Lots at Lot
      
      #@map' ) when it
     
     >
     
      comes time for the server to release them, the maps are written back to
     
     >
     
      unique-items (so they aren't getting recycled properly.).  Is there a way
     
     >
     
      to flush the maps from memory (or tempmaps or whatever) to prevent this?
     
     >
     
      Even when testing out maps with unique floors, this is a bit of a problem
     
     >
     
      since you have to shutdown the server then delete the unique-item maps to
     
     >
     
      refresh your changes.
     
     
  If the entire map is unique, it never gets written as a temp map - it just 
cycles to/from disk directly.

  It shouldn't be too hard to make a call to explicitly save out a map in memory 
to disk - more appropriate in this case would be to delete it from memory, but 
see notes above.

>
     
     
     >
     
      Also if a player happened to be on a map when it was sold (or less likely,
     
     >
     
      since the lots are expensive, when the owner quits) it would make this
     
     >
     
      more of a problem (since the homes are accessable by static exits on the
     
     >
     
      main maps someone could have wandered onto the entry way - or worse
     
     >
     
      someone could have been let in by the owner and is wandering around (have
     
     >
     
      to make sure there is an exit from each map to prevent  players trapping
     
     >
     
      other players in their homes).  I guess you whould have to check for a
     
     >
     
      player on the map, move them, and then recycle the map?
     
     
  Yes - if a player is on a map, he would need to get placed on some other map 
before it got saved out.

  However, there is no convenient way to do that right now.  It's typically not 
obvious where a player should get relocated to from the map they are on.

  Now if a map was a single layer (eg, exit on it lead to non private map), you 
could do some trickery by clearing the unique flag on the map and setting the 
reset time to zero - then, when the player does finally vacate, the map will 
just reset without ever going to disk.

  Problem is if you have a multistory residence, this is tricky.  For example, 
suppose you have the city, which leads to the first floor of the house.  First 
floor has a staircase that leads to the second floor.

  You don't really want to clear out the first floor, because then the player on 
the second floor is effectively trapped (his staircase down leads to a non 
existent map).

This is complicated to fix if the unique maps are stored in the player directory 
- they basically have to get cleaned up when the player quits.  IMO, stuff in 
the players directory should only be avialable to that player, and not other 
players - if these maps can be visited by other players, they should be stored 
in a common unique maps area.

  In that case, you could have a script that catches a player quit event, and 
cleans out those maps right then (if not in memory or no players are on them). 
Otherwise, marks them for future removal, and update the exit that leads to them 
so no one can get to them.



    
    


More information about the crossfire mailing list