]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/client.h
Schematics: Add indent-with-space option for schematic Lua table serialization
[dragonfireclient.git] / src / client.h
index afa519d16cf59434cffbdbe440a172ec3e4e5f86..082b3d6dd1a7f52f50c614c99b6e6d45fd819d88 100644 (file)
@@ -48,7 +48,6 @@ struct MapDrawControl;
 class MtEventManager;
 struct PointedThing;
 class Database;
-class Server;
 
 struct QueuedMeshUpdate
 {
@@ -350,7 +349,9 @@ class Client : public con::PeerHandler, public InventoryManager, public IGameDef
 
        void handleCommand_Null(NetworkPacket* pkt) {};
        void handleCommand_Deprecated(NetworkPacket* pkt);
-       void handleCommand_Init(NetworkPacket* pkt);
+       void handleCommand_Hello(NetworkPacket* pkt);
+       void handleCommand_AuthAccept(NetworkPacket* pkt);
+       void handleCommand_InitLegacy(NetworkPacket* pkt);
        void handleCommand_AccessDenied(NetworkPacket* pkt);
        void handleCommand_RemoveNode(NetworkPacket* pkt);
        void handleCommand_AddNode(NetworkPacket* pkt);
@@ -391,7 +392,7 @@ class Client : public con::PeerHandler, public InventoryManager, public IGameDef
        void handleCommand_LocalPlayerAnimations(NetworkPacket* pkt);
        void handleCommand_EyeOffset(NetworkPacket* pkt);
 
-       void ProcessData(u8 *data, u32 datasize, u16 sender_peer_id);
+       void ProcessData(NetworkPacket *pkt);
 
        // Returns true if something was received
        bool AsyncProcessPacket();
@@ -406,8 +407,8 @@ 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::string &oldpassword,
+                               const std::string &newpassword);
        void sendDamage(u8 damage);
        void sendBreath(u16 breath);
        void sendRespawn();
@@ -479,7 +480,7 @@ class Client : public con::PeerHandler, public InventoryManager, public IGameDef
        bool accessDenied()
        { return m_access_denied; }
 
-       std::wstring accessDeniedReason()
+       std::string accessDeniedReason()
        { return m_access_denied_reason; }
 
        bool itemdefReceived()
@@ -491,7 +492,7 @@ class Client : public con::PeerHandler, public InventoryManager, public IGameDef
 
        float mediaReceiveProgress();
 
-       void afterContentReceived(IrrlichtDevice *device, gui::IGUIFont* font);
+       void afterContentReceived(IrrlichtDevice *device);
 
        float getRTT(void);
        float getCurRate(void);
@@ -516,7 +517,7 @@ class Client : public con::PeerHandler, public InventoryManager, public IGameDef
        // Insert a media file appropriately into the appropriate manager
        bool loadMedia(const std::string &data, const std::string &filename);
        // Send a request for conventional media transfer
-       void request_media(const std::list<std::string> &file_requests);
+       void request_media(const std::vector<std::string> &file_requests);
        // Send a notification that no conventional media transfer is needed
        void received_media();
 
@@ -541,6 +542,11 @@ class Client : public con::PeerHandler, public InventoryManager, public IGameDef
        // Send the item number 'item' as player item to the server
        void sendPlayerItem(u16 item);
 
+       void sendLegacyInit(const char* playerName, const char* playerPassword);
+       void sendDeletedBlocks(std::vector<v3s16> &blocks);
+       void sendGotBlocks(v3s16 block);
+       void sendRemovedSounds(std::vector<s32> &soundList);
+
        float m_packetcounter_timer;
        float m_connection_reinit_timer;
        float m_avg_rtt_timer;
@@ -567,7 +573,6 @@ class Client : public con::PeerHandler, public InventoryManager, public IGameDef
        bool m_inventory_updated;
        Inventory *m_inventory_from_server;
        float m_inventory_from_server_age;
-       std::set<v3s16> m_active_blocks;
        PacketCounter m_packetcounter;
        bool m_show_highlighted;
        // Block mesh animation parameters
@@ -583,7 +588,7 @@ class Client : public con::PeerHandler, public InventoryManager, public IGameDef
        u64 m_map_seed;
        std::string m_password;
        bool m_access_denied;
-       std::wstring m_access_denied_reason;
+       std::string m_access_denied_reason;
        std::queue<ClientEvent> m_client_event_queue;
        bool m_itemdef_received;
        bool m_nodedef_received;
@@ -620,8 +625,9 @@ class Client : public con::PeerHandler, public InventoryManager, public IGameDef
        LocalClientState m_state;
 
        // Used for saving server map to disk client-side
-       Database *localdb;
-       Server *localserver;
+       Database *m_localdb;
+       IntervalLimiter m_localdb_save_interval;
+       u16 m_cache_save_interval;
 
        // TODO: Add callback to update these when g_settings changes
        bool m_cache_smooth_lighting;