make EnetConnection non copyable
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user