Skip to content

Commit

Permalink
Allow server@Server to be used on current server
Browse files Browse the repository at this point in the history
  • Loading branch information
Morphan1 committed Oct 25, 2015
1 parent 1813ac7 commit f2b9c75
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Expand Up @@ -6,6 +6,7 @@
import net.aufdemrand.denizencore.objects.dObject;
import net.aufdemrand.denizencore.tags.Attribute;
import net.aufdemrand.denizencore.tags.TagContext;
import net.aufdemrand.denizencore.utilities.CoreUtilities;

import java.util.HashMap;
import java.util.Map;
Expand Down Expand Up @@ -39,7 +40,7 @@ public static dServer valueOf(String string, TagContext context) {
////////
// Match faction name

string = string.toLowerCase().replace("server@", "");
string = CoreUtilities.toLowerCase(string).replace("server@", "");
if (onlineServers.containsKey(string)) {
return onlineServers.get(string);
}
Expand All @@ -49,7 +50,7 @@ public static dServer valueOf(String string, TagContext context) {
}

public static boolean matches(String arg) {
if (onlineServers.containsKey(arg.toLowerCase().replace("server@", "")))
if (onlineServers.containsKey(CoreUtilities.toLowerCase(arg).replace("server@", "")))
return true;

return false;
Expand Down
Expand Up @@ -131,6 +131,7 @@ public void run() {
packet.deserialize(data);
if (packet.isAccepted()) {
dB.log("Successfully registered name with the server");
dServer.addOnlineServer(this.registrationName);
for (String server : packet.getServerList()) {
if (!server.isEmpty())
dServer.addOnlineServer(server);
Expand Down

0 comments on commit f2b9c75

Please sign in to comment.