]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/client.h
make formspec textarea wordwrap
[dragonfireclient.git] / src / client.h
index f2e1b86d7bbd133a731aa76bc2ea9216853da586..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
 */
@@ -319,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)
@@ -354,6 +353,7 @@ class Client : public con::PeerHandler, public InventoryManager, public IGameDef
        void sendDamage(u8 damage);
        void sendBreath(u16 breath);
        void sendRespawn();
+       void sendReady();
 
        ClientEnvironment& getEnv()
        { return m_env; }
@@ -409,7 +409,8 @@ class Client : public con::PeerHandler, public InventoryManager, public IGameDef
        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; }
+       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();
@@ -454,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
@@ -537,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