Changed the list in ServerLobby to static, since they are global per running server.
This commit is contained in:
parent
9cc7a37eb9
commit
ac022e1f7c
@ -1,6 +1,7 @@
|
|||||||
package ch.unibas.dmi.dbis.cs108.sebaschi;
|
package ch.unibas.dmi.dbis.cs108.sebaschi;
|
||||||
|
|
||||||
import ch.unibas.dmi.dbis.cs108.multiplayer.server.ClientHandler;
|
import ch.unibas.dmi.dbis.cs108.multiplayer.server.ClientHandler;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -10,7 +11,15 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
public class ServerLobby {
|
public class ServerLobby {
|
||||||
|
|
||||||
List<Lobby> openLobbies;
|
private static List<Lobby> openLobbies;
|
||||||
List<ClientHandler> allClients;
|
private static List<ClientHandler> allClients;
|
||||||
|
|
||||||
|
static {
|
||||||
|
openLobbies = new ArrayList<>();
|
||||||
|
allClients = new ArrayList<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<Lobby> getOpenLobbies() {
|
||||||
|
return openLobbies;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user