Skip to content

Commit

Permalink
Allow player/server querys from other threads
Browse files Browse the repository at this point in the history
  • Loading branch information
Brokkonaut committed Nov 3, 2019
1 parent dd04dc0 commit 166cb90
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/main/java/de/cubeside/connection/GlobalClient.java
Expand Up @@ -15,9 +15,9 @@
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Objects;
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.crypto.Cipher;
Expand All @@ -40,16 +40,16 @@ public abstract class GlobalClient implements ConnectionAPI {
private ClientThread connection;
private DataOutputStream dos;

private final HashMap<String, GlobalServer> servers;
private final HashMap<UUID, GlobalPlayer> players;
private final ConcurrentHashMap<String, GlobalServer> servers;
private final ConcurrentHashMap<UUID, GlobalPlayer> players;
private final Collection<GlobalServer> unmodifiableServers;
private final Collection<GlobalPlayer> unmodifiablePlayers;

protected GlobalClient(Logger logger) {
this.logger = logger != null ? logger : Logger.getLogger("GlobalClient");
this.servers = new HashMap<>();
this.servers = new ConcurrentHashMap<>();
unmodifiableServers = Collections.unmodifiableCollection(servers.values());
this.players = new HashMap<>();
this.players = new ConcurrentHashMap<>();
unmodifiablePlayers = Collections.unmodifiableCollection(players.values());
this.running = true;

Expand Down

0 comments on commit 166cb90

Please sign in to comment.