X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Fenvironment.h;h=03c21b08ccff55aad7963da7e003876ddf4f8d59;hb=63867b1a372a4d1a4a4ffdec9d0862b094211a89;hp=a59bbd9a1d51fe996e24dc9f904717afcef343c4;hpb=f6fc39e69a0a621480bec9ceafd154ec83cf0100;p=minetest.git diff --git a/src/environment.h b/src/environment.h index a59bbd9a1..03c21b08c 100644 --- a/src/environment.h +++ b/src/environment.h @@ -70,6 +70,7 @@ class Environment virtual void addPlayer(Player *player); void removePlayer(u16 peer_id); + void removePlayer(const char *name); Player * getPlayer(u16 peer_id); Player * getPlayer(const char *name); Player * getRandomConnectedPlayer(); @@ -120,6 +121,17 @@ class Environment // Overriding the day-night ratio is useful for custom sky visuals bool m_enable_day_night_ratio_override; u32 m_day_night_ratio_override; + + /* TODO: Add a callback function so these can be updated when a setting + * changes. At this point in time it doesn't matter (e.g. /set + * is documented to change server settings only) + * + * TODO: Local caching of settings is not optimal and should at some stage + * be updated to use a global settings object for getting thse values + * (as opposed to the this local caching). This can be addressed in + * a later release. + */ + bool m_cache_enable_shaders; private: JMutex m_lock; @@ -199,7 +211,7 @@ class ServerEnvironment : public Environment { public: ServerEnvironment(ServerMap *map, GameScripting *scriptIface, - IGameDef *gamedef); + IGameDef *gamedef, const std::string &path_world); ~ServerEnvironment(); Map & getMap(); @@ -216,17 +228,16 @@ class ServerEnvironment : public Environment float getSendRecommendedInterval() { return m_recommended_send_interval; } - /* - Save players - */ - void serializePlayers(const std::string &savedir); - void deSerializePlayers(const std::string &savedir); + // Save players + void saveLoadedPlayers(); + void savePlayer(const std::string &playername); + Player *loadPlayer(const std::string &playername); /* Save and load time of day and game timer */ - void saveMeta(const std::string &savedir); - void loadMeta(const std::string &savedir); + void saveMeta(); + void loadMeta(); /* External ActiveObject interface @@ -259,6 +270,7 @@ class ServerEnvironment : public Environment inside a radius around a position */ void getAddedActiveObjects(v3s16 pos, s16 radius, + s16 player_radius, std::set ¤t_objects, std::set &added_objects); @@ -267,6 +279,7 @@ class ServerEnvironment : public Environment inside a radius around a position */ void getRemovedActiveObjects(v3s16 pos, s16 radius, + s16 player_radius, std::set ¤t_objects, std::set &removed_objects); @@ -368,6 +381,8 @@ class ServerEnvironment : public Environment GameScripting* m_script; // Game definition IGameDef *m_gamedef; + // World path + const std::string m_path_world; // Active object list std::map m_active_objects; // Outgoing network message buffer for active objects