mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-25 22:42:04 +02:00
Do not accept connections into ongoing game
This commit is contained in:
@@ -16,7 +16,6 @@ VCMI_LIB_NAMESPACE_BEGIN
|
||||
NetworkServer::NetworkServer(INetworkServerListener & listener)
|
||||
:listener(listener)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void NetworkServer::start(uint16_t port)
|
||||
@@ -63,6 +62,12 @@ void NetworkServer::sendPacket(const std::shared_ptr<NetworkConnection> & connec
|
||||
connection->sendPacket(message);
|
||||
}
|
||||
|
||||
void NetworkServer::closeConnection(const std::shared_ptr<NetworkConnection> & connection)
|
||||
{
|
||||
assert(connections.count(connection));
|
||||
connections.erase(connection);
|
||||
}
|
||||
|
||||
void NetworkServer::onDisconnected(const std::shared_ptr<NetworkConnection> & connection)
|
||||
{
|
||||
assert(connections.count(connection));
|
||||
|
||||
Reference in New Issue
Block a user