]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/client.h
make formspec textarea wordwrap
[dragonfireclient.git] / src / client.h
index 33d806f9f6ffb8eedcd13fd92f63c122d05bcb9c..885dc9d3b70f99f9b92110732796e9dd27c5b3f1 100644 (file)
@@ -57,6 +57,12 @@ struct QueuedMeshUpdate
        ~QueuedMeshUpdate();
 };
 
+enum LocalClientState {
+       LC_Created,
+       LC_Init,
+       LC_Ready
+};
+
 /*
        A thread-safe queue of mesh update tasks
 */
@@ -119,6 +125,8 @@ class MeshUpdateThread : public JThread
        MutexedQueue<MeshUpdateResult> m_queue_out;
 
        IGameDef *m_gamedef;
+       
+       v3s16 m_camera_offset;
 };
 
 enum ClientEventType
@@ -135,6 +143,7 @@ enum ClientEventType
        CE_HUDRM,
        CE_HUDCHANGE,
        CE_SET_SKY,
+       CE_OVERRIDE_DAY_NIGHT_RATIO,
 };
 
 struct ClientEvent
@@ -223,6 +232,10 @@ struct ClientEvent
                        std::string *type;
                        std::vector<std::string> *params;
                } set_sky;
+               struct{
+                       bool do_override;
+                       float ratio_f;
+               } override_day_night_ratio;
        };
 };
 
@@ -312,14 +325,7 @@ class Client : public con::PeerHandler, public InventoryManager, public IGameDef
                calling this, as it is sent in the initialization.
        */
        void connect(Address address);
-       /*
-               returns true when
-                       m_con.Connected() == true
-                       AND m_server_ser_ver != SER_FMT_VER_INVALID
-               throws con::PeerNotFoundException if connection has been deleted,
-               eg. timed out.
-       */
-       bool connectedAndInitialized();
+
        /*
                Stuff that references the environment is valid only as
                long as this is not called. (eg. Players)
@@ -342,11 +348,12 @@ class Client : public con::PeerHandler, public InventoryManager, public IGameDef
                        const std::map<std::string, std::string> &fields);
        void sendInventoryAction(InventoryAction *a);
        void sendChatMessage(const std::wstring &message);
-       void sendChangePassword(const std::wstring oldpassword,
-                       const std::wstring newpassword);
+       void sendChangePassword(const std::wstring &oldpassword,
+                               const std::wstring &newpassword);
        void sendDamage(u8 damage);
        void sendBreath(u16 breath);
        void sendRespawn();
+       void sendReady();
 
        ClientEnvironment& getEnv()
        { return m_env; }
@@ -379,9 +386,6 @@ class Client : public con::PeerHandler, public InventoryManager, public IGameDef
                        core::line3d<f32> shootline_on_map
        );
 
-       // Prints a line or two of info
-       void printDebugInfo(std::ostream &os);
-
        std::list<std::string> getConnectedPlayerNames();
 
        float getAnimationTime();
@@ -404,6 +408,9 @@ class Client : public con::PeerHandler, public InventoryManager, public IGameDef
        // Including blocks at appropriate edges
        void addUpdateMeshTaskWithEdge(v3s16 blockpos, bool ack_to_server=false, bool urgent=false);
        void addUpdateMeshTaskForNode(v3s16 nodepos, bool ack_to_server=false, bool urgent=false);
+       
+       void updateCameraOffset(v3s16 camera_offset)
+       { m_mesh_update_thread.m_camera_offset = camera_offset; }
 
        // Get event from queue. CE_NONE is returned if queue is empty.
        ClientEvent getClientEvent();
@@ -448,6 +455,8 @@ class Client : public con::PeerHandler, public InventoryManager, public IGameDef
        // Send a notification that no conventional media transfer is needed
        void received_media();
 
+       LocalClientState getState() { return m_state; }
+
 private:
 
        // Virtual methods from con::PeerHandler
@@ -531,6 +540,9 @@ class Client : public con::PeerHandler, public InventoryManager, public IGameDef
 
        // Storage for mesh data for creating multiple instances of the same mesh
        std::map<std::string, std::string> m_mesh_data;
+
+       // own state
+       LocalClientState m_state;
 };
 
 #endif // !CLIENT_HEADER