X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Fserver.h;h=0b4c67deb10a0008cb3fb1a10ff8529760039232;hb=618314985d6a632ccfd2001d969d32a5ee6e4ca1;hp=a1d7e5df73b6c0e119f753eadb3e2322f86e5bf2;hpb=f1d9880006cf713597c1fc573f83db75062712c9;p=minetest.git diff --git a/src/server.h b/src/server.h index a1d7e5df7..0b4c67deb 100644 --- a/src/server.h +++ b/src/server.h @@ -34,6 +34,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "serverremoteplayer.h" #include "mods.h" #include "inventorymanager.h" +#include "subgame.h" struct LuaState; typedef struct lua_State lua_State; class IWritableItemDefManager; @@ -405,11 +406,11 @@ class Server : public con::PeerHandler, public MapEventReceiver, /* NOTE: Every public method should be thread-safe */ - + Server( - std::string gamename, - std::string mapsavedir, - std::string configpath + const std::string &path_world, + const std::string &path_config, + const SubgameSpec &gamespec ); ~Server(); void start(unsigned short port); @@ -544,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. @@ -647,20 +653,18 @@ class Server : public con::PeerHandler, public MapEventReceiver, Variables */ - // Game name - std::string m_gamename; // World directory std::string m_path_world; // Path to user's configuration file ("" = no configuration file) std::string m_path_config; + // Subgame specification + SubgameSpec m_gamespec; // Equivalent of /usr/share/minetest/server std::string m_path_share; - // Equivalent of /usr/share/minetest/server/games/gamename - std::string m_path_game; - // Equivalent of /usr/share/minetest/server/addons/gamename - // and ~/.minetest/server/addons/gamename - std::set m_path_addons; + + // Thread can set; step() will throw as ServerError + MutexedVariable m_async_fatal_error; // Some timers float m_liquid_transform_timer;