#include "util/container.h"
#include "nodetimer.h"
+class Settings;
class Database;
class ClientMap;
class MapSector;
//bool updateChangedVisibleArea();
// Call these before and after saving of many blocks
- virtual void beginSave() {return;};
- virtual void endSave() {return;};
+ virtual void beginSave() { return; }
+ virtual void endSave() { return; }
- virtual void save(ModifiedState save_level){assert(0);};
+ virtual void save(ModifiedState save_level) { FATAL_ERROR("FIXME"); }
// Server implements these.
// Client leaves them as no-op.
- virtual bool saveBlock(MapBlock *block) { return false; };
- virtual bool deleteBlock(v3s16 blockpos) { return false; };
+ virtual bool saveBlock(MapBlock *block) { return false; }
+ virtual bool deleteBlock(v3s16 blockpos) { return false; }
/*
Updates usage timers and unloads unused blocks and sectors.
Saves modified blocks before unloading on MAPTYPE_SERVER.
*/
- void timerUpdate(float dtime, float unload_timeout,
+ void timerUpdate(float dtime, float unload_timeout, u32 max_loaded_blocks,
std::vector<v3s16> *unloaded_blocks=NULL);
/*
These are basically coordinate wrappers to MapBlock
*/
- NodeMetadata* getNodeMetadata(v3s16 p);
+ std::vector<v3s16> findNodesWithMetadata(v3s16 p1, v3s16 p2);
+ NodeMetadata *getNodeMetadata(v3s16 p);
/**
* Sets metadata for a node.
/*
Database functions
*/
+ static Database *createDatabase(const std::string &name, const std::string &savedir, Settings &conf);
// Verify we can read/write to the database
void verifyDatabase();