Security for the previous commit

This commit is contained in:
Xephi 2014-08-27 07:28:47 +02:00
parent 6cfd3f0a0b
commit 469a56258d

View File

@ -385,9 +385,14 @@ public class AuthMePlayerListener implements Listener {
final String lowname = player.getName().toLowerCase(); final String lowname = player.getName().toLowerCase();
final String name = player.getName(); final String name = player.getName();
if (!lowname.equals(name)) if (!lowname.equals(name)) {
// Little workaround to be sure registered player is the same as this
if (player.hasPlayedBefore())
// Make sure it's the correct player
if (data.getAuth(lowname).getIp().equalsIgnoreCase(player.getAddress().getAddress().getHostAddress()))
if (data.isAuthAvailable(lowname)) if (data.isAuthAvailable(lowname))
data.updateName(lowname, name); data.updateName(lowname, name);
}
if (plugin.getCitizensCommunicator().isNPC(player, plugin) || Utils.getInstance().isUnrestricted(player) || CombatTagComunicator.isNPC(player)) { if (plugin.getCitizensCommunicator().isNPC(player, plugin) || Utils.getInstance().isUnrestricted(player) || CombatTagComunicator.isNPC(player)) {
return; return;