aboutsummaryrefslogtreecommitdiff
path: root/src/client.h
diff options
context:
space:
mode:
authorLoïc Blot <nerzhul@users.noreply.github.com>2017-07-16 10:47:31 +0200
committerGitHub <noreply@github.com>2017-07-16 10:47:31 +0200
commit7ddf67aa1478813e12a5fcdfb4986b9e5adfe62f (patch)
tree0bbbee7ed9470e0de149ec9bdaf6a51693ec0e22 /src/client.h
parentecbc972ea6a2371d64b1d9c9576d31be36b8ae6a (diff)
downloadminetest-7ddf67aa1478813e12a5fcdfb4986b9e5adfe62f.tar.gz
minetest-7ddf67aa1478813e12a5fcdfb4986b9e5adfe62f.tar.bz2
minetest-7ddf67aa1478813e12a5fcdfb4986b9e5adfe62f.zip
Chat protocol rewrite (#5117)
* New TOCLIENT_CHAT_MESSAGE packet * Rename old packet to TOCLIENT_CHAT_MESSAGE_OLD for compat * Handle TOCLIENT_CHAT_MESSAGE new structure client side * Client chat queue should use a specific object * SendChatMessage: use the right packet depending on protocol version (not complete yet) * Add chatmessage(type) objects and handle them client side (partially) * Use ChatMessage instead of std::wstring server side * Update with timestamp support
Diffstat (limited to 'src/client.h')
-rw-r--r--src/client.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/client.h b/src/client.h
index 0255b2803..0f0cd8a5e 100644
--- a/src/client.h
+++ b/src/client.h
@@ -43,6 +43,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#define CLIENT_CHAT_MESSAGE_LIMIT_PER_10S 10.0f
struct MeshMakeData;
+struct ChatMessage;
class MapBlockMesh;
class IWritableTextureSource;
class IWritableShaderSource;
@@ -328,7 +329,8 @@ public:
void handleCommand_BlockData(NetworkPacket* pkt);
void handleCommand_Inventory(NetworkPacket* pkt);
void handleCommand_TimeOfDay(NetworkPacket* pkt);
- void handleCommand_ChatMessage(NetworkPacket* pkt);
+ void handleCommand_ChatMessageOld(NetworkPacket *pkt);
+ void handleCommand_ChatMessage(NetworkPacket *pkt);
void handleCommand_ActiveObjectRemoveAdd(NetworkPacket* pkt);
void handleCommand_ActiveObjectMessages(NetworkPacket* pkt);
void handleCommand_Movement(NetworkPacket* pkt);
@@ -520,9 +522,9 @@ public:
void makeScreenshot();
- inline void pushToChatQueue(const std::wstring &input)
+ inline void pushToChatQueue(ChatMessage *cec)
{
- m_chat_queue.push(input);
+ m_chat_queue.push(cec);
}
ClientScripting *getScript() { return m_script; }
@@ -629,10 +631,10 @@ private:
// 0 <= m_daynight_i < DAYNIGHT_CACHE_COUNT
//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 = 5.0f;
+ std::queue<ChatMessage *> m_chat_queue;
// The authentication methods we can use to enter sudo mode (=change password)
u32 m_sudo_auth_methods;