- m_con->Send(client->peer_id, channelnum, pkt, reliable);
+ m_con->Send(client->peer_id,
+ clientCommandFactoryTable[pkt->getCommand()].channel, pkt,
+ clientCommandFactoryTable[pkt->getCommand()].reliable);
+ }
+ }
+}
+
+void ClientInterface::sendToAllCompat(NetworkPacket *pkt, NetworkPacket *legacypkt,
+ u16 min_proto_ver)
+{
+ RecursiveMutexAutoLock clientslock(m_clients_mutex);
+ for (auto &client_it : m_clients) {
+ RemoteClient *client = client_it.second;
+ NetworkPacket *pkt_to_send = nullptr;
+
+ if (client->net_proto_version >= min_proto_ver) {
+ pkt_to_send = pkt;
+ } else if (client->net_proto_version != 0) {
+ pkt_to_send = legacypkt;
+ } else {
+ warningstream << "Client with unhandled version to handle: '"
+ << client->net_proto_version << "'";
+ continue;