Skip to content
This repository has been archived by the owner on Dec 5, 2020. It is now read-only.

Commit

Permalink
Revert name normalization
Browse files Browse the repository at this point in the history
  • Loading branch information
132ikl committed May 27, 2020
1 parent 9fede92 commit a87cb6f
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public OnlineServer getServerNormalized(String serverID) {

//Adds a server to the list
public void serverConnected(String serverID, String serverName, String serverAddress, int maxPlayers, MessageBus messageBus) {
OnlineServer toRemove = getServerNormalized(serverID);
OnlineServer toRemove = serverMap.get(serverID);
if (toRemove != null) {
onlineServers.remove(toRemove);
}
Expand All @@ -67,35 +67,35 @@ public void serverConnected(String serverID, String serverName, String serverAdd

//Marks a server as online
public void serverOnline(String serverID) {
OnlineServer server = getServerNormalized(serverID);
OnlineServer server = serverMap.get(serverID);
if (server != null) {
server.setStarted();
}
}

//Removes a server as it went offline
public void serverOffline(String serverID) {
OnlineServer toRemove = getServerNormalized(serverID);
OnlineServer toRemove = serverMap.get(serverID);
onlineServers.remove(toRemove);
serverMap.remove(serverID);
}

public void updatePlayerList(String serverID, ArrayList<String> playerList) {
OnlineServer server = getServerNormalized(serverID);
OnlineServer server = serverMap.get(serverID);
if (server != null) {
server.updatePlayerList(playerList);
}
}

public void playerJoin(String serverID, String username) {
OnlineServer server = getServerNormalized(serverID);
OnlineServer server = serverMap.get(serverID);
if (server != null) {
server.onlinePlayers.add(username);
}
}

public void playerLeave(String serverID, String username) {
OnlineServer server = getServerNormalized(serverID);
OnlineServer server = serverMap.get(serverID);
if (server != null) {
server.onlinePlayers.remove(username);
}
Expand Down

0 comments on commit a87cb6f

Please sign in to comment.