aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLoic Blot <loic.blot@unix-experience.fr>2015-03-17 09:16:39 +0100
committerLoic Blot <loic.blot@unix-experience.fr>2015-03-17 09:16:39 +0100
commitbfc4652c668f7fffc134d461800d9fe4f0055837 (patch)
treec5221f4bf9e30d19464f5b16cddb8dafe1b408a1
parentdbe5a446c3de175a30f1e7070c8623e975a6e48f (diff)
downloadminetest-bfc4652c668f7fffc134d461800d9fe4f0055837.tar.gz
minetest-bfc4652c668f7fffc134d461800d9fe4f0055837.tar.bz2
minetest-bfc4652c668f7fffc134d461800d9fe4f0055837.zip
Fix a little regression on SendActiveObjectMessages which send all TOCLIENT_ACTIVE_OBJECT_MESSAGES as reliable
-rw-r--r--src/server.cpp10
-rw-r--r--src/server.h2
2 files changed, 8 insertions, 4 deletions
diff --git a/src/server.cpp b/src/server.cpp
index 35405851f..18968cdf9 100644
--- a/src/server.cpp
+++ b/src/server.cpp
@@ -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,
diff --git a/src/server.h b/src/server.h
index 900a1eaaa..f62b5b660 100644
--- a/src/server.h
+++ b/src/server.h
@@ -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
*/