Reset environment metadata if it is unreadable
This commit is contained in:
parent
11abe53d2b
commit
745b858bae
@ -482,7 +482,13 @@ void Server::init()
|
|||||||
// Register us to receive map edit events
|
// Register us to receive map edit events
|
||||||
servermap->addEventReceiver(this);
|
servermap->addEventReceiver(this);
|
||||||
|
|
||||||
m_env->loadMeta();
|
try {
|
||||||
|
m_env->loadMeta();
|
||||||
|
} catch (SerializationError &e) {
|
||||||
|
warningstream << "Environment metadata is corrupted: " << e.what() << std::endl;
|
||||||
|
warningstream << "Loading the default instead" << std::endl;
|
||||||
|
m_env->loadDefaultMeta();
|
||||||
|
}
|
||||||
|
|
||||||
// Those settings can be overwritten in world.mt, they are
|
// Those settings can be overwritten in world.mt, they are
|
||||||
// intended to be cached after environment loading.
|
// intended to be cached after environment loading.
|
||||||
|
@ -368,13 +368,13 @@ public:
|
|||||||
|
|
||||||
const bool isCompatPlayerModel(const std::string &model_name);
|
const bool isCompatPlayerModel(const std::string &model_name);
|
||||||
inline bool getCompatSendOriginalModel() { return m_compat_send_original_model; }
|
inline bool getCompatSendOriginalModel() { return m_compat_send_original_model; }
|
||||||
private:
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* called if env_meta.txt doesn't exist (e.g. new world)
|
* called if env_meta.txt doesn't exist (e.g. new world)
|
||||||
*/
|
*/
|
||||||
void loadDefaultMeta();
|
void loadDefaultMeta();
|
||||||
|
|
||||||
|
private:
|
||||||
static PlayerDatabase *openPlayerDatabase(const std::string &name,
|
static PlayerDatabase *openPlayerDatabase(const std::string &name,
|
||||||
const std::string &savedir, const Settings &conf);
|
const std::string &savedir, const Settings &conf);
|
||||||
static AuthDatabase *openAuthDatabase(const std::string &name,
|
static AuthDatabase *openAuthDatabase(const std::string &name,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user