From dd22ea051a643a1ca2657958c8552849dc1ffa36 Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Mon, 27 Jun 2011 00:27:17 +0300 Subject: map unloading is now a whole lot better --- src/map.h | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src/map.h') diff --git a/src/map.h b/src/map.h index 2fe749007..71101b8e4 100644 --- a/src/map.h +++ b/src/map.h @@ -223,19 +223,23 @@ public: virtual void save(bool only_changed){assert(0);}; - // Server implements this + // Server implements this. + // Client leaves it as no-op. virtual void saveBlock(MapBlock *block){}; /* - Updates usage timers + Updates usage timers and unloads unused blocks and sectors. + Saves modified blocks before unloading on MAPTYPE_SERVER. */ - void timerUpdate(float dtime); + void timerUpdate(float dtime, float unload_timeout, + core::list *unloaded_blocks=NULL); // Deletes sectors and their blocks from memory // Takes cache into account // If deleted sector is in sector cache, clears cache void deleteSectors(core::list &list); - + +#if 0 /* Unload unused data = flush changed to disk and delete from memory, if usage timer of @@ -243,8 +247,9 @@ public: */ void unloadUnusedData(float timeout, core::list *deleted_blocks=NULL); +#endif - // For debug printing + // For debug printing. Prints "Map: ", "ServerMap: " or "ClientMap: " virtual void PrintInfo(std::ostream &out); void transformLiquids(core::map & modified_blocks); -- cgit v1.2.3