Add storage support for BungeeCord

This commit is contained in:
games647 committed 2016-04-27 17:02:20 +02:00
1 parent 11cc4eabc0
commit 57a59045ce
7 files changed
+391 -28

No files matched your search

@@ -32,6 +32,8 @@ import org.bukkit.plugin.java.JavaPlugin;
* This plugin checks if a player has a paid account and if so tries to skip offline mode authentication.
*/
public class FastLoginBukkit extends JavaPlugin {
private static final int WORKER_THREADS = 5;
public static UUID parseId(String withoutDashes) {
return UUID.fromString(withoutDashes.substring(0, 8)
@@ -44,7 +46,6 @@ public class FastLoginBukkit extends JavaPlugin {
//provide a immutable key pair to be thread safe | used for encrypting and decrypting traffic
private final KeyPair keyPair = EncryptionUtil.generateKeyPair();
private static final int WORKER_THREADS = 5;
private boolean bungeeCord;
private Storage storage;
@@ -37,7 +37,7 @@ public class ProtocolSupportListener implements Listener {
PlayerProfile playerProfile = plugin.getStorage().getProfile(username, true);
if (playerProfile != null) {
//user not exists in the db
if (playerProfile.getUserId() == -1) {
if (!playerProfile.isPremium() && playerProfile.getUserId() == -1) {
BukkitAuthPlugin authPlugin = plugin.getAuthPlugin();
if (plugin.getConfig().getBoolean("autoRegister") && !authPlugin.isRegistered(username)) {
UUID premiumUUID = plugin.getApiConnector().getPremiumUUID(username);
@@ -78,7 +78,7 @@ public class StartPacketListener extends PacketAdapter {
PlayerProfile playerProfile = plugin.getStorage().getProfile(username, true);
if (playerProfile != null) {
//user not exists in the db
if (playerProfile.getUserId() == -1) {
if (!playerProfile.isPremium() && playerProfile.getUserId() == -1) {
BukkitAuthPlugin authPlugin = plugin.getAuthPlugin();
if (plugin.getConfig().getBoolean("autoRegister") && !authPlugin.isRegistered(username)) {
UUID premiumUUID = plugin.getApiConnector().getPremiumUUID(username);