Fix #5655 (#5658)
authorred-001 <red-001@outlook.ie>
Wed, 26 Apr 2017 19:10:13 +0000 (20:10 +0100)
committerLoïc Blot <nerzhul@users.noreply.github.com>
Wed, 26 Apr 2017 19:10:13 +0000 (21:10 +0200)
Client: Don't send `TOSERVER_RECEIVED_MEDIA` since it's not used anymore
Server: Handle `TOSERVER_RECEIVED_MEDIA` using `Server::handleCommand_Deprecated`

src/client.cpp
src/client.h
src/network/networkprotocol.h
src/network/serveropcodes.cpp

index 19fe9b0ba39e12c9d1536fab7cf7da465bd9974c..019693f1da3be9b7d57e2d6454b4c5b7670d6371 100644 (file)
@@ -526,7 +526,6 @@ void Client::step(float dtime)
        if (m_media_downloader && m_media_downloader->isStarted()) {
                m_media_downloader->step(this);
                if (m_media_downloader->isDone()) {
-                       received_media();
                        delete m_media_downloader;
                        m_media_downloader = NULL;
                }
@@ -747,14 +746,6 @@ void Client::request_media(const std::vector<std::string> &file_requests)
                        << file_requests.size() << " files. packet size)" << std::endl;
 }
 
-void Client::received_media()
-{
-       NetworkPacket pkt(TOSERVER_RECEIVED_MEDIA, 0);
-       Send(&pkt);
-       infostream << "Client: Notifying server that we received all media"
-                       << std::endl;
-}
-
 void Client::initLocalMapSaving(const Address &address,
                const std::string &hostname,
                bool is_local_server)
index 328a24f9002075991cf0dfbd3843f43e47f0d552..68953d40216fe3e2150bc44d28cab4f4944f50d9 100644 (file)
@@ -484,8 +484,6 @@ public:
        bool loadMedia(const std::string &data, const std::string &filename);
        // Send a request for conventional media transfer
        void request_media(const std::vector<std::string> &file_requests);
-       // Send a notification that no conventional media transfer is needed
-       void received_media();
 
        LocalClientState getState() { return m_state; }
 
index cf60b3a108ad5a2ba5955f283313ce9fbc8a0053..e7a3469b73a8f048192653ada38c23fe6459dc66 100644 (file)
@@ -106,7 +106,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
                add swap_node
        PROTOCOL_VERSION 23:
                Obsolete TOSERVER_RECEIVED_MEDIA
-               Add TOSERVER_CLIENT_READY
+               Server: Stop using TOSERVER_CLIENT_READY
        PROTOCOL_VERSION 24:
                ContentFeatures version 7
                ContentFeatures: change number of special tiles to 6 (CF_SPECIAL_COUNT)
@@ -152,6 +152,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
                        with pre-30 clients by sending sqrt(visual_scale)
        PROTOCOL VERSION 31:
                Add tile overlay
+               Stop sending TOSERVER_CLIENT_READY
 */
 
 #define LATEST_PROTOCOL_VERSION 31
index 7133259e0c8fb9fdd1aafe268454496b0e97207d..31b571ff04d5debda29d2e6c5246dd75cf1b25ab 100644 (file)
@@ -89,7 +89,7 @@ const ToServerCommandHandler toServerCommandTable[TOSERVER_NUM_MSG_TYPES] =
        null_command_handler, // 0x3e
        null_command_handler, // 0x3f
        { "TOSERVER_REQUEST_MEDIA",            TOSERVER_STATE_STARTUP, &Server::handleCommand_RequestMedia }, // 0x40
-       null_command_handler, // 0x41
+       { "TOSERVER_RECEIVED_MEDIA",           TOSERVER_STATE_STARTUP, &Server::handleCommand_Deprecated }, // 0x41 not used by the server since protocol version 23
        { "TOSERVER_BREATH",                   TOSERVER_STATE_INGAME, &Server::handleCommand_Deprecated }, // 0x42 Old breath model which is now deprecated for anticheating
        { "TOSERVER_CLIENT_READY",             TOSERVER_STATE_STARTUP, &Server::handleCommand_ClientReady }, // 0x43
        null_command_handler, // 0x44