» Find Revision
L2J Revision Number:3587M
L2JDP Revision Number:6680
I want to check if player and his target IP addresses are the same:
Code: Select all
if (getClient().getConnection().getInetAddress().getHostAddress() == targetPlayer.getClient().getConnection().getInetAddress().getHostAddress()) { sendMessage("Killed player with same IP. No reward."); return; }
If I add line:
Code: Select all
sendMessage("Checking IP:" + getClient().getConnection().getInetAddress().getHostAddress() + ":" + targetPlayer.getClient().getConnection().getInetAddress().getHostAddress());
This means that i get IP of player and his target correctly(both clients are on same PC on localhost), but then how come the if sentence states false? Maybe I need to convert the value getHostAddress() before comparing?