@@ -30,6 +30,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
3030#include " emerge.h"
3131#include " content_sao.h" // TODO this is used for cleanup of only
3232#include " log.h"
33+ #include " network/serveropcodes.h"
3334#include " util/srp.h"
3435
3536const char *ClientInterface::statenames[] = {
@@ -678,16 +679,17 @@ void ClientInterface::send(u16 peer_id, u8 channelnum,
678679 m_con->Send (peer_id, channelnum, pkt, reliable);
679680}
680681
681- void ClientInterface::sendToAll (u16 channelnum,
682- NetworkPacket* pkt, bool reliable)
682+ void ClientInterface::sendToAll (NetworkPacket *pkt)
683683{
684684 MutexAutoLock clientslock (m_clients_mutex);
685- for (UNORDERED_MAP<u16 , RemoteClient*>::iterator i = m_clients.begin ();
686- i != m_clients.end (); ++i) {
685+ for (UNORDERED_MAP<u16 , RemoteClient*>::iterator i = m_clients.begin ();
686+ i != m_clients.end (); ++i) {
687687 RemoteClient *client = i->second ;
688688
689689 if (client->net_proto_version != 0 ) {
690- m_con->Send (client->peer_id , channelnum, pkt, reliable);
690+ m_con->Send (client->peer_id ,
691+ clientCommandFactoryTable[pkt->getCommand ()].channel , pkt,
692+ clientCommandFactoryTable[pkt->getCommand ()].reliable );
691693 }
692694 }
693695}
0 commit comments