make EnetConnection non copyable

This commit is contained in:
2024-07-20 10:41:15 +02:00
parent 810e17cc39
commit f165aec824
4 changed files with 6 additions and 6 deletions

View File

@@ -46,7 +46,8 @@ void EnetServer::Update() {
case Nz::ENetEventType::IncomingConnect: {
Nz::ENetPeer* peer = event.peer;
m_Connexion.insert({peer->GetPeerId(), EnetConnexion(peer)});
auto con = std::make_unique<EnetConnexion>(peer);
m_Connexion.insert({peer->GetPeerId(), std::move(con)});
OnClientConnect(*GetConnexion(peer->GetPeerId()));
break;
}
@@ -73,7 +74,7 @@ EnetConnexion* EnetServer::GetConnexion(std::uint16_t a_PeerId) {
if (it == m_Connexion.end())
return nullptr;
return &it->second;
return it->second.get();
}
/*void EnetServer::BroadcastPacket(const protocol::Packet& a_Packet, Nz::ENetPacketFlags a_Flags) {