diff --git a/Source/Engine/Networking/Drivers/ENetDriver.cpp b/Source/Engine/Networking/Drivers/ENetDriver.cpp index d75d7337f..37beaccc7 100644 --- a/Source/Engine/Networking/Drivers/ENetDriver.cpp +++ b/Source/Engine/Networking/Drivers/ENetDriver.cpp @@ -144,7 +144,18 @@ void ENetDriver::Disconnect() void ENetDriver::Disconnect(const NetworkConnection& connection) { - // TODO: kick given connection (?) + const int connectionId = connection.ConnectionId; + + void* peer = nullptr; + if(_peerMap.TryGet(connectionId, peer)) + { + enet_peer_disconnect_now((ENetPeer*)_peer, 0); + _peerMap.Remove(connectionId); + } + else + { + LOG(Error, "Failed to kick connection({0}). ENetPeer not found!", connection.ConnectionId); + } } bool ENetDriver::PopEvent(NetworkEvent* eventPtr)