more use of NonCopyable

This commit is contained in:
2024-07-20 01:09:29 +02:00
parent 072c13ca89
commit d412871de5
5 changed files with 10 additions and 7 deletions

View File

@@ -5,8 +5,10 @@
* \brief File containing the blitz::network::EnetConnexion class
*/
#include <Nazara/Core/ByteArray.hpp>
#include <NazaraUtils/Signal.hpp>
#include <blitz/protocol/PacketSerializer.h>
#include <blitz/protocol/PacketData.h>
#include <blitz/protocol/PacketDeclare.h>
namespace Nz {

View File

@@ -18,7 +18,7 @@ class EnetServer : private NonCopyable {
void Destroy();
void BroadcastPacket(const protocol::Packet& a_Packet, Nz::ENetPacketFlags a_Flags);
// void BroadcastPacket(const protocol::Packet& a_Packet, Nz::ENetPacketFlags a_Flags);
EnetConnexion* GetConnexion(std::uint16_t a_PeerId);

View File

@@ -18,7 +18,7 @@ namespace protocol {
* \class PacketVisitor
* \brief This class uses double-dispatch in order to find the real type of a packet
*/
class PacketVisitor {
class PacketVisitor : private NonCopyable {
protected:
PacketVisitor() {}
virtual ~PacketVisitor() {}

View File

@@ -5,6 +5,7 @@
* \brief File containing the definitions of the packets
*/
#include <blitz/common/NonCopyable.h>
#include <blitz/protocol/PacketData.h>
#include <blitz/protocol/PacketDeclare.h>
@@ -34,7 +35,7 @@ enum class PacketType : PacketID {
#undef DeclarePacket
class Packet {
class Packet : private NonCopyable {
public:
/**
* \return The real type of the packet

View File

@@ -76,9 +76,9 @@ EnetConnexion* EnetServer::GetConnexion(std::uint16_t a_PeerId) {
return &it->second;
}
void EnetServer::BroadcastPacket(const protocol::Packet& a_Packet, Nz::ENetPacketFlags a_Flags) {
// m_Host.Broadcast(0, a_Flags, std::move(a_Data));
}
/*void EnetServer::BroadcastPacket(const protocol::Packet& a_Packet, Nz::ENetPacketFlags a_Flags) {
m_Host.Broadcast(0, a_Flags, std::move(a_Data));
}*/
void EnetServer::RemoveConnexion(std::uint16_t a_PeerId) {
m_Connexion.erase(a_PeerId);