mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-11-27 20:57:35 +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">
|
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>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
<groupId>fr.xephi.authme</groupId>
|
<groupId>fr.xephi</groupId>
|
||||||
<artifactId>AuthMe</artifactId>
|
<artifactId>authme</artifactId>
|
||||||
<version>5.0-SNAPSHOT</version>
|
<version>5.0-SNAPSHOT</version>
|
||||||
|
|
||||||
<name>AuthMeReloaded</name>
|
<name>AuthMeReloaded</name>
|
||||||
@ -22,8 +22,6 @@
|
|||||||
|
|
||||||
<!-- Change MC Version HERE! -->
|
<!-- Change MC Version HERE! -->
|
||||||
<bukkitVersion>1.8.7-R0.1-SNAPSHOT</bukkitVersion>
|
<bukkitVersion>1.8.7-R0.1-SNAPSHOT</bukkitVersion>
|
||||||
|
|
||||||
<mainClass>${project.groupId}.${project.artifactId}</mainClass>
|
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<!-- Official Build Server ALLERT: sometimes jenkins is offline, no panic! -->
|
<!-- Official Build Server ALLERT: sometimes jenkins is offline, no panic! -->
|
||||||
@ -77,6 +75,7 @@
|
|||||||
<archive>
|
<archive>
|
||||||
<manifestFile>${manifest.file}</manifestFile>
|
<manifestFile>${manifest.file}</manifestFile>
|
||||||
</archive>
|
</archive>
|
||||||
|
<finalName>AuthMe-${project.version}</finalName>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
@ -90,8 +89,15 @@
|
|||||||
<include>com.sun.mail:*</include>
|
<include>com.sun.mail:*</include>
|
||||||
<include>javax.mail:*</include>
|
<include>javax.mail:*</include>
|
||||||
<include>com.comphenix.attribute:*</include>
|
<include>com.comphenix.attribute:*</include>
|
||||||
|
<include>org.mcstats.*:*</include>
|
||||||
</includes>
|
</includes>
|
||||||
</artifactSet>
|
</artifactSet>
|
||||||
|
<relocations>
|
||||||
|
<relocation>
|
||||||
|
<pattern>org.mcstats</pattern>
|
||||||
|
<shadedPattern>fr.xephi.authme</shadedPattern>
|
||||||
|
</relocation>
|
||||||
|
</relocations>
|
||||||
</configuration>
|
</configuration>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
@ -113,6 +119,12 @@
|
|||||||
<url>https://hub.spigotmc.org/nexus/content/groups/public/</url>
|
<url>https://hub.spigotmc.org/nexus/content/groups/public/</url>
|
||||||
</repository>
|
</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!) -->
|
<!-- Vault Repo (Already in ess repo!) -->
|
||||||
<repository>
|
<repository>
|
||||||
<id>vault-repo</id>
|
<id>vault-repo</id>
|
||||||
@ -128,7 +140,7 @@
|
|||||||
<!-- Essentials Repo -->
|
<!-- Essentials Repo -->
|
||||||
<repository>
|
<repository>
|
||||||
<id>ess-repo</id>
|
<id>ess-repo</id>
|
||||||
<url>http://repo.ess3.net/content/groups/public</url>
|
<url>http://repo.ess3.net/content/groups/essentials</url>
|
||||||
</repository>
|
</repository>
|
||||||
|
|
||||||
<!-- CombatTagPlus Repo -->
|
<!-- CombatTagPlus Repo -->
|
||||||
@ -143,12 +155,6 @@
|
|||||||
<url>http://repo.luricos.de/content/repositories/releases/</url>
|
<url>http://repo.luricos.de/content/repositories/releases/</url>
|
||||||
</repository>
|
</repository>
|
||||||
|
|
||||||
<!-- SpoutCraft Repo -->
|
|
||||||
<repository>
|
|
||||||
<id>sonatype-nexus-snapshots</id>
|
|
||||||
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
|
|
||||||
</repository>
|
|
||||||
|
|
||||||
<!-- Attribute Repo -->
|
<!-- Attribute Repo -->
|
||||||
<repository>
|
<repository>
|
||||||
<id>comphenix-snapshots</id>
|
<id>comphenix-snapshots</id>
|
||||||
@ -181,13 +187,6 @@
|
|||||||
<version>3.8.10.1</version>
|
<version>3.8.10.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- Database Library -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.h2database</groupId>
|
|
||||||
<artifactId>h2</artifactId>
|
|
||||||
<version>1.4.187</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- Java Email API -->
|
<!-- Java Email API -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.sun.mail</groupId>
|
<groupId>com.sun.mail</groupId>
|
||||||
@ -202,6 +201,23 @@
|
|||||||
<version>1.2.14</version>
|
<version>1.2.14</version>
|
||||||
</dependency>
|
</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,
|
<!-- Spigot-Api, http://www.spigotmc.org/ Based on the Bukkit project,
|
||||||
http://bukkit.org/ -->
|
http://bukkit.org/ -->
|
||||||
<dependency>
|
<dependency>
|
||||||
@ -348,23 +364,6 @@
|
|||||||
</exclusions>
|
</exclusions>
|
||||||
</dependency>
|
</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 -->
|
<!-- Local Dependencies -->
|
||||||
|
|
||||||
<!-- It doesn't have a Maven Repo, http://dev.bukkit.org/bukkit-plugins/chestshop/ -->
|
<!-- 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>
|
<systemPath>${project.basedir}/libs/ChestShop.jar</systemPath>
|
||||||
</dependency>
|
</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>
|
</dependencies>
|
||||||
</project>
|
</project>
|
||||||
|
@ -3,6 +3,7 @@ package fr.xephi.authme;
|
|||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
@ -14,13 +15,10 @@ import java.util.Collection;
|
|||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
import java.util.zip.GZIPInputStream;
|
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.apache.logging.log4j.LogManager;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
@ -31,6 +29,8 @@ import org.bukkit.entity.Player;
|
|||||||
import org.bukkit.plugin.PluginManager;
|
import org.bukkit.plugin.PluginManager;
|
||||||
import org.bukkit.plugin.RegisteredServiceProvider;
|
import org.bukkit.plugin.RegisteredServiceProvider;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
import org.bukkit.scheduler.BukkitTask;
|
||||||
|
import org.mcstats.Metrics;
|
||||||
|
|
||||||
import com.earth2me.essentials.Essentials;
|
import com.earth2me.essentials.Essentials;
|
||||||
import com.maxmind.geoip.LookupService;
|
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.AuthMeEntityListener;
|
||||||
import fr.xephi.authme.listener.AuthMePlayerListener;
|
import fr.xephi.authme.listener.AuthMePlayerListener;
|
||||||
import fr.xephi.authme.listener.AuthMeServerListener;
|
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.BungeeCordMessage;
|
||||||
import fr.xephi.authme.plugin.manager.CitizensCommunicator;
|
import fr.xephi.authme.plugin.manager.CitizensCommunicator;
|
||||||
import fr.xephi.authme.plugin.manager.CombatTagComunicator;
|
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.PlayersLogs;
|
||||||
import fr.xephi.authme.settings.Settings;
|
import fr.xephi.authme.settings.Settings;
|
||||||
import fr.xephi.authme.settings.Spawn;
|
import fr.xephi.authme.settings.Spawn;
|
||||||
|
import net.milkbowl.vault.permission.Permission;
|
||||||
|
|
||||||
public class AuthMe extends JavaPlugin {
|
public class AuthMe extends JavaPlugin {
|
||||||
|
|
||||||
@ -89,13 +89,12 @@ public class AuthMe extends JavaPlugin {
|
|||||||
private Utils utils = Utils.getInstance();
|
private Utils utils = Utils.getInstance();
|
||||||
private FileCache playerBackup = new FileCache(this);
|
private FileCache playerBackup = new FileCache(this);
|
||||||
public CitizensCommunicator citizens;
|
public CitizensCommunicator citizens;
|
||||||
|
public boolean isCitizensActive = false;
|
||||||
public SendMailSSL mail = null;
|
public SendMailSSL mail = null;
|
||||||
public int CitizensVersion = 0;
|
public boolean CombatTag = false;
|
||||||
public int CombatTag = 0;
|
|
||||||
public double ChestShop = 0;
|
public double ChestShop = 0;
|
||||||
public boolean BungeeCord = false;
|
public boolean BungeeCord = false;
|
||||||
public Essentials ess;
|
public Essentials ess;
|
||||||
public Notifications notifications;
|
|
||||||
public API api;
|
public API api;
|
||||||
public Management management;
|
public Management management;
|
||||||
public HashMap<String, Integer> captcha = new HashMap<String, Integer>();
|
public HashMap<String, Integer> captcha = new HashMap<String, Integer>();
|
||||||
@ -108,6 +107,7 @@ public class AuthMe extends JavaPlugin {
|
|||||||
public boolean delayedAntiBot = true;
|
public boolean delayedAntiBot = true;
|
||||||
protected static String vgUrl = "http://monitor-1.verygames.net/api/?action=ipclean-real-ip&out=raw&ip=%IP%&port=%PORT%";
|
protected static String vgUrl = "http://monitor-1.verygames.net/api/?action=ipclean-real-ip&out=raw&ip=%IP%&port=%PORT%";
|
||||||
public DataManager dataManager;
|
public DataManager dataManager;
|
||||||
|
public ConcurrentHashMap<String, BukkitTask> sessions = new ConcurrentHashMap<String, BukkitTask>();
|
||||||
|
|
||||||
public Settings getSettings() {
|
public Settings getSettings() {
|
||||||
return settings;
|
return settings;
|
||||||
@ -128,6 +128,15 @@ public class AuthMe extends JavaPlugin {
|
|||||||
return;
|
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);
|
citizens = new CitizensCommunicator(this);
|
||||||
|
|
||||||
if (Settings.enableAntiBot) {
|
if (Settings.enableAntiBot) {
|
||||||
@ -178,9 +187,6 @@ public class AuthMe extends JavaPlugin {
|
|||||||
// Check Combat Tag Version
|
// Check Combat Tag Version
|
||||||
combatTag();
|
combatTag();
|
||||||
|
|
||||||
// Check Notifications
|
|
||||||
checkNotifications();
|
|
||||||
|
|
||||||
// Check Multiverse
|
// Check Multiverse
|
||||||
checkMultiverse();
|
checkMultiverse();
|
||||||
|
|
||||||
@ -200,37 +206,7 @@ public class AuthMe extends JavaPlugin {
|
|||||||
else ConsoleLogger.showError("Error while making Backup");
|
else ConsoleLogger.showError("Error while making Backup");
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
setupDatabase();
|
||||||
* 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);
|
|
||||||
|
|
||||||
dataManager = new DataManager(this, database);
|
dataManager = new DataManager(this, database);
|
||||||
|
|
||||||
@ -245,10 +221,7 @@ public class AuthMe extends JavaPlugin {
|
|||||||
Bukkit.getMessenger().registerOutgoingPluginChannel(this, "BungeeCord");
|
Bukkit.getMessenger().registerOutgoingPluginChannel(this, "BungeeCord");
|
||||||
Bukkit.getMessenger().registerIncomingPluginChannel(this, "BungeeCord", new BungeeCordMessage(this));
|
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 AuthMePlayerListener(this, database), this);
|
||||||
pm.registerEvents(new AuthMeBlockListener(database, this), this);
|
pm.registerEvents(new AuthMeBlockListener(database, this), this);
|
||||||
pm.registerEvents(new AuthMeEntityListener(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));
|
this.getCommand("converter").setExecutor(new ConverterCommand(this, database));
|
||||||
|
|
||||||
if (!Settings.isForceSingleSessionEnabled) {
|
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)
|
if (Settings.reloadSupport)
|
||||||
@ -281,19 +254,15 @@ public class AuthMe extends JavaPlugin {
|
|||||||
if (Bukkit.class.getMethod("getOnlinePlayers", new Class<?>[0]).getReturnType() == Collection.class)
|
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();
|
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;
|
else playersOnline = ((Player[]) Bukkit.class.getMethod("getOnlinePlayers", new Class<?>[0]).invoke(null, new Object[0])).length;
|
||||||
} catch (NoSuchMethodException ex) {
|
} catch (Exception ex) {
|
||||||
} // can never happen
|
}
|
||||||
catch (InvocationTargetException ex) {
|
|
||||||
} // can also never happen
|
|
||||||
catch (IllegalAccessException ex) {
|
|
||||||
} // can still never happen
|
|
||||||
if (playersOnline < 1) {
|
if (playersOnline < 1) {
|
||||||
try {
|
try {
|
||||||
database.purgeLogged();
|
database.purgeLogged();
|
||||||
} catch (NullPointerException npe) {
|
} catch (NullPointerException npe) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (NullPointerException ex) {
|
} catch (Exception ex) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Settings.usePurge)
|
if (Settings.usePurge)
|
||||||
@ -306,8 +275,7 @@ public class AuthMe extends JavaPlugin {
|
|||||||
recallEmail();
|
recallEmail();
|
||||||
|
|
||||||
// Sponsor message
|
// 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("AuthMe hook perfectly with server hosting VERYGAMES");
|
||||||
ConsoleLogger.info("[SPONSOR] Look Minecraft and other offers on www.verygames.net ! ");
|
|
||||||
|
|
||||||
ConsoleLogger.info("Authme " + this.getDescription().getVersion() + " enabled");
|
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() {
|
public void combatTag() {
|
||||||
if (this.getServer().getPluginManager().getPlugin("CombatTag") != null && this.getServer().getPluginManager().getPlugin("CombatTag").isEnabled()) {
|
if (this.getServer().getPluginManager().getPlugin("CombatTag") != null && this.getServer().getPluginManager().getPlugin("CombatTag").isEnabled()) {
|
||||||
this.CombatTag = 1;
|
this.CombatTag = true;
|
||||||
} else {
|
} else {
|
||||||
this.CombatTag = 0;
|
this.CombatTag = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void citizensVersion() {
|
public void citizensVersion() {
|
||||||
if (this.getServer().getPluginManager().getPlugin("Citizens") != null && this.getServer().getPluginManager().getPlugin("Citizens").isEnabled()) {
|
if (this.getServer().getPluginManager().getPlugin("Citizens") != null && this.getServer().getPluginManager().getPlugin("Citizens").isEnabled())
|
||||||
Citizens cit = (Citizens) this.getServer().getPluginManager().getPlugin("Citizens");
|
this.isCitizensActive = true;
|
||||||
String ver = cit.getDescription().getVersion();
|
else this.isCitizensActive = false;
|
||||||
String[] args = ver.split("\\.");
|
|
||||||
if (args[0].contains("1")) {
|
|
||||||
this.CitizensVersion = 1;
|
|
||||||
} else {
|
|
||||||
this.CitizensVersion = 2;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.CitizensVersion = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -502,7 +448,7 @@ public class AuthMe extends JavaPlugin {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
} catch (NullPointerException ex) {
|
} catch (Exception ex) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -511,8 +457,8 @@ public class AuthMe extends JavaPlugin {
|
|||||||
return authme;
|
return authme;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void savePlayer(Player player) throws IllegalStateException,
|
public void savePlayer(Player player)
|
||||||
NullPointerException {
|
throws IllegalStateException, NullPointerException {
|
||||||
try {
|
try {
|
||||||
if ((citizens.isNPC(player, this)) || (Utils.getInstance().isUnrestricted(player)) || (CombatTagComunicator.isNPC(player))) {
|
if ((citizens.isNPC(player, this)) || (Utils.getInstance().isUnrestricted(player)) || (CombatTagComunicator.isNPC(player))) {
|
||||||
return;
|
return;
|
||||||
@ -827,4 +773,33 @@ public class AuthMe extends JavaPlugin {
|
|||||||
}
|
}
|
||||||
return realIP;
|
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());
|
message.setSentDate(new Date());
|
||||||
BodyPart messageBodyPart = new MimeBodyPart();
|
BodyPart messageBodyPart = new MimeBodyPart();
|
||||||
messageBodyPart.setText(mailText);
|
messageBodyPart.setText(mailText);
|
||||||
|
|
||||||
Multipart multipart = new MimeMultipart();
|
Multipart multipart = new MimeMultipart();
|
||||||
|
|
||||||
multipart.addBodyPart(messageBodyPart);
|
|
||||||
|
|
||||||
messageBodyPart = new MimeBodyPart();
|
|
||||||
|
|
||||||
multipart.addBodyPart(messageBodyPart);
|
multipart.addBodyPart(messageBodyPart);
|
||||||
message.setContent(multipart);
|
message.setContent(multipart);
|
||||||
Transport transport = session.getTransport("smtp");
|
Transport transport = session.getTransport("smtp");
|
||||||
|
@ -1,11 +1,14 @@
|
|||||||
package fr.xephi.authme.api;
|
package fr.xephi.authme.api;
|
||||||
|
|
||||||
import java.security.NoSuchAlgorithmException;
|
import java.security.NoSuchAlgorithmException;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.Server;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.plugin.Plugin;
|
import org.bukkit.plugin.Plugin;
|
||||||
|
|
||||||
import fr.xephi.authme.AuthMe;
|
import fr.xephi.authme.AuthMe;
|
||||||
import fr.xephi.authme.Utils;
|
import fr.xephi.authme.Utils;
|
||||||
import fr.xephi.authme.cache.auth.PlayerAuth;
|
import fr.xephi.authme.cache.auth.PlayerAuth;
|
||||||
@ -18,29 +21,41 @@ import fr.xephi.authme.settings.Settings;
|
|||||||
public class API {
|
public class API {
|
||||||
|
|
||||||
public static final String newline = System.getProperty("line.separator");
|
public static final String newline = System.getProperty("line.separator");
|
||||||
public static AuthMe instance;
|
public static API singleton;
|
||||||
public static DataSource database;
|
public AuthMe plugin;
|
||||||
|
public DataSource database;
|
||||||
|
|
||||||
public API(AuthMe instance, DataSource database) {
|
public API(AuthMe plugin, DataSource database) {
|
||||||
API.instance = instance;
|
this.plugin = plugin;
|
||||||
API.database = database;
|
this.database = database;
|
||||||
|
}
|
||||||
|
|
||||||
|
public API(Server serv) {
|
||||||
|
this.plugin = (AuthMe) serv.getPluginManager().getPlugin("AuthMe");
|
||||||
|
this.database = this.plugin.database;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Hook into AuthMe
|
* Hook into AuthMe
|
||||||
*
|
*
|
||||||
* @return AuthMe instance
|
* @return
|
||||||
|
*
|
||||||
|
* @return AuthMe plugin
|
||||||
*/
|
*/
|
||||||
public static AuthMe hookAuthMe() {
|
public static API getInstance() {
|
||||||
Plugin plugin = Bukkit.getServer().getPluginManager().getPlugin("AuthMe");
|
if (singleton != null)
|
||||||
if (plugin == null || !(plugin instanceof AuthMe)) {
|
return singleton;
|
||||||
|
Plugin p = Bukkit.getServer().getPluginManager().getPlugin("AuthMe");
|
||||||
|
if (p == null || !(p instanceof AuthMe)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return (AuthMe) plugin;
|
AuthMe authme = (AuthMe) p;
|
||||||
|
singleton = (new API(authme, authme.database));
|
||||||
|
return singleton;
|
||||||
}
|
}
|
||||||
|
|
||||||
public AuthMe getPlugin() {
|
public AuthMe getPlugin() {
|
||||||
return instance;
|
return plugin;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -48,7 +63,7 @@ public class API {
|
|||||||
* @param player
|
* @param player
|
||||||
* @return true if player is authenticate
|
* @return true if player is authenticate
|
||||||
*/
|
*/
|
||||||
public static boolean isAuthenticated(Player player) {
|
public boolean isAuthenticated(Player player) {
|
||||||
return PlayerCache.getInstance().isAuthenticated(player.getName());
|
return PlayerCache.getInstance().isAuthenticated(player.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -59,7 +74,7 @@ public class API {
|
|||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public boolean isaNPC(Player player) {
|
public boolean isaNPC(Player player) {
|
||||||
if (instance.getCitizensCommunicator().isNPC(player, instance))
|
if (plugin.getCitizensCommunicator().isNPC(player, plugin))
|
||||||
return true;
|
return true;
|
||||||
return CombatTagComunicator.isNPC(player);
|
return CombatTagComunicator.isNPC(player);
|
||||||
}
|
}
|
||||||
@ -70,7 +85,7 @@ public class API {
|
|||||||
* @return true if player is a npc
|
* @return true if player is a npc
|
||||||
*/
|
*/
|
||||||
public boolean isNPC(Player player) {
|
public boolean isNPC(Player player) {
|
||||||
if (instance.getCitizensCommunicator().isNPC(player, instance))
|
if (plugin.getCitizensCommunicator().isNPC(player, plugin))
|
||||||
return true;
|
return true;
|
||||||
return CombatTagComunicator.isNPC(player);
|
return CombatTagComunicator.isNPC(player);
|
||||||
}
|
}
|
||||||
@ -80,11 +95,11 @@ public class API {
|
|||||||
* @param player
|
* @param player
|
||||||
* @return true if the player is unrestricted
|
* @return true if the player is unrestricted
|
||||||
*/
|
*/
|
||||||
public static boolean isUnrestricted(Player player) {
|
public boolean isUnrestricted(Player player) {
|
||||||
return Utils.getInstance().isUnrestricted(player);
|
return Utils.getInstance().isUnrestricted(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Location getLastLocation(Player player) {
|
public Location getLastLocation(Player player) {
|
||||||
try {
|
try {
|
||||||
PlayerAuth auth = PlayerCache.getInstance().getAuth(player.getName().toLowerCase());
|
PlayerAuth auth = PlayerCache.getInstance().getAuth(player.getName().toLowerCase());
|
||||||
|
|
||||||
@ -100,7 +115,7 @@ public class API {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setPlayerInventory(Player player, ItemStack[] content,
|
public void setPlayerInventory(Player player, ItemStack[] content,
|
||||||
ItemStack[] armor) {
|
ItemStack[] armor) {
|
||||||
try {
|
try {
|
||||||
player.getInventory().setContents(content);
|
player.getInventory().setContents(content);
|
||||||
@ -114,7 +129,7 @@ public class API {
|
|||||||
* @param playerName
|
* @param playerName
|
||||||
* @return true if player is registered
|
* @return true if player is registered
|
||||||
*/
|
*/
|
||||||
public static boolean isRegistered(String playerName) {
|
public boolean isRegistered(String playerName) {
|
||||||
String player = playerName.toLowerCase();
|
String player = playerName.toLowerCase();
|
||||||
return database.isAuthAvailable(player);
|
return database.isAuthAvailable(player);
|
||||||
}
|
}
|
||||||
@ -124,8 +139,7 @@ public class API {
|
|||||||
* playerName, String passwordToCheck
|
* playerName, String passwordToCheck
|
||||||
* @return true if the password is correct , false else
|
* @return true if the password is correct , false else
|
||||||
*/
|
*/
|
||||||
public static boolean checkPassword(String playerName,
|
public boolean checkPassword(String playerName, String passwordToCheck) {
|
||||||
String passwordToCheck) {
|
|
||||||
if (!isRegistered(playerName))
|
if (!isRegistered(playerName))
|
||||||
return false;
|
return false;
|
||||||
String player = playerName.toLowerCase();
|
String player = playerName.toLowerCase();
|
||||||
@ -144,7 +158,7 @@ public class API {
|
|||||||
* playerName, String password
|
* playerName, String password
|
||||||
* @return true if the player is register correctly
|
* @return true if the player is register correctly
|
||||||
*/
|
*/
|
||||||
public static boolean registerPlayer(String playerName, String password) {
|
public boolean registerPlayer(String playerName, String password) {
|
||||||
try {
|
try {
|
||||||
String name = playerName.toLowerCase();
|
String name = playerName.toLowerCase();
|
||||||
String hash = PasswordSecurity.getHash(Settings.getPasswordHash, password, name);
|
String hash = PasswordSecurity.getHash(Settings.getPasswordHash, password, name);
|
||||||
@ -167,8 +181,8 @@ public class API {
|
|||||||
* @param Player
|
* @param Player
|
||||||
* player
|
* player
|
||||||
*/
|
*/
|
||||||
public static void forceLogin(Player player) {
|
public void forceLogin(Player player) {
|
||||||
instance.management.performLogin(player, "dontneed", true);
|
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.Messages;
|
||||||
import fr.xephi.authme.settings.Settings;
|
import fr.xephi.authme.settings.Settings;
|
||||||
import fr.xephi.authme.settings.Spawn;
|
import fr.xephi.authme.settings.Spawn;
|
||||||
import fr.xephi.authme.settings.SpoutCfg;
|
|
||||||
import fr.xephi.authme.task.MessageTask;
|
import fr.xephi.authme.task.MessageTask;
|
||||||
import fr.xephi.authme.task.TimeoutTask;
|
import fr.xephi.authme.task.TimeoutTask;
|
||||||
|
|
||||||
@ -47,7 +46,6 @@ public class AdminCommand implements CommandExecutor {
|
|||||||
|
|
||||||
public AuthMe plugin;
|
public AuthMe plugin;
|
||||||
private Messages m = Messages.getInstance();
|
private Messages m = Messages.getInstance();
|
||||||
private SpoutCfg s = SpoutCfg.getInstance();
|
|
||||||
public DataSource database;
|
public DataSource database;
|
||||||
|
|
||||||
public AdminCommand(AuthMe plugin, DataSource database) {
|
public AdminCommand(AuthMe plugin, DataSource database) {
|
||||||
@ -125,7 +123,6 @@ public class AdminCommand implements CommandExecutor {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
} else if (args[0].equalsIgnoreCase("reload")) {
|
} else if (args[0].equalsIgnoreCase("reload")) {
|
||||||
database.reload();
|
|
||||||
File newConfigFile = new File("plugins" + File.separator + "AuthMe", "config.yml");
|
File newConfigFile = new File("plugins" + File.separator + "AuthMe", "config.yml");
|
||||||
if (!newConfigFile.exists()) {
|
if (!newConfigFile.exists()) {
|
||||||
InputStream fis = getClass().getResourceAsStream("" + File.separator + "config.yml");
|
InputStream fis = getClass().getResourceAsStream("" + File.separator + "config.yml");
|
||||||
@ -155,7 +152,8 @@ public class AdminCommand implements CommandExecutor {
|
|||||||
YamlConfiguration newConfig = YamlConfiguration.loadConfiguration(newConfigFile);
|
YamlConfiguration newConfig = YamlConfiguration.loadConfiguration(newConfigFile);
|
||||||
Settings.reloadConfigOptions(newConfig);
|
Settings.reloadConfigOptions(newConfig);
|
||||||
m.reLoad();
|
m.reLoad();
|
||||||
s.reLoad();
|
plugin.database.close();
|
||||||
|
plugin.setupDatabase();
|
||||||
m.send(sender, "reload");
|
m.send(sender, "reload");
|
||||||
} else if (args[0].equalsIgnoreCase("lastlogin")) {
|
} else if (args[0].equalsIgnoreCase("lastlogin")) {
|
||||||
if (args.length != 2) {
|
if (args.length != 2) {
|
||||||
|
@ -2,8 +2,6 @@ package fr.xephi.authme.commands;
|
|||||||
|
|
||||||
import java.security.NoSuchAlgorithmException;
|
import java.security.NoSuchAlgorithmException;
|
||||||
|
|
||||||
import me.muizers.Notifications.Notification;
|
|
||||||
|
|
||||||
import org.bukkit.command.Command;
|
import org.bukkit.command.Command;
|
||||||
import org.bukkit.command.CommandExecutor;
|
import org.bukkit.command.CommandExecutor;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
@ -58,7 +56,7 @@ public class ChangePasswordCommand implements CommandExecutor {
|
|||||||
m.send(player, "password_error");
|
m.send(player, "password_error");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if ((lowpass.equalsIgnoreCase(name))){
|
if ((lowpass.equalsIgnoreCase(name))) {
|
||||||
m.send(player, "password_error_nick");
|
m.send(player, "password_error_nick");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -89,9 +87,6 @@ public class ChangePasswordCommand implements CommandExecutor {
|
|||||||
PlayerCache.getInstance().updatePlayer(auth);
|
PlayerCache.getInstance().updatePlayer(auth);
|
||||||
m.send(player, "pwd_changed");
|
m.send(player, "pwd_changed");
|
||||||
ConsoleLogger.info(player.getName() + " changed his password");
|
ConsoleLogger.info(player.getName() + " changed his password");
|
||||||
if (plugin.notifications != null) {
|
|
||||||
plugin.notifications.showNotification(new Notification("[AuthMe] " + player.getName() + " change his password!"));
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
m.send(player, "wrong_pwd");
|
m.send(player, "wrong_pwd");
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,6 @@ package fr.xephi.authme.commands;
|
|||||||
|
|
||||||
import java.security.NoSuchAlgorithmException;
|
import java.security.NoSuchAlgorithmException;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.command.Command;
|
import org.bukkit.command.Command;
|
||||||
import org.bukkit.command.CommandExecutor;
|
import org.bukkit.command.CommandExecutor;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
@ -172,21 +171,8 @@ public class EmailCommand implements CommandExecutor {
|
|||||||
m.send(player, "email_invalid");
|
m.send(player, "email_invalid");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
final String finalhashnew = hashnew;
|
auth.setHash(hashnew);
|
||||||
final PlayerAuth finalauth = auth;
|
data.updatePassword(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);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
plugin.mail.main(auth, thePass);
|
plugin.mail.main(auth, thePass);
|
||||||
m.send(player, "email_send");
|
m.send(player, "email_send");
|
||||||
} catch (NoSuchAlgorithmException ex) {
|
} catch (NoSuchAlgorithmException ex) {
|
||||||
|
@ -27,7 +27,6 @@ import fr.xephi.authme.settings.Messages;
|
|||||||
import fr.xephi.authme.settings.Settings;
|
import fr.xephi.authme.settings.Settings;
|
||||||
import fr.xephi.authme.task.MessageTask;
|
import fr.xephi.authme.task.MessageTask;
|
||||||
import fr.xephi.authme.task.TimeoutTask;
|
import fr.xephi.authme.task.TimeoutTask;
|
||||||
import me.muizers.Notifications.Notification;
|
|
||||||
|
|
||||||
public class UnregisterCommand implements CommandExecutor {
|
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)));
|
LimboCache.getInstance().getLimboPlayer(name).setMessageTaskId(sched.runTaskAsynchronously(plugin, new MessageTask(plugin, name, m.send("reg_msg"), interval)));
|
||||||
m.send(player, "unregistered");
|
m.send(player, "unregistered");
|
||||||
ConsoleLogger.info(player.getDisplayName() + " unregistered himself");
|
ConsoleLogger.info(player.getDisplayName() + " unregistered himself");
|
||||||
if (plugin.notifications != null) {
|
|
||||||
plugin.notifications.showNotification(new Notification("[AuthMe] " + player.getName() + " unregistered himself!"));
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!Settings.unRegisteredGroup.isEmpty()) {
|
if (!Settings.unRegisteredGroup.isEmpty()) {
|
||||||
@ -116,9 +112,6 @@ public class UnregisterCommand implements CommandExecutor {
|
|||||||
player.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, Settings.getRegistrationTimeout * 20, 2));
|
player.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, Settings.getRegistrationTimeout * 20, 2));
|
||||||
m.send(player, "unregistered");
|
m.send(player, "unregistered");
|
||||||
ConsoleLogger.info(player.getDisplayName() + " unregistered himself");
|
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) {
|
if (Settings.isTeleportToSpawnEnabled && !Settings.noTeleport) {
|
||||||
Location spawn = plugin.getSpawnLocation(player);
|
Location spawn = plugin.getSpawnLocation(player);
|
||||||
SpawnTeleportEvent tpEvent = new SpawnTeleportEvent(player, player.getLocation(), spawn, false);
|
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
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
try {
|
try {
|
||||||
Class.forName("com.cypherx.xauth.xAuth");
|
Class.forName("de.luricos.bukkit.xAuth.xAuth");
|
||||||
oldxAuthToFlat converter = new oldxAuthToFlat(plugin, database, sender);
|
xAuthToFlat converter = new xAuthToFlat(plugin, database, sender);
|
||||||
converter.convert();
|
converter.convert();
|
||||||
} catch (ClassNotFoundException e) {
|
} catch (ClassNotFoundException ce) {
|
||||||
try {
|
sender.sendMessage("xAuth has not been found, please put xAuth.jar in your plugin folder and restart!");
|
||||||
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!");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,13 +17,13 @@ import fr.xephi.authme.AuthMe;
|
|||||||
import fr.xephi.authme.cache.auth.PlayerAuth;
|
import fr.xephi.authme.cache.auth.PlayerAuth;
|
||||||
import fr.xephi.authme.datasource.DataSource;
|
import fr.xephi.authme.datasource.DataSource;
|
||||||
|
|
||||||
public class newxAuthToFlat {
|
public class xAuthToFlat {
|
||||||
|
|
||||||
public AuthMe instance;
|
public AuthMe instance;
|
||||||
public DataSource database;
|
public DataSource database;
|
||||||
public CommandSender sender;
|
public CommandSender sender;
|
||||||
|
|
||||||
public newxAuthToFlat(AuthMe instance, DataSource database,
|
public xAuthToFlat(AuthMe instance, DataSource database,
|
||||||
CommandSender sender) {
|
CommandSender sender) {
|
||||||
this.instance = instance;
|
this.instance = instance;
|
||||||
this.database = database;
|
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.AuthMe;
|
||||||
import fr.xephi.authme.ConsoleLogger;
|
import fr.xephi.authme.ConsoleLogger;
|
||||||
import fr.xephi.authme.Utils;
|
import fr.xephi.authme.Utils;
|
||||||
import fr.xephi.authme.api.API;
|
|
||||||
import fr.xephi.authme.cache.auth.PlayerAuth;
|
import fr.xephi.authme.cache.auth.PlayerAuth;
|
||||||
import fr.xephi.authme.cache.auth.PlayerCache;
|
import fr.xephi.authme.cache.auth.PlayerCache;
|
||||||
import fr.xephi.authme.cache.limbo.LimboCache;
|
import fr.xephi.authme.cache.limbo.LimboCache;
|
||||||
@ -54,7 +53,6 @@ public class AuthMePlayerListener implements Listener {
|
|||||||
public static GameMode gm = GameMode.SURVIVAL;
|
public static GameMode gm = GameMode.SURVIVAL;
|
||||||
public static ConcurrentHashMap<String, GameMode> gameMode = new ConcurrentHashMap<String, GameMode>();
|
public static ConcurrentHashMap<String, GameMode> gameMode = new ConcurrentHashMap<String, GameMode>();
|
||||||
public static ConcurrentHashMap<String, String> joinMessage = new ConcurrentHashMap<String, String>();
|
public static ConcurrentHashMap<String, String> joinMessage = new ConcurrentHashMap<String, String>();
|
||||||
private Utils utils = Utils.getInstance();
|
|
||||||
private Messages m = Messages.getInstance();
|
private Messages m = Messages.getInstance();
|
||||||
public AuthMe plugin;
|
public AuthMe plugin;
|
||||||
private DataSource data;
|
private DataSource data;
|
||||||
@ -344,7 +342,8 @@ public class AuthMePlayerListener implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!Settings.isMovementAllowed) {
|
if (!Settings.isMovementAllowed) {
|
||||||
event.setTo(event.getFrom());
|
if (!event.getFrom().getBlock().equals(event.getTo().getBlock()))
|
||||||
|
event.setTo(event.getFrom());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -355,14 +354,15 @@ public class AuthMePlayerListener implements Listener {
|
|||||||
int radius = Settings.getMovementRadius;
|
int radius = Settings.getMovementRadius;
|
||||||
Location spawn = plugin.getSpawnLocation(player);
|
Location spawn = plugin.getSpawnLocation(player);
|
||||||
|
|
||||||
if (spawn != null && spawn.getWorld() != null)
|
if (spawn != null && spawn.getWorld() != null) {
|
||||||
if (!event.getPlayer().getWorld().equals(spawn.getWorld())) {
|
if (!event.getPlayer().getWorld().equals(spawn.getWorld())) {
|
||||||
event.getPlayer().teleport(spawn);
|
event.getPlayer().teleport(spawn);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ((spawn.distance(player.getLocation()) > radius) && spawn.getWorld() != null) {
|
if ((spawn.distance(player.getLocation()) > radius)) {
|
||||||
event.getPlayer().teleport(spawn);
|
event.getPlayer().teleport(spawn);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -405,6 +405,7 @@ public class AuthMePlayerListener implements Listener {
|
|||||||
if (player == null)
|
if (player == null)
|
||||||
return;
|
return;
|
||||||
final String name = player.getName().toLowerCase();
|
final String name = player.getName().toLowerCase();
|
||||||
|
boolean isAuthAvailable = data.isAuthAvailable(name);
|
||||||
|
|
||||||
if (plugin.getCitizensCommunicator().isNPC(player, plugin) || Utils.getInstance().isUnrestricted(player) || CombatTagComunicator.isNPC(player)) {
|
if (plugin.getCitizensCommunicator().isNPC(player, plugin) || Utils.getInstance().isUnrestricted(player) || CombatTagComunicator.isNPC(player)) {
|
||||||
return;
|
return;
|
||||||
@ -412,7 +413,7 @@ public class AuthMePlayerListener implements Listener {
|
|||||||
|
|
||||||
if (Settings.enablePasspartu && !Settings.countriesBlacklist.isEmpty()) {
|
if (Settings.enablePasspartu && !Settings.countriesBlacklist.isEmpty()) {
|
||||||
String code = plugin.getCountryCode(event.getAddress().getHostAddress());
|
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.setKickMessage(m.send("country_banned")[0]);
|
||||||
event.setResult(PlayerLoginEvent.Result.KICK_OTHER);
|
event.setResult(PlayerLoginEvent.Result.KICK_OTHER);
|
||||||
return;
|
return;
|
||||||
@ -420,7 +421,7 @@ public class AuthMePlayerListener implements Listener {
|
|||||||
}
|
}
|
||||||
if (Settings.enableProtection && !Settings.countries.isEmpty()) {
|
if (Settings.enableProtection && !Settings.countries.isEmpty()) {
|
||||||
String code = plugin.getCountryCode(event.getAddress().getHostAddress());
|
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.setKickMessage(m.send("country_banned")[0]);
|
||||||
event.setResult(PlayerLoginEvent.Result.KICK_OTHER);
|
event.setResult(PlayerLoginEvent.Result.KICK_OTHER);
|
||||||
return;
|
return;
|
||||||
@ -441,18 +442,6 @@ public class AuthMePlayerListener implements Listener {
|
|||||||
return;
|
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
|
// Check if forceSingleSession is set to true, so kick player that has
|
||||||
// joined with same nick of online player
|
// joined with same nick of online player
|
||||||
if (player.isOnline() && Settings.isForceSingleSessionEnabled) {
|
if (player.isOnline() && Settings.isForceSingleSessionEnabled) {
|
||||||
@ -589,7 +578,7 @@ public class AuthMePlayerListener implements Listener {
|
|||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
String name = player.getName().toLowerCase();
|
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)
|
if (data.getAuth(name) != null && !PlayerCache.getInstance().isAuthenticated(name) && Settings.enableProtection)
|
||||||
event.setQuitMessage(null);
|
event.setQuitMessage(null);
|
||||||
@ -611,7 +600,7 @@ public class AuthMePlayerListener implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
plugin.management.performQuit(player);
|
plugin.management.performQuit(player, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.HIGHEST)
|
@EventHandler(priority = EventPriority.HIGHEST)
|
||||||
|
@ -56,20 +56,16 @@ public class AuthMeServerListener implements Listener {
|
|||||||
ConsoleLogger.info("Multiverse-Core has been disabled, unhook!");
|
ConsoleLogger.info("Multiverse-Core has been disabled, unhook!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (pluginName.equalsIgnoreCase("Notifications")) {
|
|
||||||
plugin.notifications = null;
|
|
||||||
ConsoleLogger.info("Notifications has been disabled, unhook!");
|
|
||||||
}
|
|
||||||
if (pluginName.equalsIgnoreCase("ChestShop")) {
|
if (pluginName.equalsIgnoreCase("ChestShop")) {
|
||||||
plugin.ChestShop = 0;
|
plugin.ChestShop = 0;
|
||||||
ConsoleLogger.info("ChestShop has been disabled, unhook!");
|
ConsoleLogger.info("ChestShop has been disabled, unhook!");
|
||||||
}
|
}
|
||||||
if (pluginName.equalsIgnoreCase("CombatTag")) {
|
if (pluginName.equalsIgnoreCase("CombatTag")) {
|
||||||
plugin.CombatTag = 0;
|
plugin.CombatTag = false;
|
||||||
ConsoleLogger.info("CombatTag has been disabled, unhook!");
|
ConsoleLogger.info("CombatTag has been disabled, unhook!");
|
||||||
}
|
}
|
||||||
if (pluginName.equalsIgnoreCase("Citizens")) {
|
if (pluginName.equalsIgnoreCase("Citizens")) {
|
||||||
plugin.CitizensVersion = 0;
|
plugin.isCitizensActive = false;
|
||||||
ConsoleLogger.info("Citizens has been disabled, unhook!");
|
ConsoleLogger.info("Citizens has been disabled, unhook!");
|
||||||
}
|
}
|
||||||
if (pluginName.equalsIgnoreCase("Vault")) {
|
if (pluginName.equalsIgnoreCase("Vault")) {
|
||||||
@ -85,8 +81,6 @@ public class AuthMeServerListener implements Listener {
|
|||||||
plugin.checkEssentials();
|
plugin.checkEssentials();
|
||||||
if (pluginName.equalsIgnoreCase("Multiverse-Core"))
|
if (pluginName.equalsIgnoreCase("Multiverse-Core"))
|
||||||
plugin.checkMultiverse();
|
plugin.checkMultiverse();
|
||||||
if (pluginName.equalsIgnoreCase("Notifications"))
|
|
||||||
plugin.checkNotifications();
|
|
||||||
if (pluginName.equalsIgnoreCase("ChestShop"))
|
if (pluginName.equalsIgnoreCase("ChestShop"))
|
||||||
plugin.checkChestShop();
|
plugin.checkChestShop();
|
||||||
if (pluginName.equalsIgnoreCase("CombatTag"))
|
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;
|
package fr.xephi.authme.plugin.manager;
|
||||||
|
|
||||||
import net.citizensnpcs.api.CitizensAPI;
|
|
||||||
import net.citizensnpcs.api.CitizensManager;
|
|
||||||
|
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
|
|
||||||
import fr.xephi.authme.AuthMe;
|
import fr.xephi.authme.AuthMe;
|
||||||
|
import net.citizensnpcs.api.CitizensAPI;
|
||||||
|
|
||||||
public class CitizensCommunicator {
|
public class CitizensCommunicator {
|
||||||
|
|
||||||
@ -16,14 +14,10 @@ public class CitizensCommunicator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean isNPC(final Entity player, AuthMe instance) {
|
public boolean isNPC(final Entity player, AuthMe instance) {
|
||||||
|
if (!this.instance.isCitizensActive)
|
||||||
|
return false;
|
||||||
try {
|
try {
|
||||||
if (instance.CitizensVersion == 1) {
|
return CitizensAPI.getNPCRegistry().isNPC(player);
|
||||||
return CitizensManager.isNPC(player);
|
|
||||||
} else if (instance.CitizensVersion == 2) {
|
|
||||||
return CitizensAPI.getNPCRegistry().isNPC(player);
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
} catch (NoClassDefFoundError ncdfe) {
|
} catch (NoClassDefFoundError ncdfe) {
|
||||||
return false;
|
return false;
|
||||||
} catch (Exception npe) {
|
} catch (Exception npe) {
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
package fr.xephi.authme.plugin.manager;
|
package fr.xephi.authme.plugin.manager;
|
||||||
|
|
||||||
import net.minelink.ctplus.CombatTagPlus;
|
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@ -10,6 +8,9 @@ import org.bukkit.plugin.Plugin;
|
|||||||
import com.trc202.CombatTag.CombatTag;
|
import com.trc202.CombatTag.CombatTag;
|
||||||
import com.trc202.CombatTagApi.CombatTagApi;
|
import com.trc202.CombatTagApi.CombatTagApi;
|
||||||
|
|
||||||
|
import fr.xephi.authme.AuthMe;
|
||||||
|
import net.minelink.ctplus.CombatTagPlus;
|
||||||
|
|
||||||
public abstract class CombatTagComunicator {
|
public abstract class CombatTagComunicator {
|
||||||
|
|
||||||
public static CombatTagApi combatApi;
|
public static CombatTagApi combatApi;
|
||||||
@ -21,6 +22,8 @@ public abstract class CombatTagComunicator {
|
|||||||
* @return true if the player is an NPC
|
* @return true if the player is an NPC
|
||||||
*/
|
*/
|
||||||
public static boolean isNPC(Entity player) {
|
public static boolean isNPC(Entity player) {
|
||||||
|
if (!AuthMe.getInstance().CombatTag)
|
||||||
|
return false;
|
||||||
try {
|
try {
|
||||||
if (Bukkit.getServer().getPluginManager().getPlugin("CombatTag") != null) {
|
if (Bukkit.getServer().getPluginManager().getPlugin("CombatTag") != null) {
|
||||||
combatApi = new CombatTagApi((CombatTag) Bukkit.getServer().getPluginManager().getPlugin("CombatTag"));
|
combatApi = new CombatTagApi((CombatTag) Bukkit.getServer().getPluginManager().getPlugin("CombatTag"));
|
||||||
|
@ -16,8 +16,8 @@ import fr.xephi.authme.settings.Settings;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @authors Xephi59, <a
|
* @authors Xephi59,
|
||||||
* href="http://dev.bukkit.org/profiles/Possible/">Possible</a>
|
* <a href="http://dev.bukkit.org/profiles/Possible/">Possible</a>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class Management {
|
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() {
|
Bukkit.getScheduler().runTaskAsynchronously(plugin, new Runnable() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
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;
|
package fr.xephi.authme.process.join;
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.GameMode;
|
import org.bukkit.GameMode;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
@ -17,7 +15,6 @@ import fr.xephi.authme.AuthMe;
|
|||||||
import fr.xephi.authme.ConsoleLogger;
|
import fr.xephi.authme.ConsoleLogger;
|
||||||
import fr.xephi.authme.Utils;
|
import fr.xephi.authme.Utils;
|
||||||
import fr.xephi.authme.Utils.groupType;
|
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.PlayerAuth;
|
||||||
import fr.xephi.authme.cache.auth.PlayerCache;
|
import fr.xephi.authme.cache.auth.PlayerCache;
|
||||||
import fr.xephi.authme.cache.backup.DataFileCache;
|
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.cache.limbo.LimboPlayer;
|
||||||
import fr.xephi.authme.datasource.DataSource;
|
import fr.xephi.authme.datasource.DataSource;
|
||||||
import fr.xephi.authme.events.ProtectInventoryEvent;
|
import fr.xephi.authme.events.ProtectInventoryEvent;
|
||||||
import fr.xephi.authme.events.SessionEvent;
|
|
||||||
import fr.xephi.authme.events.SpawnTeleportEvent;
|
import fr.xephi.authme.events.SpawnTeleportEvent;
|
||||||
import fr.xephi.authme.listener.AuthMePlayerListener;
|
import fr.xephi.authme.listener.AuthMePlayerListener;
|
||||||
import fr.xephi.authme.plugin.manager.CombatTagComunicator;
|
import fr.xephi.authme.plugin.manager.CombatTagComunicator;
|
||||||
@ -95,76 +91,6 @@ public class AsyncronousJoin {
|
|||||||
}
|
}
|
||||||
final Location spawnLoc = plugin.getSpawnLocation(player);
|
final Location spawnLoc = plugin.getSpawnLocation(player);
|
||||||
if (database.isAuthAvailable(name)) {
|
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) {
|
if (Settings.isForceSurvivalModeEnabled && !Settings.forceOnlyAfterLogin) {
|
||||||
sched.scheduleSyncDelayedTask(plugin, new Runnable() {
|
sched.scheduleSyncDelayedTask(plugin, new Runnable() {
|
||||||
|
|
||||||
@ -255,7 +181,7 @@ public class AsyncronousJoin {
|
|||||||
if (!Settings.noConsoleSpam)
|
if (!Settings.noConsoleSpam)
|
||||||
ConsoleLogger.info("ProtectInventoryEvent has been cancelled for " + player.getName() + " ...");
|
ConsoleLogger.info("ProtectInventoryEvent has been cancelled for " + player.getName() + " ...");
|
||||||
} else {
|
} else {
|
||||||
API.setPlayerInventory(player, ev.getEmptyInventory(), ev.getEmptyArmor());
|
plugin.api.setPlayerInventory(player, ev.getEmptyInventory(), ev.getEmptyArmor());
|
||||||
}
|
}
|
||||||
} catch (NullPointerException ex) {
|
} 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));
|
BukkitTask msgT = sched.runTaskAsynchronously(plugin, new MessageTask(plugin, name, msg, msgInterval));
|
||||||
LimboCache.getInstance().getLimboPlayer(name).setMessageTaskId(msgT);
|
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.Messages;
|
||||||
import fr.xephi.authme.settings.Settings;
|
import fr.xephi.authme.settings.Settings;
|
||||||
import fr.xephi.authme.task.MessageTask;
|
import fr.xephi.authme.task.MessageTask;
|
||||||
import me.muizers.Notifications.Notification;
|
|
||||||
|
|
||||||
public class AsyncronousLogin {
|
public class AsyncronousLogin {
|
||||||
|
|
||||||
@ -147,7 +146,8 @@ public class AsyncronousLogin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
player.setNoDamageTicks(0);
|
player.setNoDamageTicks(0);
|
||||||
m.send(player, "login");
|
if (!forceLogin)
|
||||||
|
m.send(player, "login");
|
||||||
|
|
||||||
displayOtherAccounts(auth, player);
|
displayOtherAccounts(auth, player);
|
||||||
|
|
||||||
@ -156,14 +156,9 @@ public class AsyncronousLogin {
|
|||||||
m.send(player, "add_email");
|
m.send(player, "add_email");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (!Settings.noConsoleSpam)
|
if (!Settings.noConsoleSpam)
|
||||||
ConsoleLogger.info(player.getName() + " logged in!");
|
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
|
// makes player isLoggedin via API
|
||||||
PlayerCache.getInstance().addPlayer(auth);
|
PlayerCache.getInstance().addPlayer(auth);
|
||||||
database.setLogged(name);
|
database.setLogged(name);
|
||||||
|
@ -91,7 +91,7 @@ public class ProcessSyncronousPlayerLogin implements Runnable {
|
|||||||
RestoreInventoryEvent event = new RestoreInventoryEvent(player, limbo.getInventory(), limbo.getArmour());
|
RestoreInventoryEvent event = new RestoreInventoryEvent(player, limbo.getInventory(), limbo.getArmour());
|
||||||
Bukkit.getServer().getPluginManager().callEvent(event);
|
Bukkit.getServer().getPluginManager().callEvent(event);
|
||||||
if (!event.isCancelled()) {
|
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 Utils utils = Utils.getInstance();
|
||||||
private FileCache playerBackup;
|
private FileCache playerBackup;
|
||||||
|
|
||||||
public AsyncronousLogout(Player player, AuthMe plugin, DataSource database) {
|
public AsyncronousLogout(Player player, AuthMe plugin,
|
||||||
|
DataSource database) {
|
||||||
this.player = player;
|
this.player = player;
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
this.database = database;
|
this.database = database;
|
||||||
@ -50,8 +51,6 @@ public class AsyncronousLogout {
|
|||||||
final Player p = player;
|
final Player p = player;
|
||||||
BukkitScheduler sched = p.getServer().getScheduler();
|
BukkitScheduler sched = p.getServer().getScheduler();
|
||||||
PlayerAuth auth = PlayerCache.getInstance().getAuth(name);
|
PlayerAuth auth = PlayerCache.getInstance().getAuth(name);
|
||||||
if (Settings.isSessionsEnabled)
|
|
||||||
auth.setLastLogin(0L);
|
|
||||||
database.updateSession(auth);
|
database.updateSession(auth);
|
||||||
auth.setQuitLocX(p.getLocation().getX());
|
auth.setQuitLocX(p.getLocation().getX());
|
||||||
auth.setQuitLocY(p.getLocation().getY());
|
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.settings.Settings;
|
||||||
import fr.xephi.authme.task.MessageTask;
|
import fr.xephi.authme.task.MessageTask;
|
||||||
import fr.xephi.authme.task.TimeoutTask;
|
import fr.xephi.authme.task.TimeoutTask;
|
||||||
import me.muizers.Notifications.Notification;
|
|
||||||
|
|
||||||
public class ProcessSyncronousPlayerLogout implements Runnable {
|
public class ProcessSyncronousPlayerLogout implements Runnable {
|
||||||
|
|
||||||
@ -32,6 +31,9 @@ public class ProcessSyncronousPlayerLogout implements Runnable {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
if (plugin.sessions.containsKey(name))
|
||||||
|
plugin.sessions.get(name).cancel();
|
||||||
|
plugin.sessions.remove(name);
|
||||||
int delay = Settings.getRegistrationTimeout * 20;
|
int delay = Settings.getRegistrationTimeout * 20;
|
||||||
int interval = Settings.getWarnMessageInterval;
|
int interval = Settings.getWarnMessageInterval;
|
||||||
BukkitScheduler sched = player.getServer().getScheduler();
|
BukkitScheduler sched = player.getServer().getScheduler();
|
||||||
@ -61,9 +63,6 @@ public class ProcessSyncronousPlayerLogout implements Runnable {
|
|||||||
});
|
});
|
||||||
m.send(player, "logout");
|
m.send(player, "logout");
|
||||||
ConsoleLogger.info(player.getDisplayName() + " logged out");
|
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.Location;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
import org.bukkit.scheduler.BukkitTask;
|
||||||
|
|
||||||
import fr.xephi.authme.AuthMe;
|
import fr.xephi.authme.AuthMe;
|
||||||
import fr.xephi.authme.Utils;
|
import fr.xephi.authme.Utils;
|
||||||
@ -30,13 +31,16 @@ public class AsyncronousQuit {
|
|||||||
private boolean isOp = false;
|
private boolean isOp = false;
|
||||||
private boolean isFlying = false;
|
private boolean isFlying = false;
|
||||||
private boolean needToChange = 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.p = p;
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
this.database = database;
|
this.database = database;
|
||||||
this.name = p.getName().toLowerCase();
|
this.name = p.getName().toLowerCase();
|
||||||
this.playerBackup = new FileCache(plugin);
|
this.playerBackup = new FileCache(plugin);
|
||||||
|
this.isKick = isKick;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void process() {
|
public void process() {
|
||||||
@ -79,9 +83,24 @@ public class AsyncronousQuit {
|
|||||||
playerBackup.removeCache(player);
|
playerBackup.removeCache(player);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
PlayerCache.getInstance().removePlayer(name);
|
if (Settings.isSessionsEnabled && !isKick) {
|
||||||
database.setUnlogged(name);
|
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);
|
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.entity.Player;
|
||||||
import org.bukkit.inventory.ItemStack;
|
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.events.RestoreInventoryEvent;
|
||||||
import fr.xephi.authme.settings.Settings;
|
import fr.xephi.authme.settings.Settings;
|
||||||
|
|
||||||
public class ProcessSyncronousPlayerQuit implements Runnable {
|
public class ProcessSyncronousPlayerQuit implements Runnable {
|
||||||
|
|
||||||
|
protected AuthMe plugin;
|
||||||
protected Player player;
|
protected Player player;
|
||||||
protected boolean isOp;
|
protected boolean isOp;
|
||||||
protected boolean isFlying;
|
protected boolean isFlying;
|
||||||
@ -17,9 +18,10 @@ public class ProcessSyncronousPlayerQuit implements Runnable {
|
|||||||
protected ItemStack[] armor;
|
protected ItemStack[] armor;
|
||||||
protected boolean needToChange;
|
protected boolean needToChange;
|
||||||
|
|
||||||
public ProcessSyncronousPlayerQuit(Player player, ItemStack[] inv,
|
public ProcessSyncronousPlayerQuit(AuthMe plugin, Player player,
|
||||||
ItemStack[] armor, boolean isOp, boolean isFlying,
|
ItemStack[] inv, ItemStack[] armor, boolean isOp, boolean isFlying,
|
||||||
boolean needToChange) {
|
boolean needToChange) {
|
||||||
|
this.plugin = plugin;
|
||||||
this.player = player;
|
this.player = player;
|
||||||
this.isOp = isOp;
|
this.isOp = isOp;
|
||||||
this.isFlying = isFlying;
|
this.isFlying = isFlying;
|
||||||
@ -34,7 +36,7 @@ public class ProcessSyncronousPlayerQuit implements Runnable {
|
|||||||
RestoreInventoryEvent ev = new RestoreInventoryEvent(player, inv, armor);
|
RestoreInventoryEvent ev = new RestoreInventoryEvent(player, inv, armor);
|
||||||
player.getServer().getPluginManager().callEvent(ev);
|
player.getServer().getPluginManager().callEvent(ev);
|
||||||
if (!ev.isCancelled()) {
|
if (!ev.isCancelled()) {
|
||||||
API.setPlayerInventory(player, ev.getInventory(), ev.getArmor());
|
plugin.api.setPlayerInventory(player, ev.getInventory(), ev.getArmor());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (needToChange) {
|
if (needToChange) {
|
||||||
|
@ -12,7 +12,6 @@ import fr.xephi.authme.settings.Messages;
|
|||||||
import fr.xephi.authme.settings.Settings;
|
import fr.xephi.authme.settings.Settings;
|
||||||
import fr.xephi.authme.task.MessageTask;
|
import fr.xephi.authme.task.MessageTask;
|
||||||
import fr.xephi.authme.task.TimeoutTask;
|
import fr.xephi.authme.task.TimeoutTask;
|
||||||
import me.muizers.Notifications.Notification;
|
|
||||||
|
|
||||||
public class ProcessSyncronousEmailRegister implements Runnable {
|
public class ProcessSyncronousEmailRegister implements Runnable {
|
||||||
|
|
||||||
@ -47,9 +46,6 @@ public class ProcessSyncronousEmailRegister implements Runnable {
|
|||||||
player.saveData();
|
player.saveData();
|
||||||
if (!Settings.noConsoleSpam)
|
if (!Settings.noConsoleSpam)
|
||||||
ConsoleLogger.info(player.getName() + " registered " + plugin.getIP(player));
|
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.settings.Settings;
|
||||||
import fr.xephi.authme.task.MessageTask;
|
import fr.xephi.authme.task.MessageTask;
|
||||||
import fr.xephi.authme.task.TimeoutTask;
|
import fr.xephi.authme.task.TimeoutTask;
|
||||||
import me.muizers.Notifications.Notification;
|
|
||||||
|
|
||||||
public class ProcessSyncronousPasswordRegister implements Runnable {
|
public class ProcessSyncronousPasswordRegister implements Runnable {
|
||||||
|
|
||||||
@ -118,9 +117,6 @@ public class ProcessSyncronousPasswordRegister implements Runnable {
|
|||||||
|
|
||||||
if (!Settings.noConsoleSpam)
|
if (!Settings.noConsoleSpam)
|
||||||
ConsoleLogger.info(player.getName() + " registered " + plugin.getIP(player));
|
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
|
// Kick Player after Registration is enabled, kick the player
|
||||||
if (Settings.forceRegKick) {
|
if (Settings.forceRegKick) {
|
||||||
|
@ -63,7 +63,7 @@ public final class Settings extends YamlConfiguration {
|
|||||||
isBackupOnStart, isBackupOnStop, enablePasspartu, isStopEnabled,
|
isBackupOnStart, isBackupOnStop, enablePasspartu, isStopEnabled,
|
||||||
reloadSupport, rakamakUseIp, noConsoleSpam, removePassword,
|
reloadSupport, rakamakUseIp, noConsoleSpam, removePassword,
|
||||||
displayOtherAccounts, useCaptcha, emailRegistration, multiverse,
|
displayOtherAccounts, useCaptcha, emailRegistration, multiverse,
|
||||||
notifications, chestshop, bungee, banUnsafeIp, doubleEmailCheck,
|
chestshop, bungee, banUnsafeIp, doubleEmailCheck,
|
||||||
sessionExpireOnIpChange, disableSocialSpy, forceOnlyAfterLogin,
|
sessionExpireOnIpChange, disableSocialSpy, forceOnlyAfterLogin,
|
||||||
useEssentialsMotd, usePurge, purgePlayerDat, purgeEssentialsFile,
|
useEssentialsMotd, usePurge, purgePlayerDat, purgeEssentialsFile,
|
||||||
supportOldPassword, purgeLimitedCreative, purgeAntiXray,
|
supportOldPassword, purgeLimitedCreative, purgeAntiXray,
|
||||||
@ -217,7 +217,6 @@ public final class Settings extends YamlConfiguration {
|
|||||||
getmaxRegPerEmail = configFile.getInt("Email.maxRegPerEmail", 1);
|
getmaxRegPerEmail = configFile.getInt("Email.maxRegPerEmail", 1);
|
||||||
multiverse = configFile.getBoolean("Hooks.multiverse", true);
|
multiverse = configFile.getBoolean("Hooks.multiverse", true);
|
||||||
chestshop = configFile.getBoolean("Hooks.chestshop", true);
|
chestshop = configFile.getBoolean("Hooks.chestshop", true);
|
||||||
notifications = configFile.getBoolean("Hooks.notifications", true);
|
|
||||||
bungee = configFile.getBoolean("Hooks.bungeecord", false);
|
bungee = configFile.getBoolean("Hooks.bungeecord", false);
|
||||||
getForcedWorlds = (List<String>) configFile.getList("settings.restrictions.ForceSpawnOnTheseWorlds", new ArrayList<String>());
|
getForcedWorlds = (List<String>) configFile.getList("settings.restrictions.ForceSpawnOnTheseWorlds", new ArrayList<String>());
|
||||||
banUnsafeIp = configFile.getBoolean("settings.restrictions.banUnsafedIP", false);
|
banUnsafeIp = configFile.getBoolean("settings.restrictions.banUnsafedIP", false);
|
||||||
@ -384,7 +383,6 @@ public final class Settings extends YamlConfiguration {
|
|||||||
getmaxRegPerEmail = configFile.getInt("Email.maxRegPerEmail", 1);
|
getmaxRegPerEmail = configFile.getInt("Email.maxRegPerEmail", 1);
|
||||||
multiverse = configFile.getBoolean("Hooks.multiverse", true);
|
multiverse = configFile.getBoolean("Hooks.multiverse", true);
|
||||||
chestshop = configFile.getBoolean("Hooks.chestshop", true);
|
chestshop = configFile.getBoolean("Hooks.chestshop", true);
|
||||||
notifications = configFile.getBoolean("Hooks.notifications", true);
|
|
||||||
bungee = configFile.getBoolean("Hooks.bungeecord", false);
|
bungee = configFile.getBoolean("Hooks.bungeecord", false);
|
||||||
getForcedWorlds = (List<String>) configFile.getList("settings.restrictions.ForceSpawnOnTheseWorlds");
|
getForcedWorlds = (List<String>) configFile.getList("settings.restrictions.ForceSpawnOnTheseWorlds");
|
||||||
banUnsafeIp = configFile.getBoolean("settings.restrictions.banUnsafedIP", false);
|
banUnsafeIp = configFile.getBoolean("settings.restrictions.banUnsafedIP", false);
|
||||||
@ -587,6 +585,8 @@ public final class Settings extends YamlConfiguration {
|
|||||||
set("Purge.removePermissions", false);
|
set("Purge.removePermissions", false);
|
||||||
changes = true;
|
changes = true;
|
||||||
}
|
}
|
||||||
|
if (contains("Hooks.notifications"))
|
||||||
|
set("Hooks.notifications", null);
|
||||||
|
|
||||||
if (changes) {
|
if (changes) {
|
||||||
plugin.getLogger().warning("Merge new Config Options - I'm not an error, please don't report me");
|
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!
|
# 0 for unlimitted sessions, use 0 at your own risk!
|
||||||
# consider that session will end only after timeout, and
|
# consider that session will end only after timeout, and
|
||||||
# if player's ip is changed but the timeout treshould isent
|
# 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
|
timeout: 10
|
||||||
# Do we need to timeout the session if the player is offline
|
# Do we need to timeout the session if the player is offline
|
||||||
# And try to login with an another IP Address?
|
# And try to login with an another IP Address?
|
||||||
@ -375,8 +375,6 @@ Hooks:
|
|||||||
chestshop: true
|
chestshop: true
|
||||||
# Do we need to hook with BungeeCord for get the real Player ip ?
|
# Do we need to hook with BungeeCord for get the real Player ip ?
|
||||||
bungeecord: false
|
bungeecord: false
|
||||||
# Do we need to hook with Notifications for Notifs sending ?
|
|
||||||
notifications: true
|
|
||||||
# Do we need to disable Essentials SocialSpy on join ?
|
# Do we need to disable Essentials SocialSpy on join ?
|
||||||
disableSocialSpy: true
|
disableSocialSpy: true
|
||||||
# Do we need to force /motd Essentials command on join ?
|
# Do we need to force /motd Essentials command on join ?
|
||||||
|
@ -24,7 +24,7 @@ user_unknown: '&cПотребителя не е регистриран'
|
|||||||
password_error: '&fПаролата не съвпада'
|
password_error: '&fПаролата не съвпада'
|
||||||
password_error_nick: '&fYou can''t use your name as password'
|
password_error_nick: '&fYou can''t use your name as password'
|
||||||
password_error_unsafe: '&fYou can''t use unsafe passwords'
|
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 за регистрация'
|
reg_only: '&fСамо за регистрирани! Моля посети http://example.com за регистрация'
|
||||||
logged_in: '&cВече сте влязъл!'
|
logged_in: '&cВече сте влязъл!'
|
||||||
logout: '&cУспешен изход от регистрацията!'
|
logout: '&cУспешен изход от регистрацията!'
|
||||||
|
@ -27,7 +27,7 @@ registered: '&cRegistrace byla uspesna!'
|
|||||||
reload: '&cZnovu nacteni nastaveni AuthMe probehlo uspesne.'
|
reload: '&cZnovu nacteni nastaveni AuthMe probehlo uspesne.'
|
||||||
timeout: '&cCas pro prihlaseni vyprsel!'
|
timeout: '&cCas pro prihlaseni vyprsel!'
|
||||||
unsafe_spawn: '&cTvoje pozice pri odpojeni byla nebezpecna, teleportuji na spawn!'
|
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.'
|
max_reg: '&cJiz jsi prekrocil(a) limit pro pocet uctu z jedne IP.'
|
||||||
password_error: '&cHesla se neshoduji!'
|
password_error: '&cHesla se neshoduji!'
|
||||||
pass_len: '&cTvoje heslo nedosahuje minimalni delky (4).'
|
pass_len: '&cTvoje heslo nedosahuje minimalni delky (4).'
|
||||||
|
@ -23,7 +23,7 @@ usage_unreg: '&cBenutze: /unregister <passwort>'
|
|||||||
pwd_changed: '&cPasswort geändert!'
|
pwd_changed: '&cPasswort geändert!'
|
||||||
user_unknown: '&cBenutzername nicht registriert'
|
user_unknown: '&cBenutzername nicht registriert'
|
||||||
password_error: '&fPasswort falsch'
|
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'
|
reg_only: '&fNur registrierte Spieler! Bitte besuche http://example.com zum registrieren'
|
||||||
logged_in: '&cBereits eingeloggt!'
|
logged_in: '&cBereits eingeloggt!'
|
||||||
logout: '&cErfolgreich ausgeloggt'
|
logout: '&cErfolgreich ausgeloggt'
|
||||||
|
@ -24,7 +24,7 @@ usage_unreg: '&cUso: /unregister contraseña'
|
|||||||
pwd_changed: '&c¡Contraseña cambiada!'
|
pwd_changed: '&c¡Contraseña cambiada!'
|
||||||
user_unknown: '&cUsuario no registrado'
|
user_unknown: '&cUsuario no registrado'
|
||||||
password_error: '&fLas contraseñas no son iguales'
|
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'
|
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!'
|
logged_in: '&c¡Ya has iniciado sesión!'
|
||||||
logout: '&cDesconectado correctamente.'
|
logout: '&cDesconectado correctamente.'
|
||||||
|
@ -23,7 +23,7 @@ usage_unreg: '&cKäyttötapa: /unregister password'
|
|||||||
pwd_changed: '&cSalasana vaihdettu!!'
|
pwd_changed: '&cSalasana vaihdettu!!'
|
||||||
user_unknown: '&cSalasanat eivät täsmää'
|
user_unknown: '&cSalasanat eivät täsmää'
|
||||||
password_error: '&fSalasanat ei 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!'
|
reg_only: '&fMene sivustolle: http://example.com rekisteröityäksesi!'
|
||||||
logged_in: '&cOlet jo kirjautunut!'
|
logged_in: '&cOlet jo kirjautunut!'
|
||||||
logout: '&cKirjauduit ulos palvelimelta.'
|
logout: '&cKirjauduit ulos palvelimelta.'
|
||||||
|
@ -24,7 +24,7 @@ usage_unreg: '&cPour supprimer ce compte, utilisez: /unregister password'
|
|||||||
pwd_changed: '&cMotdePasse changé avec succès!'
|
pwd_changed: '&cMotdePasse changé avec succès!'
|
||||||
user_unknown: '&c Ce compte n''est pas enregistré'
|
user_unknown: '&c Ce compte n''est pas enregistré'
|
||||||
password_error: '&fCe mot de passe est incorrect'
|
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!'
|
reg_only: '&fSeul les joueurs enregistré sont admis!'
|
||||||
logged_in: '&cVous êtes déjà connecté!'
|
logged_in: '&cVous êtes déjà connecté!'
|
||||||
logout: '&cVous avez été déconnecté!'
|
logout: '&cVous avez été déconnecté!'
|
||||||
|
@ -24,7 +24,7 @@ usage_unreg: '&cUso: /unregister <contrasinal>'
|
|||||||
pwd_changed: '&cCambiouse o contrasinal!'
|
pwd_changed: '&cCambiouse o contrasinal!'
|
||||||
user_unknown: '&cEse nome de usuario non está rexistrado'
|
user_unknown: '&cEse nome de usuario non está rexistrado'
|
||||||
password_error: '&fO contrasinal non coincide'
|
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'
|
reg_only: '&fSó xogadores rexistrados! Por favor, visita http://example.com para rexistrarte'
|
||||||
logged_in: '&cXa estás identificado!'
|
logged_in: '&cXa estás identificado!'
|
||||||
logout: '&cSesión pechada con éxito'
|
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.
|
unsafe_spawn: A kilépési helyzeted nem biztonságos, teleportálás a kezdö Spawnra.
|
||||||
max_reg: Csak egy karakterrel Registrálhatsz!!!
|
max_reg: Csak egy karakterrel Registrálhatsz!!!
|
||||||
password_error: A jelszó nem illik össze
|
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
|
pass_len: A jelszavad nem éri el a minimális hosszat
|
||||||
vb_nonActiv: Your Account isent Activated yet check your Emails!
|
vb_nonActiv: Your Account isent Activated yet check your Emails!
|
||||||
usage_changepassword: 'használat: /changepassword régiJelszó újJelszó'
|
usage_changepassword: 'használat: /changepassword régiJelszó újJelszó'
|
||||||
|
@ -23,7 +23,7 @@ usage_unreg: '&ePanaikinti registracija: "/unregister slaptazodis"'
|
|||||||
pwd_changed: '&aSlaptazodis pakeistas'
|
pwd_changed: '&aSlaptazodis pakeistas'
|
||||||
user_unknown: '&cVartotojas neprisiregistraves'
|
user_unknown: '&cVartotojas neprisiregistraves'
|
||||||
password_error: '&cSlaptazodziai nesutampa'
|
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.'
|
reg_only: '&cTik prisiregistravusiem zaidejams: apsilankykite: http://example.com tam kad uzsiregistruoti.'
|
||||||
logged_in: '&cTu aju prisijunges!'
|
logged_in: '&cTu aju prisijunges!'
|
||||||
logout: '&aSekmingai atsijungete'
|
logout: '&aSekmingai atsijungete'
|
||||||
|
@ -22,7 +22,7 @@ usage_unreg: '&cGebruik: /unregister password'
|
|||||||
pwd_changed: '&cWachtwoord aangepast!'
|
pwd_changed: '&cWachtwoord aangepast!'
|
||||||
user_unknown: '&cGebruikersnaam niet geregistreerd'
|
user_unknown: '&cGebruikersnaam niet geregistreerd'
|
||||||
password_error: Wachtwoord incorrect!
|
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
|
reg_only: Alleen voor geregistreerde spelers! Bezoek http://example.com om te registreren
|
||||||
logged_in: '&cJe bent al ingelogt!'
|
logged_in: '&cJe bent al ingelogt!'
|
||||||
logout: '&cJe bent succesvol uitgelogt'
|
logout: '&cJe bent succesvol uitgelogt'
|
||||||
|
@ -27,7 +27,7 @@ reload: '&fKonfiguracja bazy danych zostala przeladowana'
|
|||||||
error: '&fBlad prosimy napisac do aministracji'
|
error: '&fBlad prosimy napisac do aministracji'
|
||||||
unknown_user: '&fUzytkownika nie ma w bazie danych'
|
unknown_user: '&fUzytkownika nie ma w bazie danych'
|
||||||
unsafe_spawn: '&fTwoje pozycja jest niebezpieczna. Zostaniesz przeniesiony na bezpieczny spawn.'
|
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.'
|
max_reg: '&fPrzekroczyles limit zarejestrowanych kont na serwerze.'
|
||||||
password_error: '&fHaslo niepoprawne!'
|
password_error: '&fHaslo niepoprawne!'
|
||||||
pass_len: '&fTwoje haslo jest za krotkie lub za dlugie! Sprobuj ponownie...'
|
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'
|
password_error_unsafe: '&fYou can''t use unsafe passwords'
|
||||||
user_unknown: '&cUsername não registado'
|
user_unknown: '&cUsername não registado'
|
||||||
password_error: '&fAs passwords não coincidem'
|
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'
|
reg_only: '&fApenas jogadores registados! Visite http://example.com para se registar'
|
||||||
logged_in: '&cJá se encontra autenticado!'
|
logged_in: '&cJá se encontra autenticado!'
|
||||||
logout: '&cSaida com sucesso'
|
logout: '&cSaida com sucesso'
|
||||||
|
@ -24,7 +24,7 @@ usage_unreg: '&4Использование: &5/unregister ПАРОЛЬ'
|
|||||||
pwd_changed: '&2Пароль изменен!'
|
pwd_changed: '&2Пароль изменен!'
|
||||||
user_unknown: '&4Такой игрок не зарегистрирован'
|
user_unknown: '&4Такой игрок не зарегистрирован'
|
||||||
password_error: '&4Пароль не совпадает'
|
password_error: '&4Пароль не совпадает'
|
||||||
unvalid_session: '&4Сессия некорректна. Дождитесь, пока она закончится'
|
invalid_session: '&4Сессия некорректна. Дождитесь, пока она закончится'
|
||||||
reg_only: '&4Только для зарегистрированных! Посетите http://project.ru/register/ для регистрации'
|
reg_only: '&4Только для зарегистрированных! Посетите http://project.ru/register/ для регистрации'
|
||||||
logged_in: '&4Вы уже авторизированы!'
|
logged_in: '&4Вы уже авторизированы!'
|
||||||
logout: '&2Вы успешно вышли'
|
logout: '&2Вы успешно вышли'
|
||||||
|
@ -31,7 +31,7 @@ reload: '&fKonfigurácia a databáza bola obnovená'
|
|||||||
error: '&fNastala chyba; Kontaktujte administrátora'
|
error: '&fNastala chyba; Kontaktujte administrátora'
|
||||||
unknown_user: '&fHrac nie je v databázi'
|
unknown_user: '&fHrac nie je v databázi'
|
||||||
unsafe_spawn: '&fTvoj pozícia bol nebezpecná, teleportujem hraca na spawn'
|
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.'
|
max_reg: '&fDosiahol si maximum registrovanych uctov.'
|
||||||
password_error: '&fHeslá sa nezhodujú'
|
password_error: '&fHeslá sa nezhodujú'
|
||||||
pass_len: '&fHeslo je velmi kratke alebo dlhe'
|
pass_len: '&fHeslo je velmi kratke alebo dlhe'
|
||||||
|
@ -23,7 +23,7 @@ usage_unreg: '&cВикористовуйте: /unregister Пароль'
|
|||||||
pwd_changed: '&cПароль змінено!'
|
pwd_changed: '&cПароль змінено!'
|
||||||
user_unknown: '&cТакий користувач не зарєєстрований'
|
user_unknown: '&cТакий користувач не зарєєстрований'
|
||||||
password_error: '&fПаролі не співпадають'
|
password_error: '&fПаролі не співпадають'
|
||||||
unvalid_session: '&fСесія некоректна. Будь ласка зачекайте коли вона закінчиться'
|
invalid_session: '&fСесія некоректна. Будь ласка зачекайте коли вона закінчиться'
|
||||||
reg_only: '&Вхід доступний лише зареєстрованим користувачам. Зареєструватися можна за адресою &9&nhttp://example.com&r'
|
reg_only: '&Вхід доступний лише зареєстрованим користувачам. Зареєструватися можна за адресою &9&nhttp://example.com&r'
|
||||||
logged_in: '&2Ви уже ввійшли!'
|
logged_in: '&2Ви уже ввійшли!'
|
||||||
logout: '&cВи успішно вийшли'
|
logout: '&cВи успішно вийшли'
|
||||||
|
@ -23,7 +23,7 @@ usage_unreg: '&c正确用法:“/unregister <密码>”'
|
|||||||
pwd_changed: '&c密码已成功修改!'
|
pwd_changed: '&c密码已成功修改!'
|
||||||
user_unknown: '&c此用户名还未注册过'
|
user_unknown: '&c此用户名还未注册过'
|
||||||
password_error: '&f密码不相同'
|
password_error: '&f密码不相同'
|
||||||
unvalid_session: '&f登陆数据异常,请等待登陆结束'
|
invalid_session: '&f登陆数据异常,请等待登陆结束'
|
||||||
reg_only: '&f只允许注册过的玩家进服!请到http://example.com以注册'
|
reg_only: '&f只允许注册过的玩家进服!请到http://example.com以注册'
|
||||||
logged_in: '&c你已经登陆过了!'
|
logged_in: '&c你已经登陆过了!'
|
||||||
logout: '&c已成功登出!'
|
logout: '&c已成功登出!'
|
||||||
|
@ -25,7 +25,7 @@ usage_unreg: '&8[&6用戶系統&8] &c用法: 《 /unregister <密碼> 》'
|
|||||||
pwd_changed: '&8[&6用戶系統&8] &c你成功的更換了你的密碼 !'
|
pwd_changed: '&8[&6用戶系統&8] &c你成功的更換了你的密碼 !'
|
||||||
user_unknown: '&8[&6用戶系統&8] &c此用戶名沒有已登記資料。'
|
user_unknown: '&8[&6用戶系統&8] &c此用戶名沒有已登記資料。'
|
||||||
password_error: '&8[&6用戶系統&8] &f密碼不符合。'
|
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/ 註冊。'
|
reg_only: '&8[&6用戶系統&8] &f限已註冊會員,請先到 https://www.example.com/ 註冊。'
|
||||||
logged_in: '&8[&6用戶系統&8] &c你已經登入過了。'
|
logged_in: '&8[&6用戶系統&8] &c你已經登入過了。'
|
||||||
logout: '&8[&6用戶系統&8] &b你成功的登出了。'
|
logout: '&8[&6用戶系統&8] &b你成功的登出了。'
|
||||||
|
@ -22,7 +22,7 @@ usage_unreg: '&c正確用法為:使用"/unregister <密碼>"來取消現有密
|
|||||||
pwd_changed: '&c密碼變更成功!'
|
pwd_changed: '&c密碼變更成功!'
|
||||||
user_unknown: '&c此用戶名並未被註冊!'
|
user_unknown: '&c此用戶名並未被註冊!'
|
||||||
password_error: <密碼>與<錯認密碼>不相同!
|
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'
|
reg_only: 'Registered players only! Please visit http://example.com to register'
|
||||||
logged_in: '&c您已經登入了!'
|
logged_in: '&c您已經登入了!'
|
||||||
logout: '&a登出成功!'
|
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