[SwitchMode] Kick the player only if the player is unknown to us

This commit is contained in:
games647
2016-09-21 09:16:19 +02:00
parent 62ffb1a904
commit 87ca00d75d
5 changed files with 37 additions and 32 deletions

View File

@@ -46,15 +46,16 @@ public abstract class JoinManagement<T, S extends LoginSource> {
|| (!checkNameChange(source, username, premiumUUID)
&& !checkPremiumName(source, username, profile))) {
//nothing detected the player as premium -> start a cracked session
if (core.getConfig().get("switchMode", false)) {
source.kick(core.getMessage("switch-kick-message"));
return;
}
startCrackedSession(source, profile, username);
}
} else if (profile.isPremium()) {
requestPremiumLogin(source, profile, username, true);
} else {
if (core.getConfig().get("switchMode", false)) {
source.kick(core.getMessage("switch-kick-message"));
return;
}
startCrackedSession(source, profile, username);
}

View File

@@ -2,10 +2,15 @@ package com.github.games647.fastlogin.core.shared;
import com.github.games647.fastlogin.core.PlayerProfile;
import java.util.UUID;
public abstract class LoginSession {
private final String username;
private final PlayerProfile profile;
private UUID uuid;
protected boolean registered;
public LoginSession(String username, boolean registered, PlayerProfile profile) {
@@ -30,4 +35,22 @@ public abstract class LoginSession {
public PlayerProfile getProfile() {
return profile;
}
/**
* Get the premium UUID of this player
*
* @return the premium UUID or null if not fetched
*/
public synchronized UUID getUuid() {
return uuid;
}
/**
* Set the online UUID if it's fetched
*
* @param uuid premium UUID
*/
public synchronized void setUuid(UUID uuid) {
this.uuid = uuid;
}
}