Close all sockets on shutdown

This commit is contained in:
Christoph Hagen
2022-01-24 17:15:11 +01:00
parent 707c6d03de
commit 89007989e3
5 changed files with 21 additions and 0 deletions

View File

@ -123,6 +123,10 @@ extension AbstractTable: ManageableTable {
sendUpdateToAllPlayers()
return
}
func disconnectAllPlayers() {
players.forEach { $0.disconnect() }
}
func sendUpdateToAllPlayers() {
players.enumerated().forEach { playerIndex, player in

View File

@ -31,4 +31,6 @@ protocol ManageableTable {
func disconnect(player name: PlayerName)
func sendUpdateToAllPlayers()
func disconnectAllPlayers()
}