summaryrefslogtreecommitdiff
path: root/src/script/lua_api/l_client.cpp
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/script/lua_api/l_client.cpp
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/script/lua_api/l_client.cpp')
-rw-r--r--src/script/lua_api/l_client.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/script/lua_api/l_client.cpp b/src/script/lua_api/l_client.cpp
index 1077d5f2d..e7d75cce7 100644
--- a/src/script/lua_api/l_client.cpp
+++ b/src/script/lua_api/l_client.cpp
@@ -19,6 +19,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
*/
#include "l_client.h"
+#include "chatmessage.h"
#include "clientenvironment.h"
#include "common/c_content.h"
#include "common/c_converter.h"
@@ -80,7 +81,7 @@ int ModApiClient::l_display_chat_message(lua_State *L)
return 0;
std::string message = luaL_checkstring(L, 1);
- getClient(L)->pushToChatQueue(utf8_to_wide(message));
+ getClient(L)->pushToChatQueue(new ChatMessage(utf8_to_wide(message)));
lua_pushboolean(L, true);
return 1;
}