forked from Mirrorlandia_minetest/minetest
Remove legacy chat network code. (#6954)
This commit is contained in:
parent
11928b7af1
commit
ae6aed15cf
@ -188,7 +188,6 @@ public:
|
|||||||
void handleCommand_BlockData(NetworkPacket* pkt);
|
void handleCommand_BlockData(NetworkPacket* pkt);
|
||||||
void handleCommand_Inventory(NetworkPacket* pkt);
|
void handleCommand_Inventory(NetworkPacket* pkt);
|
||||||
void handleCommand_TimeOfDay(NetworkPacket* pkt);
|
void handleCommand_TimeOfDay(NetworkPacket* pkt);
|
||||||
void handleCommand_ChatMessageOld(NetworkPacket *pkt);
|
|
||||||
void handleCommand_ChatMessage(NetworkPacket *pkt);
|
void handleCommand_ChatMessage(NetworkPacket *pkt);
|
||||||
void handleCommand_ActiveObjectRemoveAdd(NetworkPacket* pkt);
|
void handleCommand_ActiveObjectRemoveAdd(NetworkPacket* pkt);
|
||||||
void handleCommand_ActiveObjectMessages(NetworkPacket* pkt);
|
void handleCommand_ActiveObjectMessages(NetworkPacket* pkt);
|
||||||
|
@ -72,7 +72,7 @@ const ToClientCommandHandler toClientCommandTable[TOCLIENT_NUM_MSG_TYPES] =
|
|||||||
null_command_handler,
|
null_command_handler,
|
||||||
null_command_handler,
|
null_command_handler,
|
||||||
{ "TOCLIENT_CHAT_MESSAGE", TOCLIENT_STATE_CONNECTED, &Client::handleCommand_ChatMessage }, // 0x2F
|
{ "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_REMOVE_ADD", TOCLIENT_STATE_CONNECTED, &Client::handleCommand_ActiveObjectRemoveAdd }, // 0x31
|
||||||
{ "TOCLIENT_ACTIVE_OBJECT_MESSAGES", TOCLIENT_STATE_CONNECTED, &Client::handleCommand_ActiveObjectMessages }, // 0x32
|
{ "TOCLIENT_ACTIVE_OBJECT_MESSAGES", TOCLIENT_STATE_CONNECTED, &Client::handleCommand_ActiveObjectMessages }, // 0x32
|
||||||
{ "TOCLIENT_HP", TOCLIENT_STATE_CONNECTED, &Client::handleCommand_HP }, // 0x33
|
{ "TOCLIENT_HP", TOCLIENT_STATE_CONNECTED, &Client::handleCommand_HP }, // 0x33
|
||||||
|
@ -358,30 +358,6 @@ void Client::handleCommand_TimeOfDay(NetworkPacket* pkt)
|
|||||||
<< " dr=" << dr << std::endl;
|
<< " 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)
|
void Client::handleCommand_ChatMessage(NetworkPacket *pkt)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user