Fix a little regression on SendActiveObjectMessages which send all TOCLIENT_ACTIVE_OB...
authorLoic Blot <loic.blot@unix-experience.fr>
Tue, 17 Mar 2015 08:16:39 +0000 (09:16 +0100)
committerLoic Blot <loic.blot@unix-experience.fr>
Tue, 17 Mar 2015 08:16:39 +0000 (09:16 +0100)
src/server.cpp
src/server.h

index 35405851fa85260240b44fe41f0de61c4a98de7f..18968cdf98c7d700eb86e33e8bfb4989516361dd 100644 (file)
@@ -845,7 +845,7 @@ void Server::AsyncRunStep(bool initial_step)
                        }
 
                        if(unreliable_data.size() > 0) {
-                               SendActiveObjectMessages(client->peer_id, unreliable_data);
+                               SendActiveObjectMessages(client->peer_id, unreliable_data, false);
                        }
                }
                m_clients.Unlock();
@@ -1893,13 +1893,17 @@ u32 Server::SendActiveObjectRemoveAdd(u16 peer_id, const std::string &datas)
        return pkt.getSize();
 }
 
-void Server::SendActiveObjectMessages(u16 peer_id, const std::string &datas)
+void Server::SendActiveObjectMessages(u16 peer_id, const std::string &datas, bool reliable)
 {
        NetworkPacket pkt(TOCLIENT_ACTIVE_OBJECT_MESSAGES,
                        0, peer_id);
 
        pkt.putRawString(datas.c_str(), datas.size());
-       Send(&pkt);
+
+       m_clients.send(pkt.getPeerId(),
+                       clientCommandFactoryTable[pkt.getCommand()].channel,
+                       &pkt, reliable);
+
 }
 
 s32 Server::playSound(const SimpleSoundSpec &spec,
index 900a1eaaa7e1ff8ecfe55082a1ef39ebee3032f6..f62b5b66070a6a03c1fde915371929efa4bd16ff 100644 (file)
@@ -464,7 +464,7 @@ private:
                bool collisiondetection, bool vertical, std::string texture);
 
        u32 SendActiveObjectRemoveAdd(u16 peer_id, const std::string &datas);
-       void SendActiveObjectMessages(u16 peer_id, const std::string &datas);
+       void SendActiveObjectMessages(u16 peer_id, const std::string &datas, bool reliable = true);
        /*
                Something random
        */