]> git.lizzy.rs Git - minetest.git/blobdiff - src/clientiface.h
Add limit parameter to decompressZlib
[minetest.git] / src / clientiface.h
index f7d628059e133b1ff8145bda1f7b9b0f59ac3859..bf95df4a8a126d079fbca266db2cf17dfd869159 100644 (file)
@@ -246,7 +246,7 @@ class RemoteClient
        bool isMechAllowed(AuthMechanism mech)
        { return allowed_auth_mechs & mech; }
 
-       RemoteClient() = default;
+       RemoteClient();
        ~RemoteClient() = default;
 
        /*
@@ -274,6 +274,11 @@ class RemoteClient
 
        u32 getSendingCount() const { return m_blocks_sending.size(); }
 
+       bool isBlockSent(v3s16 p) const
+       {
+               return m_blocks_sent.find(p) != m_blocks_sent.end();
+       }
+
        // Increments timeouts and removes timed-out blocks from list
        // NOTE: This doesn't fix the server-not-sending-block bug
        //       because it is related to emerging, not sending.
@@ -333,6 +338,7 @@ class RemoteClient
        u8 getMajor() const { return m_version_major; }
        u8 getMinor() const { return m_version_minor; }
        u8 getPatch() const { return m_version_patch; }
+       const std::string &getFull() const { return m_full_version; }
 private:
        // Version is stored in here after INIT before INIT2
        u8 m_pending_serialization_version = SER_FMT_VER_INVALID;
@@ -354,6 +360,13 @@ class RemoteClient
        v3s16 m_last_center;
        float m_nearest_unsent_reset_timer = 0.0f;
 
+       const u16 m_max_simul_sends;
+       const float m_min_time_from_building;
+       const s16 m_max_send_distance;
+       const s16 m_block_optimize_distance;
+       const s16 m_max_gen_distance;
+       const bool m_occ_cull;
+
        /*
                Blocks that are currently on the line.
                This is used for throttling the sending of blocks.
@@ -424,6 +437,9 @@ class ClientInterface {
        /* get list of active client id's */
        std::vector<session_t> getClientIDs(ClientState min_state=CS_Active);
 
+       /* mark block as not sent to active client sessions */
+       void markBlockposAsNotSent(const v3s16 &pos);
+
        /* verify is server user limit was reached */
        bool isUserLimitReached();
 
@@ -486,7 +502,7 @@ class ClientInterface {
 
        // Connection
        std::shared_ptr<con::Connection> m_con;
-       std::mutex m_clients_mutex;
+       std::recursive_mutex m_clients_mutex;
        // Connected clients (behind the con mutex)
        RemoteClientMap m_clients;
        std::vector<std::string> m_clients_names; //for announcing masterserver