Proper handling of failing to bind server socket

This commit is contained in:
Perttu Ahola
2012-03-11 20:45:43 +02:00
parent d1d83d7e7f
commit 618314985d
4 changed files with 51 additions and 2 deletions

View File

@@ -545,6 +545,11 @@ class Server : public con::PeerHandler, public MapEventReceiver,
std::string getWorldPath(){ return m_path_world; }
void setAsyncFatalError(const std::string &error)
{
m_async_fatal_error.set(error);
}
private:
// con::PeerHandler implementation.
@@ -658,6 +663,9 @@ class Server : public con::PeerHandler, public MapEventReceiver,
// Equivalent of /usr/share/minetest/server
std::string m_path_share;
// Thread can set; step() will throw as ServerError
MutexedVariable<std::string> m_async_fatal_error;
// Some timers
float m_liquid_transform_timer;
float m_print_info_timer;