Fixed banning users: it didn't work because we tried to send a Reliable packet using sendUnreliablePacket()

This commit is contained in:
Oren Hurvitz 2018-04-16 15:36:37 +03:00
parent 7f285c5f90
commit e610443353

View file

@ -769,8 +769,14 @@ unsigned int LimitedNodeList::broadcastToNodes(std::unique_ptr<NLPacket> packet,
eachNode([&](const SharedNodePointer& node){
if (node && destinationNodeTypes.contains(node->getType())) {
sendUnreliablePacket(*packet, *node);
++n;
if (packet->isReliable()) {
auto packet1 = NLPacket::createCopy(*packet);
sendPacket(std::move(packet1), *node);
}
else {
sendUnreliablePacket(*packet, *node);
}
++n;
}
});