]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/environment.h
Translated using Weblate (Korean)
[dragonfireclient.git] / src / environment.h
index 9eb440c4241558d8225d372a4925e1350044e4f5..794f1971c8bd94126a4d562f1f0ba7b4565668d1 100644 (file)
@@ -32,6 +32,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 
 #include <set>
 #include <list>
+#include <queue>
 #include <map>
 #include "irr_v3d.h"
 #include "activeobject.h"
@@ -81,22 +82,13 @@ class Environment
        u32 getDayNightRatio();
 
        // 0-23999
-       virtual void setTimeOfDay(u32 time)
-       {
-               m_time_of_day = time;
-               m_time_of_day_f = (float)time / 24000.0;
-       }
-
-       u32 getTimeOfDay()
-       { return m_time_of_day; }
-
-       float getTimeOfDayF()
-       { return m_time_of_day_f; }
+       virtual void setTimeOfDay(u32 time);
+       u32 getTimeOfDay();
+       float getTimeOfDayF();
 
        void stepTimeOfDay(float dtime);
 
        void setTimeOfDaySpeed(float speed);
-
        float getTimeOfDaySpeed();
 
        void setDayNightRatioOverride(bool enable, u32 value)
@@ -134,7 +126,8 @@ class Environment
        bool m_cache_enable_shaders;
 
 private:
-       JMutex m_lock;
+       JMutex m_timeofday_lock;
+       JMutex m_time_lock;
 
 };
 
@@ -228,6 +221,7 @@ class ServerEnvironment : public Environment
        float getSendRecommendedInterval()
                { return m_recommended_send_interval; }
 
+       void kickAllPlayers(const std::string &reason);
        // Save players
        void saveLoadedPlayers();
        void savePlayer(const std::string &playername);
@@ -313,7 +307,7 @@ class ServerEnvironment : public Environment
        bool swapNode(v3s16 p, const MapNode &n);
 
        // Find all active objects inside a radius around a point
-       std::set<u16> getObjectsInsideRadius(v3f pos, float radius);
+       void getObjectsInsideRadius(std::vector<u16> &objects, v3f pos, float radius);
 
        // Clear all objects, loading and going through every MapBlock
        void clearAllObjects();
@@ -386,7 +380,7 @@ class ServerEnvironment : public Environment
        // Active object list
        std::map<u16, ServerActiveObject*> m_active_objects;
        // Outgoing network message buffer for active objects
-       std::list<ActiveObjectMessage> m_active_object_messages;
+       std::queue<ActiveObjectMessage> m_active_object_messages;
        // Some timers
        float m_send_recommended_timer;
        IntervalLimiter m_object_management_interval;
@@ -401,7 +395,7 @@ class ServerEnvironment : public Environment
        u32 m_game_time;
        // A helper variable for incrementing the latter
        float m_game_time_fraction_counter;
-       std::list<ABMWithState> m_abms;
+       std::vector<ABMWithState> m_abms;
        // An interval for generally sending object positions and stuff
        float m_recommended_send_interval;
        // Estimate for general maximum lag as determined by server.
@@ -412,6 +406,8 @@ class ServerEnvironment : public Environment
 #ifndef SERVER
 
 #include "clientobject.h"
+#include "content_cao.h"
+
 class ClientSimpleObject;
 
 /*
@@ -474,6 +470,7 @@ class ClientEnvironment : public Environment
                ActiveObjects
        */
 
+       GenericCAO* getGenericCAO(u16 id);
        ClientActiveObject* getActiveObject(u16 id);
 
        /*
@@ -509,7 +506,7 @@ class ClientEnvironment : public Environment
        // Get event from queue. CEE_NONE is returned if queue is empty.
        ClientEnvEvent getClientEvent();
 
-       u16 m_attachements[USHRT_MAX];
+       u16 attachement_parent_ids[USHRT_MAX + 1];
 
        std::list<std::string> getPlayerNames()
        { return m_player_names; }
@@ -529,7 +526,7 @@ class ClientEnvironment : public Environment
        IGameDef *m_gamedef;
        IrrlichtDevice *m_irr;
        std::map<u16, ClientActiveObject*> m_active_objects;
-       std::list<ClientSimpleObject*> m_simple_objects;
+       std::vector<ClientSimpleObject*> m_simple_objects;
        std::list<ClientEnvEvent> m_client_event_queue;
        IntervalLimiter m_active_object_light_update_interval;
        IntervalLimiter m_lava_hurt_interval;