diff options
Diffstat (limited to 'src/network')
| -rw-r--r-- | src/network/clientopcodes.cpp | 1 | ||||
| -rw-r--r-- | src/network/clientpackethandler.cpp | 8 | ||||
| -rw-r--r-- | src/network/networkprotocol.h | 14 | ||||
| -rw-r--r-- | src/network/serveropcodes.cpp | 1 |
4 files changed, 21 insertions, 3 deletions
diff --git a/src/network/clientopcodes.cpp b/src/network/clientopcodes.cpp index 431455b76..e3afc0e36 100644 --- a/src/network/clientopcodes.cpp +++ b/src/network/clientopcodes.cpp @@ -122,6 +122,7 @@ const ToClientCommandHandler toClientCommandTable[TOCLIENT_NUM_MSG_TYPES] = null_command_handler, { "TOCLIENT_SRP_BYTES_S_B", TOCLIENT_STATE_NOT_CONNECTED, &Client::handleCommand_SrpBytesSandB }, // 0x60 { "TOCLIENT_FORMSPEC_PREPEND", TOCLIENT_STATE_CONNECTED, &Client::handleCommand_FormspecPrepend }, // 0x61, + { "TOCLIENT_REDIRECT", TOCLIENT_STATE_CONNECTED, &Client::handleCommand_Redirect }, // 0x62, }; const static ServerCommandFactory null_command_factory = { "TOSERVER_NULL", 0, false }; diff --git a/src/network/clientpackethandler.cpp b/src/network/clientpackethandler.cpp index 432fb415e..0fa15858f 100644 --- a/src/network/clientpackethandler.cpp +++ b/src/network/clientpackethandler.cpp @@ -1493,6 +1493,14 @@ void Client::handleCommand_FormspecPrepend(NetworkPacket *pkt) *pkt >> player->formspec_prepend; } +void Client::handleCommand_Redirect(NetworkPacket *pkt) +{ + std::string address; + u16 port; + *pkt >> address >> port; + errorstream << address << ":" << port << std::endl; +} + void Client::handleCommand_CSMRestrictionFlags(NetworkPacket *pkt) { *pkt >> m_csm_restriction_flags >> m_csm_restriction_noderange; diff --git a/src/network/networkprotocol.h b/src/network/networkprotocol.h index d3799868b..fc45804a7 100644 --- a/src/network/networkprotocol.h +++ b/src/network/networkprotocol.h @@ -204,9 +204,11 @@ with this program; if not, write to the Free Software Foundation, Inc., PROTOCOL VERSION 39: Updated set_sky packet Adds new sun, moon and stars packets + PROTOCOL VERSION 40: + Added TOCLIENT_REDIRECT */ -#define LATEST_PROTOCOL_VERSION 39 +#define LATEST_PROTOCOL_VERSION 40 #define LATEST_PROTOCOL_VERSION_STRING TOSTRING(LATEST_PROTOCOL_VERSION) // Server's supported network protocol range @@ -748,8 +750,14 @@ enum ToClientCommand u16 len u8[len] formspec */ - - TOCLIENT_NUM_MSG_TYPES = 0x62, + + TOCLIENT_REDIRECT = 0x62, + /* + std::string address + u16 port + */ + + TOCLIENT_NUM_MSG_TYPES = 0x63, }; enum ToServerCommand diff --git a/src/network/serveropcodes.cpp b/src/network/serveropcodes.cpp index cca2e56ea..c12ee2b2e 100644 --- a/src/network/serveropcodes.cpp +++ b/src/network/serveropcodes.cpp @@ -211,4 +211,5 @@ const ClientCommandFactory clientCommandFactoryTable[TOCLIENT_NUM_MSG_TYPES] = null_command_factory, // 0x5f { "TOSERVER_SRP_BYTES_S_B", 0, true }, // 0x60 { "TOCLIENT_FORMSPEC_PREPEND", 0, true }, // 0x61 + { "TOCLIENT_REDIRECT", 0, true }, // 0x62 }; |
