mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-12-24 17:47:38 +01:00
commit
930342dcf4
9
circle.yml
Normal file
9
circle.yml
Normal file
@ -0,0 +1,9 @@
|
||||
machine:
|
||||
java:
|
||||
version: oraclejdk7
|
||||
general:
|
||||
artifacts:
|
||||
- "target/*.jar"
|
||||
test:
|
||||
override:
|
||||
- mvn clean install
|
Binary file not shown.
Binary file not shown.
BIN
libs/xAuth.jar
BIN
libs/xAuth.jar
Binary file not shown.
96
pom.xml
96
pom.xml
@ -3,8 +3,8 @@
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>fr.xephi.authme</groupId>
|
||||
<artifactId>AuthMe</artifactId>
|
||||
<groupId>fr.xephi</groupId>
|
||||
<artifactId>authme</artifactId>
|
||||
<version>5.0-SNAPSHOT</version>
|
||||
|
||||
<name>AuthMeReloaded</name>
|
||||
@ -22,8 +22,6 @@
|
||||
|
||||
<!-- Change MC Version HERE! -->
|
||||
<bukkitVersion>1.8.7-R0.1-SNAPSHOT</bukkitVersion>
|
||||
|
||||
<mainClass>${project.groupId}.${project.artifactId}</mainClass>
|
||||
</properties>
|
||||
|
||||
<!-- Official Build Server ALLERT: sometimes jenkins is offline, no panic! -->
|
||||
@ -77,6 +75,7 @@
|
||||
<archive>
|
||||
<manifestFile>${manifest.file}</manifestFile>
|
||||
</archive>
|
||||
<finalName>AuthMe-${project.version}</finalName>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
@ -90,8 +89,15 @@
|
||||
<include>com.sun.mail:*</include>
|
||||
<include>javax.mail:*</include>
|
||||
<include>com.comphenix.attribute:*</include>
|
||||
<include>org.mcstats.*:*</include>
|
||||
</includes>
|
||||
</artifactSet>
|
||||
<relocations>
|
||||
<relocation>
|
||||
<pattern>org.mcstats</pattern>
|
||||
<shadedPattern>fr.xephi.authme</shadedPattern>
|
||||
</relocation>
|
||||
</relocations>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
@ -113,6 +119,12 @@
|
||||
<url>https://hub.spigotmc.org/nexus/content/groups/public/</url>
|
||||
</repository>
|
||||
|
||||
<!-- Mcstats.org Metrics Repo -->
|
||||
<repository>
|
||||
<id>Plugin Metrics</id>
|
||||
<url>http://repo.mcstats.org/content/repositories/public</url>
|
||||
</repository>
|
||||
|
||||
<!-- Vault Repo (Already in ess repo!) -->
|
||||
<repository>
|
||||
<id>vault-repo</id>
|
||||
@ -128,7 +140,7 @@
|
||||
<!-- Essentials Repo -->
|
||||
<repository>
|
||||
<id>ess-repo</id>
|
||||
<url>http://repo.ess3.net/content/groups/public</url>
|
||||
<url>http://repo.ess3.net/content/groups/essentials</url>
|
||||
</repository>
|
||||
|
||||
<!-- CombatTagPlus Repo -->
|
||||
@ -143,12 +155,6 @@
|
||||
<url>http://repo.luricos.de/content/repositories/releases/</url>
|
||||
</repository>
|
||||
|
||||
<!-- SpoutCraft Repo -->
|
||||
<repository>
|
||||
<id>sonatype-nexus-snapshots</id>
|
||||
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
|
||||
</repository>
|
||||
|
||||
<!-- Attribute Repo -->
|
||||
<repository>
|
||||
<id>comphenix-snapshots</id>
|
||||
@ -181,13 +187,6 @@
|
||||
<version>3.8.10.1</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Database Library -->
|
||||
<dependency>
|
||||
<groupId>com.h2database</groupId>
|
||||
<artifactId>h2</artifactId>
|
||||
<version>1.4.187</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Java Email API -->
|
||||
<dependency>
|
||||
<groupId>com.sun.mail</groupId>
|
||||
@ -202,6 +201,23 @@
|
||||
<version>1.2.14</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.mcstats.bukkit</groupId>
|
||||
<artifactId>metrics</artifactId>
|
||||
<version>R7</version>
|
||||
<scope>compile</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.bukkit</groupId>
|
||||
<artifactId>bukkit</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.bukkit</groupId>
|
||||
<artifactId>craftbukkit</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<!-- Spigot-Api, http://www.spigotmc.org/ Based on the Bukkit project,
|
||||
http://bukkit.org/ -->
|
||||
<dependency>
|
||||
@ -348,23 +364,6 @@
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<!-- Spout API, https://spoutcraft.org/downloads/ -->
|
||||
<dependency>
|
||||
<groupId>org.spoutcraft</groupId>
|
||||
<artifactId>spoutcraftplugin</artifactId>
|
||||
<version>1.6.4-SNAPSHOT</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.bukkit</groupId>
|
||||
<artifactId>bukkit</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.bukkit</groupId>
|
||||
<artifactId>craftbukkit</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<!-- Local Dependencies -->
|
||||
|
||||
<!-- It doesn't have a Maven Repo, http://dev.bukkit.org/bukkit-plugins/chestshop/ -->
|
||||
@ -376,32 +375,5 @@
|
||||
<systemPath>${project.basedir}/libs/ChestShop.jar</systemPath>
|
||||
</dependency>
|
||||
|
||||
<!-- Citizens 1.X (No API) -->
|
||||
<dependency>
|
||||
<groupId>net.citizensnpcs</groupId>
|
||||
<artifactId>citizens</artifactId>
|
||||
<version>1.2.4</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${project.basedir}/libs/Citizens.jar</systemPath>
|
||||
</dependency>
|
||||
|
||||
<!-- Old version of xAuth by Cypherx -->
|
||||
<dependency>
|
||||
<groupId>com.cypherx</groupId>
|
||||
<artifactId>xauth</artifactId>
|
||||
<version>2.0.26</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${project.basedir}/libs/xAuth.jar</systemPath>
|
||||
</dependency>
|
||||
|
||||
<!-- A SpoutApi Plugin, http://dev.bukkit.org/bukkit-plugins/notifications/ -->
|
||||
<dependency>
|
||||
<groupId>me.muizers</groupId>
|
||||
<artifactId>Notifications</artifactId>
|
||||
<version>1.6</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${project.basedir}/libs/Notifications.jar</systemPath>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
</project>
|
||||
|
@ -3,6 +3,7 @@ package fr.xephi.authme;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.OutputStream;
|
||||
@ -14,13 +15,10 @@ import java.util.Collection;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.logging.Logger;
|
||||
import java.util.zip.GZIPInputStream;
|
||||
|
||||
import me.muizers.Notifications.Notifications;
|
||||
import net.citizensnpcs.Citizens;
|
||||
import net.milkbowl.vault.permission.Permission;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
@ -31,6 +29,8 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.PluginManager;
|
||||
import org.bukkit.plugin.RegisteredServiceProvider;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
import org.bukkit.scheduler.BukkitTask;
|
||||
import org.mcstats.Metrics;
|
||||
|
||||
import com.earth2me.essentials.Essentials;
|
||||
import com.maxmind.geoip.LookupService;
|
||||
@ -63,7 +63,6 @@ import fr.xephi.authme.listener.AuthMeChestShopListener;
|
||||
import fr.xephi.authme.listener.AuthMeEntityListener;
|
||||
import fr.xephi.authme.listener.AuthMePlayerListener;
|
||||
import fr.xephi.authme.listener.AuthMeServerListener;
|
||||
import fr.xephi.authme.listener.AuthMeSpoutListener;
|
||||
import fr.xephi.authme.plugin.manager.BungeeCordMessage;
|
||||
import fr.xephi.authme.plugin.manager.CitizensCommunicator;
|
||||
import fr.xephi.authme.plugin.manager.CombatTagComunicator;
|
||||
@ -74,6 +73,7 @@ import fr.xephi.authme.settings.OtherAccounts;
|
||||
import fr.xephi.authme.settings.PlayersLogs;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
import fr.xephi.authme.settings.Spawn;
|
||||
import net.milkbowl.vault.permission.Permission;
|
||||
|
||||
public class AuthMe extends JavaPlugin {
|
||||
|
||||
@ -89,13 +89,12 @@ public class AuthMe extends JavaPlugin {
|
||||
private Utils utils = Utils.getInstance();
|
||||
private FileCache playerBackup = new FileCache(this);
|
||||
public CitizensCommunicator citizens;
|
||||
public boolean isCitizensActive = false;
|
||||
public SendMailSSL mail = null;
|
||||
public int CitizensVersion = 0;
|
||||
public int CombatTag = 0;
|
||||
public boolean CombatTag = false;
|
||||
public double ChestShop = 0;
|
||||
public boolean BungeeCord = false;
|
||||
public Essentials ess;
|
||||
public Notifications notifications;
|
||||
public API api;
|
||||
public Management management;
|
||||
public HashMap<String, Integer> captcha = new HashMap<String, Integer>();
|
||||
@ -108,6 +107,7 @@ public class AuthMe extends JavaPlugin {
|
||||
public boolean delayedAntiBot = true;
|
||||
protected static String vgUrl = "http://monitor-1.verygames.net/api/?action=ipclean-real-ip&out=raw&ip=%IP%&port=%PORT%";
|
||||
public DataManager dataManager;
|
||||
public ConcurrentHashMap<String, BukkitTask> sessions = new ConcurrentHashMap<String, BukkitTask>();
|
||||
|
||||
public Settings getSettings() {
|
||||
return settings;
|
||||
@ -128,6 +128,15 @@ public class AuthMe extends JavaPlugin {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
Metrics metrics = new Metrics(this);
|
||||
metrics.start();
|
||||
ConsoleLogger.info("Metrics started successfully!");
|
||||
} catch (IOException e) {
|
||||
// Failed to submit the stats :-(
|
||||
ConsoleLogger.showError("Can't start Metrics! The plugin will work anyway...");
|
||||
}
|
||||
|
||||
citizens = new CitizensCommunicator(this);
|
||||
|
||||
if (Settings.enableAntiBot) {
|
||||
@ -178,9 +187,6 @@ public class AuthMe extends JavaPlugin {
|
||||
// Check Combat Tag Version
|
||||
combatTag();
|
||||
|
||||
// Check Notifications
|
||||
checkNotifications();
|
||||
|
||||
// Check Multiverse
|
||||
checkMultiverse();
|
||||
|
||||
@ -200,37 +206,7 @@ public class AuthMe extends JavaPlugin {
|
||||
else ConsoleLogger.showError("Error while making Backup");
|
||||
}
|
||||
|
||||
/*
|
||||
* Backend MYSQL - FILE - SQLITE
|
||||
*/
|
||||
switch (Settings.getDataSource) {
|
||||
case FILE:
|
||||
FlatFile fileThread = new FlatFile();
|
||||
database = fileThread;
|
||||
final int a = database.getAccountsRegistered();
|
||||
if (a >= 1000) {
|
||||
ConsoleLogger.showError("YOU'RE USING FILE DATABASE WITH " + a + "+ ACCOUNTS, FOR BETTER PERFORMANCES, PLEASE USE MYSQL!!");
|
||||
}
|
||||
break;
|
||||
case MYSQL:
|
||||
MySQL sqlThread = new MySQL();
|
||||
database = sqlThread;
|
||||
break;
|
||||
case SQLITE:
|
||||
SQLite sqliteThread = new SQLite();
|
||||
database = sqliteThread;
|
||||
final int b = database.getAccountsRegistered();
|
||||
if (b >= 2000) {
|
||||
ConsoleLogger.showError("YOU'RE USING SQLITE DATABASE WITH " + b + "+ ACCOUNTS, FOR BETTER PERFORMANCES, PLEASE USE MYSQL!!");
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (Settings.isCachingEnabled) {
|
||||
database = new CacheDataSource(this, database);
|
||||
}
|
||||
|
||||
database = new DatabaseCalls(this, database);
|
||||
setupDatabase();
|
||||
|
||||
dataManager = new DataManager(this, database);
|
||||
|
||||
@ -245,10 +221,7 @@ public class AuthMe extends JavaPlugin {
|
||||
Bukkit.getMessenger().registerOutgoingPluginChannel(this, "BungeeCord");
|
||||
Bukkit.getMessenger().registerIncomingPluginChannel(this, "BungeeCord", new BungeeCordMessage(this));
|
||||
}
|
||||
if (pm.isPluginEnabled("Spout")) {
|
||||
pm.registerEvents(new AuthMeSpoutListener(database), this);
|
||||
ConsoleLogger.info("Successfully hook with Spout!");
|
||||
}
|
||||
|
||||
pm.registerEvents(new AuthMePlayerListener(this, database), this);
|
||||
pm.registerEvents(new AuthMeBlockListener(database, this), this);
|
||||
pm.registerEvents(new AuthMeEntityListener(database, this), this);
|
||||
@ -270,7 +243,7 @@ public class AuthMe extends JavaPlugin {
|
||||
this.getCommand("converter").setExecutor(new ConverterCommand(this, database));
|
||||
|
||||
if (!Settings.isForceSingleSessionEnabled) {
|
||||
ConsoleLogger.showError("ATTENTION by disabling ForceSingleSession, your server protection is set to low");
|
||||
ConsoleLogger.showError("BECAREFUL !!! By disabling ForceSingleSession, your server protection is set to LOW");
|
||||
}
|
||||
|
||||
if (Settings.reloadSupport)
|
||||
@ -281,19 +254,15 @@ public class AuthMe extends JavaPlugin {
|
||||
if (Bukkit.class.getMethod("getOnlinePlayers", new Class<?>[0]).getReturnType() == Collection.class)
|
||||
playersOnline = ((Collection<?>) Bukkit.class.getMethod("getOnlinePlayers", new Class<?>[0]).invoke(null, new Object[0])).size();
|
||||
else playersOnline = ((Player[]) Bukkit.class.getMethod("getOnlinePlayers", new Class<?>[0]).invoke(null, new Object[0])).length;
|
||||
} catch (NoSuchMethodException ex) {
|
||||
} // can never happen
|
||||
catch (InvocationTargetException ex) {
|
||||
} // can also never happen
|
||||
catch (IllegalAccessException ex) {
|
||||
} // can still never happen
|
||||
} catch (Exception ex) {
|
||||
}
|
||||
if (playersOnline < 1) {
|
||||
try {
|
||||
database.purgeLogged();
|
||||
} catch (NullPointerException npe) {
|
||||
}
|
||||
}
|
||||
} catch (NullPointerException ex) {
|
||||
} catch (Exception ex) {
|
||||
}
|
||||
|
||||
if (Settings.usePurge)
|
||||
@ -306,8 +275,7 @@ public class AuthMe extends JavaPlugin {
|
||||
recallEmail();
|
||||
|
||||
// Sponsor message
|
||||
ConsoleLogger.info("[SPONSOR] AuthMe is sponsored and hook perfectly with server hosting VERYGAMES, rent your server for only 1.99$/months");
|
||||
ConsoleLogger.info("[SPONSOR] Look Minecraft and other offers on www.verygames.net ! ");
|
||||
ConsoleLogger.info("AuthMe hook perfectly with server hosting VERYGAMES");
|
||||
|
||||
ConsoleLogger.info("Authme " + this.getDescription().getVersion() + " enabled");
|
||||
}
|
||||
@ -419,40 +387,18 @@ public class AuthMe extends JavaPlugin {
|
||||
}
|
||||
}
|
||||
|
||||
public void checkNotifications() {
|
||||
if (!Settings.notifications) {
|
||||
this.notifications = null;
|
||||
return;
|
||||
}
|
||||
if (this.getServer().getPluginManager().getPlugin("Notifications") != null && this.getServer().getPluginManager().getPlugin("Notifications").isEnabled()) {
|
||||
this.notifications = (Notifications) this.getServer().getPluginManager().getPlugin("Notifications");
|
||||
ConsoleLogger.info("Successfully hook with Notifications");
|
||||
} else {
|
||||
this.notifications = null;
|
||||
}
|
||||
}
|
||||
|
||||
public void combatTag() {
|
||||
if (this.getServer().getPluginManager().getPlugin("CombatTag") != null && this.getServer().getPluginManager().getPlugin("CombatTag").isEnabled()) {
|
||||
this.CombatTag = 1;
|
||||
this.CombatTag = true;
|
||||
} else {
|
||||
this.CombatTag = 0;
|
||||
this.CombatTag = false;
|
||||
}
|
||||
}
|
||||
|
||||
public void citizensVersion() {
|
||||
if (this.getServer().getPluginManager().getPlugin("Citizens") != null && this.getServer().getPluginManager().getPlugin("Citizens").isEnabled()) {
|
||||
Citizens cit = (Citizens) this.getServer().getPluginManager().getPlugin("Citizens");
|
||||
String ver = cit.getDescription().getVersion();
|
||||
String[] args = ver.split("\\.");
|
||||
if (args[0].contains("1")) {
|
||||
this.CitizensVersion = 1;
|
||||
} else {
|
||||
this.CitizensVersion = 2;
|
||||
}
|
||||
} else {
|
||||
this.CitizensVersion = 0;
|
||||
}
|
||||
if (this.getServer().getPluginManager().getPlugin("Citizens") != null && this.getServer().getPluginManager().getPlugin("Citizens").isEnabled())
|
||||
this.isCitizensActive = true;
|
||||
else this.isCitizensActive = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -502,7 +448,7 @@ public class AuthMe extends JavaPlugin {
|
||||
}
|
||||
}
|
||||
return;
|
||||
} catch (NullPointerException ex) {
|
||||
} catch (Exception ex) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -511,8 +457,8 @@ public class AuthMe extends JavaPlugin {
|
||||
return authme;
|
||||
}
|
||||
|
||||
public void savePlayer(Player player) throws IllegalStateException,
|
||||
NullPointerException {
|
||||
public void savePlayer(Player player)
|
||||
throws IllegalStateException, NullPointerException {
|
||||
try {
|
||||
if ((citizens.isNPC(player, this)) || (Utils.getInstance().isUnrestricted(player)) || (CombatTagComunicator.isNPC(player))) {
|
||||
return;
|
||||
@ -827,4 +773,33 @@ public class AuthMe extends JavaPlugin {
|
||||
}
|
||||
return realIP;
|
||||
}
|
||||
|
||||
public void setupDatabase() {
|
||||
/*
|
||||
* Backend MYSQL - FILE - SQLITE
|
||||
*/
|
||||
switch (Settings.getDataSource) {
|
||||
case FILE:
|
||||
database = new FlatFile();
|
||||
final int a = database.getAccountsRegistered();
|
||||
if (a >= 1000)
|
||||
ConsoleLogger.showError("YOU'RE USING FILE DATABASE WITH " + a + "+ ACCOUNTS, FOR BETTER PERFORMANCES, PLEASE USE MYSQL!!");
|
||||
break;
|
||||
case MYSQL:
|
||||
database = new MySQL();
|
||||
break;
|
||||
case SQLITE:
|
||||
database = new SQLite();
|
||||
final int b = database.getAccountsRegistered();
|
||||
if (b >= 2000)
|
||||
ConsoleLogger.showError("YOU'RE USING SQLITE DATABASE WITH " + b + "+ ACCOUNTS, FOR BETTER PERFORMANCES, PLEASE USE MYSQL!!");
|
||||
break;
|
||||
}
|
||||
|
||||
if (Settings.isCachingEnabled) {
|
||||
database = new CacheDataSource(this, database);
|
||||
}
|
||||
|
||||
database = new DatabaseCalls(this, database);
|
||||
}
|
||||
}
|
||||
|
@ -72,13 +72,7 @@ public class SendMailSSL {
|
||||
message.setSentDate(new Date());
|
||||
BodyPart messageBodyPart = new MimeBodyPart();
|
||||
messageBodyPart.setText(mailText);
|
||||
|
||||
Multipart multipart = new MimeMultipart();
|
||||
|
||||
multipart.addBodyPart(messageBodyPart);
|
||||
|
||||
messageBodyPart = new MimeBodyPart();
|
||||
|
||||
multipart.addBodyPart(messageBodyPart);
|
||||
message.setContent(multipart);
|
||||
Transport transport = session.getTransport("smtp");
|
||||
|
@ -1,174 +1,188 @@
|
||||
package fr.xephi.authme.api;
|
||||
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import fr.xephi.authme.AuthMe;
|
||||
import fr.xephi.authme.Utils;
|
||||
import fr.xephi.authme.cache.auth.PlayerAuth;
|
||||
import fr.xephi.authme.cache.auth.PlayerCache;
|
||||
import fr.xephi.authme.datasource.DataSource;
|
||||
import fr.xephi.authme.plugin.manager.CombatTagComunicator;
|
||||
import fr.xephi.authme.security.PasswordSecurity;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
|
||||
public class API {
|
||||
|
||||
public static final String newline = System.getProperty("line.separator");
|
||||
public static AuthMe instance;
|
||||
public static DataSource database;
|
||||
|
||||
public API(AuthMe instance, DataSource database) {
|
||||
API.instance = instance;
|
||||
API.database = database;
|
||||
}
|
||||
|
||||
/**
|
||||
* Hook into AuthMe
|
||||
*
|
||||
* @return AuthMe instance
|
||||
*/
|
||||
public static AuthMe hookAuthMe() {
|
||||
Plugin plugin = Bukkit.getServer().getPluginManager().getPlugin("AuthMe");
|
||||
if (plugin == null || !(plugin instanceof AuthMe)) {
|
||||
return null;
|
||||
}
|
||||
return (AuthMe) plugin;
|
||||
}
|
||||
|
||||
public AuthMe getPlugin() {
|
||||
return instance;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param player
|
||||
* @return true if player is authenticate
|
||||
*/
|
||||
public static boolean isAuthenticated(Player player) {
|
||||
return PlayerCache.getInstance().isAuthenticated(player.getName());
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param player
|
||||
* @return true if player is a npc
|
||||
*/
|
||||
@Deprecated
|
||||
public boolean isaNPC(Player player) {
|
||||
if (instance.getCitizensCommunicator().isNPC(player, instance))
|
||||
return true;
|
||||
return CombatTagComunicator.isNPC(player);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param player
|
||||
* @return true if player is a npc
|
||||
*/
|
||||
public boolean isNPC(Player player) {
|
||||
if (instance.getCitizensCommunicator().isNPC(player, instance))
|
||||
return true;
|
||||
return CombatTagComunicator.isNPC(player);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param player
|
||||
* @return true if the player is unrestricted
|
||||
*/
|
||||
public static boolean isUnrestricted(Player player) {
|
||||
return Utils.getInstance().isUnrestricted(player);
|
||||
}
|
||||
|
||||
public static Location getLastLocation(Player player) {
|
||||
try {
|
||||
PlayerAuth auth = PlayerCache.getInstance().getAuth(player.getName().toLowerCase());
|
||||
|
||||
if (auth != null) {
|
||||
Location loc = new Location(Bukkit.getWorld(auth.getWorld()), auth.getQuitLocX(), auth.getQuitLocY(), auth.getQuitLocZ());
|
||||
return loc;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
||||
} catch (NullPointerException ex) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static void setPlayerInventory(Player player, ItemStack[] content,
|
||||
ItemStack[] armor) {
|
||||
try {
|
||||
player.getInventory().setContents(content);
|
||||
player.getInventory().setArmorContents(armor);
|
||||
} catch (NullPointerException npe) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param playerName
|
||||
* @return true if player is registered
|
||||
*/
|
||||
public static boolean isRegistered(String playerName) {
|
||||
String player = playerName.toLowerCase();
|
||||
return database.isAuthAvailable(player);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param String
|
||||
* playerName, String passwordToCheck
|
||||
* @return true if the password is correct , false else
|
||||
*/
|
||||
public static boolean checkPassword(String playerName,
|
||||
String passwordToCheck) {
|
||||
if (!isRegistered(playerName))
|
||||
return false;
|
||||
String player = playerName.toLowerCase();
|
||||
PlayerAuth auth = database.getAuth(player);
|
||||
try {
|
||||
return PasswordSecurity.comparePasswordWithHash(passwordToCheck, auth.getHash(), playerName);
|
||||
} catch (NoSuchAlgorithmException e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Register a player
|
||||
*
|
||||
* @param String
|
||||
* playerName, String password
|
||||
* @return true if the player is register correctly
|
||||
*/
|
||||
public static boolean registerPlayer(String playerName, String password) {
|
||||
try {
|
||||
String name = playerName.toLowerCase();
|
||||
String hash = PasswordSecurity.getHash(Settings.getPasswordHash, password, name);
|
||||
if (isRegistered(name)) {
|
||||
return false;
|
||||
}
|
||||
PlayerAuth auth = new PlayerAuth(name, hash, "198.18.0.1", 0, "your@email.com");
|
||||
if (!database.saveAuth(auth)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
} catch (NoSuchAlgorithmException ex) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Force a player to login
|
||||
*
|
||||
* @param Player
|
||||
* player
|
||||
*/
|
||||
public static void forceLogin(Player player) {
|
||||
instance.management.performLogin(player, "dontneed", true);
|
||||
}
|
||||
|
||||
}
|
||||
package fr.xephi.authme.api;
|
||||
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
import fr.xephi.authme.AuthMe;
|
||||
import fr.xephi.authme.Utils;
|
||||
import fr.xephi.authme.cache.auth.PlayerAuth;
|
||||
import fr.xephi.authme.cache.auth.PlayerCache;
|
||||
import fr.xephi.authme.datasource.DataSource;
|
||||
import fr.xephi.authme.plugin.manager.CombatTagComunicator;
|
||||
import fr.xephi.authme.security.PasswordSecurity;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
|
||||
public class API {
|
||||
|
||||
public static final String newline = System.getProperty("line.separator");
|
||||
public static API singleton;
|
||||
public AuthMe plugin;
|
||||
public DataSource database;
|
||||
|
||||
public API(AuthMe plugin, DataSource database) {
|
||||
this.plugin = plugin;
|
||||
this.database = database;
|
||||
}
|
||||
|
||||
public API(Server serv) {
|
||||
this.plugin = (AuthMe) serv.getPluginManager().getPlugin("AuthMe");
|
||||
this.database = this.plugin.database;
|
||||
}
|
||||
|
||||
/**
|
||||
* Hook into AuthMe
|
||||
*
|
||||
* @return
|
||||
*
|
||||
* @return AuthMe plugin
|
||||
*/
|
||||
public static API getInstance() {
|
||||
if (singleton != null)
|
||||
return singleton;
|
||||
Plugin p = Bukkit.getServer().getPluginManager().getPlugin("AuthMe");
|
||||
if (p == null || !(p instanceof AuthMe)) {
|
||||
return null;
|
||||
}
|
||||
AuthMe authme = (AuthMe) p;
|
||||
singleton = (new API(authme, authme.database));
|
||||
return singleton;
|
||||
}
|
||||
|
||||
public AuthMe getPlugin() {
|
||||
return plugin;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param player
|
||||
* @return true if player is authenticate
|
||||
*/
|
||||
public boolean isAuthenticated(Player player) {
|
||||
return PlayerCache.getInstance().isAuthenticated(player.getName());
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param player
|
||||
* @return true if player is a npc
|
||||
*/
|
||||
@Deprecated
|
||||
public boolean isaNPC(Player player) {
|
||||
if (plugin.getCitizensCommunicator().isNPC(player, plugin))
|
||||
return true;
|
||||
return CombatTagComunicator.isNPC(player);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param player
|
||||
* @return true if player is a npc
|
||||
*/
|
||||
public boolean isNPC(Player player) {
|
||||
if (plugin.getCitizensCommunicator().isNPC(player, plugin))
|
||||
return true;
|
||||
return CombatTagComunicator.isNPC(player);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param player
|
||||
* @return true if the player is unrestricted
|
||||
*/
|
||||
public boolean isUnrestricted(Player player) {
|
||||
return Utils.getInstance().isUnrestricted(player);
|
||||
}
|
||||
|
||||
public Location getLastLocation(Player player) {
|
||||
try {
|
||||
PlayerAuth auth = PlayerCache.getInstance().getAuth(player.getName().toLowerCase());
|
||||
|
||||
if (auth != null) {
|
||||
Location loc = new Location(Bukkit.getWorld(auth.getWorld()), auth.getQuitLocX(), auth.getQuitLocY(), auth.getQuitLocZ());
|
||||
return loc;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
||||
} catch (NullPointerException ex) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public void setPlayerInventory(Player player, ItemStack[] content,
|
||||
ItemStack[] armor) {
|
||||
try {
|
||||
player.getInventory().setContents(content);
|
||||
player.getInventory().setArmorContents(armor);
|
||||
} catch (NullPointerException npe) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param playerName
|
||||
* @return true if player is registered
|
||||
*/
|
||||
public boolean isRegistered(String playerName) {
|
||||
String player = playerName.toLowerCase();
|
||||
return database.isAuthAvailable(player);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param String
|
||||
* playerName, String passwordToCheck
|
||||
* @return true if the password is correct , false else
|
||||
*/
|
||||
public boolean checkPassword(String playerName, String passwordToCheck) {
|
||||
if (!isRegistered(playerName))
|
||||
return false;
|
||||
String player = playerName.toLowerCase();
|
||||
PlayerAuth auth = database.getAuth(player);
|
||||
try {
|
||||
return PasswordSecurity.comparePasswordWithHash(passwordToCheck, auth.getHash(), playerName);
|
||||
} catch (NoSuchAlgorithmException e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Register a player
|
||||
*
|
||||
* @param String
|
||||
* playerName, String password
|
||||
* @return true if the player is register correctly
|
||||
*/
|
||||
public boolean registerPlayer(String playerName, String password) {
|
||||
try {
|
||||
String name = playerName.toLowerCase();
|
||||
String hash = PasswordSecurity.getHash(Settings.getPasswordHash, password, name);
|
||||
if (isRegistered(name)) {
|
||||
return false;
|
||||
}
|
||||
PlayerAuth auth = new PlayerAuth(name, hash, "198.18.0.1", 0, "your@email.com");
|
||||
if (!database.saveAuth(auth)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
} catch (NoSuchAlgorithmException ex) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Force a player to login
|
||||
*
|
||||
* @param Player
|
||||
* player
|
||||
*/
|
||||
public void forceLogin(Player player) {
|
||||
plugin.management.performLogin(player, "dontneed", true);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -39,7 +39,6 @@ import fr.xephi.authme.security.PasswordSecurity;
|
||||
import fr.xephi.authme.settings.Messages;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
import fr.xephi.authme.settings.Spawn;
|
||||
import fr.xephi.authme.settings.SpoutCfg;
|
||||
import fr.xephi.authme.task.MessageTask;
|
||||
import fr.xephi.authme.task.TimeoutTask;
|
||||
|
||||
@ -47,7 +46,6 @@ public class AdminCommand implements CommandExecutor {
|
||||
|
||||
public AuthMe plugin;
|
||||
private Messages m = Messages.getInstance();
|
||||
private SpoutCfg s = SpoutCfg.getInstance();
|
||||
public DataSource database;
|
||||
|
||||
public AdminCommand(AuthMe plugin, DataSource database) {
|
||||
@ -125,7 +123,6 @@ public class AdminCommand implements CommandExecutor {
|
||||
return true;
|
||||
}
|
||||
} else if (args[0].equalsIgnoreCase("reload")) {
|
||||
database.reload();
|
||||
File newConfigFile = new File("plugins" + File.separator + "AuthMe", "config.yml");
|
||||
if (!newConfigFile.exists()) {
|
||||
InputStream fis = getClass().getResourceAsStream("" + File.separator + "config.yml");
|
||||
@ -155,7 +152,8 @@ public class AdminCommand implements CommandExecutor {
|
||||
YamlConfiguration newConfig = YamlConfiguration.loadConfiguration(newConfigFile);
|
||||
Settings.reloadConfigOptions(newConfig);
|
||||
m.reLoad();
|
||||
s.reLoad();
|
||||
plugin.database.close();
|
||||
plugin.setupDatabase();
|
||||
m.send(sender, "reload");
|
||||
} else if (args[0].equalsIgnoreCase("lastlogin")) {
|
||||
if (args.length != 2) {
|
||||
|
@ -2,8 +2,6 @@ package fr.xephi.authme.commands;
|
||||
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
|
||||
import me.muizers.Notifications.Notification;
|
||||
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
@ -58,7 +56,7 @@ public class ChangePasswordCommand implements CommandExecutor {
|
||||
m.send(player, "password_error");
|
||||
return true;
|
||||
}
|
||||
if ((lowpass.equalsIgnoreCase(name))){
|
||||
if ((lowpass.equalsIgnoreCase(name))) {
|
||||
m.send(player, "password_error_nick");
|
||||
return true;
|
||||
}
|
||||
@ -89,9 +87,6 @@ public class ChangePasswordCommand implements CommandExecutor {
|
||||
PlayerCache.getInstance().updatePlayer(auth);
|
||||
m.send(player, "pwd_changed");
|
||||
ConsoleLogger.info(player.getName() + " changed his password");
|
||||
if (plugin.notifications != null) {
|
||||
plugin.notifications.showNotification(new Notification("[AuthMe] " + player.getName() + " change his password!"));
|
||||
}
|
||||
} else {
|
||||
m.send(player, "wrong_pwd");
|
||||
}
|
||||
|
@ -2,7 +2,6 @@ package fr.xephi.authme.commands;
|
||||
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
@ -172,21 +171,8 @@ public class EmailCommand implements CommandExecutor {
|
||||
m.send(player, "email_invalid");
|
||||
return true;
|
||||
}
|
||||
final String finalhashnew = hashnew;
|
||||
final PlayerAuth finalauth = auth;
|
||||
if (data instanceof Thread) {
|
||||
finalauth.setHash(hashnew);
|
||||
data.updatePassword(auth);
|
||||
} else {
|
||||
Bukkit.getScheduler().runTaskAsynchronously(plugin, new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
finalauth.setHash(finalhashnew);
|
||||
data.updatePassword(finalauth);
|
||||
}
|
||||
});
|
||||
}
|
||||
auth.setHash(hashnew);
|
||||
data.updatePassword(auth);
|
||||
plugin.mail.main(auth, thePass);
|
||||
m.send(player, "email_send");
|
||||
} catch (NoSuchAlgorithmException ex) {
|
||||
|
@ -27,7 +27,6 @@ import fr.xephi.authme.settings.Messages;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
import fr.xephi.authme.task.MessageTask;
|
||||
import fr.xephi.authme.task.TimeoutTask;
|
||||
import me.muizers.Notifications.Notification;
|
||||
|
||||
public class UnregisterCommand implements CommandExecutor {
|
||||
|
||||
@ -98,9 +97,6 @@ public class UnregisterCommand implements CommandExecutor {
|
||||
LimboCache.getInstance().getLimboPlayer(name).setMessageTaskId(sched.runTaskAsynchronously(plugin, new MessageTask(plugin, name, m.send("reg_msg"), interval)));
|
||||
m.send(player, "unregistered");
|
||||
ConsoleLogger.info(player.getDisplayName() + " unregistered himself");
|
||||
if (plugin.notifications != null) {
|
||||
plugin.notifications.showNotification(new Notification("[AuthMe] " + player.getName() + " unregistered himself!"));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
if (!Settings.unRegisteredGroup.isEmpty()) {
|
||||
@ -116,9 +112,6 @@ public class UnregisterCommand implements CommandExecutor {
|
||||
player.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, Settings.getRegistrationTimeout * 20, 2));
|
||||
m.send(player, "unregistered");
|
||||
ConsoleLogger.info(player.getDisplayName() + " unregistered himself");
|
||||
if (plugin.notifications != null) {
|
||||
plugin.notifications.showNotification(new Notification("[AuthMe] " + player.getName() + " unregistered himself!"));
|
||||
}
|
||||
if (Settings.isTeleportToSpawnEnabled && !Settings.noTeleport) {
|
||||
Location spawn = plugin.getSpawnLocation(player);
|
||||
SpawnTeleportEvent tpEvent = new SpawnTeleportEvent(player, player.getLocation(), spawn, false);
|
||||
|
@ -1,132 +0,0 @@
|
||||
package fr.xephi.authme.converter;
|
||||
|
||||
import java.io.File;
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
import com.cypherx.xauth.xAuth;
|
||||
import com.cypherx.xauth.database.Table;
|
||||
import com.cypherx.xauth.utils.xAuthLog;
|
||||
|
||||
import fr.xephi.authme.AuthMe;
|
||||
import fr.xephi.authme.cache.auth.PlayerAuth;
|
||||
import fr.xephi.authme.datasource.DataSource;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Xephi59
|
||||
*/
|
||||
public class oldxAuthToFlat {
|
||||
|
||||
public AuthMe instance;
|
||||
public DataSource database;
|
||||
public CommandSender sender;
|
||||
|
||||
public oldxAuthToFlat(AuthMe instance, DataSource database,
|
||||
CommandSender sender) {
|
||||
this.instance = instance;
|
||||
this.database = database;
|
||||
this.sender = sender;
|
||||
}
|
||||
|
||||
public boolean convert() {
|
||||
if (instance.getServer().getPluginManager().getPlugin("xAuth") == null) {
|
||||
sender.sendMessage("[AuthMe] xAuth plugin not found");
|
||||
return false;
|
||||
}
|
||||
if (!(new File(instance.getDataFolder().getParent() + File.separator + "xAuth" + File.separator + "xAuth.h2.db").exists())) {
|
||||
sender.sendMessage("[AuthMe] xAuth H2 database not found, checking for MySQL or SQLite data...");
|
||||
}
|
||||
List<Integer> players = getXAuthPlayers();
|
||||
if (players == null || players.isEmpty()) {
|
||||
sender.sendMessage("[AuthMe] Error while import xAuthPlayers");
|
||||
return false;
|
||||
}
|
||||
sender.sendMessage("[AuthMe] Starting import...");
|
||||
try {
|
||||
for (int id : players) {
|
||||
String pl = getIdPlayer(id);
|
||||
String psw = getPassword(id);
|
||||
if (psw != null && !psw.isEmpty() && pl != null) {
|
||||
PlayerAuth auth = new PlayerAuth(pl, psw, "198.18.0.1", 0, "your@email.com");
|
||||
database.saveAuth(auth);
|
||||
}
|
||||
}
|
||||
sender.sendMessage("[AuthMe] Successfull convert from xAuth database");
|
||||
} catch (Exception e) {
|
||||
sender.sendMessage("[AuthMe] An error has been thrown while import xAuth database, the import hadn't fail but can be not complete ");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public String getIdPlayer(int id) {
|
||||
String realPass = "";
|
||||
Connection conn = xAuth.getPlugin().getDatabaseController().getConnection();
|
||||
PreparedStatement ps = null;
|
||||
ResultSet rs = null;
|
||||
try {
|
||||
String sql = String.format("SELECT `playername` FROM `%s` WHERE `id` = ?", xAuth.getPlugin().getDatabaseController().getTable(Table.ACCOUNT));
|
||||
ps = conn.prepareStatement(sql);
|
||||
ps.setInt(1, id);
|
||||
rs = ps.executeQuery();
|
||||
if (!rs.next())
|
||||
return null;
|
||||
realPass = rs.getString("playername").toLowerCase();
|
||||
} catch (SQLException e) {
|
||||
xAuthLog.severe("Failed to retrieve name for account: " + id, e);
|
||||
return null;
|
||||
} finally {
|
||||
xAuth.getPlugin().getDatabaseController().close(conn, ps, rs);
|
||||
}
|
||||
return realPass;
|
||||
}
|
||||
|
||||
public List<Integer> getXAuthPlayers() {
|
||||
List<Integer> xP = new ArrayList<Integer>();
|
||||
Connection conn = xAuth.getPlugin().getDatabaseController().getConnection();
|
||||
PreparedStatement ps = null;
|
||||
ResultSet rs = null;
|
||||
try {
|
||||
String sql = String.format("SELECT * FROM `%s`", xAuth.getPlugin().getDatabaseController().getTable(Table.ACCOUNT));
|
||||
ps = conn.prepareStatement(sql);
|
||||
rs = ps.executeQuery();
|
||||
while (rs.next()) {
|
||||
xP.add(rs.getInt("id"));
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
xAuthLog.severe("Cannot import xAuthPlayers", e);
|
||||
return new ArrayList<Integer>();
|
||||
} finally {
|
||||
xAuth.getPlugin().getDatabaseController().close(conn, ps, rs);
|
||||
}
|
||||
return xP;
|
||||
}
|
||||
|
||||
public String getPassword(int accountId) {
|
||||
String realPass = "";
|
||||
Connection conn = xAuth.getPlugin().getDatabaseController().getConnection();
|
||||
PreparedStatement ps = null;
|
||||
ResultSet rs = null;
|
||||
try {
|
||||
String sql = String.format("SELECT `password`, `pwtype` FROM `%s` WHERE `id` = ?", xAuth.getPlugin().getDatabaseController().getTable(Table.ACCOUNT));
|
||||
ps = conn.prepareStatement(sql);
|
||||
ps.setInt(1, accountId);
|
||||
rs = ps.executeQuery();
|
||||
if (!rs.next())
|
||||
return null;
|
||||
realPass = rs.getString("password");
|
||||
} catch (SQLException e) {
|
||||
xAuthLog.severe("Failed to retrieve password hash for account: " + accountId, e);
|
||||
return null;
|
||||
} finally {
|
||||
xAuth.getPlugin().getDatabaseController().close(conn, ps, rs);
|
||||
}
|
||||
return realPass;
|
||||
}
|
||||
}
|
@ -21,17 +21,11 @@ public class xAuthConverter implements Converter {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
Class.forName("com.cypherx.xauth.xAuth");
|
||||
oldxAuthToFlat converter = new oldxAuthToFlat(plugin, database, sender);
|
||||
Class.forName("de.luricos.bukkit.xAuth.xAuth");
|
||||
xAuthToFlat converter = new xAuthToFlat(plugin, database, sender);
|
||||
converter.convert();
|
||||
} catch (ClassNotFoundException e) {
|
||||
try {
|
||||
Class.forName("de.luricos.bukkit.xAuth.xAuth");
|
||||
newxAuthToFlat converter = new newxAuthToFlat(plugin, database, sender);
|
||||
converter.convert();
|
||||
} catch (ClassNotFoundException ce) {
|
||||
sender.sendMessage("xAuth has not been found, please put xAuth.jar in your plugin folder and restart!");
|
||||
}
|
||||
} catch (ClassNotFoundException ce) {
|
||||
sender.sendMessage("xAuth has not been found, please put xAuth.jar in your plugin folder and restart!");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -17,13 +17,13 @@ import fr.xephi.authme.AuthMe;
|
||||
import fr.xephi.authme.cache.auth.PlayerAuth;
|
||||
import fr.xephi.authme.datasource.DataSource;
|
||||
|
||||
public class newxAuthToFlat {
|
||||
public class xAuthToFlat {
|
||||
|
||||
public AuthMe instance;
|
||||
public DataSource database;
|
||||
public CommandSender sender;
|
||||
|
||||
public newxAuthToFlat(AuthMe instance, DataSource database,
|
||||
public xAuthToFlat(AuthMe instance, DataSource database,
|
||||
CommandSender sender) {
|
||||
this.instance = instance;
|
||||
this.database = database;
|
@ -1,33 +0,0 @@
|
||||
package fr.xephi.authme.events;
|
||||
|
||||
import fr.xephi.authme.cache.auth.PlayerAuth;
|
||||
|
||||
/**
|
||||
*
|
||||
* This event is call when a player logging in through a timed session
|
||||
*
|
||||
* @author Xephi59
|
||||
*/
|
||||
public class SessionEvent extends CustomEvent {
|
||||
|
||||
private PlayerAuth player;
|
||||
private boolean isLogin;
|
||||
|
||||
public SessionEvent(PlayerAuth auth, boolean isLogin) {
|
||||
this.player = auth;
|
||||
this.isLogin = isLogin;
|
||||
}
|
||||
|
||||
public PlayerAuth getPlayerAuth() {
|
||||
return this.player;
|
||||
}
|
||||
|
||||
public void setPlayer(PlayerAuth player) {
|
||||
this.player = player;
|
||||
}
|
||||
|
||||
public boolean isLogin() {
|
||||
return isLogin;
|
||||
}
|
||||
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
package fr.xephi.authme.gui;
|
||||
|
||||
import org.getspout.spoutapi.event.screen.ButtonClickEvent;
|
||||
|
||||
public interface Clickable {
|
||||
|
||||
public void handleClick(ButtonClickEvent event);
|
||||
}
|
@ -1,24 +0,0 @@
|
||||
package fr.xephi.authme.gui;
|
||||
|
||||
import org.getspout.spoutapi.event.screen.ButtonClickEvent;
|
||||
import org.getspout.spoutapi.gui.GenericButton;
|
||||
|
||||
public class CustomButton extends GenericButton {
|
||||
|
||||
public Clickable handleRef = null;
|
||||
|
||||
public CustomButton(Clickable c) {
|
||||
handleRef = c;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onButtonClick(ButtonClickEvent event) {
|
||||
handleRef.handleClick(event);
|
||||
}
|
||||
|
||||
public CustomButton setMidPos(int x, int y) {
|
||||
this.setX(x).setY(y).shiftXPos(-(width / 2)).shiftYPos(-(height / 2));
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
@ -1,96 +0,0 @@
|
||||
package fr.xephi.authme.gui.screens;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.getspout.spoutapi.event.screen.ButtonClickEvent;
|
||||
import org.getspout.spoutapi.gui.Button;
|
||||
import org.getspout.spoutapi.gui.Color;
|
||||
import org.getspout.spoutapi.gui.GenericLabel;
|
||||
import org.getspout.spoutapi.gui.GenericPopup;
|
||||
import org.getspout.spoutapi.gui.GenericTextField;
|
||||
import org.getspout.spoutapi.gui.RenderPriority;
|
||||
import org.getspout.spoutapi.gui.Widget;
|
||||
import org.getspout.spoutapi.gui.WidgetAnchor;
|
||||
import org.getspout.spoutapi.player.SpoutPlayer;
|
||||
|
||||
import fr.xephi.authme.AuthMe;
|
||||
import fr.xephi.authme.gui.Clickable;
|
||||
import fr.xephi.authme.gui.CustomButton;
|
||||
import fr.xephi.authme.settings.SpoutCfg;
|
||||
|
||||
public class LoginScreen extends GenericPopup implements Clickable {
|
||||
|
||||
public AuthMe plugin = AuthMe.getInstance();
|
||||
private SpoutCfg spoutCfg = SpoutCfg.getInstance();
|
||||
private CustomButton exitBtn;
|
||||
private CustomButton loginBtn;
|
||||
private GenericTextField passBox;
|
||||
private GenericLabel titleLbl;
|
||||
private GenericLabel textLbl;
|
||||
private GenericLabel errorLbl;
|
||||
|
||||
String exitTxt = spoutCfg.getString("LoginScreen.exit button");
|
||||
String loginTxt = spoutCfg.getString("LoginScreen.login button");
|
||||
String exitMsg = spoutCfg.getString("LoginScreen.exit message");
|
||||
String title = spoutCfg.getString("LoginScreen.title");
|
||||
@SuppressWarnings("unchecked")
|
||||
List<String> textlines = (List<String>) spoutCfg.getList("LoginScreen.text");
|
||||
public SpoutPlayer splayer;
|
||||
|
||||
public LoginScreen(SpoutPlayer player) {
|
||||
this.splayer = player;
|
||||
createScreen();
|
||||
}
|
||||
|
||||
private void createScreen() {
|
||||
int objects = textlines.size() + 4;
|
||||
int part = !(textlines.size() <= 5) ? 195 / objects : 20;
|
||||
int h = 3 * part / 4, w = 8 * part;
|
||||
titleLbl = new GenericLabel();
|
||||
titleLbl.setText(title).setTextColor(new Color(1.0F, 0, 0, 1.0F)).setAlign(WidgetAnchor.TOP_CENTER).setHeight(h).setWidth(w).setX(maxWidth / 2).setY(25);
|
||||
this.attachWidget(plugin, titleLbl);
|
||||
int ystart = 25 + h + part / 2;
|
||||
for (int x = 0; x < textlines.size(); x++) {
|
||||
textLbl = new GenericLabel();
|
||||
textLbl.setText(textlines.get(x)).setAlign(WidgetAnchor.TOP_CENTER).setHeight(h).setWidth(w).setX(maxWidth / 2).setY(ystart + x * part);
|
||||
this.attachWidget(plugin, textLbl);
|
||||
}
|
||||
passBox = new GenericTextField();
|
||||
passBox.setMaximumCharacters(18).setMaximumLines(1).setHeight(h - 2).setWidth(w - 2).setY(220 - h - 2 * part);
|
||||
passBox.setPasswordField(true);
|
||||
setXToMid(passBox);
|
||||
this.attachWidget(plugin, passBox);
|
||||
errorLbl = new GenericLabel();
|
||||
errorLbl.setText("").setTextColor(new Color(1.0F, 0, 0, 1.0F)).setHeight(h).setWidth(w).setX(passBox.getX() + passBox.getWidth() + 2).setY(passBox.getY());
|
||||
this.attachWidget(plugin, errorLbl);
|
||||
loginBtn = new CustomButton(this);
|
||||
loginBtn.setText(loginTxt).setHeight(h).setWidth(w).setY(220 - h - part);
|
||||
setXToMid(loginBtn);
|
||||
this.attachWidget(plugin, loginBtn);
|
||||
exitBtn = new CustomButton(this);
|
||||
exitBtn.setText(exitTxt).setHeight(h).setWidth(w).setY(220 - h);
|
||||
setXToMid(exitBtn);
|
||||
this.attachWidget(plugin, exitBtn);
|
||||
this.setPriority(RenderPriority.Highest);
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
public void handleClick(ButtonClickEvent event) {
|
||||
Button b = event.getButton();
|
||||
SpoutPlayer player = event.getPlayer();
|
||||
if (event.isCancelled() || event == null || event.getPlayer() == null)
|
||||
return;
|
||||
if (b.equals(loginBtn)) {
|
||||
plugin.management.performLogin(player, passBox.getText(), false);
|
||||
} else if (b.equals(exitBtn)) {
|
||||
event.getPlayer().kickPlayer(exitMsg);
|
||||
}
|
||||
}
|
||||
|
||||
private void setXToMid(Widget w) {
|
||||
w.setX((maxWidth - w.getWidth()) / 2);
|
||||
}
|
||||
|
||||
}
|
@ -39,7 +39,6 @@ import org.bukkit.event.player.PlayerRespawnEvent;
|
||||
import fr.xephi.authme.AuthMe;
|
||||
import fr.xephi.authme.ConsoleLogger;
|
||||
import fr.xephi.authme.Utils;
|
||||
import fr.xephi.authme.api.API;
|
||||
import fr.xephi.authme.cache.auth.PlayerAuth;
|
||||
import fr.xephi.authme.cache.auth.PlayerCache;
|
||||
import fr.xephi.authme.cache.limbo.LimboCache;
|
||||
@ -54,7 +53,6 @@ public class AuthMePlayerListener implements Listener {
|
||||
public static GameMode gm = GameMode.SURVIVAL;
|
||||
public static ConcurrentHashMap<String, GameMode> gameMode = new ConcurrentHashMap<String, GameMode>();
|
||||
public static ConcurrentHashMap<String, String> joinMessage = new ConcurrentHashMap<String, String>();
|
||||
private Utils utils = Utils.getInstance();
|
||||
private Messages m = Messages.getInstance();
|
||||
public AuthMe plugin;
|
||||
private DataSource data;
|
||||
@ -344,7 +342,8 @@ public class AuthMePlayerListener implements Listener {
|
||||
}
|
||||
|
||||
if (!Settings.isMovementAllowed) {
|
||||
event.setTo(event.getFrom());
|
||||
if (!event.getFrom().getBlock().equals(event.getTo().getBlock()))
|
||||
event.setTo(event.getFrom());
|
||||
return;
|
||||
}
|
||||
|
||||
@ -355,14 +354,15 @@ public class AuthMePlayerListener implements Listener {
|
||||
int radius = Settings.getMovementRadius;
|
||||
Location spawn = plugin.getSpawnLocation(player);
|
||||
|
||||
if (spawn != null && spawn.getWorld() != null)
|
||||
if (spawn != null && spawn.getWorld() != null) {
|
||||
if (!event.getPlayer().getWorld().equals(spawn.getWorld())) {
|
||||
event.getPlayer().teleport(spawn);
|
||||
return;
|
||||
}
|
||||
if ((spawn.distance(player.getLocation()) > radius) && spawn.getWorld() != null) {
|
||||
event.getPlayer().teleport(spawn);
|
||||
return;
|
||||
if ((spawn.distance(player.getLocation()) > radius)) {
|
||||
event.getPlayer().teleport(spawn);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -405,6 +405,7 @@ public class AuthMePlayerListener implements Listener {
|
||||
if (player == null)
|
||||
return;
|
||||
final String name = player.getName().toLowerCase();
|
||||
boolean isAuthAvailable = data.isAuthAvailable(name);
|
||||
|
||||
if (plugin.getCitizensCommunicator().isNPC(player, plugin) || Utils.getInstance().isUnrestricted(player) || CombatTagComunicator.isNPC(player)) {
|
||||
return;
|
||||
@ -412,7 +413,7 @@ public class AuthMePlayerListener implements Listener {
|
||||
|
||||
if (Settings.enablePasspartu && !Settings.countriesBlacklist.isEmpty()) {
|
||||
String code = plugin.getCountryCode(event.getAddress().getHostAddress());
|
||||
if (((code == null) || (Settings.countriesBlacklist.contains(code) && !API.isRegistered(name))) && !plugin.authmePermissible(player, "authme.bypassantibot")) {
|
||||
if (((code == null) || (Settings.countriesBlacklist.contains(code) && !isAuthAvailable)) && !plugin.authmePermissible(player, "authme.bypassantibot")) {
|
||||
event.setKickMessage(m.send("country_banned")[0]);
|
||||
event.setResult(PlayerLoginEvent.Result.KICK_OTHER);
|
||||
return;
|
||||
@ -420,7 +421,7 @@ public class AuthMePlayerListener implements Listener {
|
||||
}
|
||||
if (Settings.enableProtection && !Settings.countries.isEmpty()) {
|
||||
String code = plugin.getCountryCode(event.getAddress().getHostAddress());
|
||||
if (((code == null) || (!Settings.countries.contains(code) && !API.isRegistered(name))) && !plugin.authmePermissible(player, "authme.bypassantibot")) {
|
||||
if (((code == null) || (!Settings.countries.contains(code) && !isAuthAvailable)) && !plugin.authmePermissible(player, "authme.bypassantibot")) {
|
||||
event.setKickMessage(m.send("country_banned")[0]);
|
||||
event.setResult(PlayerLoginEvent.Result.KICK_OTHER);
|
||||
return;
|
||||
@ -441,18 +442,6 @@ public class AuthMePlayerListener implements Listener {
|
||||
return;
|
||||
}
|
||||
|
||||
if (data.isAuthAvailable(name) && LimboCache.getInstance().hasLimboPlayer(name))
|
||||
if (Settings.isSessionsEnabled)
|
||||
if (PlayerCache.getInstance().isAuthenticated(name))
|
||||
if (!Settings.sessionExpireOnIpChange)
|
||||
Bukkit.getScheduler().runTaskAsynchronously(plugin, new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
LimboCache.getInstance().deleteLimboPlayer(name);
|
||||
}
|
||||
});
|
||||
|
||||
// Check if forceSingleSession is set to true, so kick player that has
|
||||
// joined with same nick of online player
|
||||
if (player.isOnline() && Settings.isForceSingleSessionEnabled) {
|
||||
@ -589,7 +578,7 @@ public class AuthMePlayerListener implements Listener {
|
||||
Player player = event.getPlayer();
|
||||
String name = player.getName().toLowerCase();
|
||||
|
||||
plugin.management.performQuit(player);
|
||||
plugin.management.performQuit(player, false);
|
||||
|
||||
if (data.getAuth(name) != null && !PlayerCache.getInstance().isAuthenticated(name) && Settings.enableProtection)
|
||||
event.setQuitMessage(null);
|
||||
@ -611,7 +600,7 @@ public class AuthMePlayerListener implements Listener {
|
||||
return;
|
||||
}
|
||||
|
||||
plugin.management.performQuit(player);
|
||||
plugin.management.performQuit(player, true);
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
|
@ -56,20 +56,16 @@ public class AuthMeServerListener implements Listener {
|
||||
ConsoleLogger.info("Multiverse-Core has been disabled, unhook!");
|
||||
return;
|
||||
}
|
||||
if (pluginName.equalsIgnoreCase("Notifications")) {
|
||||
plugin.notifications = null;
|
||||
ConsoleLogger.info("Notifications has been disabled, unhook!");
|
||||
}
|
||||
if (pluginName.equalsIgnoreCase("ChestShop")) {
|
||||
plugin.ChestShop = 0;
|
||||
ConsoleLogger.info("ChestShop has been disabled, unhook!");
|
||||
}
|
||||
if (pluginName.equalsIgnoreCase("CombatTag")) {
|
||||
plugin.CombatTag = 0;
|
||||
plugin.CombatTag = false;
|
||||
ConsoleLogger.info("CombatTag has been disabled, unhook!");
|
||||
}
|
||||
if (pluginName.equalsIgnoreCase("Citizens")) {
|
||||
plugin.CitizensVersion = 0;
|
||||
plugin.isCitizensActive = false;
|
||||
ConsoleLogger.info("Citizens has been disabled, unhook!");
|
||||
}
|
||||
if (pluginName.equalsIgnoreCase("Vault")) {
|
||||
@ -85,8 +81,6 @@ public class AuthMeServerListener implements Listener {
|
||||
plugin.checkEssentials();
|
||||
if (pluginName.equalsIgnoreCase("Multiverse-Core"))
|
||||
plugin.checkMultiverse();
|
||||
if (pluginName.equalsIgnoreCase("Notifications"))
|
||||
plugin.checkNotifications();
|
||||
if (pluginName.equalsIgnoreCase("ChestShop"))
|
||||
plugin.checkChestShop();
|
||||
if (pluginName.equalsIgnoreCase("CombatTag"))
|
||||
|
@ -1,28 +0,0 @@
|
||||
package fr.xephi.authme.listener;
|
||||
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.getspout.spoutapi.event.spout.SpoutCraftEnableEvent;
|
||||
|
||||
import fr.xephi.authme.cache.auth.PlayerCache;
|
||||
import fr.xephi.authme.datasource.DataSource;
|
||||
import fr.xephi.authme.gui.screens.LoginScreen;
|
||||
import fr.xephi.authme.settings.SpoutCfg;
|
||||
|
||||
public class AuthMeSpoutListener implements Listener {
|
||||
|
||||
private DataSource data;
|
||||
|
||||
public AuthMeSpoutListener(DataSource data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onSpoutCraftEnable(final SpoutCraftEnableEvent event) {
|
||||
if (SpoutCfg.getInstance().getBoolean("LoginScreen.enabled")) {
|
||||
if (data.isAuthAvailable(event.getPlayer().getName().toLowerCase()) && !PlayerCache.getInstance().isAuthenticated(event.getPlayer().getName().toLowerCase())) {
|
||||
event.getPlayer().getMainScreen().attachPopupScreen(new LoginScreen(event.getPlayer()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,11 +1,9 @@
|
||||
package fr.xephi.authme.plugin.manager;
|
||||
|
||||
import net.citizensnpcs.api.CitizensAPI;
|
||||
import net.citizensnpcs.api.CitizensManager;
|
||||
|
||||
import org.bukkit.entity.Entity;
|
||||
|
||||
import fr.xephi.authme.AuthMe;
|
||||
import net.citizensnpcs.api.CitizensAPI;
|
||||
|
||||
public class CitizensCommunicator {
|
||||
|
||||
@ -16,14 +14,10 @@ public class CitizensCommunicator {
|
||||
}
|
||||
|
||||
public boolean isNPC(final Entity player, AuthMe instance) {
|
||||
if (!this.instance.isCitizensActive)
|
||||
return false;
|
||||
try {
|
||||
if (instance.CitizensVersion == 1) {
|
||||
return CitizensManager.isNPC(player);
|
||||
} else if (instance.CitizensVersion == 2) {
|
||||
return CitizensAPI.getNPCRegistry().isNPC(player);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
return CitizensAPI.getNPCRegistry().isNPC(player);
|
||||
} catch (NoClassDefFoundError ncdfe) {
|
||||
return false;
|
||||
} catch (Exception npe) {
|
||||
|
@ -1,7 +1,5 @@
|
||||
package fr.xephi.authme.plugin.manager;
|
||||
|
||||
import net.minelink.ctplus.CombatTagPlus;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -10,6 +8,9 @@ import org.bukkit.plugin.Plugin;
|
||||
import com.trc202.CombatTag.CombatTag;
|
||||
import com.trc202.CombatTagApi.CombatTagApi;
|
||||
|
||||
import fr.xephi.authme.AuthMe;
|
||||
import net.minelink.ctplus.CombatTagPlus;
|
||||
|
||||
public abstract class CombatTagComunicator {
|
||||
|
||||
public static CombatTagApi combatApi;
|
||||
@ -21,6 +22,8 @@ public abstract class CombatTagComunicator {
|
||||
* @return true if the player is an NPC
|
||||
*/
|
||||
public static boolean isNPC(Entity player) {
|
||||
if (!AuthMe.getInstance().CombatTag)
|
||||
return false;
|
||||
try {
|
||||
if (Bukkit.getServer().getPluginManager().getPlugin("CombatTag") != null) {
|
||||
combatApi = new CombatTagApi((CombatTag) Bukkit.getServer().getPluginManager().getPlugin("CombatTag"));
|
||||
|
@ -16,8 +16,8 @@ import fr.xephi.authme.settings.Settings;
|
||||
|
||||
/**
|
||||
*
|
||||
* @authors Xephi59, <a
|
||||
* href="http://dev.bukkit.org/profiles/Possible/">Possible</a>
|
||||
* @authors Xephi59,
|
||||
* <a href="http://dev.bukkit.org/profiles/Possible/">Possible</a>
|
||||
*
|
||||
*/
|
||||
public class Management {
|
||||
@ -65,12 +65,12 @@ public class Management {
|
||||
});
|
||||
}
|
||||
|
||||
public void performQuit(final Player player) {
|
||||
public void performQuit(final Player player, final boolean isKick) {
|
||||
Bukkit.getScheduler().runTaskAsynchronously(plugin, new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
new AsyncronousQuit(player, plugin, database).process();
|
||||
new AsyncronousQuit(player, plugin, database, isKick).process();
|
||||
}
|
||||
|
||||
});
|
||||
|
@ -1,7 +1,5 @@
|
||||
package fr.xephi.authme.process.join;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Location;
|
||||
@ -17,7 +15,6 @@ import fr.xephi.authme.AuthMe;
|
||||
import fr.xephi.authme.ConsoleLogger;
|
||||
import fr.xephi.authme.Utils;
|
||||
import fr.xephi.authme.Utils.groupType;
|
||||
import fr.xephi.authme.api.API;
|
||||
import fr.xephi.authme.cache.auth.PlayerAuth;
|
||||
import fr.xephi.authme.cache.auth.PlayerCache;
|
||||
import fr.xephi.authme.cache.backup.DataFileCache;
|
||||
@ -26,7 +23,6 @@ import fr.xephi.authme.cache.limbo.LimboCache;
|
||||
import fr.xephi.authme.cache.limbo.LimboPlayer;
|
||||
import fr.xephi.authme.datasource.DataSource;
|
||||
import fr.xephi.authme.events.ProtectInventoryEvent;
|
||||
import fr.xephi.authme.events.SessionEvent;
|
||||
import fr.xephi.authme.events.SpawnTeleportEvent;
|
||||
import fr.xephi.authme.listener.AuthMePlayerListener;
|
||||
import fr.xephi.authme.plugin.manager.CombatTagComunicator;
|
||||
@ -95,76 +91,6 @@ public class AsyncronousJoin {
|
||||
}
|
||||
final Location spawnLoc = plugin.getSpawnLocation(player);
|
||||
if (database.isAuthAvailable(name)) {
|
||||
if (Settings.isSessionsEnabled) {
|
||||
PlayerAuth auth = database.getAuth(name);
|
||||
long timeout = Settings.getSessionTimeout * 60000;
|
||||
long lastLogin = auth.getLastLogin();
|
||||
long cur = new Date().getTime();
|
||||
if ((cur - lastLogin < timeout || timeout == 0) && !auth.getIp().matches("198.168.(0|1).1")) {
|
||||
if (auth.getNickname().equalsIgnoreCase(name) && auth.getIp().equals(ip)) {
|
||||
if (PlayerCache.getInstance().getAuth(name) != null) {
|
||||
PlayerCache.getInstance().updatePlayer(auth);
|
||||
} else {
|
||||
PlayerCache.getInstance().addPlayer(auth);
|
||||
database.setLogged(name);
|
||||
}
|
||||
m.send(player, "valid_session");
|
||||
// Restore Permission Group
|
||||
utils.setGroup(player, Utils.groupType.LOGGEDIN);
|
||||
plugin.getServer().getPluginManager().callEvent(new SessionEvent(auth, true));
|
||||
return;
|
||||
} else if (!Settings.sessionExpireOnIpChange) {
|
||||
final GameMode gM = AuthMePlayerListener.gameMode.get(name);
|
||||
sched.scheduleSyncDelayedTask(plugin, new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
AuthMePlayerListener.causeByAuthMe.put(name, true);
|
||||
player.setGameMode(gM);
|
||||
AuthMePlayerListener.causeByAuthMe.put(name, false);
|
||||
player.kickPlayer(m.send("unvalid_session")[0]);
|
||||
}
|
||||
|
||||
});
|
||||
return;
|
||||
} else if (auth.getNickname().equalsIgnoreCase(name)) {
|
||||
if (Settings.isForceSurvivalModeEnabled && !Settings.forceOnlyAfterLogin) {
|
||||
sched.scheduleSyncDelayedTask(plugin, new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
AuthMePlayerListener.causeByAuthMe.put(name, true);
|
||||
Utils.forceGM(player);
|
||||
AuthMePlayerListener.causeByAuthMe.put(name, false);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
// Player change his IP between 2 relog-in
|
||||
PlayerCache.getInstance().removePlayer(name);
|
||||
database.setUnlogged(name);
|
||||
} else {
|
||||
final GameMode gM = AuthMePlayerListener.gameMode.get(name);
|
||||
sched.scheduleSyncDelayedTask(plugin, new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
AuthMePlayerListener.causeByAuthMe.put(name, true);
|
||||
player.setGameMode(gM);
|
||||
AuthMePlayerListener.causeByAuthMe.put(name, false);
|
||||
player.kickPlayer(m.send("unvalid_session")[0]);
|
||||
}
|
||||
|
||||
});
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
// Session is ended correctly
|
||||
PlayerCache.getInstance().removePlayer(name);
|
||||
database.setUnlogged(name);
|
||||
}
|
||||
}
|
||||
// isent in session or session was ended correctly
|
||||
if (Settings.isForceSurvivalModeEnabled && !Settings.forceOnlyAfterLogin) {
|
||||
sched.scheduleSyncDelayedTask(plugin, new Runnable() {
|
||||
|
||||
@ -255,7 +181,7 @@ public class AsyncronousJoin {
|
||||
if (!Settings.noConsoleSpam)
|
||||
ConsoleLogger.info("ProtectInventoryEvent has been cancelled for " + player.getName() + " ...");
|
||||
} else {
|
||||
API.setPlayerInventory(player, ev.getEmptyInventory(), ev.getEmptyArmor());
|
||||
plugin.api.setPlayerInventory(player, ev.getEmptyInventory(), ev.getEmptyArmor());
|
||||
}
|
||||
} catch (NullPointerException ex) {
|
||||
}
|
||||
@ -302,6 +228,23 @@ public class AsyncronousJoin {
|
||||
}
|
||||
|
||||
});
|
||||
if (Settings.isSessionsEnabled && database.isAuthAvailable(name) && (PlayerCache.getInstance().isAuthenticated(name) || database.isLogged(name))) {
|
||||
if (plugin.sessions.containsKey(name))
|
||||
plugin.sessions.get(name).cancel();
|
||||
plugin.sessions.remove(name);
|
||||
PlayerAuth auth = database.getAuth(name);
|
||||
if (auth != null && auth.getIp().equals(ip)) {
|
||||
m.send(player, "valid_session");
|
||||
PlayerCache.getInstance().removePlayer(name);
|
||||
database.setUnlogged(name);
|
||||
plugin.management.performLogin(player, "dontneed", true);
|
||||
} else if (Settings.sessionExpireOnIpChange) {
|
||||
PlayerCache.getInstance().removePlayer(name);
|
||||
database.setUnlogged(name);
|
||||
m.send(player, "invalid_session");
|
||||
}
|
||||
return;
|
||||
}
|
||||
BukkitTask msgT = sched.runTaskAsynchronously(plugin, new MessageTask(plugin, name, msg, msgInterval));
|
||||
LimboCache.getInstance().getLimboPlayer(name).setMessageTaskId(msgT);
|
||||
}
|
||||
|
@ -19,7 +19,6 @@ import fr.xephi.authme.security.RandomString;
|
||||
import fr.xephi.authme.settings.Messages;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
import fr.xephi.authme.task.MessageTask;
|
||||
import me.muizers.Notifications.Notification;
|
||||
|
||||
public class AsyncronousLogin {
|
||||
|
||||
@ -147,23 +146,19 @@ public class AsyncronousLogin {
|
||||
}
|
||||
|
||||
player.setNoDamageTicks(0);
|
||||
m.send(player, "login");
|
||||
if (!forceLogin)
|
||||
m.send(player, "login");
|
||||
|
||||
displayOtherAccounts(auth, player);
|
||||
|
||||
|
||||
if (Settings.recallEmail) {
|
||||
if (email == null || email.isEmpty() || email.equalsIgnoreCase("your@email.com"))
|
||||
m.send(player, "add_email");
|
||||
}
|
||||
|
||||
|
||||
if (!Settings.noConsoleSpam)
|
||||
ConsoleLogger.info(player.getName() + " logged in!");
|
||||
|
||||
if (plugin.notifications != null) {
|
||||
plugin.notifications.showNotification(new Notification("[AuthMe] " + player.getName() + " logged in!"));
|
||||
}
|
||||
|
||||
// makes player isLoggedin via API
|
||||
PlayerCache.getInstance().addPlayer(auth);
|
||||
database.setLogged(name);
|
||||
|
@ -91,7 +91,7 @@ public class ProcessSyncronousPlayerLogin implements Runnable {
|
||||
RestoreInventoryEvent event = new RestoreInventoryEvent(player, limbo.getInventory(), limbo.getArmour());
|
||||
Bukkit.getServer().getPluginManager().callEvent(event);
|
||||
if (!event.isCancelled()) {
|
||||
API.setPlayerInventory(player, event.getInventory(), event.getArmor());
|
||||
plugin.api.setPlayerInventory(player, event.getInventory(), event.getArmor());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -28,7 +28,8 @@ public class AsyncronousLogout {
|
||||
private Utils utils = Utils.getInstance();
|
||||
private FileCache playerBackup;
|
||||
|
||||
public AsyncronousLogout(Player player, AuthMe plugin, DataSource database) {
|
||||
public AsyncronousLogout(Player player, AuthMe plugin,
|
||||
DataSource database) {
|
||||
this.player = player;
|
||||
this.plugin = plugin;
|
||||
this.database = database;
|
||||
@ -50,8 +51,6 @@ public class AsyncronousLogout {
|
||||
final Player p = player;
|
||||
BukkitScheduler sched = p.getServer().getScheduler();
|
||||
PlayerAuth auth = PlayerCache.getInstance().getAuth(name);
|
||||
if (Settings.isSessionsEnabled)
|
||||
auth.setLastLogin(0L);
|
||||
database.updateSession(auth);
|
||||
auth.setQuitLocX(p.getLocation().getX());
|
||||
auth.setQuitLocY(p.getLocation().getY());
|
||||
|
@ -15,7 +15,6 @@ import fr.xephi.authme.settings.Messages;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
import fr.xephi.authme.task.MessageTask;
|
||||
import fr.xephi.authme.task.TimeoutTask;
|
||||
import me.muizers.Notifications.Notification;
|
||||
|
||||
public class ProcessSyncronousPlayerLogout implements Runnable {
|
||||
|
||||
@ -32,6 +31,9 @@ public class ProcessSyncronousPlayerLogout implements Runnable {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
if (plugin.sessions.containsKey(name))
|
||||
plugin.sessions.get(name).cancel();
|
||||
plugin.sessions.remove(name);
|
||||
int delay = Settings.getRegistrationTimeout * 20;
|
||||
int interval = Settings.getWarnMessageInterval;
|
||||
BukkitScheduler sched = player.getServer().getScheduler();
|
||||
@ -61,9 +63,6 @@ public class ProcessSyncronousPlayerLogout implements Runnable {
|
||||
});
|
||||
m.send(player, "logout");
|
||||
ConsoleLogger.info(player.getDisplayName() + " logged out");
|
||||
if (plugin.notifications != null) {
|
||||
plugin.notifications.showNotification(new Notification("[AuthMe] " + player.getName() + " logged out!"));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -4,6 +4,7 @@ import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.scheduler.BukkitTask;
|
||||
|
||||
import fr.xephi.authme.AuthMe;
|
||||
import fr.xephi.authme.Utils;
|
||||
@ -30,13 +31,16 @@ public class AsyncronousQuit {
|
||||
private boolean isOp = false;
|
||||
private boolean isFlying = false;
|
||||
private boolean needToChange = false;
|
||||
private boolean isKick = false;
|
||||
|
||||
public AsyncronousQuit(Player p, AuthMe plugin, DataSource database) {
|
||||
public AsyncronousQuit(Player p, AuthMe plugin, DataSource database,
|
||||
boolean isKick) {
|
||||
this.p = p;
|
||||
this.plugin = plugin;
|
||||
this.database = database;
|
||||
this.name = p.getName().toLowerCase();
|
||||
this.playerBackup = new FileCache(plugin);
|
||||
this.isKick = isKick;
|
||||
}
|
||||
|
||||
public void process() {
|
||||
@ -79,9 +83,24 @@ public class AsyncronousQuit {
|
||||
playerBackup.removeCache(player);
|
||||
}
|
||||
}
|
||||
PlayerCache.getInstance().removePlayer(name);
|
||||
database.setUnlogged(name);
|
||||
if (Settings.isSessionsEnabled && !isKick) {
|
||||
BukkitTask task = plugin.getServer().getScheduler().runTaskLaterAsynchronously(plugin, new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
PlayerCache.getInstance().removePlayer(name);
|
||||
if (database.isLogged(name))
|
||||
database.setUnlogged(name);
|
||||
plugin.sessions.remove(name);
|
||||
}
|
||||
|
||||
}, Settings.getSessionTimeout * 20 * 60);
|
||||
plugin.sessions.put(name, task);
|
||||
} else {
|
||||
PlayerCache.getInstance().removePlayer(name);
|
||||
database.setUnlogged(name);
|
||||
}
|
||||
AuthMePlayerListener.gameMode.remove(name);
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new ProcessSyncronousPlayerQuit(player, inv, armor, isOp, isFlying, needToChange));
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new ProcessSyncronousPlayerQuit(plugin, player, inv, armor, isOp, isFlying, needToChange));
|
||||
}
|
||||
}
|
||||
|
@ -4,12 +4,13 @@ import org.bukkit.GameMode;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import fr.xephi.authme.api.API;
|
||||
import fr.xephi.authme.AuthMe;
|
||||
import fr.xephi.authme.events.RestoreInventoryEvent;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
|
||||
public class ProcessSyncronousPlayerQuit implements Runnable {
|
||||
|
||||
protected AuthMe plugin;
|
||||
protected Player player;
|
||||
protected boolean isOp;
|
||||
protected boolean isFlying;
|
||||
@ -17,9 +18,10 @@ public class ProcessSyncronousPlayerQuit implements Runnable {
|
||||
protected ItemStack[] armor;
|
||||
protected boolean needToChange;
|
||||
|
||||
public ProcessSyncronousPlayerQuit(Player player, ItemStack[] inv,
|
||||
ItemStack[] armor, boolean isOp, boolean isFlying,
|
||||
public ProcessSyncronousPlayerQuit(AuthMe plugin, Player player,
|
||||
ItemStack[] inv, ItemStack[] armor, boolean isOp, boolean isFlying,
|
||||
boolean needToChange) {
|
||||
this.plugin = plugin;
|
||||
this.player = player;
|
||||
this.isOp = isOp;
|
||||
this.isFlying = isFlying;
|
||||
@ -34,7 +36,7 @@ public class ProcessSyncronousPlayerQuit implements Runnable {
|
||||
RestoreInventoryEvent ev = new RestoreInventoryEvent(player, inv, armor);
|
||||
player.getServer().getPluginManager().callEvent(ev);
|
||||
if (!ev.isCancelled()) {
|
||||
API.setPlayerInventory(player, ev.getInventory(), ev.getArmor());
|
||||
plugin.api.setPlayerInventory(player, ev.getInventory(), ev.getArmor());
|
||||
}
|
||||
}
|
||||
if (needToChange) {
|
||||
|
@ -12,7 +12,6 @@ import fr.xephi.authme.settings.Messages;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
import fr.xephi.authme.task.MessageTask;
|
||||
import fr.xephi.authme.task.TimeoutTask;
|
||||
import me.muizers.Notifications.Notification;
|
||||
|
||||
public class ProcessSyncronousEmailRegister implements Runnable {
|
||||
|
||||
@ -47,9 +46,6 @@ public class ProcessSyncronousEmailRegister implements Runnable {
|
||||
player.saveData();
|
||||
if (!Settings.noConsoleSpam)
|
||||
ConsoleLogger.info(player.getName() + " registered " + plugin.getIP(player));
|
||||
if (plugin.notifications != null) {
|
||||
plugin.notifications.showNotification(new Notification("[AuthMe] " + player.getName() + " has registered by email!"));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -20,7 +20,6 @@ import fr.xephi.authme.settings.Messages;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
import fr.xephi.authme.task.MessageTask;
|
||||
import fr.xephi.authme.task.TimeoutTask;
|
||||
import me.muizers.Notifications.Notification;
|
||||
|
||||
public class ProcessSyncronousPasswordRegister implements Runnable {
|
||||
|
||||
@ -118,9 +117,6 @@ public class ProcessSyncronousPasswordRegister implements Runnable {
|
||||
|
||||
if (!Settings.noConsoleSpam)
|
||||
ConsoleLogger.info(player.getName() + " registered " + plugin.getIP(player));
|
||||
if (plugin.notifications != null) {
|
||||
plugin.notifications.showNotification(new Notification("[AuthMe] " + player.getName() + " has registered!"));
|
||||
}
|
||||
|
||||
// Kick Player after Registration is enabled, kick the player
|
||||
if (Settings.forceRegKick) {
|
||||
|
@ -63,7 +63,7 @@ public final class Settings extends YamlConfiguration {
|
||||
isBackupOnStart, isBackupOnStop, enablePasspartu, isStopEnabled,
|
||||
reloadSupport, rakamakUseIp, noConsoleSpam, removePassword,
|
||||
displayOtherAccounts, useCaptcha, emailRegistration, multiverse,
|
||||
notifications, chestshop, bungee, banUnsafeIp, doubleEmailCheck,
|
||||
chestshop, bungee, banUnsafeIp, doubleEmailCheck,
|
||||
sessionExpireOnIpChange, disableSocialSpy, forceOnlyAfterLogin,
|
||||
useEssentialsMotd, usePurge, purgePlayerDat, purgeEssentialsFile,
|
||||
supportOldPassword, purgeLimitedCreative, purgeAntiXray,
|
||||
@ -217,7 +217,6 @@ public final class Settings extends YamlConfiguration {
|
||||
getmaxRegPerEmail = configFile.getInt("Email.maxRegPerEmail", 1);
|
||||
multiverse = configFile.getBoolean("Hooks.multiverse", true);
|
||||
chestshop = configFile.getBoolean("Hooks.chestshop", true);
|
||||
notifications = configFile.getBoolean("Hooks.notifications", true);
|
||||
bungee = configFile.getBoolean("Hooks.bungeecord", false);
|
||||
getForcedWorlds = (List<String>) configFile.getList("settings.restrictions.ForceSpawnOnTheseWorlds", new ArrayList<String>());
|
||||
banUnsafeIp = configFile.getBoolean("settings.restrictions.banUnsafedIP", false);
|
||||
@ -384,7 +383,6 @@ public final class Settings extends YamlConfiguration {
|
||||
getmaxRegPerEmail = configFile.getInt("Email.maxRegPerEmail", 1);
|
||||
multiverse = configFile.getBoolean("Hooks.multiverse", true);
|
||||
chestshop = configFile.getBoolean("Hooks.chestshop", true);
|
||||
notifications = configFile.getBoolean("Hooks.notifications", true);
|
||||
bungee = configFile.getBoolean("Hooks.bungeecord", false);
|
||||
getForcedWorlds = (List<String>) configFile.getList("settings.restrictions.ForceSpawnOnTheseWorlds");
|
||||
banUnsafeIp = configFile.getBoolean("settings.restrictions.banUnsafedIP", false);
|
||||
@ -587,6 +585,8 @@ public final class Settings extends YamlConfiguration {
|
||||
set("Purge.removePermissions", false);
|
||||
changes = true;
|
||||
}
|
||||
if (contains("Hooks.notifications"))
|
||||
set("Hooks.notifications", null);
|
||||
|
||||
if (changes) {
|
||||
plugin.getLogger().warning("Merge new Config Options - I'm not an error, please don't report me");
|
||||
|
@ -1,41 +0,0 @@
|
||||
package fr.xephi.authme.settings;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class SpoutCfg extends CustomConfiguration {
|
||||
|
||||
private static SpoutCfg instance = null;
|
||||
|
||||
public SpoutCfg(File file) {
|
||||
super(file);
|
||||
loadDefaults();
|
||||
load();
|
||||
save();
|
||||
}
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
private void loadDefaults() {
|
||||
this.set("Spout GUI enabled", true);
|
||||
this.set("LoginScreen.enabled", true);
|
||||
this.set("LoginScreen.exit button", "Quit");
|
||||
this.set("LoginScreen.exit message", "Good Bye");
|
||||
this.set("LoginScreen.login button", "Login");
|
||||
this.set("LoginScreen.title", "LOGIN");
|
||||
this.set("LoginScreen.text", new ArrayList<String>() {
|
||||
|
||||
{
|
||||
add("Sample text");
|
||||
add("Change this at spout.yml");
|
||||
add("--- AuthMe Reloaded by ---");
|
||||
add("Xephi59");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static SpoutCfg getInstance() {
|
||||
if (instance == null)
|
||||
instance = new SpoutCfg(new File("plugins" + File.separator + "AuthMe", "spout.yml"));
|
||||
return instance;
|
||||
}
|
||||
}
|
@ -68,7 +68,7 @@ settings:
|
||||
# 0 for unlimitted sessions, use 0 at your own risk!
|
||||
# consider that session will end only after timeout, and
|
||||
# if player's ip is changed but the timeout treshould isent
|
||||
# ended, player will kick out of sever for unvalidSession!
|
||||
# ended, player will kick out of sever for invalidSession!
|
||||
timeout: 10
|
||||
# Do we need to timeout the session if the player is offline
|
||||
# And try to login with an another IP Address?
|
||||
@ -375,8 +375,6 @@ Hooks:
|
||||
chestshop: true
|
||||
# Do we need to hook with BungeeCord for get the real Player ip ?
|
||||
bungeecord: false
|
||||
# Do we need to hook with Notifications for Notifs sending ?
|
||||
notifications: true
|
||||
# Do we need to disable Essentials SocialSpy on join ?
|
||||
disableSocialSpy: true
|
||||
# Do we need to force /motd Essentials command on join ?
|
||||
|
@ -24,7 +24,7 @@ user_unknown: '&cПотребителя не е регистриран'
|
||||
password_error: '&fПаролата не съвпада'
|
||||
password_error_nick: '&fYou can''t use your name as password'
|
||||
password_error_unsafe: '&fYou can''t use unsafe passwords'
|
||||
unvalid_session: '&fSession Dataes doesnt corrispond Plaese wait the end of session'
|
||||
invalid_session: '&fSession Dataes doesnt corrispond Plaese wait the end of session'
|
||||
reg_only: '&fСамо за регистрирани! Моля посети http://example.com за регистрация'
|
||||
logged_in: '&cВече сте влязъл!'
|
||||
logout: '&cУспешен изход от регистрацията!'
|
||||
|
@ -27,7 +27,7 @@ registered: '&cRegistrace byla uspesna!'
|
||||
reload: '&cZnovu nacteni nastaveni AuthMe probehlo uspesne.'
|
||||
timeout: '&cCas pro prihlaseni vyprsel!'
|
||||
unsafe_spawn: '&cTvoje pozice pri odpojeni byla nebezpecna, teleportuji na spawn!'
|
||||
unvalid_session: '&cChybna data pri cteni pockejte do vyprseni.'
|
||||
invalid_session: '&cChybna data pri cteni pockejte do vyprseni.'
|
||||
max_reg: '&cJiz jsi prekrocil(a) limit pro pocet uctu z jedne IP.'
|
||||
password_error: '&cHesla se neshoduji!'
|
||||
pass_len: '&cTvoje heslo nedosahuje minimalni delky (4).'
|
||||
|
@ -23,7 +23,7 @@ usage_unreg: '&cBenutze: /unregister <passwort>'
|
||||
pwd_changed: '&cPasswort geändert!'
|
||||
user_unknown: '&cBenutzername nicht registriert'
|
||||
password_error: '&fPasswort falsch'
|
||||
unvalid_session: '&fUngültige Session. Bitte starte das Spiel neu oder warte, bis die Session abgelaufen ist'
|
||||
invalid_session: '&fUngültige Session. Bitte starte das Spiel neu oder warte, bis die Session abgelaufen ist'
|
||||
reg_only: '&fNur registrierte Spieler! Bitte besuche http://example.com zum registrieren'
|
||||
logged_in: '&cBereits eingeloggt!'
|
||||
logout: '&cErfolgreich ausgeloggt'
|
||||
|
@ -24,7 +24,7 @@ usage_unreg: '&cUso: /unregister contraseña'
|
||||
pwd_changed: '&c¡Contraseña cambiada!'
|
||||
user_unknown: '&cUsuario no registrado'
|
||||
password_error: '&fLas contraseñas no son iguales'
|
||||
unvalid_session: '&fLos datos de sesión no corresponden. Por favor espera a terminar la sesión.'
|
||||
invalid_session: '&fLos datos de sesión no corresponden. Por favor espera a terminar la sesión.'
|
||||
reg_only: '&f¡Sólo para jugadores registrados! Por favor visita http://www.example.com/ para registrarte'
|
||||
logged_in: '&c¡Ya has iniciado sesión!'
|
||||
logout: '&cDesconectado correctamente.'
|
||||
|
@ -23,7 +23,7 @@ usage_unreg: '&cKäyttötapa: /unregister password'
|
||||
pwd_changed: '&cSalasana vaihdettu!!'
|
||||
user_unknown: '&cSalasanat eivät täsmää'
|
||||
password_error: '&fSalasanat ei täsmää'
|
||||
unvalid_session: '&fIstunto ei täsmää! Ole hyvä ja odota istunnon loppuun'
|
||||
invalid_session: '&fIstunto ei täsmää! Ole hyvä ja odota istunnon loppuun'
|
||||
reg_only: '&fMene sivustolle: http://example.com rekisteröityäksesi!'
|
||||
logged_in: '&cOlet jo kirjautunut!'
|
||||
logout: '&cKirjauduit ulos palvelimelta.'
|
||||
|
@ -24,7 +24,7 @@ usage_unreg: '&cPour supprimer ce compte, utilisez: /unregister password'
|
||||
pwd_changed: '&cMotdePasse changé avec succès!'
|
||||
user_unknown: '&c Ce compte n''est pas enregistré'
|
||||
password_error: '&fCe mot de passe est incorrect'
|
||||
unvalid_session: '&fSession invalide, relancez le jeu ou attendez la fin de la session'
|
||||
invalid_session: '&fSession invalide, relancez le jeu ou attendez la fin de la session'
|
||||
reg_only: '&fSeul les joueurs enregistré sont admis!'
|
||||
logged_in: '&cVous êtes déjà connecté!'
|
||||
logout: '&cVous avez été déconnecté!'
|
||||
|
@ -24,7 +24,7 @@ usage_unreg: '&cUso: /unregister <contrasinal>'
|
||||
pwd_changed: '&cCambiouse o contrasinal!'
|
||||
user_unknown: '&cEse nome de usuario non está rexistrado'
|
||||
password_error: '&fO contrasinal non coincide'
|
||||
unvalid_session: '&fOs datos de sesión non corresponden, por favor, espere a que remate a sesión'
|
||||
invalid_session: '&fOs datos de sesión non corresponden, por favor, espere a que remate a sesión'
|
||||
reg_only: '&fSó xogadores rexistrados! Por favor, visita http://example.com para rexistrarte'
|
||||
logged_in: '&cXa estás identificado!'
|
||||
logout: '&cSesión pechada con éxito'
|
||||
|
@ -29,7 +29,7 @@ reg_email_msg: '&cPlease register with "/register <email> <confirmEmail>"'
|
||||
unsafe_spawn: A kilépési helyzeted nem biztonságos, teleportálás a kezdö Spawnra.
|
||||
max_reg: Csak egy karakterrel Registrálhatsz!!!
|
||||
password_error: A jelszó nem illik össze
|
||||
unvalid_session: Session Dataes doesnt corrispond Plaese wait the end of session
|
||||
invalid_session: Session Dataes doesnt corrispond Plaese wait the end of session
|
||||
pass_len: A jelszavad nem éri el a minimális hosszat
|
||||
vb_nonActiv: Your Account isent Activated yet check your Emails!
|
||||
usage_changepassword: 'használat: /changepassword régiJelszó újJelszó'
|
||||
|
@ -23,7 +23,7 @@ usage_unreg: '&ePanaikinti registracija: "/unregister slaptazodis"'
|
||||
pwd_changed: '&aSlaptazodis pakeistas'
|
||||
user_unknown: '&cVartotojas neprisiregistraves'
|
||||
password_error: '&cSlaptazodziai nesutampa'
|
||||
unvalid_session: '&cSesijos laikai nesutampa, prasome palaukti kol secija baigsis.'
|
||||
invalid_session: '&cSesijos laikai nesutampa, prasome palaukti kol secija baigsis.'
|
||||
reg_only: '&cTik prisiregistravusiem zaidejams: apsilankykite: http://example.com tam kad uzsiregistruoti.'
|
||||
logged_in: '&cTu aju prisijunges!'
|
||||
logout: '&aSekmingai atsijungete'
|
||||
|
@ -22,7 +22,7 @@ usage_unreg: '&cGebruik: /unregister password'
|
||||
pwd_changed: '&cWachtwoord aangepast!'
|
||||
user_unknown: '&cGebruikersnaam niet geregistreerd'
|
||||
password_error: Wachtwoord incorrect!
|
||||
unvalid_session: Sessie beschadigt, wacht tot de sessie is verlopen en join opnieuw.
|
||||
invalid_session: Sessie beschadigt, wacht tot de sessie is verlopen en join opnieuw.
|
||||
reg_only: Alleen voor geregistreerde spelers! Bezoek http://example.com om te registreren
|
||||
logged_in: '&cJe bent al ingelogt!'
|
||||
logout: '&cJe bent succesvol uitgelogt'
|
||||
|
@ -27,7 +27,7 @@ reload: '&fKonfiguracja bazy danych zostala przeladowana'
|
||||
error: '&fBlad prosimy napisac do aministracji'
|
||||
unknown_user: '&fUzytkownika nie ma w bazie danych'
|
||||
unsafe_spawn: '&fTwoje pozycja jest niebezpieczna. Zostaniesz przeniesiony na bezpieczny spawn.'
|
||||
unvalid_session: '&fSesja zakonczona!'
|
||||
invalid_session: '&fSesja zakonczona!'
|
||||
max_reg: '&fPrzekroczyles limit zarejestrowanych kont na serwerze.'
|
||||
password_error: '&fHaslo niepoprawne!'
|
||||
pass_len: '&fTwoje haslo jest za krotkie lub za dlugie! Sprobuj ponownie...'
|
||||
|
@ -23,7 +23,7 @@ password_error_nick: '&fYou can''t use your name as password'
|
||||
password_error_unsafe: '&fYou can''t use unsafe passwords'
|
||||
user_unknown: '&cUsername não registado'
|
||||
password_error: '&fAs passwords não coincidem'
|
||||
unvalid_session: '&fDados de sessão não correspondem. Por favor aguarde o fim da sessão'
|
||||
invalid_session: '&fDados de sessão não correspondem. Por favor aguarde o fim da sessão'
|
||||
reg_only: '&fApenas jogadores registados! Visite http://example.com para se registar'
|
||||
logged_in: '&cJá se encontra autenticado!'
|
||||
logout: '&cSaida com sucesso'
|
||||
|
@ -24,7 +24,7 @@ usage_unreg: '&4Использование: &5/unregister ПАРОЛЬ'
|
||||
pwd_changed: '&2Пароль изменен!'
|
||||
user_unknown: '&4Такой игрок не зарегистрирован'
|
||||
password_error: '&4Пароль не совпадает'
|
||||
unvalid_session: '&4Сессия некорректна. Дождитесь, пока она закончится'
|
||||
invalid_session: '&4Сессия некорректна. Дождитесь, пока она закончится'
|
||||
reg_only: '&4Только для зарегистрированных! Посетите http://project.ru/register/ для регистрации'
|
||||
logged_in: '&4Вы уже авторизированы!'
|
||||
logout: '&2Вы успешно вышли'
|
||||
|
@ -31,7 +31,7 @@ reload: '&fKonfigurácia a databáza bola obnovená'
|
||||
error: '&fNastala chyba; Kontaktujte administrátora'
|
||||
unknown_user: '&fHrac nie je v databázi'
|
||||
unsafe_spawn: '&fTvoj pozícia bol nebezpecná, teleportujem hraca na spawn'
|
||||
unvalid_session: '&fZapamätane casove data nie su doveryhodne. Cakaj na ukoncenie spojenia'
|
||||
invalid_session: '&fZapamätane casove data nie su doveryhodne. Cakaj na ukoncenie spojenia'
|
||||
max_reg: '&fDosiahol si maximum registrovanych uctov.'
|
||||
password_error: '&fHeslá sa nezhodujú'
|
||||
pass_len: '&fHeslo je velmi kratke alebo dlhe'
|
||||
|
@ -23,7 +23,7 @@ usage_unreg: '&cВикористовуйте: /unregister Пароль'
|
||||
pwd_changed: '&cПароль змінено!'
|
||||
user_unknown: '&cТакий користувач не зарєєстрований'
|
||||
password_error: '&fПаролі не співпадають'
|
||||
unvalid_session: '&fСесія некоректна. Будь ласка зачекайте коли вона закінчиться'
|
||||
invalid_session: '&fСесія некоректна. Будь ласка зачекайте коли вона закінчиться'
|
||||
reg_only: '&Вхід доступний лише зареєстрованим користувачам. Зареєструватися можна за адресою &9&nhttp://example.com&r'
|
||||
logged_in: '&2Ви уже ввійшли!'
|
||||
logout: '&cВи успішно вийшли'
|
||||
|
@ -23,7 +23,7 @@ usage_unreg: '&c正确用法:“/unregister <密码>”'
|
||||
pwd_changed: '&c密码已成功修改!'
|
||||
user_unknown: '&c此用户名还未注册过'
|
||||
password_error: '&f密码不相同'
|
||||
unvalid_session: '&f登陆数据异常,请等待登陆结束'
|
||||
invalid_session: '&f登陆数据异常,请等待登陆结束'
|
||||
reg_only: '&f只允许注册过的玩家进服!请到http://example.com以注册'
|
||||
logged_in: '&c你已经登陆过了!'
|
||||
logout: '&c已成功登出!'
|
||||
|
@ -25,7 +25,7 @@ usage_unreg: '&8[&6用戶系統&8] &c用法: 《 /unregister <密碼> 》'
|
||||
pwd_changed: '&8[&6用戶系統&8] &c你成功的更換了你的密碼 !'
|
||||
user_unknown: '&8[&6用戶系統&8] &c此用戶名沒有已登記資料。'
|
||||
password_error: '&8[&6用戶系統&8] &f密碼不符合。'
|
||||
unvalid_session: '&8[&6用戶系統&8] &f登入階段資料已損壞,請等待登入階段結束。'
|
||||
invalid_session: '&8[&6用戶系統&8] &f登入階段資料已損壞,請等待登入階段結束。'
|
||||
reg_only: '&8[&6用戶系統&8] &f限已註冊會員,請先到 https://www.example.com/ 註冊。'
|
||||
logged_in: '&8[&6用戶系統&8] &c你已經登入過了。'
|
||||
logout: '&8[&6用戶系統&8] &b你成功的登出了。'
|
||||
|
@ -22,7 +22,7 @@ usage_unreg: '&c正確用法為:使用"/unregister <密碼>"來取消現有密
|
||||
pwd_changed: '&c密碼變更成功!'
|
||||
user_unknown: '&c此用戶名並未被註冊!'
|
||||
password_error: <密碼>與<錯認密碼>不相同!
|
||||
unvalid_session: 'Session Dataes doesnt corrispond Plaese wait the end of session'
|
||||
invalid_session: 'Session Dataes doesnt corrispond Plaese wait the end of session'
|
||||
reg_only: 'Registered players only! Please visit http://example.com to register'
|
||||
logged_in: '&c您已經登入了!'
|
||||
logout: '&a登出成功!'
|
||||
|
@ -1,12 +0,0 @@
|
||||
Spout GUI enabled: true
|
||||
LoginScreen:
|
||||
enabled: true
|
||||
exit button: Quit
|
||||
exit message: Good Bye
|
||||
login button: Login
|
||||
title: LOGIN
|
||||
text:
|
||||
- Sample text
|
||||
- Change this at spout.yml
|
||||
- '--- AuthMe Reloaded by ---'
|
||||
- Xephi59
|
Loading…
Reference in New Issue
Block a user