summaryrefslogtreecommitdiff
path: root/src/clientiface.cpp
diff options
context:
space:
mode:
authorLoïc Blot <nerzhul@users.noreply.github.com>2017-04-14 15:34:01 +0200
committerGitHub <noreply@github.com>2017-04-14 15:34:01 +0200
commitb0be7ab61ec9ca04f2618db2d60f75396f205a58 (patch)
tree8b99926f9350a777418dfe0d7bf0c3e22be46b59 /src/clientiface.cpp
parent98286a24bce14627295230fd3b846abf9641c086 (diff)
downloadminetest-b0be7ab61ec9ca04f2618db2d60f75396f205a58.tar.gz
minetest-b0be7ab61ec9ca04f2618db2d60f75396f205a58.tar.bz2
minetest-b0be7ab61ec9ca04f2618db2d60f75396f205a58.zip
ClientIface::sendToAll: honor packet configuration (#5590)
Diffstat (limited to 'src/clientiface.cpp')
-rw-r--r--src/clientiface.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/clientiface.cpp b/src/clientiface.cpp
index 39223d3eb..64fa1c6b7 100644
--- a/src/clientiface.cpp
+++ b/src/clientiface.cpp
@@ -30,6 +30,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "emerge.h"
#include "content_sao.h" // TODO this is used for cleanup of only
#include "log.h"
+#include "network/serveropcodes.h"
#include "util/srp.h"
const char *ClientInterface::statenames[] = {
@@ -678,16 +679,17 @@ void ClientInterface::send(u16 peer_id, u8 channelnum,
m_con->Send(peer_id, channelnum, pkt, reliable);
}
-void ClientInterface::sendToAll(u16 channelnum,
- NetworkPacket* pkt, bool reliable)
+void ClientInterface::sendToAll(NetworkPacket *pkt)
{
MutexAutoLock clientslock(m_clients_mutex);
- for(UNORDERED_MAP<u16, RemoteClient*>::iterator i = m_clients.begin();
- i != m_clients.end(); ++i) {
+ for (UNORDERED_MAP<u16, RemoteClient*>::iterator i = m_clients.begin();
+ i != m_clients.end(); ++i) {
RemoteClient *client = i->second;
if (client->net_proto_version != 0) {
- m_con->Send(client->peer_id, channelnum, pkt, reliable);
+ m_con->Send(client->peer_id,
+ clientCommandFactoryTable[pkt->getCommand()].channel, pkt,
+ clientCommandFactoryTable[pkt->getCommand()].reliable);
}
}
}