Skip to content
This repository has been archived by the owner on Jul 27, 2019. It is now read-only.

Commit

Permalink
Remove redundant player IP lookup call.
Browse files Browse the repository at this point in the history
  • Loading branch information
cnaude committed Jan 17, 2015
1 parent 987d58e commit dad8948
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dependency-reduced-pom.xml
Expand Up @@ -256,7 +256,7 @@
<dependency>
<groupId>com.cnaude.protocol</groupId>
<artifactId>ProtocolLib</artifactId>
<version>3.6.3</version>
<version>3.4.0</version>
<scope>compile</scope>
</dependency>
<dependency>
Expand Down
6 changes: 4 additions & 2 deletions src/main/java/com/cnaude/purpleirc/PurpleIRC.java
Expand Up @@ -1381,8 +1381,10 @@ public void loadUuidCache() {
}
}

public String getPlayerHost(Player player) {
final String playerIP = player.getAddress().getAddress().getHostAddress();
public String getPlayerHost(final String playerIP) {
if (playerIP == null) {
return "unknown";
}
if (hostCache.containsKey(playerIP)) {
return hostCache.get(playerIP);
} else {
Expand Down
Expand Up @@ -548,7 +548,7 @@ public String playerTokenizer(Player player, String message) {
String group = plugin.getPlayerGroup(player);
String displayName = player.getDisplayName();
String playerIP = player.getAddress().getAddress().getHostAddress();
String host = plugin.getPlayerHost(player);
String host = plugin.getPlayerHost(playerIP);
String worldName = "";
String worldAlias = "";
String worldColor = "";
Expand Down

0 comments on commit dad8948

Please sign in to comment.