mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-12-22 08:37:49 +01:00
Move from Join to Login
This commit is contained in:
parent
7fe0fe5c8e
commit
5c059bdd43
@ -44,6 +44,7 @@ import fr.xephi.authme.cache.auth.PlayerAuth;
|
||||
import fr.xephi.authme.cache.auth.PlayerCache;
|
||||
import fr.xephi.authme.cache.limbo.LimboCache;
|
||||
import fr.xephi.authme.cache.limbo.LimboPlayer;
|
||||
import fr.xephi.authme.datasource.DataSource;
|
||||
import fr.xephi.authme.plugin.manager.CombatTagComunicator;
|
||||
import fr.xephi.authme.settings.Messages;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
@ -465,6 +466,17 @@ public class AuthMePlayerListener implements Listener {
|
||||
return;
|
||||
}
|
||||
|
||||
if (plugin.database.getType() != DataSource.DataSourceType.FILE) {
|
||||
PlayerAuth auth = plugin.database.getAuth(name);
|
||||
if (auth.getRealName() != null && !auth.getRealName().isEmpty() && !auth.getRealName().equalsIgnoreCase("Player") && !auth.getRealName().equals(player.getName())) {
|
||||
event.setKickMessage(m.send("same_nick")[0]);
|
||||
event.setResult(PlayerLoginEvent.Result.KICK_OTHER);
|
||||
if (Settings.banUnsafeIp)
|
||||
plugin.getServer().banIP(player.getAddress().getAddress().getHostAddress());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
int min = Settings.getMinNickLength;
|
||||
int max = Settings.getMaxNickLength;
|
||||
String regex = Settings.getNickRegex;
|
||||
|
@ -100,28 +100,6 @@ public class AsyncronousJoin {
|
||||
}
|
||||
final Location spawnLoc = plugin.getSpawnLocation(player);
|
||||
if (database.isAuthAvailable(name)) {
|
||||
if (database.getType() != DataSource.DataSourceType.FILE) {
|
||||
PlayerAuth auth = database.getAuth(name);
|
||||
if (auth.getRealName() != null && !auth.getRealName().isEmpty() && !auth.getRealName().equalsIgnoreCase("Player") && !auth.getRealName().equals(player.getName())) {
|
||||
final GameMode gM = AuthMePlayerListener.gameMode.get(name);
|
||||
sched.scheduleSyncDelayedTask(plugin, new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
if (gM != null) {
|
||||
AuthMePlayerListener.causeByAuthMe.put(name, true);
|
||||
player.setGameMode(gM);
|
||||
AuthMePlayerListener.causeByAuthMe.put(name, false);
|
||||
}
|
||||
player.kickPlayer("You are not the Owner of this account, please try another name!");
|
||||
if (Settings.banUnsafeIp)
|
||||
plugin.getServer().banIP(ip);
|
||||
}
|
||||
|
||||
}, 1);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (Settings.isForceSurvivalModeEnabled && !Settings.forceOnlyAfterLogin) {
|
||||
sched.scheduleSyncDelayedTask(plugin, new Runnable() {
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user