summaryrefslogtreecommitdiff
path: root/src/map.h
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2011-06-27 00:27:17 +0300
committerPerttu Ahola <celeron55@gmail.com>2011-06-27 00:27:17 +0300
commitdd22ea051a643a1ca2657958c8552849dc1ffa36 (patch)
treefa9047294f1463270995277c6f4b948ae79b17f6 /src/map.h
parent3fccc67eb7c530c280e9b496e22288ffa772152d (diff)
downloadminetest-dd22ea051a643a1ca2657958c8552849dc1ffa36.tar.gz
minetest-dd22ea051a643a1ca2657958c8552849dc1ffa36.tar.bz2
minetest-dd22ea051a643a1ca2657958c8552849dc1ffa36.zip
map unloading is now a whole lot better
Diffstat (limited to 'src/map.h')
-rw-r--r--src/map.h15
1 files changed, 10 insertions, 5 deletions
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<v3s16> *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<v2s16> &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<v3s16> *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<v3s16, MapBlock*> & modified_blocks);