]> git.localhorst.tv Git - blank.git/blobdiff - src/server/ClientConnection.hpp
send updates less frequently on bad connections
[blank.git] / src / server / ClientConnection.hpp
index 11670bcee6da3e8e4fc4c5117899e327bcd1d0e0..16beccf7aecb100471185aca85cd684023e2d6c8 100644 (file)
@@ -83,12 +83,15 @@ private:
        void On(const Packet::Login &) override;
        void On(const Packet::Part &) override;
        void On(const Packet::PlayerUpdate &) override;
+       void On(const Packet::Message &) override;
 
        bool CanSpawn(const Entity &) const noexcept;
        bool CanDespawn(const Entity &) const noexcept;
 
        void SendSpawn(SpawnStatus &);
        void SendDespawn(SpawnStatus &);
+       /// true if updates are pushed to the client this frame
+       bool SendingUpdates() const noexcept;
        void QueueUpdate(SpawnStatus &);
        void SendUpdates();
 
@@ -105,10 +108,11 @@ private:
        unsigned int confirm_wait;
 
        std::vector<SpawnStatus *> entity_updates;
+       unsigned int entity_updates_skipped;
 
        EntityState player_update_state;
        std::uint16_t player_update_pack;
-       IntervalTimer player_update_timer;
+       CoarseTimer player_update_timer;
        std::uint8_t old_actions;
 
        ChunkTransmitter transmitter;