mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Don't crash if a Lua error occurs inside get_staticdata
This commit is contained in:
parent
d71872af23
commit
26453df2f7
4 changed files with 35 additions and 17 deletions
11
src/server.h
11
src/server.h
|
@ -150,7 +150,7 @@ public:
|
|||
Address bind_addr,
|
||||
bool dedicated,
|
||||
ChatInterface *iface = nullptr,
|
||||
std::string *on_shutdown_errmsg = nullptr
|
||||
std::string *shutdown_errmsg = nullptr
|
||||
);
|
||||
~Server();
|
||||
DISABLE_CLASS_COPY(Server);
|
||||
|
@ -300,6 +300,9 @@ public:
|
|||
setAsyncFatalError(std::string("Lua: ") + e.what());
|
||||
}
|
||||
|
||||
// Not thread-safe.
|
||||
void addShutdownError(const ModError &e);
|
||||
|
||||
bool showFormspec(const char *name, const std::string &formspec, const std::string &formname);
|
||||
Map & getMap() { return m_env->getMap(); }
|
||||
ServerEnvironment & getEnv() { return *m_env; }
|
||||
|
@ -655,9 +658,9 @@ private:
|
|||
ChatInterface *m_admin_chat;
|
||||
std::string m_admin_nick;
|
||||
|
||||
// if a mod-error occurs in the on_shutdown callback, the error message will
|
||||
// be written into this
|
||||
std::string *const m_on_shutdown_errmsg;
|
||||
// If a mod error occurs while shutting down, the error message will be
|
||||
// written into this.
|
||||
std::string *const m_shutdown_errmsg;
|
||||
|
||||
/*
|
||||
Map edit event queue. Automatically receives all map edits.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue