From ae6aed15cfd95e6efbdcf4eb1f6de2697acd8c13 Mon Sep 17 00:00:00 2001 From: red-001 Date: Sat, 17 Feb 2018 18:23:21 +0000 Subject: Remove legacy chat network code. (#6954) --- src/client.h | 1 - src/network/clientopcodes.cpp | 2 +- src/network/clientpackethandler.cpp | 24 ------------------------ 3 files changed, 1 insertion(+), 26 deletions(-) (limited to 'src') diff --git a/src/client.h b/src/client.h index 10158dc5c..8b8923f29 100644 --- a/src/client.h +++ b/src/client.h @@ -188,7 +188,6 @@ public: void handleCommand_BlockData(NetworkPacket* pkt); void handleCommand_Inventory(NetworkPacket* pkt); void handleCommand_TimeOfDay(NetworkPacket* pkt); - void handleCommand_ChatMessageOld(NetworkPacket *pkt); void handleCommand_ChatMessage(NetworkPacket *pkt); void handleCommand_ActiveObjectRemoveAdd(NetworkPacket* pkt); void handleCommand_ActiveObjectMessages(NetworkPacket* pkt); diff --git a/src/network/clientopcodes.cpp b/src/network/clientopcodes.cpp index bc5bd37dd..929827529 100644 --- a/src/network/clientopcodes.cpp +++ b/src/network/clientopcodes.cpp @@ -72,7 +72,7 @@ const ToClientCommandHandler toClientCommandTable[TOCLIENT_NUM_MSG_TYPES] = null_command_handler, null_command_handler, { "TOCLIENT_CHAT_MESSAGE", TOCLIENT_STATE_CONNECTED, &Client::handleCommand_ChatMessage }, // 0x2F - { "TOCLIENT_CHAT_MESSAGE_OLD", TOCLIENT_STATE_CONNECTED, &Client::handleCommand_ChatMessageOld }, // 0x30 + null_command_handler, // 0x30 { "TOCLIENT_ACTIVE_OBJECT_REMOVE_ADD", TOCLIENT_STATE_CONNECTED, &Client::handleCommand_ActiveObjectRemoveAdd }, // 0x31 { "TOCLIENT_ACTIVE_OBJECT_MESSAGES", TOCLIENT_STATE_CONNECTED, &Client::handleCommand_ActiveObjectMessages }, // 0x32 { "TOCLIENT_HP", TOCLIENT_STATE_CONNECTED, &Client::handleCommand_HP }, // 0x33 diff --git a/src/network/clientpackethandler.cpp b/src/network/clientpackethandler.cpp index aa4d8c244..07a38e397 100644 --- a/src/network/clientpackethandler.cpp +++ b/src/network/clientpackethandler.cpp @@ -358,30 +358,6 @@ void Client::handleCommand_TimeOfDay(NetworkPacket* pkt) << " dr=" << dr << std::endl; } -void Client::handleCommand_ChatMessageOld(NetworkPacket *pkt) -{ - /* - u16 command - u16 length - wstring message - */ - u16 len, read_wchar; - - *pkt >> len; - - std::wstring message; - for (u32 i = 0; i < len; i++) { - *pkt >> read_wchar; - message += (wchar_t)read_wchar; - } - - // If chat message not consummed by client lua API - // @TODO send this to CSM using ChatMessage object - if (!moddingEnabled() || !m_script->on_receiving_message(wide_to_utf8(message))) { - pushToChatQueue(new ChatMessage(message)); - } -} - void Client::handleCommand_ChatMessage(NetworkPacket *pkt) { /* -- cgit v1.2.3