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
|
||||
servermap->addEventReceiver(this);
|
||||
|
||||
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
|
||||
// intended to be cached after environment loading.
|
||||
|
@ -368,13 +368,13 @@ public:
|
||||
|
||||
const bool isCompatPlayerModel(const std::string &model_name);
|
||||
inline bool getCompatSendOriginalModel() { return m_compat_send_original_model; }
|
||||
private:
|
||||
|
||||
/**
|
||||
* called if env_meta.txt doesn't exist (e.g. new world)
|
||||
*/
|
||||
void loadDefaultMeta();
|
||||
|
||||
private:
|
||||
static PlayerDatabase *openPlayerDatabase(const std::string &name,
|
||||
const std::string &savedir, const Settings &conf);
|
||||
static AuthDatabase *openAuthDatabase(const std::string &name,
|
||||
|
Loading…
x
Reference in New Issue
Block a user