Browse Source

Add ability to clean broken connections for getter

`GetActiveConnections()` by default returns all connections currently
recorded in `ConnectionService`, which might include broken player
connections, if player disconnected recently and it still was not
properly handled.

Optional parameter was added to clean connections before returning them,
which might cause a change in state of `ConnectionService`.
pull/8/head
Anton Tarasenko 4 years ago
parent
commit
9cc0b2afe9
  1. 6
      sources/Services/Connection/ConnectionService.uc

6
sources/Services/Connection/ConnectionService.uc

@ -146,8 +146,12 @@ public final function bool RegisterConnection(PlayerController player)
return true;
}
public final function array<Connection> GetActiveConnections()
public final function array<Connection> GetActiveConnections(
optional bool removeBroken)
{
if (removeBroken) {
RemoveBrokenConnections();
}
return activeConnections;
}

Loading…
Cancel
Save