2015-01-12 17:01:41 +01:00
|
|
|
/*
|
|
|
|
Minetest
|
|
|
|
Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>
|
|
|
|
Copyright (C) 2015 nerzhul, Loic Blot <loic.blot@unix-experience.fr>
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU Lesser General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2.1 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU Lesser General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Lesser General Public License along
|
|
|
|
with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "serveropcodes.h"
|
|
|
|
|
|
|
|
const static ToServerCommandHandler null_command_handler = { "TOSERVER_NULL", TOSERVER_STATE_ALL, &Server::handleCommand_Null };
|
|
|
|
|
|
|
|
const ToServerCommandHandler toServerCommandTable[TOSERVER_NUM_MSG_TYPES] =
|
|
|
|
{
|
2015-03-13 14:14:48 +01:00
|
|
|
null_command_handler, // 0x00 (never use this)
|
2015-01-12 17:01:41 +01:00
|
|
|
null_command_handler, // 0x01
|
2015-04-12 04:49:13 +02:00
|
|
|
{ "TOSERVER_INIT", TOSERVER_STATE_NOT_CONNECTED, &Server::handleCommand_Init }, // 0x02
|
|
|
|
null_command_handler, // 0x03
|
2015-01-12 17:01:41 +01:00
|
|
|
null_command_handler, // 0x04
|
|
|
|
null_command_handler, // 0x05
|
|
|
|
null_command_handler, // 0x06
|
|
|
|
null_command_handler, // 0x07
|
|
|
|
null_command_handler, // 0x08
|
|
|
|
null_command_handler, // 0x09
|
|
|
|
null_command_handler, // 0x0a
|
|
|
|
null_command_handler, // 0x0b
|
|
|
|
null_command_handler, // 0x0c
|
|
|
|
null_command_handler, // 0x0d
|
|
|
|
null_command_handler, // 0x0e
|
|
|
|
null_command_handler, // 0x0f
|
2015-03-13 14:14:48 +01:00
|
|
|
{ "TOSERVER_INIT_LEGACY", TOSERVER_STATE_NOT_CONNECTED, &Server::handleCommand_Init_Legacy }, // 0x10
|
2015-01-12 17:01:41 +01:00
|
|
|
{ "TOSERVER_INIT2", TOSERVER_STATE_NOT_CONNECTED, &Server::handleCommand_Init2 }, // 0x11
|
|
|
|
null_command_handler, // 0x12
|
|
|
|
null_command_handler, // 0x13
|
|
|
|
null_command_handler, // 0x14
|
|
|
|
null_command_handler, // 0x15
|
|
|
|
null_command_handler, // 0x16
|
|
|
|
null_command_handler, // 0x17
|
|
|
|
null_command_handler, // 0x18
|
|
|
|
null_command_handler, // 0x19
|
|
|
|
null_command_handler, // 0x1a
|
|
|
|
null_command_handler, // 0x1b
|
|
|
|
null_command_handler, // 0x1c
|
|
|
|
null_command_handler, // 0x1d
|
|
|
|
null_command_handler, // 0x1e
|
|
|
|
null_command_handler, // 0x1f
|
|
|
|
null_command_handler, // 0x20
|
|
|
|
null_command_handler, // 0x21
|
|
|
|
null_command_handler, // 0x22
|
|
|
|
{ "TOSERVER_PLAYERPOS", TOSERVER_STATE_INGAME, &Server::handleCommand_PlayerPos }, // 0x23
|
|
|
|
{ "TOSERVER_GOTBLOCKS", TOSERVER_STATE_STARTUP, &Server::handleCommand_GotBlocks }, // 0x24
|
|
|
|
{ "TOSERVER_DELETEDBLOCKS", TOSERVER_STATE_INGAME, &Server::handleCommand_DeletedBlocks }, // 0x25
|
|
|
|
null_command_handler, // 0x26
|
|
|
|
{ "TOSERVER_CLICK_OBJECT", TOSERVER_STATE_INGAME, &Server::handleCommand_Deprecated }, // 0x27
|
|
|
|
{ "TOSERVER_GROUND_ACTION", TOSERVER_STATE_INGAME, &Server::handleCommand_Deprecated }, // 0x28
|
|
|
|
{ "TOSERVER_RELEASE", TOSERVER_STATE_INGAME, &Server::handleCommand_Deprecated }, // 0x29
|
|
|
|
null_command_handler, // 0x2a
|
|
|
|
null_command_handler, // 0x2b
|
|
|
|
null_command_handler, // 0x2c
|
|
|
|
null_command_handler, // 0x2d
|
|
|
|
null_command_handler, // 0x2e
|
|
|
|
null_command_handler, // 0x2f
|
|
|
|
{ "TOSERVER_SIGNTEXT", TOSERVER_STATE_INGAME, &Server::handleCommand_Deprecated }, // 0x30
|
|
|
|
{ "TOSERVER_INVENTORY_ACTION", TOSERVER_STATE_INGAME, &Server::handleCommand_InventoryAction }, // 0x31
|
|
|
|
{ "TOSERVER_CHAT_MESSAGE", TOSERVER_STATE_INGAME, &Server::handleCommand_ChatMessage }, // 0x32
|
|
|
|
{ "TOSERVER_SIGNNODETEXT", TOSERVER_STATE_INGAME, &Server::handleCommand_Deprecated }, // 0x33
|
|
|
|
{ "TOSERVER_CLICK_ACTIVEOBJECT", TOSERVER_STATE_INGAME, &Server::handleCommand_Deprecated }, // 0x34
|
|
|
|
{ "TOSERVER_DAMAGE", TOSERVER_STATE_INGAME, &Server::handleCommand_Damage }, // 0x35
|
2015-03-13 16:35:21 +01:00
|
|
|
{ "TOSERVER_PASSWORD_LEGACY", TOSERVER_STATE_INGAME, &Server::handleCommand_Password }, // 0x36
|
2015-01-12 17:01:41 +01:00
|
|
|
{ "TOSERVER_PLAYERITEM", TOSERVER_STATE_INGAME, &Server::handleCommand_PlayerItem }, // 0x37
|
|
|
|
{ "TOSERVER_RESPAWN", TOSERVER_STATE_INGAME, &Server::handleCommand_Respawn }, // 0x38
|
|
|
|
{ "TOSERVER_INTERACT", TOSERVER_STATE_INGAME, &Server::handleCommand_Interact }, // 0x39
|
|
|
|
{ "TOSERVER_REMOVED_SOUNDS", TOSERVER_STATE_INGAME, &Server::handleCommand_RemovedSounds }, // 0x3a
|
|
|
|
{ "TOSERVER_NODEMETA_FIELDS", TOSERVER_STATE_INGAME, &Server::handleCommand_NodeMetaFields }, // 0x3b
|
|
|
|
{ "TOSERVER_INVENTORY_FIELDS", TOSERVER_STATE_INGAME, &Server::handleCommand_InventoryFields }, // 0x3c
|
2015-04-12 04:49:13 +02:00
|
|
|
null_command_handler, // 0x3d
|
2015-01-12 17:01:41 +01:00
|
|
|
null_command_handler, // 0x3e
|
|
|
|
null_command_handler, // 0x3f
|
|
|
|
{ "TOSERVER_REQUEST_MEDIA", TOSERVER_STATE_STARTUP, &Server::handleCommand_RequestMedia }, // 0x40
|
2017-04-26 21:10:13 +02:00
|
|
|
{ "TOSERVER_RECEIVED_MEDIA", TOSERVER_STATE_STARTUP, &Server::handleCommand_Deprecated }, // 0x41 not used by the server since protocol version 23
|
2017-01-01 16:13:01 +01:00
|
|
|
{ "TOSERVER_BREATH", TOSERVER_STATE_INGAME, &Server::handleCommand_Deprecated }, // 0x42 Old breath model which is now deprecated for anticheating
|
2015-01-12 17:01:41 +01:00
|
|
|
{ "TOSERVER_CLIENT_READY", TOSERVER_STATE_STARTUP, &Server::handleCommand_ClientReady }, // 0x43
|
2015-04-12 04:49:13 +02:00
|
|
|
null_command_handler, // 0x44
|
|
|
|
null_command_handler, // 0x45
|
|
|
|
null_command_handler, // 0x46
|
|
|
|
null_command_handler, // 0x47
|
|
|
|
null_command_handler, // 0x48
|
|
|
|
null_command_handler, // 0x49
|
|
|
|
null_command_handler, // 0x4a
|
|
|
|
null_command_handler, // 0x4b
|
|
|
|
null_command_handler, // 0x4c
|
|
|
|
null_command_handler, // 0x4d
|
|
|
|
null_command_handler, // 0x4e
|
|
|
|
null_command_handler, // 0x4f
|
|
|
|
{ "TOSERVER_FIRST_SRP", TOSERVER_STATE_NOT_CONNECTED, &Server::handleCommand_FirstSrp }, // 0x50
|
|
|
|
{ "TOSERVER_SRP_BYTES_A", TOSERVER_STATE_NOT_CONNECTED, &Server::handleCommand_SrpBytesA }, // 0x51
|
|
|
|
{ "TOSERVER_SRP_BYTES_M", TOSERVER_STATE_NOT_CONNECTED, &Server::handleCommand_SrpBytesM }, // 0x52
|
2015-01-12 17:01:41 +01:00
|
|
|
};
|
[Patch 2/4] Network rework: packet writing, sending and cleanups
NetworkPacket.cpp:
* Remove some deprecated functions, we must use streaming interface
* m_data converted from u8* to std::vector<u8>
* Add an exporter to forge packet to Connection object
* implement operator << std::wstring. n
* implement operator << std::string
* dynamic resize when write packet content.
* fix string writing and performances.
* create ServerCommandFactory, used by client to get useful informations about packet processing (sending).
* Reliability
* Transmit channel
* Implement putRawString for some ugly char (_INIT packet), and use it.
* Many packet read and write migrated
* Implement oldForgePacket to interface writing with current connection
* fix U8/char/bool writing
* fix string writing and performances.
* add some missing functions
* Use v3s16 read instead of reading x,y,z separately
* Add irr::video::SColor support into packets
* Add some missing handlers
* Add a template function to increase offset
* Throw a serialization error on packet reading (must be improved)
PacketFactories:
* Create ServerCommandFactory, used by client to get useful informations about packet processing (sending).
* Create ClientCommandFactory, used by server to get useful informations about packet processing (sending).
Client.cpp:
* implement NetworkPacket ::Send interface.
* Move packet handlers to a dedicated file
* Remove Client::Send(SharedBuffer)
Server.cpp:
* implement NetworkPacket ::Send interface.
* Rewrite all packets using NetworkPacket
* Move packet handlers to a dedicated file
* Remove Server::Send(SharedBuffer)
ClientIface.cpp:
* Remove sendToAll(SharedBuffer<u8>)
Connection.hpp rework:
* Remove duplicate include
* Remove duplicate negation
* Remove a useless variable
* Improve code performance by using a m_peers_list instead of scanning m_peers map
* Remove Connection::Send(SharedBuffer)
* Fix useafterfree into NetworkPacket Sending
* Remove unused Connection::sendToAll
Test.cpp:
* Remove dead code
* Update tests to use NetworkPackets
Misc:
* add new wrappers to Send packets in client, using NetworkPacket
* Add NetworkPacket methods for Connection
* coding style fix
* dead code since changes cleanup
* Use v3s16 read instead of reading x,y,z separately in some packets
* Use different files to handle packets received by client and server
* Cleanup: Remove useless includes
ok @Zeno-
Tested by @Zeno- @VanessaE and @nerzhul on running servers
2015-01-16 11:37:49 +01:00
|
|
|
|
|
|
|
const static ClientCommandFactory null_command_factory = { "TOCLIENT_NULL", 0, false };
|
|
|
|
|
|
|
|
const ClientCommandFactory clientCommandFactoryTable[TOCLIENT_NUM_MSG_TYPES] =
|
|
|
|
{
|
2015-03-13 14:14:48 +01:00
|
|
|
null_command_factory, // 0x00
|
|
|
|
null_command_factory, // 0x01
|
2015-05-16 01:19:43 +02:00
|
|
|
{ "TOCLIENT_HELLO", 0, true }, // 0x02
|
2015-03-13 16:35:21 +01:00
|
|
|
{ "TOCLIENT_AUTH_ACCEPT", 0, true }, // 0x03
|
2015-04-12 04:49:13 +02:00
|
|
|
{ "TOCLIENT_ACCEPT_SUDO_MODE", 0, true }, // 0x04
|
|
|
|
{ "TOCLIENT_DENY_SUDO_MODE", 0, true }, // 0x05
|
2015-03-13 14:14:48 +01:00
|
|
|
null_command_factory, // 0x06
|
|
|
|
null_command_factory, // 0x07
|
|
|
|
null_command_factory, // 0x08
|
|
|
|
null_command_factory, // 0x09
|
|
|
|
{ "TOCLIENT_ACCESS_DENIED", 0, true }, // 0x0A
|
|
|
|
null_command_factory, // 0x0B
|
|
|
|
null_command_factory, // 0x0C
|
|
|
|
null_command_factory, // 0x0D
|
|
|
|
null_command_factory, // 0x0E
|
|
|
|
null_command_factory, // 0x0F
|
|
|
|
{ "TOCLIENT_INIT", 0, true }, // 0x10
|
[Patch 2/4] Network rework: packet writing, sending and cleanups
NetworkPacket.cpp:
* Remove some deprecated functions, we must use streaming interface
* m_data converted from u8* to std::vector<u8>
* Add an exporter to forge packet to Connection object
* implement operator << std::wstring. n
* implement operator << std::string
* dynamic resize when write packet content.
* fix string writing and performances.
* create ServerCommandFactory, used by client to get useful informations about packet processing (sending).
* Reliability
* Transmit channel
* Implement putRawString for some ugly char (_INIT packet), and use it.
* Many packet read and write migrated
* Implement oldForgePacket to interface writing with current connection
* fix U8/char/bool writing
* fix string writing and performances.
* add some missing functions
* Use v3s16 read instead of reading x,y,z separately
* Add irr::video::SColor support into packets
* Add some missing handlers
* Add a template function to increase offset
* Throw a serialization error on packet reading (must be improved)
PacketFactories:
* Create ServerCommandFactory, used by client to get useful informations about packet processing (sending).
* Create ClientCommandFactory, used by server to get useful informations about packet processing (sending).
Client.cpp:
* implement NetworkPacket ::Send interface.
* Move packet handlers to a dedicated file
* Remove Client::Send(SharedBuffer)
Server.cpp:
* implement NetworkPacket ::Send interface.
* Rewrite all packets using NetworkPacket
* Move packet handlers to a dedicated file
* Remove Server::Send(SharedBuffer)
ClientIface.cpp:
* Remove sendToAll(SharedBuffer<u8>)
Connection.hpp rework:
* Remove duplicate include
* Remove duplicate negation
* Remove a useless variable
* Improve code performance by using a m_peers_list instead of scanning m_peers map
* Remove Connection::Send(SharedBuffer)
* Fix useafterfree into NetworkPacket Sending
* Remove unused Connection::sendToAll
Test.cpp:
* Remove dead code
* Update tests to use NetworkPackets
Misc:
* add new wrappers to Send packets in client, using NetworkPacket
* Add NetworkPacket methods for Connection
* coding style fix
* dead code since changes cleanup
* Use v3s16 read instead of reading x,y,z separately in some packets
* Use different files to handle packets received by client and server
* Cleanup: Remove useless includes
ok @Zeno-
Tested by @Zeno- @VanessaE and @nerzhul on running servers
2015-01-16 11:37:49 +01:00
|
|
|
null_command_factory,
|
|
|
|
null_command_factory,
|
|
|
|
null_command_factory,
|
|
|
|
null_command_factory,
|
|
|
|
null_command_factory,
|
|
|
|
null_command_factory,
|
|
|
|
null_command_factory,
|
|
|
|
null_command_factory,
|
|
|
|
null_command_factory,
|
|
|
|
null_command_factory,
|
|
|
|
null_command_factory,
|
|
|
|
null_command_factory,
|
|
|
|
null_command_factory,
|
|
|
|
null_command_factory,
|
|
|
|
null_command_factory,
|
|
|
|
{ "TOCLIENT_BLOCKDATA", 2, true }, // 0x20
|
|
|
|
{ "TOCLIENT_ADDNODE", 0, true }, // 0x21
|
|
|
|
{ "TOCLIENT_REMOVENODE", 0, true }, // 0x22
|
|
|
|
null_command_factory,
|
|
|
|
null_command_factory,
|
|
|
|
null_command_factory,
|
|
|
|
null_command_factory,
|
|
|
|
{ "TOCLIENT_INVENTORY", 0, true }, // 0x27
|
|
|
|
null_command_factory,
|
|
|
|
{ "TOCLIENT_TIME_OF_DAY", 0, true }, // 0x29
|
2017-07-18 21:39:55 +02:00
|
|
|
{ "TOCLIENT_CSM_FLAVOUR_LIMITS", 0, true }, // 0x2A
|
[Patch 2/4] Network rework: packet writing, sending and cleanups
NetworkPacket.cpp:
* Remove some deprecated functions, we must use streaming interface
* m_data converted from u8* to std::vector<u8>
* Add an exporter to forge packet to Connection object
* implement operator << std::wstring. n
* implement operator << std::string
* dynamic resize when write packet content.
* fix string writing and performances.
* create ServerCommandFactory, used by client to get useful informations about packet processing (sending).
* Reliability
* Transmit channel
* Implement putRawString for some ugly char (_INIT packet), and use it.
* Many packet read and write migrated
* Implement oldForgePacket to interface writing with current connection
* fix U8/char/bool writing
* fix string writing and performances.
* add some missing functions
* Use v3s16 read instead of reading x,y,z separately
* Add irr::video::SColor support into packets
* Add some missing handlers
* Add a template function to increase offset
* Throw a serialization error on packet reading (must be improved)
PacketFactories:
* Create ServerCommandFactory, used by client to get useful informations about packet processing (sending).
* Create ClientCommandFactory, used by server to get useful informations about packet processing (sending).
Client.cpp:
* implement NetworkPacket ::Send interface.
* Move packet handlers to a dedicated file
* Remove Client::Send(SharedBuffer)
Server.cpp:
* implement NetworkPacket ::Send interface.
* Rewrite all packets using NetworkPacket
* Move packet handlers to a dedicated file
* Remove Server::Send(SharedBuffer)
ClientIface.cpp:
* Remove sendToAll(SharedBuffer<u8>)
Connection.hpp rework:
* Remove duplicate include
* Remove duplicate negation
* Remove a useless variable
* Improve code performance by using a m_peers_list instead of scanning m_peers map
* Remove Connection::Send(SharedBuffer)
* Fix useafterfree into NetworkPacket Sending
* Remove unused Connection::sendToAll
Test.cpp:
* Remove dead code
* Update tests to use NetworkPackets
Misc:
* add new wrappers to Send packets in client, using NetworkPacket
* Add NetworkPacket methods for Connection
* coding style fix
* dead code since changes cleanup
* Use v3s16 read instead of reading x,y,z separately in some packets
* Use different files to handle packets received by client and server
* Cleanup: Remove useless includes
ok @Zeno-
Tested by @Zeno- @VanessaE and @nerzhul on running servers
2015-01-16 11:37:49 +01:00
|
|
|
null_command_factory,
|
|
|
|
null_command_factory,
|
|
|
|
null_command_factory,
|
|
|
|
null_command_factory,
|
2017-07-16 10:47:31 +02:00
|
|
|
{ "TOCLIENT_CHAT_MESSAGE", 0, true }, // 0x2F
|
|
|
|
{ "TOCLIENT_CHAT_MESSAGE_OLD", 0, true }, // 0x30
|
[Patch 2/4] Network rework: packet writing, sending and cleanups
NetworkPacket.cpp:
* Remove some deprecated functions, we must use streaming interface
* m_data converted from u8* to std::vector<u8>
* Add an exporter to forge packet to Connection object
* implement operator << std::wstring. n
* implement operator << std::string
* dynamic resize when write packet content.
* fix string writing and performances.
* create ServerCommandFactory, used by client to get useful informations about packet processing (sending).
* Reliability
* Transmit channel
* Implement putRawString for some ugly char (_INIT packet), and use it.
* Many packet read and write migrated
* Implement oldForgePacket to interface writing with current connection
* fix U8/char/bool writing
* fix string writing and performances.
* add some missing functions
* Use v3s16 read instead of reading x,y,z separately
* Add irr::video::SColor support into packets
* Add some missing handlers
* Add a template function to increase offset
* Throw a serialization error on packet reading (must be improved)
PacketFactories:
* Create ServerCommandFactory, used by client to get useful informations about packet processing (sending).
* Create ClientCommandFactory, used by server to get useful informations about packet processing (sending).
Client.cpp:
* implement NetworkPacket ::Send interface.
* Move packet handlers to a dedicated file
* Remove Client::Send(SharedBuffer)
Server.cpp:
* implement NetworkPacket ::Send interface.
* Rewrite all packets using NetworkPacket
* Move packet handlers to a dedicated file
* Remove Server::Send(SharedBuffer)
ClientIface.cpp:
* Remove sendToAll(SharedBuffer<u8>)
Connection.hpp rework:
* Remove duplicate include
* Remove duplicate negation
* Remove a useless variable
* Improve code performance by using a m_peers_list instead of scanning m_peers map
* Remove Connection::Send(SharedBuffer)
* Fix useafterfree into NetworkPacket Sending
* Remove unused Connection::sendToAll
Test.cpp:
* Remove dead code
* Update tests to use NetworkPackets
Misc:
* add new wrappers to Send packets in client, using NetworkPacket
* Add NetworkPacket methods for Connection
* coding style fix
* dead code since changes cleanup
* Use v3s16 read instead of reading x,y,z separately in some packets
* Use different files to handle packets received by client and server
* Cleanup: Remove useless includes
ok @Zeno-
Tested by @Zeno- @VanessaE and @nerzhul on running servers
2015-01-16 11:37:49 +01:00
|
|
|
{ "TOCLIENT_ACTIVE_OBJECT_REMOVE_ADD", 0, true }, // 0x31
|
|
|
|
{ "TOCLIENT_ACTIVE_OBJECT_MESSAGES", 0, true }, // 0x32 Special packet, sent by 0 (rel) and 1 (unrel) channel
|
|
|
|
{ "TOCLIENT_HP", 0, true }, // 0x33
|
|
|
|
{ "TOCLIENT_MOVE_PLAYER", 0, true }, // 0x34
|
2015-03-13 14:14:48 +01:00
|
|
|
{ "TOCLIENT_ACCESS_DENIED_LEGACY", 0, true }, // 0x35
|
[Patch 2/4] Network rework: packet writing, sending and cleanups
NetworkPacket.cpp:
* Remove some deprecated functions, we must use streaming interface
* m_data converted from u8* to std::vector<u8>
* Add an exporter to forge packet to Connection object
* implement operator << std::wstring. n
* implement operator << std::string
* dynamic resize when write packet content.
* fix string writing and performances.
* create ServerCommandFactory, used by client to get useful informations about packet processing (sending).
* Reliability
* Transmit channel
* Implement putRawString for some ugly char (_INIT packet), and use it.
* Many packet read and write migrated
* Implement oldForgePacket to interface writing with current connection
* fix U8/char/bool writing
* fix string writing and performances.
* add some missing functions
* Use v3s16 read instead of reading x,y,z separately
* Add irr::video::SColor support into packets
* Add some missing handlers
* Add a template function to increase offset
* Throw a serialization error on packet reading (must be improved)
PacketFactories:
* Create ServerCommandFactory, used by client to get useful informations about packet processing (sending).
* Create ClientCommandFactory, used by server to get useful informations about packet processing (sending).
Client.cpp:
* implement NetworkPacket ::Send interface.
* Move packet handlers to a dedicated file
* Remove Client::Send(SharedBuffer)
Server.cpp:
* implement NetworkPacket ::Send interface.
* Rewrite all packets using NetworkPacket
* Move packet handlers to a dedicated file
* Remove Server::Send(SharedBuffer)
ClientIface.cpp:
* Remove sendToAll(SharedBuffer<u8>)
Connection.hpp rework:
* Remove duplicate include
* Remove duplicate negation
* Remove a useless variable
* Improve code performance by using a m_peers_list instead of scanning m_peers map
* Remove Connection::Send(SharedBuffer)
* Fix useafterfree into NetworkPacket Sending
* Remove unused Connection::sendToAll
Test.cpp:
* Remove dead code
* Update tests to use NetworkPackets
Misc:
* add new wrappers to Send packets in client, using NetworkPacket
* Add NetworkPacket methods for Connection
* coding style fix
* dead code since changes cleanup
* Use v3s16 read instead of reading x,y,z separately in some packets
* Use different files to handle packets received by client and server
* Cleanup: Remove useless includes
ok @Zeno-
Tested by @Zeno- @VanessaE and @nerzhul on running servers
2015-01-16 11:37:49 +01:00
|
|
|
{ "TOCLIENT_PLAYERITEM", 0, false }, // 0x36 obsolete
|
|
|
|
{ "TOCLIENT_DEATHSCREEN", 0, true }, // 0x37
|
|
|
|
{ "TOCLIENT_MEDIA", 2, true }, // 0x38
|
|
|
|
{ "TOCLIENT_TOOLDEF", 0, false }, // 0x39 obsolete
|
|
|
|
{ "TOCLIENT_NODEDEF", 0, true }, // 0x3a
|
|
|
|
{ "TOCLIENT_CRAFTITEMDEF", 0, false }, // 0x3b obsolete
|
|
|
|
{ "TOCLIENT_ANNOUNCE_MEDIA", 0, true }, // 0x3c
|
|
|
|
{ "TOCLIENT_ITEMDEF", 0, true }, // 0x3d
|
|
|
|
null_command_factory,
|
|
|
|
{ "TOCLIENT_PLAY_SOUND", 0, true }, // 0x3f
|
|
|
|
{ "TOCLIENT_STOP_SOUND", 0, true }, // 0x40
|
|
|
|
{ "TOCLIENT_PRIVILEGES", 0, true }, // 0x41
|
|
|
|
{ "TOCLIENT_INVENTORY_FORMSPEC", 0, true }, // 0x42
|
|
|
|
{ "TOCLIENT_DETACHED_INVENTORY", 0, true }, // 0x43
|
|
|
|
{ "TOCLIENT_SHOW_FORMSPEC", 0, true }, // 0x44
|
|
|
|
{ "TOCLIENT_MOVEMENT", 0, true }, // 0x45
|
|
|
|
{ "TOCLIENT_SPAWN_PARTICLE", 0, true }, // 0x46
|
|
|
|
{ "TOCLIENT_ADD_PARTICLESPAWNER", 0, true }, // 0x47
|
2015-03-13 13:40:48 +01:00
|
|
|
{ "TOCLIENT_DELETE_PARTICLESPAWNER_LEGACY", 0, true }, // 0x48
|
[Patch 2/4] Network rework: packet writing, sending and cleanups
NetworkPacket.cpp:
* Remove some deprecated functions, we must use streaming interface
* m_data converted from u8* to std::vector<u8>
* Add an exporter to forge packet to Connection object
* implement operator << std::wstring. n
* implement operator << std::string
* dynamic resize when write packet content.
* fix string writing and performances.
* create ServerCommandFactory, used by client to get useful informations about packet processing (sending).
* Reliability
* Transmit channel
* Implement putRawString for some ugly char (_INIT packet), and use it.
* Many packet read and write migrated
* Implement oldForgePacket to interface writing with current connection
* fix U8/char/bool writing
* fix string writing and performances.
* add some missing functions
* Use v3s16 read instead of reading x,y,z separately
* Add irr::video::SColor support into packets
* Add some missing handlers
* Add a template function to increase offset
* Throw a serialization error on packet reading (must be improved)
PacketFactories:
* Create ServerCommandFactory, used by client to get useful informations about packet processing (sending).
* Create ClientCommandFactory, used by server to get useful informations about packet processing (sending).
Client.cpp:
* implement NetworkPacket ::Send interface.
* Move packet handlers to a dedicated file
* Remove Client::Send(SharedBuffer)
Server.cpp:
* implement NetworkPacket ::Send interface.
* Rewrite all packets using NetworkPacket
* Move packet handlers to a dedicated file
* Remove Server::Send(SharedBuffer)
ClientIface.cpp:
* Remove sendToAll(SharedBuffer<u8>)
Connection.hpp rework:
* Remove duplicate include
* Remove duplicate negation
* Remove a useless variable
* Improve code performance by using a m_peers_list instead of scanning m_peers map
* Remove Connection::Send(SharedBuffer)
* Fix useafterfree into NetworkPacket Sending
* Remove unused Connection::sendToAll
Test.cpp:
* Remove dead code
* Update tests to use NetworkPackets
Misc:
* add new wrappers to Send packets in client, using NetworkPacket
* Add NetworkPacket methods for Connection
* coding style fix
* dead code since changes cleanup
* Use v3s16 read instead of reading x,y,z separately in some packets
* Use different files to handle packets received by client and server
* Cleanup: Remove useless includes
ok @Zeno-
Tested by @Zeno- @VanessaE and @nerzhul on running servers
2015-01-16 11:37:49 +01:00
|
|
|
{ "TOCLIENT_HUDADD", 1, true }, // 0x49
|
|
|
|
{ "TOCLIENT_HUDRM", 1, true }, // 0x4a
|
|
|
|
{ "TOCLIENT_HUDCHANGE", 0, true }, // 0x4b
|
|
|
|
{ "TOCLIENT_HUD_SET_FLAGS", 0, true }, // 0x4c
|
|
|
|
{ "TOCLIENT_HUD_SET_PARAM", 0, true }, // 0x4d
|
|
|
|
{ "TOCLIENT_BREATH", 0, true }, // 0x4e
|
|
|
|
{ "TOCLIENT_SET_SKY", 0, true }, // 0x4f
|
|
|
|
{ "TOCLIENT_OVERRIDE_DAY_NIGHT_RATIO", 0, true }, // 0x50
|
|
|
|
{ "TOCLIENT_LOCAL_PLAYER_ANIMATIONS", 0, true }, // 0x51
|
|
|
|
{ "TOCLIENT_EYE_OFFSET", 0, true }, // 0x52
|
2015-03-13 14:14:48 +01:00
|
|
|
{ "TOCLIENT_DELETE_PARTICLESPAWNER", 0, true }, // 0x53
|
2017-03-17 10:39:47 +01:00
|
|
|
{ "TOCLIENT_CLOUD_PARAMS", 0, true }, // 0x54
|
2017-05-05 20:21:04 +02:00
|
|
|
{ "TOCLIENT_FADE_SOUND", 0, true }, // 0x55
|
2017-06-08 15:30:09 +02:00
|
|
|
{ "TOCLIENT_UPDATE_PLAYER_LIST", 0, true }, // 0x56
|
2015-04-12 04:49:13 +02:00
|
|
|
null_command_factory,
|
|
|
|
null_command_factory,
|
|
|
|
null_command_factory,
|
|
|
|
null_command_factory,
|
|
|
|
null_command_factory,
|
|
|
|
null_command_factory,
|
|
|
|
null_command_factory,
|
|
|
|
null_command_factory,
|
|
|
|
null_command_factory,
|
|
|
|
{ "TOSERVER_SRP_BYTES_S_B", 0, true }, // 0x60
|
[Patch 2/4] Network rework: packet writing, sending and cleanups
NetworkPacket.cpp:
* Remove some deprecated functions, we must use streaming interface
* m_data converted from u8* to std::vector<u8>
* Add an exporter to forge packet to Connection object
* implement operator << std::wstring. n
* implement operator << std::string
* dynamic resize when write packet content.
* fix string writing and performances.
* create ServerCommandFactory, used by client to get useful informations about packet processing (sending).
* Reliability
* Transmit channel
* Implement putRawString for some ugly char (_INIT packet), and use it.
* Many packet read and write migrated
* Implement oldForgePacket to interface writing with current connection
* fix U8/char/bool writing
* fix string writing and performances.
* add some missing functions
* Use v3s16 read instead of reading x,y,z separately
* Add irr::video::SColor support into packets
* Add some missing handlers
* Add a template function to increase offset
* Throw a serialization error on packet reading (must be improved)
PacketFactories:
* Create ServerCommandFactory, used by client to get useful informations about packet processing (sending).
* Create ClientCommandFactory, used by server to get useful informations about packet processing (sending).
Client.cpp:
* implement NetworkPacket ::Send interface.
* Move packet handlers to a dedicated file
* Remove Client::Send(SharedBuffer)
Server.cpp:
* implement NetworkPacket ::Send interface.
* Rewrite all packets using NetworkPacket
* Move packet handlers to a dedicated file
* Remove Server::Send(SharedBuffer)
ClientIface.cpp:
* Remove sendToAll(SharedBuffer<u8>)
Connection.hpp rework:
* Remove duplicate include
* Remove duplicate negation
* Remove a useless variable
* Improve code performance by using a m_peers_list instead of scanning m_peers map
* Remove Connection::Send(SharedBuffer)
* Fix useafterfree into NetworkPacket Sending
* Remove unused Connection::sendToAll
Test.cpp:
* Remove dead code
* Update tests to use NetworkPackets
Misc:
* add new wrappers to Send packets in client, using NetworkPacket
* Add NetworkPacket methods for Connection
* coding style fix
* dead code since changes cleanup
* Use v3s16 read instead of reading x,y,z separately in some packets
* Use different files to handle packets received by client and server
* Cleanup: Remove useless includes
ok @Zeno-
Tested by @Zeno- @VanessaE and @nerzhul on running servers
2015-01-16 11:37:49 +01:00
|
|
|
};
|