Tooltips: Unify the tooltip[] and list[] description tooltip display functions (...
[oweals/minetest.git] / src / client.h
index cc0d4699d30abf89d14650eabb372b4dee993f67..b4145c76ff207127c08084f2dfcdb9f29e72e053 100644 (file)
@@ -38,6 +38,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "tileanimation.h"
 #include "mesh_generator_thread.h"
 
+#define CLIENT_CHAT_MESSAGE_LIMIT_PER_10S 10.0f
+
 struct MeshMakeData;
 class MapBlockMesh;
 class IWritableTextureSource;
@@ -360,6 +362,7 @@ public:
                const StringMap &fields);
        void sendInventoryAction(InventoryAction *a);
        void sendChatMessage(const std::wstring &message);
+       void clearOutChatQueue();
        void sendChangePassword(const std::string &oldpassword,
                const std::string &newpassword);
        void sendDamage(u8 damage);
@@ -565,6 +568,8 @@ private:
        inline std::string getPlayerName()
        { return m_env.getLocalPlayer()->getName(); }
 
+       bool canSendChatMessage() const;
+
        float m_packetcounter_timer;
        float m_connection_reinit_timer;
        float m_avg_rtt_timer;
@@ -612,6 +617,9 @@ private:
        //s32 m_daynight_i;
        //u32 m_daynight_ratio;
        std::queue<std::wstring> m_chat_queue;
+       std::queue<std::wstring> m_out_chat_queue;
+       u32 m_last_chat_message_sent;
+       float m_chat_message_allowance;
 
        // The authentication methods we can use to enter sudo mode (=change password)
        u32 m_sudo_auth_methods;