Fixed NPE in BungeeCord on cracked login for existing players (#22)

This commit is contained in:
games647
2016-06-10 08:57:08 +02:00
parent be89eec23b
commit 7733135ce4
4 changed files with 9 additions and 0 deletions

View File

@ -2,6 +2,7 @@
* Added localization
* Fixed NPE on premium name check if it's pure cracked player
* Fixed NPE in BungeeCord on cracked login for existing players
######1.4

View File

@ -74,6 +74,9 @@ public class ProtocolSupportListener implements Listener {
}
} else if (profile.isPremium()) {
startPremiumSession(username, loginStartEvent, true, profile);
} else {
BukkitLoginSession loginSession = new BukkitLoginSession(username, profile);
plugin.getSessions().put(loginStartEvent.getAddress().toString(), loginSession);
}
}
}

View File

@ -117,6 +117,9 @@ public class StartPacketListener extends PacketAdapter {
}
} else if (profile.isPremium()) {
enablePremiumLogin(username, profile, sessionKey, player, packetEvent, true);
} else {
BukkitLoginSession loginSession = new BukkitLoginSession(username, profile);
plugin.getSessions().put(sessionKey, loginSession);
}
}
}

View File

@ -47,6 +47,8 @@ public class AsyncPremiumCheck implements Runnable {
}
} else if (profile.isPremium()) {
requestPremiumLogin(connection, profile, username, true);
} else {
plugin.getSession().put(connection, new LoginSession(username, false, profile));
}
} catch (Exception ex) {
plugin.getLogger().log(Level.SEVERE, "Failed to check premium state", ex);