add method to slowly delete objects
This commit is contained in:
parent
3f9897105c
commit
aeb02566d4
|
@ -136,6 +136,7 @@ void set_default_settings(Settings *settings)
|
|||
settings->setDefault("server_unload_unused_data_timeout", "19");
|
||||
settings->setDefault("server_map_save_interval", "1.238");
|
||||
settings->setDefault("full_block_send_enable_min_time_from_building", "2.0");
|
||||
settings->setDefault("onload_ignore_objects","false");
|
||||
settings->setDefault("enable_experimental", "false");
|
||||
settings->setDefault("enable_lavabuckets", "true");
|
||||
settings->setDefault("enable_tnt", "true");
|
||||
|
|
|
@ -24,6 +24,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
#include <string>
|
||||
#include <sstream>
|
||||
#include "utility.h"
|
||||
#include "settings.h"
|
||||
#include "main.h"
|
||||
|
||||
struct StaticObject
|
||||
{
|
||||
|
@ -137,6 +139,7 @@ public:
|
|||
}
|
||||
void deSerialize(std::istream &is)
|
||||
{
|
||||
bool drop = g_settings->getBool("onload_ignore_objects");
|
||||
char buf[12];
|
||||
// version
|
||||
is.read(buf, 1);
|
||||
|
@ -148,6 +151,7 @@ public:
|
|||
{
|
||||
StaticObject s_obj;
|
||||
s_obj.deSerialize(is, version);
|
||||
if (!drop)
|
||||
m_stored.push_back(s_obj);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -179,4 +179,6 @@
|
|||
# Set to true to enable experimental features or stuff that is tested
|
||||
# (varies from version to version, usually not useful at all)
|
||||
#enable_experimental = false
|
||||
# a slow delete for objects, stops them being loaded from disk
|
||||
#onload_ignore_objects = false
|
||||
|
||||
|
|
Loading…
Reference in New Issue