mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-09-19 02:11:55 +02:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
0cc98a839c
69
pom.xml
69
pom.xml
@ -13,6 +13,11 @@
|
|||||||
<url>http://dev.bukkit.org/bukkit-plugins/authme-reloaded/</url>
|
<url>http://dev.bukkit.org/bukkit-plugins/authme-reloaded/</url>
|
||||||
<!-- See also: https://www.spigotmc.org/resources/authme-reloaded.6269/ -->
|
<!-- See also: https://www.spigotmc.org/resources/authme-reloaded.6269/ -->
|
||||||
|
|
||||||
|
<organization>
|
||||||
|
<name>AuthMe-Team</name>
|
||||||
|
<url>https://github.com/AuthMe-Team</url>
|
||||||
|
</organization>
|
||||||
|
|
||||||
<scm>
|
<scm>
|
||||||
<connection>scm:git:https://github.com/Xephi/AuthMeReloaded.git</connection>
|
<connection>scm:git:https://github.com/Xephi/AuthMeReloaded.git</connection>
|
||||||
<developerConnection>scm:git:git@github.com:Xephi/AuthMeReloaded.git</developerConnection>
|
<developerConnection>scm:git:git@github.com:Xephi/AuthMeReloaded.git</developerConnection>
|
||||||
@ -56,6 +61,14 @@
|
|||||||
<include>*.yml</include>
|
<include>*.yml</include>
|
||||||
</includes>
|
</includes>
|
||||||
</resource>
|
</resource>
|
||||||
|
<resource>
|
||||||
|
<targetPath>./messages/</targetPath>
|
||||||
|
<filtering>false</filtering>
|
||||||
|
<directory>${basedir}/src/main/resources/messages/</directory>
|
||||||
|
<includes>
|
||||||
|
<include>*.yml</include>
|
||||||
|
</includes>
|
||||||
|
</resource>
|
||||||
</resources>
|
</resources>
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
@ -74,13 +87,12 @@
|
|||||||
<configuration>
|
<configuration>
|
||||||
<artifactSet>
|
<artifactSet>
|
||||||
<includes>
|
<includes>
|
||||||
<include>com.maxmind.geoip:*</include>
|
<include>com.zaxxer:HikariCP</include>
|
||||||
<include>javax.mail:*</include>
|
<include>org.slf4j:slf4j-simple</include>
|
||||||
<include>com.sun.mail:*</include>
|
<include>com.maxmind.geoip:geoip-api</include>
|
||||||
<include>com.comphenix.attribute:*</include>
|
<include>com.sun.mail:javax.mail</include>
|
||||||
<include>org.mcstats.*:*</include>
|
<include>com.comphenix.attribute:AttributeStorage</include>
|
||||||
<include>com.zaxxer:*</include>
|
<include>org.mcstats.bukkit:metrics</include>
|
||||||
<include>org.slf4j:*</include>
|
|
||||||
</includes>
|
</includes>
|
||||||
</artifactSet>
|
</artifactSet>
|
||||||
<relocations>
|
<relocations>
|
||||||
@ -164,42 +176,27 @@
|
|||||||
<url>http://repo.mcstats.org/content/repositories/snapshots/</url>
|
<url>http://repo.mcstats.org/content/repositories/snapshots/</url>
|
||||||
</repository>
|
</repository>
|
||||||
|
|
||||||
|
<!-- sgdc3 HikariCP Log4J Repo -->
|
||||||
|
<repository>
|
||||||
|
<id>hikaricp-log4j-releases</id>
|
||||||
|
<url>http://nexus-sgdc3.rhcloud.com/nexus/content/repositories/hikaricp-log4j-releases/</url>
|
||||||
|
</repository>
|
||||||
|
|
||||||
</repositories>
|
</repositories>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|
||||||
<!-- Maven Dependencies -->
|
<!-- Maven Dependencies -->
|
||||||
|
|
||||||
<!-- MySql Connection Pool -->
|
<!-- Database Connection Pool -->
|
||||||
<dependency>
|
|
||||||
<groupId>mysql</groupId>
|
|
||||||
<artifactId>mysql-connector-java</artifactId>
|
|
||||||
<version>5.1.36</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.slf4j</groupId>
|
|
||||||
<artifactId>slf4j-simple</artifactId>
|
|
||||||
<version>1.7.12</version>
|
|
||||||
<scope>compile</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.zaxxer</groupId>
|
<groupId>com.zaxxer</groupId>
|
||||||
<artifactId>HikariCP</artifactId>
|
<artifactId>HikariCP</artifactId>
|
||||||
<version>2.4.1</version>
|
<version>2.4.1</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
<exclusions>
|
|
||||||
<exclusion>
|
|
||||||
<groupId>org.slf4j</groupId>
|
|
||||||
<artifactId>slf4j-api</artifactId>
|
|
||||||
</exclusion>
|
|
||||||
<exclusion>
|
|
||||||
<groupId>org.slf4j</groupId>
|
|
||||||
<artifactId>slf4j-simple</artifactId>
|
|
||||||
</exclusion>
|
|
||||||
</exclusions>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- SQLite Library -->
|
<!-- SQLite Connector -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.xerial</groupId>
|
<groupId>org.xerial</groupId>
|
||||||
<artifactId>sqlite-jdbc</artifactId>
|
<artifactId>sqlite-jdbc</artifactId>
|
||||||
@ -207,7 +204,13 @@
|
|||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- Java Email API -->
|
<!-- Java Email API and Implementation -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>javax.mail</groupId>
|
||||||
|
<artifactId>javax.mail-api</artifactId>
|
||||||
|
<version>1.5.4</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.sun.mail</groupId>
|
<groupId>com.sun.mail</groupId>
|
||||||
<artifactId>javax.mail</artifactId>
|
<artifactId>javax.mail</artifactId>
|
||||||
@ -557,9 +560,7 @@
|
|||||||
</exclusion>
|
</exclusion>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
<artifactId>simplechestlock</artifactId>
|
<artifactId>simplechestlock</artifactId>
|
||||||
<groupId>
|
<groupId>com.webkonsept.bukkit.simplechestlock</groupId>
|
||||||
com.webkonsept.bukkit.simplechestlock
|
|
||||||
</groupId>
|
|
||||||
</exclusion>
|
</exclusion>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
<artifactId>commandbook</artifactId>
|
<artifactId>commandbook</artifactId>
|
||||||
|
@ -10,6 +10,7 @@ import java.io.OutputStream;
|
|||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.net.URLConnection;
|
import java.net.URLConnection;
|
||||||
|
import java.sql.SQLException;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
@ -34,6 +35,7 @@ import org.mcstats.Metrics;
|
|||||||
import com.earth2me.essentials.Essentials;
|
import com.earth2me.essentials.Essentials;
|
||||||
import com.maxmind.geoip.LookupService;
|
import com.maxmind.geoip.LookupService;
|
||||||
import com.onarandombox.MultiverseCore.MultiverseCore;
|
import com.onarandombox.MultiverseCore.MultiverseCore;
|
||||||
|
import com.zaxxer.hikari.pool.PoolInitializationException;
|
||||||
|
|
||||||
import fr.xephi.authme.api.API;
|
import fr.xephi.authme.api.API;
|
||||||
import fr.xephi.authme.api.NewAPI;
|
import fr.xephi.authme.api.NewAPI;
|
||||||
@ -214,7 +216,18 @@ public class AuthMe extends JavaPlugin {
|
|||||||
else ConsoleLogger.showError("Error while performing the backup!");
|
else ConsoleLogger.showError("Error while performing the backup!");
|
||||||
}
|
}
|
||||||
|
|
||||||
setupDatabase();
|
try {
|
||||||
|
setupDatabase();
|
||||||
|
} catch (ClassNotFoundException nfe) {
|
||||||
|
ConsoleLogger.showError("Fatal error occurred! Authme initialization ABORTED!");
|
||||||
|
return;
|
||||||
|
} catch (SQLException sqle) {
|
||||||
|
ConsoleLogger.showError("Fatal error occurred! Authme initialization ABORTED!");
|
||||||
|
return;
|
||||||
|
} catch (PoolInitializationException pie) {
|
||||||
|
ConsoleLogger.showError("Fatal error occurred! Authme initialization ABORTED!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
dataManager = new DataManager(this);
|
dataManager = new DataManager(this);
|
||||||
|
|
||||||
@ -800,7 +813,7 @@ public class AuthMe extends JavaPlugin {
|
|||||||
return realIP;
|
return realIP;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setupDatabase() {
|
public void setupDatabase() throws ClassNotFoundException, PoolInitializationException, SQLException {
|
||||||
/*
|
/*
|
||||||
* Backend MYSQL - FILE - SQLITE
|
* Backend MYSQL - FILE - SQLITE
|
||||||
*/
|
*/
|
||||||
|
@ -134,10 +134,13 @@ public class DataManager {
|
|||||||
playerFile.delete();
|
playerFile.delete();
|
||||||
i++;
|
i++;
|
||||||
} else {
|
} else {
|
||||||
playerFile = new File(plugin.ess.getDataFolder() + File.separator + "userdata" + File.separator + Bukkit.getOfflinePlayer(name).getUniqueId() + ".yml");
|
try {
|
||||||
if (playerFile.exists()) {
|
playerFile = new File(plugin.ess.getDataFolder() + File.separator + "userdata" + File.separator + Bukkit.getOfflinePlayer(name).getUniqueId() + ".yml");
|
||||||
playerFile.delete();
|
if (playerFile.exists()) {
|
||||||
i++;
|
playerFile.delete();
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
} catch (Exception e) { // Don't do nothing if the method getUniqueId() isn't avariable ( MC version < 1.7.5 )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
@ -505,8 +505,12 @@ public class FileCache {
|
|||||||
else armours[i] = item;
|
else armours[i] = item;
|
||||||
}
|
}
|
||||||
} catch (final RuntimeException e) {
|
} catch (final RuntimeException e) {
|
||||||
|
//verbose
|
||||||
|
e.printStackTrace();
|
||||||
ConsoleLogger.showError("Error while reading file for " + player.getName() + ", some wipe inventory incoming...");
|
ConsoleLogger.showError("Error while reading file for " + player.getName() + ", some wipe inventory incoming...");
|
||||||
} catch (final Exception e) {
|
} catch (final Exception e) {
|
||||||
|
//verbose
|
||||||
|
e.printStackTrace();
|
||||||
ConsoleLogger.showError("Error while reading file for " + player.getName() + ", some wipe inventory incoming...");
|
ConsoleLogger.showError("Error while reading file for " + player.getName() + ", some wipe inventory incoming...");
|
||||||
} finally {
|
} finally {
|
||||||
if (reader != null)
|
if (reader != null)
|
||||||
@ -515,9 +519,13 @@ public class FileCache {
|
|||||||
return new DataFileCache(inv, armours, group, op, flying);
|
return new DataFileCache(inv, armours, group, op, flying);
|
||||||
}
|
}
|
||||||
} catch (RuntimeException e) {
|
} catch (RuntimeException e) {
|
||||||
|
// Verbose
|
||||||
|
e.printStackTrace();
|
||||||
ConsoleLogger.showError("Error while reading file for " + player.getName() + ", some wipe inventory incoming...");
|
ConsoleLogger.showError("Error while reading file for " + player.getName() + ", some wipe inventory incoming...");
|
||||||
return null;
|
return null;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
// Verbose
|
||||||
|
e.printStackTrace();
|
||||||
ConsoleLogger.showError("Error while reading file for " + player.getName() + ", some wipe inventory incoming...");
|
ConsoleLogger.showError("Error while reading file for " + player.getName() + ", some wipe inventory incoming...");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,7 @@ import java.io.File;
|
|||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.security.NoSuchAlgorithmException;
|
import java.security.NoSuchAlgorithmException;
|
||||||
|
import java.sql.SQLException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
@ -22,6 +23,8 @@ import org.bukkit.potion.PotionEffectType;
|
|||||||
import org.bukkit.scheduler.BukkitScheduler;
|
import org.bukkit.scheduler.BukkitScheduler;
|
||||||
import org.bukkit.scheduler.BukkitTask;
|
import org.bukkit.scheduler.BukkitTask;
|
||||||
|
|
||||||
|
import com.zaxxer.hikari.pool.PoolInitializationException;
|
||||||
|
|
||||||
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;
|
||||||
@ -143,7 +146,38 @@ public class AdminCommand implements CommandExecutor {
|
|||||||
Settings.reloadConfigOptions(newConfig);
|
Settings.reloadConfigOptions(newConfig);
|
||||||
m.reloadMessages();
|
m.reloadMessages();
|
||||||
plugin.database.close();
|
plugin.database.close();
|
||||||
plugin.setupDatabase();
|
|
||||||
|
try {
|
||||||
|
plugin.setupDatabase();
|
||||||
|
} catch (ClassNotFoundException nfe) {
|
||||||
|
ConsoleLogger.showError("Fatal error occurred! Authme instance ABORTED!");
|
||||||
|
if (Settings.isStopEnabled) {
|
||||||
|
AuthMe.getInstance().getServer().shutdown();
|
||||||
|
AuthMe.getInstance().getServer().getPluginManager().disablePlugin(AuthMe.getInstance());
|
||||||
|
} else {
|
||||||
|
AuthMe.getInstance().getServer().getPluginManager().disablePlugin(AuthMe.getInstance());
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
} catch (SQLException sqle) {
|
||||||
|
ConsoleLogger.showError("Fatal error occurred! Authme instance ABORTED!");
|
||||||
|
if (Settings.isStopEnabled) {
|
||||||
|
AuthMe.getInstance().getServer().shutdown();
|
||||||
|
AuthMe.getInstance().getServer().getPluginManager().disablePlugin(AuthMe.getInstance());
|
||||||
|
} else {
|
||||||
|
AuthMe.getInstance().getServer().getPluginManager().disablePlugin(AuthMe.getInstance());
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
} catch (PoolInitializationException pie) {
|
||||||
|
ConsoleLogger.showError("Fatal error occurred! Authme instance ABORTED!");
|
||||||
|
if (Settings.isStopEnabled) {
|
||||||
|
AuthMe.getInstance().getServer().shutdown();
|
||||||
|
AuthMe.getInstance().getServer().getPluginManager().disablePlugin(AuthMe.getInstance());
|
||||||
|
} else {
|
||||||
|
AuthMe.getInstance().getServer().getPluginManager().disablePlugin(AuthMe.getInstance());
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
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) {
|
||||||
|
@ -8,7 +8,6 @@ import java.sql.SQLException;
|
|||||||
import java.sql.Statement;
|
import java.sql.Statement;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.TimeoutException;
|
|
||||||
|
|
||||||
import com.zaxxer.hikari.HikariConfig;
|
import com.zaxxer.hikari.HikariConfig;
|
||||||
import com.zaxxer.hikari.HikariDataSource;
|
import com.zaxxer.hikari.HikariDataSource;
|
||||||
@ -45,7 +44,7 @@ public class MySQL implements DataSource {
|
|||||||
private HikariDataSource ds;
|
private HikariDataSource ds;
|
||||||
private String columnRealName;
|
private String columnRealName;
|
||||||
|
|
||||||
public MySQL() {
|
public MySQL() throws ClassNotFoundException, SQLException, PoolInitializationException {
|
||||||
this.host = Settings.getMySQLHost;
|
this.host = Settings.getMySQLHost;
|
||||||
this.port = Settings.getMySQLPort;
|
this.port = Settings.getMySQLPort;
|
||||||
this.username = Settings.getMySQLUsername;
|
this.username = Settings.getMySQLUsername;
|
||||||
@ -67,73 +66,112 @@ public class MySQL implements DataSource {
|
|||||||
this.columnID = Settings.getMySQLColumnId;
|
this.columnID = Settings.getMySQLColumnId;
|
||||||
this.columnLogged = Settings.getMySQLColumnLogged;
|
this.columnLogged = Settings.getMySQLColumnLogged;
|
||||||
this.columnRealName = Settings.getMySQLColumnRealName;
|
this.columnRealName = Settings.getMySQLColumnRealName;
|
||||||
|
|
||||||
|
// Set the connection arguments (and check if connection is ok)
|
||||||
try {
|
try {
|
||||||
this.connect();
|
this.setConnectionArguments();
|
||||||
this.setup();
|
} catch (ClassNotFoundException ne) {
|
||||||
} catch (ClassNotFoundException e) {
|
ConsoleLogger.showError(ne.getMessage());
|
||||||
ConsoleLogger.showError(e.getMessage());
|
ConsoleLogger.showError("Can't use the Hikari Connection Pool! Please, report this error to the developer! SHUTDOWN...");
|
||||||
|
this.close();
|
||||||
if (Settings.isStopEnabled) {
|
if (Settings.isStopEnabled) {
|
||||||
ConsoleLogger.showError("Can't use MySQL... Please input correct MySQL informations ! SHUTDOWN...");
|
|
||||||
AuthMe.getInstance().getServer().shutdown();
|
AuthMe.getInstance().getServer().shutdown();
|
||||||
}
|
|
||||||
if (!Settings.isStopEnabled)
|
|
||||||
AuthMe.getInstance().getServer().getPluginManager().disablePlugin(AuthMe.getInstance());
|
AuthMe.getInstance().getServer().getPluginManager().disablePlugin(AuthMe.getInstance());
|
||||||
return;
|
} else {
|
||||||
|
AuthMe.getInstance().getServer().getPluginManager().disablePlugin(AuthMe.getInstance());
|
||||||
|
}
|
||||||
|
throw new ClassNotFoundException(ne.getMessage());
|
||||||
|
} catch (IllegalArgumentException ae) { // This means that there are problems with the hikaricp pool arguments!
|
||||||
|
ConsoleLogger.showError(ae.getMessage());
|
||||||
|
ConsoleLogger.showError("Invalid database arguments! Please check your configuration!");
|
||||||
|
ConsoleLogger.showError("If this error persists, please report it to the developer! SHUTDOWN...");
|
||||||
|
this.close();
|
||||||
|
if (Settings.isStopEnabled) {
|
||||||
|
AuthMe.getInstance().getServer().shutdown();
|
||||||
|
AuthMe.getInstance().getServer().getPluginManager().disablePlugin(AuthMe.getInstance());
|
||||||
|
} else {
|
||||||
|
AuthMe.getInstance().getServer().getPluginManager().disablePlugin(AuthMe.getInstance());
|
||||||
|
}
|
||||||
|
throw new IllegalArgumentException(ae);
|
||||||
|
} catch (PoolInitializationException ie) { // Can't initialize the connection pool!
|
||||||
|
ConsoleLogger.showError(ie.getMessage());
|
||||||
|
ConsoleLogger.showError("Can't connect to the MySql database! Please check your configuration!");
|
||||||
|
ConsoleLogger.showError("If this error persists, please report it to the developer! SHUTDOWN...");
|
||||||
|
this.close();
|
||||||
|
if (Settings.isStopEnabled) {
|
||||||
|
AuthMe.getInstance().getServer().shutdown();
|
||||||
|
AuthMe.getInstance().getServer().getPluginManager().disablePlugin(AuthMe.getInstance());
|
||||||
|
} else {
|
||||||
|
AuthMe.getInstance().getServer().getPluginManager().disablePlugin(AuthMe.getInstance());
|
||||||
|
}
|
||||||
|
throw new PoolInitializationException(ie);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Initialize the database
|
||||||
|
try {
|
||||||
|
this.setupConnection();
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
ConsoleLogger.showError(e.getMessage());
|
ConsoleLogger.showError(e.getMessage());
|
||||||
|
ConsoleLogger.showError("Can't initialize the MySQL database... Please check your database settings in the config.yml file! SHUTDOWN...");
|
||||||
|
ConsoleLogger.showError("If this error persists, please report it to the developer! SHUTDOWN...");
|
||||||
|
this.close();
|
||||||
if (Settings.isStopEnabled) {
|
if (Settings.isStopEnabled) {
|
||||||
ConsoleLogger.showError("Can't use MySQL... Please input correct MySQL informations ! SHUTDOWN...");
|
|
||||||
AuthMe.getInstance().getServer().shutdown();
|
AuthMe.getInstance().getServer().shutdown();
|
||||||
}
|
|
||||||
if (!Settings.isStopEnabled)
|
|
||||||
AuthMe.getInstance().getServer().getPluginManager().disablePlugin(AuthMe.getInstance());
|
AuthMe.getInstance().getServer().getPluginManager().disablePlugin(AuthMe.getInstance());
|
||||||
return;
|
} else {
|
||||||
} catch (TimeoutException e) {
|
|
||||||
ConsoleLogger.showError(e.getMessage());
|
|
||||||
if (Settings.isStopEnabled) {
|
|
||||||
ConsoleLogger.showError("Can't use MySQL... Please input correct MySQL informations ! SHUTDOWN...");
|
|
||||||
AuthMe.getInstance().getServer().shutdown();
|
|
||||||
}
|
|
||||||
if (!Settings.isStopEnabled)
|
|
||||||
AuthMe.getInstance().getServer().getPluginManager().disablePlugin(AuthMe.getInstance());
|
AuthMe.getInstance().getServer().getPluginManager().disablePlugin(AuthMe.getInstance());
|
||||||
return;
|
|
||||||
} catch (PoolInitializationException e) {
|
|
||||||
ConsoleLogger.showError(e.getMessage());
|
|
||||||
if (Settings.isStopEnabled) {
|
|
||||||
ConsoleLogger.showError("Can't use MySQL... Please input correct MySQL informations ! SHUTDOWN...");
|
|
||||||
AuthMe.getInstance().getServer().shutdown();
|
|
||||||
}
|
}
|
||||||
if (!Settings.isStopEnabled)
|
throw new SQLException(e);
|
||||||
AuthMe.getInstance().getServer().getPluginManager().disablePlugin(AuthMe.getInstance());
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private synchronized void connect()
|
private synchronized void setConnectionArguments()
|
||||||
throws ClassNotFoundException, SQLException, TimeoutException,
|
throws ClassNotFoundException, IllegalArgumentException {
|
||||||
NumberFormatException, PoolInitializationException {
|
|
||||||
HikariConfig config = new HikariConfig();
|
HikariConfig config = new HikariConfig();
|
||||||
config.setDriverClassName("com.mysql.jdbc.Driver");
|
config.setPoolName("AuthMeMYSQLPool");
|
||||||
|
config.setDataSourceClassName("com.mysql.jdbc.jdbc2.optional.MysqlDataSource");
|
||||||
config.setJdbcUrl("jdbc:mysql://" + this.host + ":" + this.port + "/" + this.database);
|
config.setJdbcUrl("jdbc:mysql://" + this.host + ":" + this.port + "/" + this.database);
|
||||||
config.setUsername(this.username);
|
config.setUsername(this.username);
|
||||||
config.setPassword(this.password);
|
config.setPassword(this.password);
|
||||||
config.setPoolName("AuthMeMYSQLPool");
|
|
||||||
config.addDataSourceProperty("cachePrepStmts", "true");
|
config.addDataSourceProperty("cachePrepStmts", "true");
|
||||||
config.addDataSourceProperty("prepStmtCacheSize", "250");
|
config.addDataSourceProperty("prepStmtCacheSize", "250");
|
||||||
config.addDataSourceProperty("prepStmtCacheSqlLimit", "2048");
|
config.addDataSourceProperty("prepStmtCacheSqlLimit", "2048");
|
||||||
config.addDataSourceProperty("autoReconnect", true);
|
config.addDataSourceProperty("autoReconnect", false);
|
||||||
config.setMaxLifetime(30000);
|
config.setInitializationFailFast(true); // Don't start the plugin if the database is unavariable
|
||||||
config.setInitializationFailFast(false);
|
config.setMaxLifetime(180000); // 3 Min
|
||||||
|
config.setIdleTimeout(60000); // 1 Min
|
||||||
|
config.setMaximumPoolSize(50); // 50 (including idle connections)
|
||||||
ds = new HikariDataSource(config);
|
ds = new HikariDataSource(config);
|
||||||
ConsoleLogger.info("Connection pool ready");
|
ConsoleLogger.info("Connection arguments loaded, Hikari ConnectionPool ready!");
|
||||||
}
|
}
|
||||||
|
|
||||||
private synchronized void setup() throws SQLException {
|
private synchronized void reloadArguments()
|
||||||
|
throws ClassNotFoundException, IllegalArgumentException {
|
||||||
|
if (ds != null){
|
||||||
|
ds.close();
|
||||||
|
}
|
||||||
|
setConnectionArguments();
|
||||||
|
ConsoleLogger.info("Hikari ConnectionPool arguments reloaded!");
|
||||||
|
}
|
||||||
|
|
||||||
|
private synchronized Connection getConnection() {
|
||||||
|
Connection con = null;
|
||||||
|
while(con == null){
|
||||||
|
try {
|
||||||
|
con = ds.getConnection();
|
||||||
|
} catch (SQLException ce) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return con;
|
||||||
|
}
|
||||||
|
|
||||||
|
private synchronized void setupConnection() throws SQLException {
|
||||||
Connection con = null;
|
Connection con = null;
|
||||||
Statement st = null;
|
Statement st = null;
|
||||||
ResultSet rs = null;
|
ResultSet rs = null;
|
||||||
try {
|
try {
|
||||||
con = makeSureConnectionIsReady();
|
con = getConnection();
|
||||||
st = con.createStatement();
|
st = con.createStatement();
|
||||||
st.executeUpdate("CREATE TABLE IF NOT EXISTS " + tableName + " (" + columnID + " INTEGER AUTO_INCREMENT," + columnName + " VARCHAR(255) NOT NULL UNIQUE," + columnPassword + " VARCHAR(255) NOT NULL," + columnIp + " VARCHAR(40) NOT NULL DEFAULT '127.0.0.1'," + columnLastLogin + " BIGINT NOT NULL DEFAULT '" + System.currentTimeMillis() + "'," + lastlocX + " DOUBLE NOT NULL DEFAULT '0.0'," + lastlocY + " DOUBLE NOT NULL DEFAULT '0.0'," + lastlocZ + " DOUBLE NOT NULL DEFAULT '0.0'," + lastlocWorld + " VARCHAR(255) NOT NULL DEFAULT '" + Settings.defaultWorld + "'," + columnEmail + " VARCHAR(255) DEFAULT 'your@email.com'," + columnLogged + " SMALLINT NOT NULL DEFAULT '0'," + "CONSTRAINT table_const_prim PRIMARY KEY (" + columnID + "));");
|
st.executeUpdate("CREATE TABLE IF NOT EXISTS " + tableName + " (" + columnID + " INTEGER AUTO_INCREMENT," + columnName + " VARCHAR(255) NOT NULL UNIQUE," + columnPassword + " VARCHAR(255) NOT NULL," + columnIp + " VARCHAR(40) NOT NULL DEFAULT '127.0.0.1'," + columnLastLogin + " BIGINT NOT NULL DEFAULT '" + System.currentTimeMillis() + "'," + lastlocX + " DOUBLE NOT NULL DEFAULT '0.0'," + lastlocY + " DOUBLE NOT NULL DEFAULT '0.0'," + lastlocZ + " DOUBLE NOT NULL DEFAULT '0.0'," + lastlocWorld + " VARCHAR(255) NOT NULL DEFAULT '" + Settings.defaultWorld + "'," + columnEmail + " VARCHAR(255) DEFAULT 'your@email.com'," + columnLogged + " SMALLINT NOT NULL DEFAULT '0'," + "CONSTRAINT table_const_prim PRIMARY KEY (" + columnID + "));");
|
||||||
rs = con.getMetaData().getColumns(null, null, tableName, columnPassword);
|
rs = con.getMetaData().getColumns(null, null, tableName, columnPassword);
|
||||||
@ -185,6 +223,7 @@ public class MySQL implements DataSource {
|
|||||||
close(st);
|
close(st);
|
||||||
close(con);
|
close(con);
|
||||||
}
|
}
|
||||||
|
ConsoleLogger.info("MySQL Setup finished");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -193,7 +232,7 @@ public class MySQL implements DataSource {
|
|||||||
PreparedStatement pst = null;
|
PreparedStatement pst = null;
|
||||||
ResultSet rs = null;
|
ResultSet rs = null;
|
||||||
try {
|
try {
|
||||||
con = makeSureConnectionIsReady();
|
con = getConnection();
|
||||||
pst = con.prepareStatement("SELECT * FROM " + tableName + " WHERE LOWER(" + columnName + ")=LOWER(?);");
|
pst = con.prepareStatement("SELECT * FROM " + tableName + " WHERE LOWER(" + columnName + ")=LOWER(?);");
|
||||||
pst.setString(1, user);
|
pst.setString(1, user);
|
||||||
rs = pst.executeQuery();
|
rs = pst.executeQuery();
|
||||||
@ -217,7 +256,7 @@ public class MySQL implements DataSource {
|
|||||||
PlayerAuth pAuth = null;
|
PlayerAuth pAuth = null;
|
||||||
int id = -1;
|
int id = -1;
|
||||||
try {
|
try {
|
||||||
con = makeSureConnectionIsReady();
|
con = getConnection();
|
||||||
pst = con.prepareStatement("SELECT * FROM " + tableName + " WHERE LOWER(" + columnName + ")=LOWER(?);");
|
pst = con.prepareStatement("SELECT * FROM " + tableName + " WHERE LOWER(" + columnName + ")=LOWER(?);");
|
||||||
pst.setString(1, user);
|
pst.setString(1, user);
|
||||||
rs = pst.executeQuery();
|
rs = pst.executeQuery();
|
||||||
@ -264,7 +303,7 @@ public class MySQL implements DataSource {
|
|||||||
Connection con = null;
|
Connection con = null;
|
||||||
PreparedStatement pst = null;
|
PreparedStatement pst = null;
|
||||||
try {
|
try {
|
||||||
con = makeSureConnectionIsReady();
|
con = getConnection();
|
||||||
if ((columnSalt == null || columnSalt.isEmpty()) || (auth.getSalt() == null || auth.getSalt().isEmpty())) {
|
if ((columnSalt == null || columnSalt.isEmpty()) || (auth.getSalt() == null || auth.getSalt().isEmpty())) {
|
||||||
pst = con.prepareStatement("INSERT INTO " + tableName + "(" + columnName + "," + columnPassword + "," + columnIp + "," + columnLastLogin + "," + columnRealName + ") VALUES (?,?,?,?,?);");
|
pst = con.prepareStatement("INSERT INTO " + tableName + "(" + columnName + "," + columnPassword + "," + columnIp + "," + columnLastLogin + "," + columnRealName + ") VALUES (?,?,?,?,?);");
|
||||||
pst.setString(1, auth.getNickname());
|
pst.setString(1, auth.getNickname());
|
||||||
@ -473,7 +512,7 @@ public class MySQL implements DataSource {
|
|||||||
Connection con = null;
|
Connection con = null;
|
||||||
PreparedStatement pst = null;
|
PreparedStatement pst = null;
|
||||||
try {
|
try {
|
||||||
con = makeSureConnectionIsReady();
|
con = getConnection();
|
||||||
pst = con.prepareStatement("UPDATE " + tableName + " SET " + columnPassword + "=? WHERE LOWER(" + columnName + ")=?;");
|
pst = con.prepareStatement("UPDATE " + tableName + " SET " + columnPassword + "=? WHERE LOWER(" + columnName + ")=?;");
|
||||||
pst.setString(1, auth.getHash());
|
pst.setString(1, auth.getHash());
|
||||||
pst.setString(2, auth.getNickname());
|
pst.setString(2, auth.getNickname());
|
||||||
@ -518,7 +557,7 @@ public class MySQL implements DataSource {
|
|||||||
Connection con = null;
|
Connection con = null;
|
||||||
PreparedStatement pst = null;
|
PreparedStatement pst = null;
|
||||||
try {
|
try {
|
||||||
con = makeSureConnectionIsReady();
|
con = getConnection();
|
||||||
pst = con.prepareStatement("UPDATE " + tableName + " SET " + columnIp + "=?, " + columnLastLogin + "=?, " + columnRealName + "=? WHERE LOWER(" + columnName + ")=?;");
|
pst = con.prepareStatement("UPDATE " + tableName + " SET " + columnIp + "=?, " + columnLastLogin + "=?, " + columnRealName + "=? WHERE LOWER(" + columnName + ")=?;");
|
||||||
pst.setString(1, auth.getIp());
|
pst.setString(1, auth.getIp());
|
||||||
pst.setLong(2, auth.getLastLogin());
|
pst.setLong(2, auth.getLastLogin());
|
||||||
@ -540,7 +579,7 @@ public class MySQL implements DataSource {
|
|||||||
Connection con = null;
|
Connection con = null;
|
||||||
PreparedStatement pst = null;
|
PreparedStatement pst = null;
|
||||||
try {
|
try {
|
||||||
con = makeSureConnectionIsReady();
|
con = getConnection();
|
||||||
pst = con.prepareStatement("DELETE FROM " + tableName + " WHERE " + columnLastLogin + "<?;");
|
pst = con.prepareStatement("DELETE FROM " + tableName + " WHERE " + columnLastLogin + "<?;");
|
||||||
pst.setLong(1, until);
|
pst.setLong(1, until);
|
||||||
return pst.executeUpdate();
|
return pst.executeUpdate();
|
||||||
@ -560,7 +599,7 @@ public class MySQL implements DataSource {
|
|||||||
ResultSet rs = null;
|
ResultSet rs = null;
|
||||||
List<String> list = new ArrayList<String>();
|
List<String> list = new ArrayList<String>();
|
||||||
try {
|
try {
|
||||||
con = makeSureConnectionIsReady();
|
con = getConnection();
|
||||||
pst = con.prepareStatement("SELECT * FROM " + tableName + " WHERE " + columnLastLogin + "<?;");
|
pst = con.prepareStatement("SELECT * FROM " + tableName + " WHERE " + columnLastLogin + "<?;");
|
||||||
pst.setLong(1, until);
|
pst.setLong(1, until);
|
||||||
rs = pst.executeQuery();
|
rs = pst.executeQuery();
|
||||||
@ -587,7 +626,7 @@ public class MySQL implements DataSource {
|
|||||||
Connection con = null;
|
Connection con = null;
|
||||||
PreparedStatement pst = null;
|
PreparedStatement pst = null;
|
||||||
try {
|
try {
|
||||||
con = makeSureConnectionIsReady();
|
con = getConnection();
|
||||||
if (Settings.getPasswordHash == HashAlgorithm.XENFORO) {
|
if (Settings.getPasswordHash == HashAlgorithm.XENFORO) {
|
||||||
int id;
|
int id;
|
||||||
ResultSet rs = null;
|
ResultSet rs = null;
|
||||||
@ -623,7 +662,7 @@ public class MySQL implements DataSource {
|
|||||||
Connection con = null;
|
Connection con = null;
|
||||||
PreparedStatement pst = null;
|
PreparedStatement pst = null;
|
||||||
try {
|
try {
|
||||||
con = makeSureConnectionIsReady();
|
con = getConnection();
|
||||||
pst = con.prepareStatement("UPDATE " + tableName + " SET " + lastlocX + " =?, " + lastlocY + "=?, " + lastlocZ + "=?, " + lastlocWorld + "=? WHERE LOWER(" + columnName + ")=?;");
|
pst = con.prepareStatement("UPDATE " + tableName + " SET " + lastlocX + " =?, " + lastlocY + "=?, " + lastlocZ + "=?, " + lastlocWorld + "=? WHERE LOWER(" + columnName + ")=?;");
|
||||||
pst.setDouble(1, auth.getQuitLocX());
|
pst.setDouble(1, auth.getQuitLocX());
|
||||||
pst.setDouble(2, auth.getQuitLocY());
|
pst.setDouble(2, auth.getQuitLocY());
|
||||||
@ -648,7 +687,7 @@ public class MySQL implements DataSource {
|
|||||||
ResultSet rs = null;
|
ResultSet rs = null;
|
||||||
int countIp = 0;
|
int countIp = 0;
|
||||||
try {
|
try {
|
||||||
con = makeSureConnectionIsReady();
|
con = getConnection();
|
||||||
pst = con.prepareStatement("SELECT * FROM " + tableName + " WHERE " + columnIp + "=?;");
|
pst = con.prepareStatement("SELECT * FROM " + tableName + " WHERE " + columnIp + "=?;");
|
||||||
pst.setString(1, ip);
|
pst.setString(1, ip);
|
||||||
rs = pst.executeQuery();
|
rs = pst.executeQuery();
|
||||||
@ -671,7 +710,7 @@ public class MySQL implements DataSource {
|
|||||||
Connection con = null;
|
Connection con = null;
|
||||||
PreparedStatement pst = null;
|
PreparedStatement pst = null;
|
||||||
try {
|
try {
|
||||||
con = makeSureConnectionIsReady();
|
con = getConnection();
|
||||||
pst = con.prepareStatement("UPDATE " + tableName + " SET " + columnEmail + " =? WHERE LOWER(" + columnName + ")=?;");
|
pst = con.prepareStatement("UPDATE " + tableName + " SET " + columnEmail + " =? WHERE LOWER(" + columnName + ")=?;");
|
||||||
pst.setString(1, auth.getEmail());
|
pst.setString(1, auth.getEmail());
|
||||||
pst.setString(2, auth.getNickname());
|
pst.setString(2, auth.getNickname());
|
||||||
@ -694,7 +733,7 @@ public class MySQL implements DataSource {
|
|||||||
Connection con = null;
|
Connection con = null;
|
||||||
PreparedStatement pst = null;
|
PreparedStatement pst = null;
|
||||||
try {
|
try {
|
||||||
con = makeSureConnectionIsReady();
|
con = getConnection();
|
||||||
pst = con.prepareStatement("UPDATE " + tableName + " SET " + columnSalt + " =? WHERE LOWER(" + columnName + ")=?;");
|
pst = con.prepareStatement("UPDATE " + tableName + " SET " + columnSalt + " =? WHERE LOWER(" + columnName + ")=?;");
|
||||||
pst.setString(1, auth.getSalt());
|
pst.setString(1, auth.getSalt());
|
||||||
pst.setString(2, auth.getNickname());
|
pst.setString(2, auth.getNickname());
|
||||||
@ -709,6 +748,21 @@ public class MySQL implements DataSource {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void reload() {
|
||||||
|
try {
|
||||||
|
reloadArguments();
|
||||||
|
} catch (Exception e) {
|
||||||
|
ConsoleLogger.showError(e.getMessage());
|
||||||
|
ConsoleLogger.showError("Can't reconnect to MySQL database... Please check your MySQL informations ! SHUTDOWN...");
|
||||||
|
if (Settings.isStopEnabled) {
|
||||||
|
AuthMe.getInstance().getServer().shutdown();
|
||||||
|
}
|
||||||
|
if (!Settings.isStopEnabled)
|
||||||
|
AuthMe.getInstance().getServer().getPluginManager().disablePlugin(AuthMe.getInstance());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public synchronized void close() {
|
public synchronized void close() {
|
||||||
try {
|
try {
|
||||||
@ -718,21 +772,6 @@ public class MySQL implements DataSource {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void reload() {
|
|
||||||
try {
|
|
||||||
reconnect(true);
|
|
||||||
} catch (Exception e) {
|
|
||||||
ConsoleLogger.showError(e.getMessage());
|
|
||||||
if (Settings.isStopEnabled) {
|
|
||||||
ConsoleLogger.showError("Can't reconnect to MySQL database... Please check your MySQL informations ! SHUTDOWN...");
|
|
||||||
AuthMe.getInstance().getServer().shutdown();
|
|
||||||
}
|
|
||||||
if (!Settings.isStopEnabled)
|
|
||||||
AuthMe.getInstance().getServer().getPluginManager().disablePlugin(AuthMe.getInstance());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void close(Statement st) {
|
private void close(Statement st) {
|
||||||
if (st != null) {
|
if (st != null) {
|
||||||
try {
|
try {
|
||||||
@ -770,7 +809,7 @@ public class MySQL implements DataSource {
|
|||||||
ResultSet rs = null;
|
ResultSet rs = null;
|
||||||
List<String> countIp = new ArrayList<String>();
|
List<String> countIp = new ArrayList<String>();
|
||||||
try {
|
try {
|
||||||
con = makeSureConnectionIsReady();
|
con = getConnection();
|
||||||
pst = con.prepareStatement("SELECT * FROM " + tableName + " WHERE " + columnIp + "=?;");
|
pst = con.prepareStatement("SELECT * FROM " + tableName + " WHERE " + columnIp + "=?;");
|
||||||
pst.setString(1, auth.getIp());
|
pst.setString(1, auth.getIp());
|
||||||
rs = pst.executeQuery();
|
rs = pst.executeQuery();
|
||||||
@ -795,7 +834,7 @@ public class MySQL implements DataSource {
|
|||||||
ResultSet rs = null;
|
ResultSet rs = null;
|
||||||
List<String> countIp = new ArrayList<String>();
|
List<String> countIp = new ArrayList<String>();
|
||||||
try {
|
try {
|
||||||
con = makeSureConnectionIsReady();
|
con = getConnection();
|
||||||
pst = con.prepareStatement("SELECT * FROM " + tableName + " WHERE " + columnIp + "=?;");
|
pst = con.prepareStatement("SELECT * FROM " + tableName + " WHERE " + columnIp + "=?;");
|
||||||
pst.setString(1, ip);
|
pst.setString(1, ip);
|
||||||
rs = pst.executeQuery();
|
rs = pst.executeQuery();
|
||||||
@ -820,7 +859,7 @@ public class MySQL implements DataSource {
|
|||||||
ResultSet rs = null;
|
ResultSet rs = null;
|
||||||
List<String> countEmail = new ArrayList<String>();
|
List<String> countEmail = new ArrayList<String>();
|
||||||
try {
|
try {
|
||||||
con = makeSureConnectionIsReady();
|
con = getConnection();
|
||||||
pst = con.prepareStatement("SELECT * FROM " + tableName + " WHERE " + columnEmail + "=?;");
|
pst = con.prepareStatement("SELECT * FROM " + tableName + " WHERE " + columnEmail + "=?;");
|
||||||
pst.setString(1, email);
|
pst.setString(1, email);
|
||||||
rs = pst.executeQuery();
|
rs = pst.executeQuery();
|
||||||
@ -844,7 +883,7 @@ public class MySQL implements DataSource {
|
|||||||
PreparedStatement pst = null;
|
PreparedStatement pst = null;
|
||||||
try {
|
try {
|
||||||
for (String name : banned) {
|
for (String name : banned) {
|
||||||
con = makeSureConnectionIsReady();
|
con = getConnection();
|
||||||
pst = con.prepareStatement("DELETE FROM " + tableName + " WHERE LOWER(" + columnName + ")=?;");
|
pst = con.prepareStatement("DELETE FROM " + tableName + " WHERE LOWER(" + columnName + ")=?;");
|
||||||
pst.setString(1, name);
|
pst.setString(1, name);
|
||||||
pst.executeUpdate();
|
pst.executeUpdate();
|
||||||
@ -857,75 +896,6 @@ public class MySQL implements DataSource {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private synchronized Connection makeSureConnectionIsReady() {
|
|
||||||
Connection con = null;
|
|
||||||
try {
|
|
||||||
con = ds.getConnection();
|
|
||||||
} catch (Exception te) {
|
|
||||||
try {
|
|
||||||
con = null;
|
|
||||||
reconnect(false);
|
|
||||||
} catch (Exception e) {
|
|
||||||
ConsoleLogger.showError(e.getMessage());
|
|
||||||
if (Settings.isStopEnabled) {
|
|
||||||
ConsoleLogger.showError("Can't reconnect to MySQL database... Please check your MySQL informations ! SHUTDOWN...");
|
|
||||||
AuthMe.getInstance().getServer().shutdown();
|
|
||||||
}
|
|
||||||
if (!Settings.isStopEnabled)
|
|
||||||
AuthMe.getInstance().getServer().getPluginManager().disablePlugin(AuthMe.getInstance());
|
|
||||||
}
|
|
||||||
} catch (AssertionError ae) {
|
|
||||||
// Make sure assertionerror is caused by the connectionpoolmanager,
|
|
||||||
// else re-throw it
|
|
||||||
if (!ae.getMessage().equalsIgnoreCase("AuthMeDatabaseError"))
|
|
||||||
throw new AssertionError(ae.getMessage());
|
|
||||||
try {
|
|
||||||
con = null;
|
|
||||||
reconnect(false);
|
|
||||||
} catch (Exception e) {
|
|
||||||
ConsoleLogger.showError(e.getMessage());
|
|
||||||
if (Settings.isStopEnabled) {
|
|
||||||
ConsoleLogger.showError("Can't reconnect to MySQL database... Please check your MySQL informations ! SHUTDOWN...");
|
|
||||||
AuthMe.getInstance().getServer().shutdown();
|
|
||||||
}
|
|
||||||
if (!Settings.isStopEnabled)
|
|
||||||
AuthMe.getInstance().getServer().getPluginManager().disablePlugin(AuthMe.getInstance());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
while (con == null)
|
|
||||||
try {
|
|
||||||
con = ds.getConnection();
|
|
||||||
} catch (Exception e) {
|
|
||||||
try {
|
|
||||||
reconnect(false);
|
|
||||||
con = ds.getConnection();
|
|
||||||
} catch (Exception ex) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return con;
|
|
||||||
}
|
|
||||||
|
|
||||||
private synchronized void reconnect(boolean reload)
|
|
||||||
throws ClassNotFoundException, SQLException, TimeoutException,
|
|
||||||
PoolInitializationException {
|
|
||||||
if (ds != null)
|
|
||||||
ds.close();
|
|
||||||
HikariConfig config = new HikariConfig();
|
|
||||||
config.setJdbcUrl("jdbc:mysql://" + this.host + ":" + this.port + "/" + this.database);
|
|
||||||
config.setUsername(this.username);
|
|
||||||
config.setPassword(this.password);
|
|
||||||
config.addDataSourceProperty("cachePrepStmts", "true");
|
|
||||||
config.addDataSourceProperty("prepStmtCacheSize", "250");
|
|
||||||
config.addDataSourceProperty("prepStmtCacheSqlLimit", "2048");
|
|
||||||
config.addDataSourceProperty("autoReconnect", true);
|
|
||||||
config.setInitializationFailFast(false);
|
|
||||||
config.setMaxLifetime(12000);
|
|
||||||
config.setPoolName("AuthMeMYSQLPool");
|
|
||||||
ds = new HikariDataSource(config);
|
|
||||||
if (!reload)
|
|
||||||
ConsoleLogger.info("ConnectionPool was unavailable... Reconnected!");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DataSourceType getType() {
|
public DataSourceType getType() {
|
||||||
return DataSourceType.MYSQL;
|
return DataSourceType.MYSQL;
|
||||||
@ -937,7 +907,7 @@ public class MySQL implements DataSource {
|
|||||||
PreparedStatement pst = null;
|
PreparedStatement pst = null;
|
||||||
ResultSet rs = null;
|
ResultSet rs = null;
|
||||||
try {
|
try {
|
||||||
con = makeSureConnectionIsReady();
|
con = getConnection();
|
||||||
pst = con.prepareStatement("SELECT * FROM " + tableName + " WHERE LOWER(" + columnName + ")=?;");
|
pst = con.prepareStatement("SELECT * FROM " + tableName + " WHERE LOWER(" + columnName + ")=?;");
|
||||||
pst.setString(1, user);
|
pst.setString(1, user);
|
||||||
rs = pst.executeQuery();
|
rs = pst.executeQuery();
|
||||||
@ -959,7 +929,7 @@ public class MySQL implements DataSource {
|
|||||||
Connection con = null;
|
Connection con = null;
|
||||||
PreparedStatement pst = null;
|
PreparedStatement pst = null;
|
||||||
try {
|
try {
|
||||||
con = makeSureConnectionIsReady();
|
con = getConnection();
|
||||||
pst = con.prepareStatement("UPDATE " + tableName + " SET " + columnLogged + "=? WHERE LOWER(" + columnName + ")=?;");
|
pst = con.prepareStatement("UPDATE " + tableName + " SET " + columnLogged + "=? WHERE LOWER(" + columnName + ")=?;");
|
||||||
pst.setInt(1, 1);
|
pst.setInt(1, 1);
|
||||||
pst.setString(2, user);
|
pst.setString(2, user);
|
||||||
@ -980,7 +950,7 @@ public class MySQL implements DataSource {
|
|||||||
PreparedStatement pst = null;
|
PreparedStatement pst = null;
|
||||||
if (user != null)
|
if (user != null)
|
||||||
try {
|
try {
|
||||||
con = makeSureConnectionIsReady();
|
con = getConnection();
|
||||||
pst = con.prepareStatement("UPDATE " + tableName + " SET " + columnLogged + "=? WHERE LOWER(" + columnName + ")=?;");
|
pst = con.prepareStatement("UPDATE " + tableName + " SET " + columnLogged + "=? WHERE LOWER(" + columnName + ")=?;");
|
||||||
pst.setInt(1, 0);
|
pst.setInt(1, 0);
|
||||||
pst.setString(2, user);
|
pst.setString(2, user);
|
||||||
@ -1000,7 +970,7 @@ public class MySQL implements DataSource {
|
|||||||
Connection con = null;
|
Connection con = null;
|
||||||
PreparedStatement pst = null;
|
PreparedStatement pst = null;
|
||||||
try {
|
try {
|
||||||
con = makeSureConnectionIsReady();
|
con = getConnection();
|
||||||
pst = con.prepareStatement("UPDATE " + tableName + " SET " + columnLogged + "=? WHERE " + columnLogged + "=?;");
|
pst = con.prepareStatement("UPDATE " + tableName + " SET " + columnLogged + "=? WHERE " + columnLogged + "=?;");
|
||||||
pst.setInt(1, 0);
|
pst.setInt(1, 0);
|
||||||
pst.setInt(2, 1);
|
pst.setInt(2, 1);
|
||||||
@ -1022,7 +992,7 @@ public class MySQL implements DataSource {
|
|||||||
PreparedStatement pst = null;
|
PreparedStatement pst = null;
|
||||||
ResultSet rs = null;
|
ResultSet rs = null;
|
||||||
try {
|
try {
|
||||||
con = makeSureConnectionIsReady();
|
con = getConnection();
|
||||||
pst = con.prepareStatement("SELECT COUNT(*) FROM " + tableName + ";");
|
pst = con.prepareStatement("SELECT COUNT(*) FROM " + tableName + ";");
|
||||||
rs = pst.executeQuery();
|
rs = pst.executeQuery();
|
||||||
if (rs != null && rs.next()) {
|
if (rs != null && rs.next()) {
|
||||||
@ -1043,7 +1013,7 @@ public class MySQL implements DataSource {
|
|||||||
Connection con = null;
|
Connection con = null;
|
||||||
PreparedStatement pst = null;
|
PreparedStatement pst = null;
|
||||||
try {
|
try {
|
||||||
con = makeSureConnectionIsReady();
|
con = getConnection();
|
||||||
pst = con.prepareStatement("UPDATE " + tableName + " SET " + columnName + "=? WHERE LOWER(" + columnName + ")=?;");
|
pst = con.prepareStatement("UPDATE " + tableName + " SET " + columnName + "=? WHERE LOWER(" + columnName + ")=?;");
|
||||||
pst.setString(1, newone);
|
pst.setString(1, newone);
|
||||||
pst.setString(2, oldone);
|
pst.setString(2, oldone);
|
||||||
@ -1065,7 +1035,7 @@ public class MySQL implements DataSource {
|
|||||||
PreparedStatement pst = null;
|
PreparedStatement pst = null;
|
||||||
ResultSet rs = null;
|
ResultSet rs = null;
|
||||||
try {
|
try {
|
||||||
con = makeSureConnectionIsReady();
|
con = getConnection();
|
||||||
pst = con.prepareStatement("SELECT * FROM " + tableName + ";");
|
pst = con.prepareStatement("SELECT * FROM " + tableName + ";");
|
||||||
rs = pst.executeQuery();
|
rs = pst.executeQuery();
|
||||||
while (rs.next()) {
|
while (rs.next()) {
|
||||||
@ -1116,7 +1086,7 @@ public class MySQL implements DataSource {
|
|||||||
PreparedStatement pst = null;
|
PreparedStatement pst = null;
|
||||||
ResultSet rs = null;
|
ResultSet rs = null;
|
||||||
try {
|
try {
|
||||||
con = makeSureConnectionIsReady();
|
con = getConnection();
|
||||||
pst = con.prepareStatement("SELECT * FROM " + tableName + " WHERE " + columnLogged + "=1;");
|
pst = con.prepareStatement("SELECT * FROM " + tableName + " WHERE " + columnLogged + "=1;");
|
||||||
rs = pst.executeQuery();
|
rs = pst.executeQuery();
|
||||||
while (rs.next()) {
|
while (rs.next()) {
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
package fr.xephi.authme.datasource;
|
package fr.xephi.authme.datasource;
|
||||||
|
|
||||||
import java.io.EOFException;
|
|
||||||
import java.sql.Connection;
|
import java.sql.Connection;
|
||||||
import java.sql.PreparedStatement;
|
import java.sql.PreparedStatement;
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
@ -8,10 +7,10 @@ import java.sql.SQLException;
|
|||||||
import java.sql.Statement;
|
import java.sql.Statement;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Properties;
|
|
||||||
|
|
||||||
import com.zaxxer.hikari.HikariConfig;
|
import com.zaxxer.hikari.HikariConfig;
|
||||||
import com.zaxxer.hikari.HikariDataSource;
|
import com.zaxxer.hikari.HikariDataSource;
|
||||||
|
import com.zaxxer.hikari.pool.PoolInitializationException;
|
||||||
|
|
||||||
import fr.xephi.authme.AuthMe;
|
import fr.xephi.authme.AuthMe;
|
||||||
import fr.xephi.authme.ConsoleLogger;
|
import fr.xephi.authme.ConsoleLogger;
|
||||||
@ -38,7 +37,7 @@ public class SQLite_HIKARI implements DataSource {
|
|||||||
private String columnLogged;
|
private String columnLogged;
|
||||||
private String columnRealName;
|
private String columnRealName;
|
||||||
|
|
||||||
public SQLite_HIKARI() {
|
public SQLite_HIKARI() throws ClassNotFoundException, SQLException, PoolInitializationException {
|
||||||
this.database = Settings.getMySQLDatabase;
|
this.database = Settings.getMySQLDatabase;
|
||||||
this.tableName = Settings.getMySQLTablename;
|
this.tableName = Settings.getMySQLTablename;
|
||||||
this.columnName = Settings.getMySQLColumnName;
|
this.columnName = Settings.getMySQLColumnName;
|
||||||
@ -56,65 +55,127 @@ public class SQLite_HIKARI implements DataSource {
|
|||||||
this.columnLogged = Settings.getMySQLColumnLogged;
|
this.columnLogged = Settings.getMySQLColumnLogged;
|
||||||
this.columnRealName = Settings.getMySQLColumnRealName;
|
this.columnRealName = Settings.getMySQLColumnRealName;
|
||||||
|
|
||||||
|
// Set the connection arguments (and check if connection is ok)
|
||||||
try {
|
try {
|
||||||
this.connect();
|
this.setConnectionArguments();
|
||||||
this.setup();
|
} catch (ClassNotFoundException ne) {
|
||||||
} catch (ClassNotFoundException e) {
|
ConsoleLogger.showError(ne.getMessage());
|
||||||
ConsoleLogger.showError(e.getMessage());
|
ConsoleLogger.showError("Can't use the Hikari Connection Pool! Please, report this error to the developer! SHUTDOWN...");
|
||||||
|
this.close();
|
||||||
if (Settings.isStopEnabled) {
|
if (Settings.isStopEnabled) {
|
||||||
ConsoleLogger.showError("Can't use SQLITE... ! SHUTDOWN...");
|
|
||||||
AuthMe.getInstance().getServer().shutdown();
|
AuthMe.getInstance().getServer().shutdown();
|
||||||
}
|
|
||||||
if (!Settings.isStopEnabled)
|
|
||||||
AuthMe.getInstance().getServer().getPluginManager().disablePlugin(AuthMe.getInstance());
|
AuthMe.getInstance().getServer().getPluginManager().disablePlugin(AuthMe.getInstance());
|
||||||
return;
|
} else {
|
||||||
|
AuthMe.getInstance().getServer().getPluginManager().disablePlugin(AuthMe.getInstance());
|
||||||
|
}
|
||||||
|
throw new ClassNotFoundException(ne.getMessage());
|
||||||
|
} catch (IllegalArgumentException ae) { // This means that there are problems with the hikaricp pool arguments!
|
||||||
|
ConsoleLogger.showError(ae.getMessage());
|
||||||
|
ConsoleLogger.showError("Invalid database arguments! Please check your configuration!");
|
||||||
|
ConsoleLogger.showError("If this error persists, please report it to the developer! SHUTDOWN...");
|
||||||
|
this.close();
|
||||||
|
if (Settings.isStopEnabled) {
|
||||||
|
AuthMe.getInstance().getServer().shutdown();
|
||||||
|
AuthMe.getInstance().getServer().getPluginManager().disablePlugin(AuthMe.getInstance());
|
||||||
|
} else {
|
||||||
|
AuthMe.getInstance().getServer().getPluginManager().disablePlugin(AuthMe.getInstance());
|
||||||
|
}
|
||||||
|
throw new IllegalArgumentException(ae);
|
||||||
|
} catch (PoolInitializationException ie) { // Can't initialize the connection pool!
|
||||||
|
ConsoleLogger.showError(ie.getMessage());
|
||||||
|
ConsoleLogger.showError("Can't connect to the SQLite database! Please check your configuration!");
|
||||||
|
ConsoleLogger.showError("If this error persists, please report it to the developer! SHUTDOWN...");
|
||||||
|
this.close();
|
||||||
|
if (Settings.isStopEnabled) {
|
||||||
|
AuthMe.getInstance().getServer().shutdown();
|
||||||
|
AuthMe.getInstance().getServer().getPluginManager().disablePlugin(AuthMe.getInstance());
|
||||||
|
} else {
|
||||||
|
AuthMe.getInstance().getServer().getPluginManager().disablePlugin(AuthMe.getInstance());
|
||||||
|
}
|
||||||
|
throw new PoolInitializationException(ie);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Initialize the database
|
||||||
|
try {
|
||||||
|
this.setupConnection();
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
ConsoleLogger.showError(e.getMessage());
|
ConsoleLogger.showError(e.getMessage());
|
||||||
|
ConsoleLogger.showError("Can't initialize the MySQL database... Please check your database settings in the config.yml file! SHUTDOWN...");
|
||||||
|
ConsoleLogger.showError("If this error persists, please report it to the developer! SHUTDOWN...");
|
||||||
|
this.close();
|
||||||
if (Settings.isStopEnabled) {
|
if (Settings.isStopEnabled) {
|
||||||
ConsoleLogger.showError("Can't use SQLITE... ! SHUTDOWN...");
|
|
||||||
AuthMe.getInstance().getServer().shutdown();
|
AuthMe.getInstance().getServer().shutdown();
|
||||||
}
|
|
||||||
if (!Settings.isStopEnabled)
|
|
||||||
AuthMe.getInstance().getServer().getPluginManager().disablePlugin(AuthMe.getInstance());
|
AuthMe.getInstance().getServer().getPluginManager().disablePlugin(AuthMe.getInstance());
|
||||||
return;
|
} else {
|
||||||
} catch (EOFException e) {
|
|
||||||
ConsoleLogger.showError(e.getMessage());
|
|
||||||
if (Settings.isStopEnabled) {
|
|
||||||
ConsoleLogger.showError("Can't use SQLITE... ! SHUTDOWN...");
|
|
||||||
AuthMe.getInstance().getServer().shutdown();
|
|
||||||
}
|
|
||||||
if (!Settings.isStopEnabled)
|
|
||||||
AuthMe.getInstance().getServer().getPluginManager().disablePlugin(AuthMe.getInstance());
|
AuthMe.getInstance().getServer().getPluginManager().disablePlugin(AuthMe.getInstance());
|
||||||
return;
|
}
|
||||||
|
throw new SQLException(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private Connection getConnection() throws SQLException, EOFException {
|
@Override
|
||||||
return this.ds.getConnection();
|
public DataSourceType getType() {
|
||||||
|
return DataSourceType.SQLITE;
|
||||||
}
|
}
|
||||||
|
|
||||||
private synchronized void connect()
|
private synchronized void setConnectionArguments()
|
||||||
throws ClassNotFoundException, SQLException, EOFException {
|
throws ClassNotFoundException, IllegalArgumentException {
|
||||||
/*
|
HikariConfig config = new HikariConfig();
|
||||||
* Class.forName("org.sqlite.JDBC"); ConsoleLogger.info(
|
config.setPoolName("AuthMeSQLitePool");
|
||||||
* "SQLite driver loaded"); this.con =
|
config.setDataSourceClassName("org.sqlite.SQLiteDataSource");
|
||||||
* DriverManager.getConnection("jdbc:sqlite:plugins/AuthMe/" + database
|
config.setJdbcUrl("jdbc:sqlite:plugins/AuthMe/" + database + ".db");
|
||||||
* + ".db");
|
config.setInitializationFailFast(true); // Don't start the plugin if the database is unavariable
|
||||||
*/
|
config.setConnectionTestQuery("SELECT 1");
|
||||||
Properties props = new Properties();
|
config.setMaxLifetime(180000); // 3 Min
|
||||||
props.setProperty("dataSourceClassName", "org.sqlite.SQLiteDataSource");
|
config.setIdleTimeout(60000); // 1 Min
|
||||||
HikariConfig config = new HikariConfig(props);
|
config.setMaximumPoolSize(50); // 50 (including idle connections)
|
||||||
config.setPoolName("AuthMeSQLiteLPool");
|
|
||||||
ds = new HikariDataSource(config);
|
ds = new HikariDataSource(config);
|
||||||
ConsoleLogger.info("Connection pool ready");
|
ConsoleLogger.info("Connection arguments loaded, Hikari ConnectionPool ready!");
|
||||||
}
|
}
|
||||||
|
|
||||||
private synchronized void setup() throws SQLException, EOFException {
|
private synchronized Connection getRawConnection() {
|
||||||
|
Connection con = null;
|
||||||
|
while(con == null){
|
||||||
|
try {
|
||||||
|
con = ds.getConnection();
|
||||||
|
} catch (SQLException ce) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return con;
|
||||||
|
}
|
||||||
|
|
||||||
|
private synchronized Connection getConnection() {
|
||||||
|
Connection con;
|
||||||
|
con = getRawConnection();
|
||||||
|
if(con == null){
|
||||||
|
ds.close();
|
||||||
|
ConsoleLogger.showError("Database connection is LOST! SHUTDOWN...");
|
||||||
|
if (Settings.isStopEnabled) {
|
||||||
|
AuthMe.getInstance().getServer().shutdown();
|
||||||
|
} else {
|
||||||
|
AuthMe.getInstance().getServer().getPluginManager().disablePlugin(AuthMe.getInstance());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return con;
|
||||||
|
}
|
||||||
|
|
||||||
|
private synchronized void setupConnection() throws SQLException {
|
||||||
Connection con = null;
|
Connection con = null;
|
||||||
Statement st = null;
|
Statement st = null;
|
||||||
ResultSet rs = null;
|
ResultSet rs = null;
|
||||||
try {
|
try {
|
||||||
con = getConnection();
|
con = getRawConnection();
|
||||||
|
if(con == null){
|
||||||
|
ds.close();
|
||||||
|
if (Settings.isStopEnabled) {
|
||||||
|
ConsoleLogger.showError("Can't connect to the SQLite database... Please check your database settings in the config.yml file! SHUTDOWN...");
|
||||||
|
AuthMe.getInstance().getServer().shutdown();
|
||||||
|
} else {
|
||||||
|
AuthMe.getInstance().getServer().getPluginManager().disablePlugin(AuthMe.getInstance());
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
st = con.createStatement();
|
st = con.createStatement();
|
||||||
st.executeUpdate("CREATE TABLE IF NOT EXISTS " + tableName + " (" + columnID + " INTEGER AUTO_INCREMENT," + columnName + " VARCHAR(255) NOT NULL UNIQUE," + columnPassword + " VARCHAR(255) NOT NULL," + columnIp + " VARCHAR(40) NOT NULL," + columnLastLogin + " BIGINT," + lastlocX + " DOUBLE NOT NULL DEFAULT '0.0'," + lastlocY + " DOUBLE NOT NULL DEFAULT '0.0'," + lastlocZ + " DOUBLE NOT NULL DEFAULT '0.0'," + lastlocWorld + " VARCHAR(255) NOT NULL DEFAULT '" + Settings.defaultWorld + "'," + columnEmail + " VARCHAR(255) DEFAULT 'your@email.com'," + "CONSTRAINT table_const_prim PRIMARY KEY (" + columnID + "));");
|
st.executeUpdate("CREATE TABLE IF NOT EXISTS " + tableName + " (" + columnID + " INTEGER AUTO_INCREMENT," + columnName + " VARCHAR(255) NOT NULL UNIQUE," + columnPassword + " VARCHAR(255) NOT NULL," + columnIp + " VARCHAR(40) NOT NULL," + columnLastLogin + " BIGINT," + lastlocX + " DOUBLE NOT NULL DEFAULT '0.0'," + lastlocY + " DOUBLE NOT NULL DEFAULT '0.0'," + lastlocZ + " DOUBLE NOT NULL DEFAULT '0.0'," + lastlocWorld + " VARCHAR(255) NOT NULL DEFAULT '" + Settings.defaultWorld + "'," + columnEmail + " VARCHAR(255) DEFAULT 'your@email.com'," + "CONSTRAINT table_const_prim PRIMARY KEY (" + columnID + "));");
|
||||||
rs = con.getMetaData().getColumns(null, null, tableName, columnPassword);
|
rs = con.getMetaData().getColumns(null, null, tableName, columnPassword);
|
||||||
@ -166,14 +227,6 @@ public class SQLite_HIKARI implements DataSource {
|
|||||||
ConsoleLogger.info("SQLite Setup finished");
|
ConsoleLogger.info("SQLite Setup finished");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void close(Connection con) {
|
|
||||||
try {
|
|
||||||
if (con != null)
|
|
||||||
con.close();
|
|
||||||
} catch (Exception e) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public synchronized boolean isAuthAvailable(String user) {
|
public synchronized boolean isAuthAvailable(String user) {
|
||||||
Connection con = null;
|
Connection con = null;
|
||||||
@ -185,7 +238,7 @@ public class SQLite_HIKARI implements DataSource {
|
|||||||
pst.setString(1, user);
|
pst.setString(1, user);
|
||||||
rs = pst.executeQuery();
|
rs = pst.executeQuery();
|
||||||
return rs.next();
|
return rs.next();
|
||||||
} catch (Exception ex) {
|
} catch (SQLException ex) {
|
||||||
ConsoleLogger.showError(ex.getMessage());
|
ConsoleLogger.showError(ex.getMessage());
|
||||||
return false;
|
return false;
|
||||||
} finally {
|
} finally {
|
||||||
@ -218,7 +271,7 @@ public class SQLite_HIKARI implements DataSource {
|
|||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
} catch (Exception ex) {
|
} catch (SQLException ex) {
|
||||||
ConsoleLogger.showError(ex.getMessage());
|
ConsoleLogger.showError(ex.getMessage());
|
||||||
return null;
|
return null;
|
||||||
} finally {
|
} finally {
|
||||||
@ -230,8 +283,8 @@ public class SQLite_HIKARI implements DataSource {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public synchronized boolean saveAuth(PlayerAuth auth) {
|
public synchronized boolean saveAuth(PlayerAuth auth) {
|
||||||
PreparedStatement pst = null;
|
|
||||||
Connection con = null;
|
Connection con = null;
|
||||||
|
PreparedStatement pst = null;
|
||||||
try {
|
try {
|
||||||
con = getConnection();
|
con = getConnection();
|
||||||
if (columnSalt.isEmpty() && auth.getSalt().isEmpty()) {
|
if (columnSalt.isEmpty() && auth.getSalt().isEmpty()) {
|
||||||
@ -252,7 +305,7 @@ public class SQLite_HIKARI implements DataSource {
|
|||||||
pst.setString(6, auth.getRealName());
|
pst.setString(6, auth.getRealName());
|
||||||
pst.executeUpdate();
|
pst.executeUpdate();
|
||||||
}
|
}
|
||||||
} catch (Exception ex) {
|
} catch (SQLException ex) {
|
||||||
ConsoleLogger.showError(ex.getMessage());
|
ConsoleLogger.showError(ex.getMessage());
|
||||||
return false;
|
return false;
|
||||||
} finally {
|
} finally {
|
||||||
@ -272,7 +325,7 @@ public class SQLite_HIKARI implements DataSource {
|
|||||||
pst.setString(1, auth.getHash());
|
pst.setString(1, auth.getHash());
|
||||||
pst.setString(2, auth.getNickname());
|
pst.setString(2, auth.getNickname());
|
||||||
pst.executeUpdate();
|
pst.executeUpdate();
|
||||||
} catch (Exception ex) {
|
} catch (SQLException ex) {
|
||||||
ConsoleLogger.showError(ex.getMessage());
|
ConsoleLogger.showError(ex.getMessage());
|
||||||
return false;
|
return false;
|
||||||
} finally {
|
} finally {
|
||||||
@ -294,7 +347,7 @@ public class SQLite_HIKARI implements DataSource {
|
|||||||
pst.setString(3, auth.getRealName());
|
pst.setString(3, auth.getRealName());
|
||||||
pst.setString(4, auth.getNickname());
|
pst.setString(4, auth.getNickname());
|
||||||
pst.executeUpdate();
|
pst.executeUpdate();
|
||||||
} catch (Exception ex) {
|
} catch (SQLException ex) {
|
||||||
ConsoleLogger.showError(ex.getMessage());
|
ConsoleLogger.showError(ex.getMessage());
|
||||||
return false;
|
return false;
|
||||||
} finally {
|
} finally {
|
||||||
@ -313,7 +366,7 @@ public class SQLite_HIKARI implements DataSource {
|
|||||||
pst = con.prepareStatement("DELETE FROM " + tableName + " WHERE " + columnLastLogin + "<?;");
|
pst = con.prepareStatement("DELETE FROM " + tableName + " WHERE " + columnLastLogin + "<?;");
|
||||||
pst.setLong(1, until);
|
pst.setLong(1, until);
|
||||||
return pst.executeUpdate();
|
return pst.executeUpdate();
|
||||||
} catch (Exception ex) {
|
} catch (SQLException ex) {
|
||||||
ConsoleLogger.showError(ex.getMessage());
|
ConsoleLogger.showError(ex.getMessage());
|
||||||
return 0;
|
return 0;
|
||||||
} finally {
|
} finally {
|
||||||
@ -337,7 +390,7 @@ public class SQLite_HIKARI implements DataSource {
|
|||||||
list.add(rs.getString(columnName));
|
list.add(rs.getString(columnName));
|
||||||
}
|
}
|
||||||
return list;
|
return list;
|
||||||
} catch (Exception ex) {
|
} catch (SQLException ex) {
|
||||||
ConsoleLogger.showError(ex.getMessage());
|
ConsoleLogger.showError(ex.getMessage());
|
||||||
return new ArrayList<String>();
|
return new ArrayList<String>();
|
||||||
} finally {
|
} finally {
|
||||||
@ -349,14 +402,14 @@ public class SQLite_HIKARI implements DataSource {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public synchronized boolean removeAuth(String user) {
|
public synchronized boolean removeAuth(String user) {
|
||||||
PreparedStatement pst = null;
|
|
||||||
Connection con = null;
|
Connection con = null;
|
||||||
|
PreparedStatement pst = null;
|
||||||
try {
|
try {
|
||||||
con = getConnection();
|
con = getConnection();
|
||||||
pst = con.prepareStatement("DELETE FROM " + tableName + " WHERE " + columnName + "=?;");
|
pst = con.prepareStatement("DELETE FROM " + tableName + " WHERE " + columnName + "=?;");
|
||||||
pst.setString(1, user);
|
pst.setString(1, user);
|
||||||
pst.executeUpdate();
|
pst.executeUpdate();
|
||||||
} catch (Exception ex) {
|
} catch (SQLException ex) {
|
||||||
ConsoleLogger.showError(ex.getMessage());
|
ConsoleLogger.showError(ex.getMessage());
|
||||||
return false;
|
return false;
|
||||||
} finally {
|
} finally {
|
||||||
@ -368,8 +421,8 @@ public class SQLite_HIKARI implements DataSource {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean updateQuitLoc(PlayerAuth auth) {
|
public boolean updateQuitLoc(PlayerAuth auth) {
|
||||||
PreparedStatement pst = null;
|
|
||||||
Connection con = null;
|
Connection con = null;
|
||||||
|
PreparedStatement pst = null;
|
||||||
try {
|
try {
|
||||||
con = getConnection();
|
con = getConnection();
|
||||||
pst = con.prepareStatement("UPDATE " + tableName + " SET " + lastlocX + "=?, " + lastlocY + "=?, " + lastlocZ + "=?, " + lastlocWorld + "=? WHERE " + columnName + "=?;");
|
pst = con.prepareStatement("UPDATE " + tableName + " SET " + lastlocX + "=?, " + lastlocY + "=?, " + lastlocZ + "=?, " + lastlocWorld + "=? WHERE " + columnName + "=?;");
|
||||||
@ -379,7 +432,7 @@ public class SQLite_HIKARI implements DataSource {
|
|||||||
pst.setString(4, auth.getWorld());
|
pst.setString(4, auth.getWorld());
|
||||||
pst.setString(5, auth.getNickname());
|
pst.setString(5, auth.getNickname());
|
||||||
pst.executeUpdate();
|
pst.executeUpdate();
|
||||||
} catch (Exception ex) {
|
} catch (SQLException ex) {
|
||||||
ConsoleLogger.showError(ex.getMessage());
|
ConsoleLogger.showError(ex.getMessage());
|
||||||
return false;
|
return false;
|
||||||
} finally {
|
} finally {
|
||||||
@ -391,9 +444,9 @@ public class SQLite_HIKARI implements DataSource {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getIps(String ip) {
|
public int getIps(String ip) {
|
||||||
|
Connection con = null;
|
||||||
PreparedStatement pst = null;
|
PreparedStatement pst = null;
|
||||||
ResultSet rs = null;
|
ResultSet rs = null;
|
||||||
Connection con = null;
|
|
||||||
int countIp = 0;
|
int countIp = 0;
|
||||||
try {
|
try {
|
||||||
con = getConnection();
|
con = getConnection();
|
||||||
@ -404,7 +457,7 @@ public class SQLite_HIKARI implements DataSource {
|
|||||||
countIp++;
|
countIp++;
|
||||||
}
|
}
|
||||||
return countIp;
|
return countIp;
|
||||||
} catch (Exception ex) {
|
} catch (SQLException ex) {
|
||||||
ConsoleLogger.showError(ex.getMessage());
|
ConsoleLogger.showError(ex.getMessage());
|
||||||
return 0;
|
return 0;
|
||||||
} finally {
|
} finally {
|
||||||
@ -416,15 +469,15 @@ public class SQLite_HIKARI implements DataSource {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean updateEmail(PlayerAuth auth) {
|
public boolean updateEmail(PlayerAuth auth) {
|
||||||
PreparedStatement pst = null;
|
|
||||||
Connection con = null;
|
Connection con = null;
|
||||||
|
PreparedStatement pst = null;
|
||||||
try {
|
try {
|
||||||
con = getConnection();
|
con = getConnection();
|
||||||
pst = con.prepareStatement("UPDATE " + tableName + " SET " + columnEmail + "=? WHERE " + columnName + "=?;");
|
pst = con.prepareStatement("UPDATE " + tableName + " SET " + columnEmail + "=? WHERE " + columnName + "=?;");
|
||||||
pst.setString(1, auth.getEmail());
|
pst.setString(1, auth.getEmail());
|
||||||
pst.setString(2, auth.getNickname());
|
pst.setString(2, auth.getNickname());
|
||||||
pst.executeUpdate();
|
pst.executeUpdate();
|
||||||
} catch (Exception ex) {
|
} catch (SQLException ex) {
|
||||||
ConsoleLogger.showError(ex.getMessage());
|
ConsoleLogger.showError(ex.getMessage());
|
||||||
return false;
|
return false;
|
||||||
} finally {
|
} finally {
|
||||||
@ -447,7 +500,7 @@ public class SQLite_HIKARI implements DataSource {
|
|||||||
pst.setString(1, auth.getSalt());
|
pst.setString(1, auth.getSalt());
|
||||||
pst.setString(2, auth.getNickname());
|
pst.setString(2, auth.getNickname());
|
||||||
pst.executeUpdate();
|
pst.executeUpdate();
|
||||||
} catch (Exception ex) {
|
} catch (SQLException ex) {
|
||||||
ConsoleLogger.showError(ex.getMessage());
|
ConsoleLogger.showError(ex.getMessage());
|
||||||
return false;
|
return false;
|
||||||
} finally {
|
} finally {
|
||||||
@ -457,56 +510,11 @@ public class SQLite_HIKARI implements DataSource {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public synchronized void close() {
|
|
||||||
try {
|
|
||||||
if (ds != null)
|
|
||||||
ds.close();
|
|
||||||
} catch (Exception e) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void reload() {
|
|
||||||
try {
|
|
||||||
connect();
|
|
||||||
setup();
|
|
||||||
} catch (Exception e) {
|
|
||||||
ConsoleLogger.showError(e.getMessage());
|
|
||||||
if (Settings.isStopEnabled) {
|
|
||||||
ConsoleLogger.showError("Can't reconnect to SQLite database... SHUTDOWN...");
|
|
||||||
AuthMe.getInstance().getServer().shutdown();
|
|
||||||
}
|
|
||||||
if (!Settings.isStopEnabled)
|
|
||||||
AuthMe.getInstance().getServer().getPluginManager().disablePlugin(AuthMe.getInstance());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void close(Statement st) {
|
|
||||||
if (st != null) {
|
|
||||||
try {
|
|
||||||
st.close();
|
|
||||||
} catch (SQLException ex) {
|
|
||||||
ConsoleLogger.showError(ex.getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void close(ResultSet rs) {
|
|
||||||
if (rs != null) {
|
|
||||||
try {
|
|
||||||
rs.close();
|
|
||||||
} catch (SQLException ex) {
|
|
||||||
ConsoleLogger.showError(ex.getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getAllAuthsByName(PlayerAuth auth) {
|
public List<String> getAllAuthsByName(PlayerAuth auth) {
|
||||||
|
Connection con = null;
|
||||||
PreparedStatement pst = null;
|
PreparedStatement pst = null;
|
||||||
ResultSet rs = null;
|
ResultSet rs = null;
|
||||||
Connection con = null;
|
|
||||||
List<String> countIp = new ArrayList<String>();
|
List<String> countIp = new ArrayList<String>();
|
||||||
try {
|
try {
|
||||||
con = getConnection();
|
con = getConnection();
|
||||||
@ -517,11 +525,11 @@ public class SQLite_HIKARI implements DataSource {
|
|||||||
countIp.add(rs.getString(columnName));
|
countIp.add(rs.getString(columnName));
|
||||||
}
|
}
|
||||||
return countIp;
|
return countIp;
|
||||||
} catch (NullPointerException ex) {
|
} catch (SQLException ex) {
|
||||||
return new ArrayList<String>();
|
|
||||||
} catch (Exception ex) {
|
|
||||||
ConsoleLogger.showError(ex.getMessage());
|
ConsoleLogger.showError(ex.getMessage());
|
||||||
return new ArrayList<String>();
|
return new ArrayList<String>();
|
||||||
|
} catch (NullPointerException npe) {
|
||||||
|
return new ArrayList<String>();
|
||||||
} finally {
|
} finally {
|
||||||
close(rs);
|
close(rs);
|
||||||
close(pst);
|
close(pst);
|
||||||
@ -531,9 +539,9 @@ public class SQLite_HIKARI implements DataSource {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getAllAuthsByIp(String ip) {
|
public List<String> getAllAuthsByIp(String ip) {
|
||||||
|
Connection con = null;
|
||||||
PreparedStatement pst = null;
|
PreparedStatement pst = null;
|
||||||
ResultSet rs = null;
|
ResultSet rs = null;
|
||||||
Connection con = null;
|
|
||||||
List<String> countIp = new ArrayList<String>();
|
List<String> countIp = new ArrayList<String>();
|
||||||
try {
|
try {
|
||||||
con = getConnection();
|
con = getConnection();
|
||||||
@ -544,11 +552,11 @@ public class SQLite_HIKARI implements DataSource {
|
|||||||
countIp.add(rs.getString(columnName));
|
countIp.add(rs.getString(columnName));
|
||||||
}
|
}
|
||||||
return countIp;
|
return countIp;
|
||||||
} catch (NullPointerException ex) {
|
} catch (SQLException ex) {
|
||||||
return new ArrayList<String>();
|
|
||||||
} catch (Exception ex) {
|
|
||||||
ConsoleLogger.showError(ex.getMessage());
|
ConsoleLogger.showError(ex.getMessage());
|
||||||
return new ArrayList<String>();
|
return new ArrayList<String>();
|
||||||
|
} catch (NullPointerException npe) {
|
||||||
|
return new ArrayList<String>();
|
||||||
} finally {
|
} finally {
|
||||||
close(rs);
|
close(rs);
|
||||||
close(pst);
|
close(pst);
|
||||||
@ -558,9 +566,9 @@ public class SQLite_HIKARI implements DataSource {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getAllAuthsByEmail(String email) {
|
public List<String> getAllAuthsByEmail(String email) {
|
||||||
|
Connection con = null;
|
||||||
PreparedStatement pst = null;
|
PreparedStatement pst = null;
|
||||||
ResultSet rs = null;
|
ResultSet rs = null;
|
||||||
Connection con = null;
|
|
||||||
List<String> countEmail = new ArrayList<String>();
|
List<String> countEmail = new ArrayList<String>();
|
||||||
try {
|
try {
|
||||||
con = getConnection();
|
con = getConnection();
|
||||||
@ -571,11 +579,11 @@ public class SQLite_HIKARI implements DataSource {
|
|||||||
countEmail.add(rs.getString(columnName));
|
countEmail.add(rs.getString(columnName));
|
||||||
}
|
}
|
||||||
return countEmail;
|
return countEmail;
|
||||||
} catch (NullPointerException ex) {
|
} catch (SQLException ex) {
|
||||||
return new ArrayList<String>();
|
|
||||||
} catch (Exception ex) {
|
|
||||||
ConsoleLogger.showError(ex.getMessage());
|
ConsoleLogger.showError(ex.getMessage());
|
||||||
return new ArrayList<String>();
|
return new ArrayList<String>();
|
||||||
|
} catch (NullPointerException npe) {
|
||||||
|
return new ArrayList<String>();
|
||||||
} finally {
|
} finally {
|
||||||
close(rs);
|
close(rs);
|
||||||
close(pst);
|
close(pst);
|
||||||
@ -585,8 +593,8 @@ public class SQLite_HIKARI implements DataSource {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void purgeBanned(List<String> banned) {
|
public void purgeBanned(List<String> banned) {
|
||||||
PreparedStatement pst = null;
|
|
||||||
Connection con = null;
|
Connection con = null;
|
||||||
|
PreparedStatement pst = null;
|
||||||
try {
|
try {
|
||||||
con = getConnection();
|
con = getConnection();
|
||||||
for (String name : banned) {
|
for (String name : banned) {
|
||||||
@ -594,7 +602,7 @@ public class SQLite_HIKARI implements DataSource {
|
|||||||
pst.setString(1, name);
|
pst.setString(1, name);
|
||||||
pst.executeUpdate();
|
pst.executeUpdate();
|
||||||
}
|
}
|
||||||
} catch (Exception ex) {
|
} catch (SQLException ex) {
|
||||||
ConsoleLogger.showError(ex.getMessage());
|
ConsoleLogger.showError(ex.getMessage());
|
||||||
} finally {
|
} finally {
|
||||||
close(pst);
|
close(pst);
|
||||||
@ -602,16 +610,11 @@ public class SQLite_HIKARI implements DataSource {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public DataSourceType getType() {
|
|
||||||
return DataSourceType.SQLITE;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLogged(String user) {
|
public boolean isLogged(String user) {
|
||||||
|
Connection con = null;
|
||||||
PreparedStatement pst = null;
|
PreparedStatement pst = null;
|
||||||
ResultSet rs = null;
|
ResultSet rs = null;
|
||||||
Connection con = null;
|
|
||||||
try {
|
try {
|
||||||
con = getConnection();
|
con = getConnection();
|
||||||
pst = con.prepareStatement("SELECT * FROM " + tableName + " WHERE LOWER(" + columnName + ")=?;");
|
pst = con.prepareStatement("SELECT * FROM " + tableName + " WHERE LOWER(" + columnName + ")=?;");
|
||||||
@ -619,7 +622,7 @@ public class SQLite_HIKARI implements DataSource {
|
|||||||
rs = pst.executeQuery();
|
rs = pst.executeQuery();
|
||||||
if (rs.next())
|
if (rs.next())
|
||||||
return (rs.getInt(columnLogged) == 1);
|
return (rs.getInt(columnLogged) == 1);
|
||||||
} catch (Exception ex) {
|
} catch (SQLException ex) {
|
||||||
ConsoleLogger.showError(ex.getMessage());
|
ConsoleLogger.showError(ex.getMessage());
|
||||||
return false;
|
return false;
|
||||||
} finally {
|
} finally {
|
||||||
@ -632,15 +635,15 @@ public class SQLite_HIKARI implements DataSource {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setLogged(String user) {
|
public void setLogged(String user) {
|
||||||
PreparedStatement pst = null;
|
|
||||||
Connection con = null;
|
Connection con = null;
|
||||||
|
PreparedStatement pst = null;
|
||||||
try {
|
try {
|
||||||
con = getConnection();
|
con = getConnection();
|
||||||
pst = con.prepareStatement("UPDATE " + tableName + " SET " + columnLogged + "=? WHERE LOWER(" + columnName + ")=?;");
|
pst = con.prepareStatement("UPDATE " + tableName + " SET " + columnLogged + "=? WHERE LOWER(" + columnName + ")=?;");
|
||||||
pst.setInt(1, 1);
|
pst.setInt(1, 1);
|
||||||
pst.setString(2, user);
|
pst.setString(2, user);
|
||||||
pst.executeUpdate();
|
pst.executeUpdate();
|
||||||
} catch (Exception ex) {
|
} catch (SQLException ex) {
|
||||||
ConsoleLogger.showError(ex.getMessage());
|
ConsoleLogger.showError(ex.getMessage());
|
||||||
return;
|
return;
|
||||||
} finally {
|
} finally {
|
||||||
@ -652,8 +655,8 @@ public class SQLite_HIKARI implements DataSource {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setUnlogged(String user) {
|
public void setUnlogged(String user) {
|
||||||
PreparedStatement pst = null;
|
|
||||||
Connection con = null;
|
Connection con = null;
|
||||||
|
PreparedStatement pst = null;
|
||||||
if (user != null)
|
if (user != null)
|
||||||
try {
|
try {
|
||||||
con = getConnection();
|
con = getConnection();
|
||||||
@ -661,7 +664,7 @@ public class SQLite_HIKARI implements DataSource {
|
|||||||
pst.setInt(1, 0);
|
pst.setInt(1, 0);
|
||||||
pst.setString(2, user);
|
pst.setString(2, user);
|
||||||
pst.executeUpdate();
|
pst.executeUpdate();
|
||||||
} catch (Exception ex) {
|
} catch (SQLException ex) {
|
||||||
ConsoleLogger.showError(ex.getMessage());
|
ConsoleLogger.showError(ex.getMessage());
|
||||||
return;
|
return;
|
||||||
} finally {
|
} finally {
|
||||||
@ -673,15 +676,15 @@ public class SQLite_HIKARI implements DataSource {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void purgeLogged() {
|
public void purgeLogged() {
|
||||||
PreparedStatement pst = null;
|
|
||||||
Connection con = null;
|
Connection con = null;
|
||||||
|
PreparedStatement pst = null;
|
||||||
try {
|
try {
|
||||||
con = getConnection();
|
con = getConnection();
|
||||||
pst = con.prepareStatement("UPDATE " + tableName + " SET " + columnLogged + "=? WHERE " + columnLogged + "=?;");
|
pst = con.prepareStatement("UPDATE " + tableName + " SET " + columnLogged + "=? WHERE " + columnLogged + "=?;");
|
||||||
pst.setInt(1, 0);
|
pst.setInt(1, 0);
|
||||||
pst.setInt(2, 1);
|
pst.setInt(2, 1);
|
||||||
pst.executeUpdate();
|
pst.executeUpdate();
|
||||||
} catch (Exception ex) {
|
} catch (SQLException ex) {
|
||||||
ConsoleLogger.showError(ex.getMessage());
|
ConsoleLogger.showError(ex.getMessage());
|
||||||
return;
|
return;
|
||||||
} finally {
|
} finally {
|
||||||
@ -693,10 +696,10 @@ public class SQLite_HIKARI implements DataSource {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getAccountsRegistered() {
|
public int getAccountsRegistered() {
|
||||||
int result = 0;
|
Connection con = null;
|
||||||
PreparedStatement pst = null;
|
PreparedStatement pst = null;
|
||||||
ResultSet rs = null;
|
ResultSet rs = null;
|
||||||
Connection con = null;
|
int result = 0;
|
||||||
try {
|
try {
|
||||||
con = getConnection();
|
con = getConnection();
|
||||||
pst = con.prepareStatement("SELECT COUNT(*) FROM " + tableName + ";");
|
pst = con.prepareStatement("SELECT COUNT(*) FROM " + tableName + ";");
|
||||||
@ -704,7 +707,7 @@ public class SQLite_HIKARI implements DataSource {
|
|||||||
if (rs != null && rs.next()) {
|
if (rs != null && rs.next()) {
|
||||||
result = rs.getInt(1);
|
result = rs.getInt(1);
|
||||||
}
|
}
|
||||||
} catch (Exception ex) {
|
} catch (SQLException ex) {
|
||||||
ConsoleLogger.showError(ex.getMessage());
|
ConsoleLogger.showError(ex.getMessage());
|
||||||
return result;
|
return result;
|
||||||
} finally {
|
} finally {
|
||||||
@ -716,15 +719,15 @@ public class SQLite_HIKARI implements DataSource {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateName(String oldone, String newone) {
|
public void updateName(String oldone, String newone) {
|
||||||
PreparedStatement pst = null;
|
|
||||||
Connection con = null;
|
Connection con = null;
|
||||||
|
PreparedStatement pst = null;
|
||||||
try {
|
try {
|
||||||
con = getConnection();
|
con = getConnection();
|
||||||
pst = con.prepareStatement("UPDATE " + tableName + " SET " + columnName + "=? WHERE " + columnName + "=?;");
|
pst = con.prepareStatement("UPDATE " + tableName + " SET " + columnName + "=? WHERE " + columnName + "=?;");
|
||||||
pst.setString(1, newone);
|
pst.setString(1, newone);
|
||||||
pst.setString(2, oldone);
|
pst.setString(2, oldone);
|
||||||
pst.executeUpdate();
|
pst.executeUpdate();
|
||||||
} catch (Exception ex) {
|
} catch (SQLException ex) {
|
||||||
ConsoleLogger.showError(ex.getMessage());
|
ConsoleLogger.showError(ex.getMessage());
|
||||||
return;
|
return;
|
||||||
} finally {
|
} finally {
|
||||||
@ -736,10 +739,10 @@ public class SQLite_HIKARI implements DataSource {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<PlayerAuth> getAllAuths() {
|
public List<PlayerAuth> getAllAuths() {
|
||||||
List<PlayerAuth> auths = new ArrayList<PlayerAuth>();
|
Connection con = null;
|
||||||
PreparedStatement pst = null;
|
PreparedStatement pst = null;
|
||||||
ResultSet rs = null;
|
ResultSet rs = null;
|
||||||
Connection con = null;
|
List<PlayerAuth> auths = new ArrayList<PlayerAuth>();
|
||||||
try {
|
try {
|
||||||
con = getConnection();
|
con = getConnection();
|
||||||
pst = con.prepareStatement("SELECT * FROM " + tableName + ";");
|
pst = con.prepareStatement("SELECT * FROM " + tableName + ";");
|
||||||
@ -758,7 +761,7 @@ public class SQLite_HIKARI implements DataSource {
|
|||||||
if (pAuth != null)
|
if (pAuth != null)
|
||||||
auths.add(pAuth);
|
auths.add(pAuth);
|
||||||
}
|
}
|
||||||
} catch (Exception ex) {
|
} catch (SQLException ex) {
|
||||||
ConsoleLogger.showError(ex.getMessage());
|
ConsoleLogger.showError(ex.getMessage());
|
||||||
return auths;
|
return auths;
|
||||||
} finally {
|
} finally {
|
||||||
@ -770,10 +773,10 @@ public class SQLite_HIKARI implements DataSource {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<PlayerAuth> getLoggedPlayers() {
|
public List<PlayerAuth> getLoggedPlayers() {
|
||||||
List<PlayerAuth> auths = new ArrayList<PlayerAuth>();
|
Connection con = null;
|
||||||
PreparedStatement pst = null;
|
PreparedStatement pst = null;
|
||||||
ResultSet rs = null;
|
ResultSet rs = null;
|
||||||
Connection con = null;
|
List<PlayerAuth> auths = new ArrayList<PlayerAuth>();
|
||||||
try {
|
try {
|
||||||
con = getConnection();
|
con = getConnection();
|
||||||
pst = con.prepareStatement("SELECT * FROM " + tableName + " WHERE " + columnLogged + "=1;");
|
pst = con.prepareStatement("SELECT * FROM " + tableName + " WHERE " + columnLogged + "=1;");
|
||||||
@ -792,7 +795,7 @@ public class SQLite_HIKARI implements DataSource {
|
|||||||
if (pAuth != null)
|
if (pAuth != null)
|
||||||
auths.add(pAuth);
|
auths.add(pAuth);
|
||||||
}
|
}
|
||||||
} catch (Exception ex) {
|
} catch (SQLException ex) {
|
||||||
ConsoleLogger.showError(ex.getMessage());
|
ConsoleLogger.showError(ex.getMessage());
|
||||||
return auths;
|
return auths;
|
||||||
} finally {
|
} finally {
|
||||||
@ -801,4 +804,47 @@ public class SQLite_HIKARI implements DataSource {
|
|||||||
}
|
}
|
||||||
return auths;
|
return auths;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void reload() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public synchronized void close() {
|
||||||
|
try {
|
||||||
|
if (ds != null)
|
||||||
|
ds.close();
|
||||||
|
} catch (Exception e) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void close(Statement st) {
|
||||||
|
if (st != null) {
|
||||||
|
try {
|
||||||
|
st.close();
|
||||||
|
} catch (Exception ex) {
|
||||||
|
ConsoleLogger.showError(ex.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void close(ResultSet rs) {
|
||||||
|
if (rs != null) {
|
||||||
|
try {
|
||||||
|
rs.close();
|
||||||
|
} catch (Exception ex) {
|
||||||
|
ConsoleLogger.showError(ex.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void close(Connection con) {
|
||||||
|
if (con != null) {
|
||||||
|
try {
|
||||||
|
con.close();
|
||||||
|
} catch (Exception ex) {
|
||||||
|
ConsoleLogger.showError(ex.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -48,9 +48,11 @@ public class ModuleManager implements Module {
|
|||||||
@Override
|
@Override
|
||||||
public boolean load() {
|
public boolean load() {
|
||||||
File dir = new File(plugin.getDataFolder() + File.separator + "modules");
|
File dir = new File(plugin.getDataFolder() + File.separator + "modules");
|
||||||
if (dir == null || !dir.exists() || !dir.isDirectory() || dir.listFiles() == null || dir.listFiles().length <= 0)
|
String[] files = dir.list();
|
||||||
|
if (files == null || files.length == 0){
|
||||||
return false;
|
return false;
|
||||||
for (File pathToJar : dir.listFiles()) {
|
}
|
||||||
|
for (File pathToJar : dir.listFiles()) { // FindBugs: "possible null pointers" O_o ?
|
||||||
JarFile jarFile = null;
|
JarFile jarFile = null;
|
||||||
try {
|
try {
|
||||||
jarFile = new JarFile(pathToJar);
|
jarFile = new JarFile(pathToJar);
|
||||||
|
@ -1,12 +1,9 @@
|
|||||||
package fr.xephi.authme.settings;
|
package fr.xephi.authme.settings;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.InputStream;
|
|
||||||
|
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.configuration.file.YamlConfiguration;
|
import org.bukkit.configuration.file.YamlConfiguration;
|
||||||
|
|
||||||
import fr.xephi.authme.AuthMe;
|
|
||||||
import fr.xephi.authme.ConsoleLogger;
|
import fr.xephi.authme.ConsoleLogger;
|
||||||
|
|
||||||
public class Messages extends CustomConfiguration {
|
public class Messages extends CustomConfiguration {
|
||||||
@ -29,13 +26,11 @@ public class Messages extends CustomConfiguration {
|
|||||||
* @param filename
|
* @param filename
|
||||||
* The filename to open
|
* The filename to open
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("deprecation")
|
|
||||||
public final void loadDefaults(File file) {
|
public final void loadDefaults(File file) {
|
||||||
InputStream stream = AuthMe.getInstance().getResource(file.getName());
|
if(file.isFile()){
|
||||||
if (stream == null)
|
setDefaults(YamlConfiguration.loadConfiguration(file));
|
||||||
return;
|
}
|
||||||
|
return;
|
||||||
setDefaults(YamlConfiguration.loadConfiguration(stream));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -28,7 +28,7 @@ public final class Settings extends YamlConfiguration {
|
|||||||
public static String PLUGIN_FOLDER = "." + File.separator + "plugins" + File.separator + "AuthMe";
|
public static String PLUGIN_FOLDER = "." + File.separator + "plugins" + File.separator + "AuthMe";
|
||||||
public static final String CACHE_FOLDER = Settings.PLUGIN_FOLDER + File.separator + "cache";
|
public static final String CACHE_FOLDER = Settings.PLUGIN_FOLDER + File.separator + "cache";
|
||||||
public static final String AUTH_FILE = Settings.PLUGIN_FOLDER + File.separator + "auths.db";
|
public static final String AUTH_FILE = Settings.PLUGIN_FOLDER + File.separator + "auths.db";
|
||||||
public static final String MESSAGE_FILE = Settings.PLUGIN_FOLDER + File.separator + "messages";
|
public static final String MESSAGE_FILE = Settings.PLUGIN_FOLDER + File.separator + "messages" + File.separator + "messages";
|
||||||
public static final String SETTINGS_FILE = Settings.PLUGIN_FOLDER + File.separator + "config.yml";
|
public static final String SETTINGS_FILE = Settings.PLUGIN_FOLDER + File.separator + "config.yml";
|
||||||
public static List<String> allowCommands = null;
|
public static List<String> allowCommands = null;
|
||||||
public static List<String> getJoinPermissions = null;
|
public static List<String> getJoinPermissions = null;
|
||||||
|
@ -1,58 +1,58 @@
|
|||||||
unknown_user: '&fПользователь не найден в Базе Данных'
|
unknown_user: '&fПользователь не найден в Базе Данных'
|
||||||
unsafe_spawn: '&eВаше расположение перед выходом было опасным - вы перенесены на спавн'
|
unsafe_spawn: '&eВаше расположение перед выходом было опасным - вы перенесены на спавн'
|
||||||
not_logged_in: '&cВы еще не вошли!'
|
not_logged_in: '&cВы еще не вошли!'
|
||||||
reg_voluntarily: '&aЧтобы зарегистрироваться введите: &5/reg ПАРОЛЬ ПОВТОР_ПАРОЛЯ'
|
reg_voluntarily: '&aЧтобы зарегистрироваться введите: &5/reg ПАРОЛЬ ПОВТОР_ПАРОЛЯ'
|
||||||
usage_log: '&eСинтаксис: &d/l ПАРОЛЬ &eили &d/login ПАРОЛЬ'
|
usage_log: '&eСинтаксис: &d/l ПАРОЛЬ &eили &d/login ПАРОЛЬ'
|
||||||
wrong_pwd: '&4Неправильный пароль!'
|
wrong_pwd: '&4Неправильный пароль!'
|
||||||
unregistered: '&6Вы успешно удалили свой аккаунт!'
|
unregistered: '&6Вы успешно удалили свой аккаунт!'
|
||||||
reg_disabled: '&4Регистрация отключена'
|
reg_disabled: '&4Регистрация отключена'
|
||||||
valid_session: '&aСессия открыта'
|
valid_session: '&aСессия открыта'
|
||||||
login: '&2Вы успешно вошли!'
|
login: '&2Вы успешно вошли!'
|
||||||
vb_nonActiv: '&6Ваш аккаунт еще не активирован! Проверьте вашу почту!'
|
vb_nonActiv: '&6Ваш аккаунт еще не активирован! Проверьте вашу почту!'
|
||||||
user_regged: '&4Такой игрок уже зарегистрирован'
|
user_regged: '&4Такой игрок уже зарегистрирован'
|
||||||
usage_reg: '&4Использование: &5/reg ПАРОЛЬ ПОВТОР_ПАРОЛЯ'
|
usage_reg: '&4Использование: &5/reg ПАРОЛЬ ПОВТОР_ПАРОЛЯ'
|
||||||
max_reg: '&4Вы превысили макс количество регистраций на ваш IP'
|
max_reg: '&4Вы превысили макс количество регистраций на ваш IP'
|
||||||
no_perm: '&4Недостаточно прав'
|
no_perm: '&4Недостаточно прав'
|
||||||
error: '&4Произошла ошибка. Свяжитесь с администратором'
|
error: '&4Произошла ошибка. Свяжитесь с администратором'
|
||||||
login_msg: '&4Авторизация: &5/l ПАРОЛЬ'
|
login_msg: '&4Авторизация: &5/l ПАРОЛЬ'
|
||||||
reg_msg: '&4Регистрация: &5/reg ПАРОЛЬ ПОВТОР_ПАРОЛЯ'
|
reg_msg: '&4Регистрация: &5/reg ПАРОЛЬ ПОВТОР_ПАРОЛЯ'
|
||||||
password_error_nick: '&fВы не можете использовать ваш ник в роли пароля'
|
password_error_nick: '&fВы не можете использовать ваш ник в роли пароля'
|
||||||
password_error_unsafe: '&fВы не можете использовать небезопасный пароль'
|
password_error_unsafe: '&fВы не можете использовать небезопасный пароль'
|
||||||
reg_email_msg: '&4Регистрация: &5/reg EMAIL ПОВТОР_EMAIL'
|
reg_email_msg: '&4Регистрация: &5/reg EMAIL ПОВТОР_EMAIL'
|
||||||
usage_unreg: '&4Использование: &5/unregister ПАРОЛЬ'
|
usage_unreg: '&4Использование: &5/unregister ПАРОЛЬ'
|
||||||
pwd_changed: '&2Пароль изменен!'
|
pwd_changed: '&2Пароль изменен!'
|
||||||
user_unknown: '&4Такой игрок не зарегистрирован'
|
user_unknown: '&4Такой игрок не зарегистрирован'
|
||||||
password_error: '&4Пароль не совпадает'
|
password_error: '&4Пароль не совпадает'
|
||||||
invalid_session: '&4Сессия некорректна. Дождитесь, пока она закончится'
|
invalid_session: '&4Сессия некорректна. Дождитесь, пока она закончится'
|
||||||
reg_only: '&4Только для зарегистрированных! Посетите http://сайт_сервера.com/register/ для регистрации'
|
reg_only: '&4Только для зарегистрированных! Посетите http://сайт_сервера.com/register/ для регистрации'
|
||||||
logged_in: '&4Вы уже авторизированы!'
|
logged_in: '&4Вы уже авторизированы!'
|
||||||
logout: '&2Вы успешно вышли'
|
logout: '&2Вы успешно вышли'
|
||||||
same_nick: '&4Такой игрок уже играет на сервере'
|
same_nick: '&4Такой игрок уже играет на сервере'
|
||||||
registered: '&2Успешная регистрация!'
|
registered: '&2Успешная регистрация!'
|
||||||
pass_len: '&4Твой пароль либо слишком длинный, либо слишком короткий'
|
pass_len: '&4Твой пароль либо слишком длинный, либо слишком короткий'
|
||||||
reload: '&6Конфигурация и база данных перезагружены'
|
reload: '&6Конфигурация и база данных перезагружены'
|
||||||
timeout: '&4Время для авторизации истекло'
|
timeout: '&4Время для авторизации истекло'
|
||||||
usage_changepassword: '&4Использование: &5/changepassword СТАРЫЙ_ПАРОЛЬ НОВЫЙ_ПАРОЛЬ'
|
usage_changepassword: '&4Использование: &5/changepassword СТАРЫЙ_ПАРОЛЬ НОВЫЙ_ПАРОЛЬ'
|
||||||
name_len: '&4Ваш логин слишком длинный или слишком короткий'
|
name_len: '&4Ваш логин слишком длинный или слишком короткий'
|
||||||
regex: '&4Ваш логин содержит запрещенные символы. Разрешенные символы: REG_EX'
|
regex: '&4Ваш логин содержит запрещенные символы. Разрешенные символы: REG_EX'
|
||||||
add_email: '&4Добавьте свой email: &5/email add ВАШ_EMAIL ВАШ_EMAIL'
|
add_email: '&4Добавьте свой email: &5/email add ВАШ_EMAIL ВАШ_EMAIL'
|
||||||
bad_database_email: '&4[AuthMe] Команда &5/email&4 доступна только при работе с MySQL или SQLite. Обратититесь к администрации сервера'
|
bad_database_email: '&4[AuthMe] Команда &5/email&4 доступна только при работе с MySQL или SQLite. Обратититесь к администрации сервера'
|
||||||
recovery_email: '&4Забыли пароль? Используйте &5/email recovery ВАШ_EMAIL'
|
recovery_email: '&4Забыли пароль? Используйте &5/email recovery ВАШ_EMAIL'
|
||||||
usage_captcha: '&4Вы должны ввести код, используйте: &5/captcha <theCaptcha>'
|
usage_captcha: '&4Вы должны ввести код, используйте: &5/captcha <theCaptcha>'
|
||||||
wrong_captcha: '&4Неверный код, используйте: &5/captcha THE_CAPTCHA'
|
wrong_captcha: '&4Неверный код, используйте: &5/captcha THE_CAPTCHA'
|
||||||
valid_captcha: '&2Вы успешно ввели код!'
|
valid_captcha: '&2Вы успешно ввели код!'
|
||||||
kick_forvip: '&6VIP игрок зашел на переполненный сервер!'
|
kick_forvip: '&6VIP игрок зашел на переполненный сервер!'
|
||||||
kick_fullserver: '&4Сервер переполнен!'
|
kick_fullserver: '&4Сервер переполнен!'
|
||||||
usage_email_add: '&4Использование: &5/email add ВАШ_EMAIL ПОВТОР_EMAIL'
|
usage_email_add: '&4Использование: &5/email add ВАШ_EMAIL ПОВТОР_EMAIL'
|
||||||
usage_email_change: '&4Использование: &5/email change СТАРЫЙ_EMAIL НОВЫЙ_EMAIL'
|
usage_email_change: '&4Использование: &5/email change СТАРЫЙ_EMAIL НОВЫЙ_EMAIL'
|
||||||
usage_email_recovery: '&4Использование: /email recovery EMAIL'
|
usage_email_recovery: '&4Использование: /email recovery EMAIL'
|
||||||
new_email_invalid: '[AuthMe] Недействительный новый email!'
|
new_email_invalid: '[AuthMe] Недействительный новый email!'
|
||||||
old_email_invalid: '[AuthMe] Недействительный старый email!'
|
old_email_invalid: '[AuthMe] Недействительный старый email!'
|
||||||
email_invalid: '[AuthMe] Недействительный email'
|
email_invalid: '[AuthMe] Недействительный email'
|
||||||
email_added: '[AuthMe] Email добавлен!'
|
email_added: '[AuthMe] Email добавлен!'
|
||||||
email_confirm: '[AuthMe] Подтвердите ваш Email!'
|
email_confirm: '[AuthMe] Подтвердите ваш Email!'
|
||||||
email_changed: '[AuthMe] Email изменен!'
|
email_changed: '[AuthMe] Email изменен!'
|
||||||
email_send: '[AuthMe] Письмо с инструкциями для восстановления было отправлено на ваш Email!'
|
email_send: '[AuthMe] Письмо с инструкциями для восстановления было отправлено на ваш Email!'
|
||||||
country_banned: 'Вход с IP-адресов вашей страны воспрещен на этом сервере'
|
country_banned: 'Вход с IP-адресов вашей страны воспрещен на этом сервере'
|
||||||
antibot_auto_enabled: '[AuthMe] AntiBot-режим автоматически включен из-за большого количества входов!'
|
antibot_auto_enabled: '[AuthMe] AntiBot-режим автоматически включен из-за большого количества входов!'
|
||||||
antibot_auto_disabled: '[AuthMe] AntiBot-режим автоматичски отключен после %m мин. Надеюсь атака закончилась'
|
antibot_auto_disabled: '[AuthMe] AntiBot-режим автоматичски отключен после %m мин. Надеюсь атака закончилась'
|
@ -1,59 +1,59 @@
|
|||||||
unknown_user: '&fNgười chơi không tồn tại trong cơ sở dữ liệu'
|
unknown_user: '&fNgười chơi không tồn tại trong cơ sở dữ liệu'
|
||||||
unsafe_spawn: '&fNơi thoát server của bạn không an toàn, đang dịch chuyển bạn tới điểm spawn của server'
|
unsafe_spawn: '&fNơi thoát server của bạn không an toàn, đang dịch chuyển bạn tới điểm spawn của server'
|
||||||
not_logged_in: '&cChưa đăng nhập!'
|
not_logged_in: '&cChưa đăng nhập!'
|
||||||
reg_voluntarily: '&fBạn có thể đăng kí tài khoản với lệnh
|
reg_voluntarily: '&fBạn có thể đăng kí tài khoản với lệnh
|
||||||
"/register mật-khẩu nhập-lại-mật-khẩu"'
|
"/register mật-khẩu nhập-lại-mật-khẩu"'
|
||||||
usage_log: '&eSử dụng: /login password'
|
usage_log: '&eSử dụng: /login password'
|
||||||
wrong_pwd: '&cSai mật khẩu'
|
wrong_pwd: '&cSai mật khẩu'
|
||||||
unregistered: '&cHuỷ đăng kí thành công!'
|
unregistered: '&cHuỷ đăng kí thành công!'
|
||||||
reg_disabled: '&cHệ thống đăng kí đã bị vô hiệu'
|
reg_disabled: '&cHệ thống đăng kí đã bị vô hiệu'
|
||||||
valid_session: '&cPhiên đăng nhập còn tồn tại, bạn không cần nhập mật khẩu'
|
valid_session: '&cPhiên đăng nhập còn tồn tại, bạn không cần nhập mật khẩu'
|
||||||
login: '&cĐăng nhập thành công!'
|
login: '&cĐăng nhập thành công!'
|
||||||
vb_nonActiv: '&fTài khoản của bạn chưa được kích hoạt, kiểm tra email!'
|
vb_nonActiv: '&fTài khoản của bạn chưa được kích hoạt, kiểm tra email!'
|
||||||
user_regged: '&cTên đăng nhập này đã được đăng kí'
|
user_regged: '&cTên đăng nhập này đã được đăng kí'
|
||||||
usage_reg: '&eSử dụng: /register mật-khẩu nhập-lại-mật-khẩu'
|
usage_reg: '&eSử dụng: /register mật-khẩu nhập-lại-mật-khẩu'
|
||||||
max_reg: '&fSố lượng tài khoản ở IP của bạn trong server này đã quá giới hạn cho phép'
|
max_reg: '&fSố lượng tài khoản ở IP của bạn trong server này đã quá giới hạn cho phép'
|
||||||
no_perm: '&cKhông có quyền'
|
no_perm: '&cKhông có quyền'
|
||||||
error: '&fCó lỗi xảy ra; Báo lại cho người điều hành server'
|
error: '&fCó lỗi xảy ra; Báo lại cho người điều hành server'
|
||||||
login_msg: '&cĐăng nhập với lệnh "/login mật-khẩu"'
|
login_msg: '&cĐăng nhập với lệnh "/login mật-khẩu"'
|
||||||
reg_msg: '&cĐăng kí tài khoản với lệnh "/register mật-khẩu nhập-lại-mật-khẩu"'
|
reg_msg: '&cĐăng kí tài khoản với lệnh "/register mật-khẩu nhập-lại-mật-khẩu"'
|
||||||
reg_email_msg: '&cĐăng kí email cho tài khoản với lệnh "/register <email> <nhập-lại-email>"'
|
reg_email_msg: '&cĐăng kí email cho tài khoản với lệnh "/register <email> <nhập-lại-email>"'
|
||||||
usage_unreg: '&eSử dụng: /unregister mật-khẩu'
|
usage_unreg: '&eSử dụng: /unregister mật-khẩu'
|
||||||
pwd_changed: '&cĐã đổi mật khẩu!'
|
pwd_changed: '&cĐã đổi mật khẩu!'
|
||||||
user_unknown: '&cTài khoản này chưa được đăng kí'
|
user_unknown: '&cTài khoản này chưa được đăng kí'
|
||||||
password_error: '&fMật khẩu không khớp'
|
password_error: '&fMật khẩu không khớp'
|
||||||
unvalid_session: '&fPhiên đăng nhập không hồi đáp, vui lòng chờ phiên đăng nhập kết thúc'
|
unvalid_session: '&fPhiên đăng nhập không hồi đáp, vui lòng chờ phiên đăng nhập kết thúc'
|
||||||
reg_only: '&fChỉ cho phép người đã đăng kí! Hãy vào trang http://web-của.bạn/ để đăng kí'
|
reg_only: '&fChỉ cho phép người đã đăng kí! Hãy vào trang http://web-của.bạn/ để đăng kí'
|
||||||
logged_in: '&cĐã đăng nhập!'
|
logged_in: '&cĐã đăng nhập!'
|
||||||
logout: '&cThoát đăng nhập thành công'
|
logout: '&cThoát đăng nhập thành công'
|
||||||
same_nick: '&fTài khoản đang được người khác sử dụng trong server'
|
same_nick: '&fTài khoản đang được người khác sử dụng trong server'
|
||||||
registered: '&cĐăng kí thành công!'
|
registered: '&cĐăng kí thành công!'
|
||||||
pass_len: '&fMật khẩu của bạn quá ngắn hoặc quá dài'
|
pass_len: '&fMật khẩu của bạn quá ngắn hoặc quá dài'
|
||||||
reload: '&fThiết lập và dữ liệu đã được nạp lại'
|
reload: '&fThiết lập và dữ liệu đã được nạp lại'
|
||||||
timeout: '&fQuá thời gian đăng nhập'
|
timeout: '&fQuá thời gian đăng nhập'
|
||||||
usage_changepassword: '&eSử dụng: /changepassword mật-khẩu-cũ mật-khẩu-mới'
|
usage_changepassword: '&eSử dụng: /changepassword mật-khẩu-cũ mật-khẩu-mới'
|
||||||
name_len: '&cTên đăng nhập của bạn quá ngắn hoặc quá dài'
|
name_len: '&cTên đăng nhập của bạn quá ngắn hoặc quá dài'
|
||||||
regex: '&cTên đăng nhập của bạn có chứa kí tự đặc biệt không được cho phép. Các kí tự hợp lệ: REG_EX'
|
regex: '&cTên đăng nhập của bạn có chứa kí tự đặc biệt không được cho phép. Các kí tự hợp lệ: REG_EX'
|
||||||
add_email: '&cVui lòng thêm địa chỉ email cho tài khoản với lệnh: /email add email-của-bạn nhập-lại-email-của-bạn'
|
add_email: '&cVui lòng thêm địa chỉ email cho tài khoản với lệnh: /email add email-của-bạn nhập-lại-email-của-bạn'
|
||||||
bad_database_email: '[AuthMe] Lệnh /email chỉ hoạt động với cơ sở dữ liệu MySQL và SQLite,
|
bad_database_email: '[AuthMe] Lệnh /email chỉ hoạt động với cơ sở dữ liệu MySQL và SQLite,
|
||||||
hãy liên hệ điều hành viên của server'
|
hãy liên hệ điều hành viên của server'
|
||||||
recovery_email: '&cQuên mật khẩu? Hãy dùng lệnh /email recovery <email-của-bạn>'
|
recovery_email: '&cQuên mật khẩu? Hãy dùng lệnh /email recovery <email-của-bạn>'
|
||||||
usage_captcha: '&cBạn cần nhập mã xác nhận: /captcha <mã-xác-nhận>'
|
usage_captcha: '&cBạn cần nhập mã xác nhận: /captcha <mã-xác-nhận>'
|
||||||
wrong_captcha: '&cSai mã xác nhận, nhập lại: /captcha <mã-xác-nhận>'
|
wrong_captcha: '&cSai mã xác nhận, nhập lại: /captcha <mã-xác-nhận>'
|
||||||
valid_captcha: '&aMã xác nhận hợp lệ!'
|
valid_captcha: '&aMã xác nhận hợp lệ!'
|
||||||
kick_forvip: '&cNgười chơi VIP đã vào server hiện đang full!'
|
kick_forvip: '&cNgười chơi VIP đã vào server hiện đang full!'
|
||||||
kick_fullserver: '&cXin lỗi, hiện tại server không còn trống slot để bạn có thể vào!'
|
kick_fullserver: '&cXin lỗi, hiện tại server không còn trống slot để bạn có thể vào!'
|
||||||
usage_email_add: '&eSử dụng: /email add <email> <nhập-lại-email> '
|
usage_email_add: '&eSử dụng: /email add <email> <nhập-lại-email> '
|
||||||
usage_email_change: '&eSử dụng: /email change <email-cũ> <email-mới> '
|
usage_email_change: '&eSử dụng: /email change <email-cũ> <email-mới> '
|
||||||
usage_email_recovery: '&eSử dụng: /email recovery <Email>'
|
usage_email_recovery: '&eSử dụng: /email recovery <Email>'
|
||||||
new_email_invalid: '[AuthMe] Địa chỉ email mới không hợp lệ!'
|
new_email_invalid: '[AuthMe] Địa chỉ email mới không hợp lệ!'
|
||||||
old_email_invalid: '[AuthMe] Địa chỉ email cũ không hợp lệ!'
|
old_email_invalid: '[AuthMe] Địa chỉ email cũ không hợp lệ!'
|
||||||
email_invalid: '[AuthMe] Sai địa chỉ email'
|
email_invalid: '[AuthMe] Sai địa chỉ email'
|
||||||
email_added: '[AuthMe] Đã thêm địa chỉ email !'
|
email_added: '[AuthMe] Đã thêm địa chỉ email !'
|
||||||
email_confirm: '[AuthMe] Xác nhận email !'
|
email_confirm: '[AuthMe] Xác nhận email !'
|
||||||
email_changed: '[AuthMe] Đã thay đổi email !'
|
email_changed: '[AuthMe] Đã thay đổi email !'
|
||||||
email_send: '[AuthMe] Đã gửi email khôi phục mật khẩu tới bạn !'
|
email_send: '[AuthMe] Đã gửi email khôi phục mật khẩu tới bạn !'
|
||||||
country_banned: 'Rất tiếc, quốc gia của bạn không được phép gia nhập server'
|
country_banned: 'Rất tiếc, quốc gia của bạn không được phép gia nhập server'
|
||||||
antibot_auto_enabled: '[AuthMe] AntiBot đã được kích hoạt vì lượng người chơi kết nối vượt quá giới hạn!'
|
antibot_auto_enabled: '[AuthMe] AntiBot đã được kích hoạt vì lượng người chơi kết nối vượt quá giới hạn!'
|
||||||
antibot_auto_disabled: '[AuthMe] AntiBot tự huỷ kích hoạt sau %m phút,
|
antibot_auto_disabled: '[AuthMe] AntiBot tự huỷ kích hoạt sau %m phút,
|
||||||
hi vọng lượng kết nối sẽ giảm bớt'
|
hi vọng lượng kết nối sẽ giảm bớt'
|
@ -1,61 +1,61 @@
|
|||||||
# Translator: uSoc_lifehome (http://lifeho.me) #
|
# Translator: uSoc_lifehome (http://lifeho.me) #
|
||||||
# Translator: WaterXCubic 水方塊 #
|
# Translator: WaterXCubic 水方塊 #
|
||||||
# -------------------------------------------- #
|
# -------------------------------------------- #
|
||||||
unknown_user: '&8[&6用戶系統&8] &f用戶資料並不存在於資料庫中。'
|
unknown_user: '&8[&6用戶系統&8] &f用戶資料並不存在於資料庫中。'
|
||||||
unsafe_spawn: '&8[&6用戶系統&8] &f你的登出位置不安全,現在將傳送你到重生點。'
|
unsafe_spawn: '&8[&6用戶系統&8] &f你的登出位置不安全,現在將傳送你到重生點。'
|
||||||
not_logged_in: '&8[&6用戶系統&8] &c你還沒有登入 !'
|
not_logged_in: '&8[&6用戶系統&8] &c你還沒有登入 !'
|
||||||
reg_voluntarily: '&8[&6用戶系統&8] &f你可以使用這個的指令來註冊: 《 /register <密碼> <重覆密碼> 》'
|
reg_voluntarily: '&8[&6用戶系統&8] &f你可以使用這個的指令來註冊: 《 /register <密碼> <重覆密碼> 》'
|
||||||
usage_log: '&8[&6用戶系統&8] &c用法: 《 /login <密碼> 》'
|
usage_log: '&8[&6用戶系統&8] &c用法: 《 /login <密碼> 》'
|
||||||
wrong_pwd: '&8[&6用戶系統&8] &c你輸入了錯誤的密碼。'
|
wrong_pwd: '&8[&6用戶系統&8] &c你輸入了錯誤的密碼。'
|
||||||
unregistered: '&8[&6用戶系統&8] &c你已成功取消會員註冊記錄。'
|
unregistered: '&8[&6用戶系統&8] &c你已成功取消會員註冊記錄。'
|
||||||
reg_disabled: '&8[&6用戶系統&8] &c本伺服器已停止新玩家註冊。'
|
reg_disabled: '&8[&6用戶系統&8] &c本伺服器已停止新玩家註冊。'
|
||||||
valid_session: '&8[&6用戶系統&8] &b嗨 ! 我記得你,歡迎回來~'
|
valid_session: '&8[&6用戶系統&8] &b嗨 ! 我記得你,歡迎回來~'
|
||||||
login: '&8[&6用戶系統&8] &c你成功的登入了。'
|
login: '&8[&6用戶系統&8] &c你成功的登入了。'
|
||||||
password_error_nick: '&f你不可以使用你的名字為密碼!'
|
password_error_nick: '&f你不可以使用你的名字為密碼!'
|
||||||
password_error_unsafe: '&f你不可以使用不安全的密碼'
|
password_error_unsafe: '&f你不可以使用不安全的密碼'
|
||||||
vb_nonActiv: '&8[&6用戶系統&8] &f你的帳戶還沒有經過電郵驗證 !'
|
vb_nonActiv: '&8[&6用戶系統&8] &f你的帳戶還沒有經過電郵驗證 !'
|
||||||
user_regged: '&8[&6用戶系統&8] &c此用戶名已經註冊過了。'
|
user_regged: '&8[&6用戶系統&8] &c此用戶名已經註冊過了。'
|
||||||
usage_reg: '&8[&6用戶系統&8] &c用法: 《 /register <密碼> <重覆密碼> 》'
|
usage_reg: '&8[&6用戶系統&8] &c用法: 《 /register <密碼> <重覆密碼> 》'
|
||||||
max_reg: '&8[&6用戶系統&8] &f你的IP地址已達到註冊數上限。'
|
max_reg: '&8[&6用戶系統&8] &f你的IP地址已達到註冊數上限。'
|
||||||
no_perm: '&8[&6用戶系統&8] &b你可以到 CraftingHK 玩家百科中查看說明文件。'
|
no_perm: '&8[&6用戶系統&8] &b你可以到 CraftingHK 玩家百科中查看說明文件。'
|
||||||
error: '&8[&6用戶系統&8] &f發生錯誤,請與管理員聯絡。'
|
error: '&8[&6用戶系統&8] &f發生錯誤,請與管理員聯絡。'
|
||||||
login_msg: '&8[&6用戶系統&8] &c請使用這個指令來登入: 《 /login <密碼> 》'
|
login_msg: '&8[&6用戶系統&8] &c請使用這個指令來登入: 《 /login <密碼> 》'
|
||||||
reg_msg: '&8[&6用戶系統&8] &c請使用這個的指令來註冊: 《 /register <密碼> <重覆密碼> 》'
|
reg_msg: '&8[&6用戶系統&8] &c請使用這個的指令來註冊: 《 /register <密碼> <重覆密碼> 》'
|
||||||
reg_email_msg: '&8[&6用戶系統&8] &c請使用這個的指令來註冊: 《 /register <電郵> <重覆電郵> 》'
|
reg_email_msg: '&8[&6用戶系統&8] &c請使用這個的指令來註冊: 《 /register <電郵> <重覆電郵> 》'
|
||||||
usage_unreg: '&8[&6用戶系統&8] &c用法: 《 /unregister <密碼> 》'
|
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密碼不符合。'
|
||||||
invalid_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你成功的登出了。'
|
||||||
same_nick: '&8[&6用戶系統&8] &f同名玩家已在遊玩。'
|
same_nick: '&8[&6用戶系統&8] &f同名玩家已在遊玩。'
|
||||||
registered: '&8[&6用戶系統&8] &b你成功的註冊了。'
|
registered: '&8[&6用戶系統&8] &b你成功的註冊了。'
|
||||||
pass_len: '&8[&6用戶系統&8] &f你的密碼並不符合規定長度。'
|
pass_len: '&8[&6用戶系統&8] &f你的密碼並不符合規定長度。'
|
||||||
reload: '&8[&6用戶系統&8] &b登入系統設定及資料庫重新載入完畢。'
|
reload: '&8[&6用戶系統&8] &b登入系統設定及資料庫重新載入完畢。'
|
||||||
timeout: '&8[&6用戶系統&8] &f登入逾時。'
|
timeout: '&8[&6用戶系統&8] &f登入逾時。'
|
||||||
usage_changepassword: '&8[&6用戶系統&8] &f用法: 《 /changepassword <舊密碼> <新密碼> 》'
|
usage_changepassword: '&8[&6用戶系統&8] &f用法: 《 /changepassword <舊密碼> <新密碼> 》'
|
||||||
name_len: '&8[&6用戶系統&8] &c你的用戶名不符合規定長度。'
|
name_len: '&8[&6用戶系統&8] &c你的用戶名不符合規定長度。'
|
||||||
regex: '&8[&6用戶系統&8] &c你的用戶名含有不容許之字符。以下為准許之字母: REG_EX'
|
regex: '&8[&6用戶系統&8] &c你的用戶名含有不容許之字符。以下為准許之字母: REG_EX'
|
||||||
add_email: '&8[&6用戶系統&8] &b請為你的帳戶立即添加電郵地址: 《 /email add <電郵地址> <重覆電郵地址> 》'
|
add_email: '&8[&6用戶系統&8] &b請為你的帳戶立即添加電郵地址: 《 /email add <電郵地址> <重覆電郵地址> 》'
|
||||||
bad_database_email: '&8[&6用戶系統&8] 此指令只適用於使用MySQL或SQLite之伺服器。'
|
bad_database_email: '&8[&6用戶系統&8] 此指令只適用於使用MySQL或SQLite之伺服器。'
|
||||||
recovery_email: '&8[&6用戶系統&8] &c忘記密碼 ? 請使用這個的指令來更新密碼: 《 /email recovery <電郵地址> 》'
|
recovery_email: '&8[&6用戶系統&8] &c忘記密碼 ? 請使用這個的指令來更新密碼: 《 /email recovery <電郵地址> 》'
|
||||||
usage_captcha: '&8[&6用戶系統&8] &c用法: 《 /captcha <theCaptcha> 》'
|
usage_captcha: '&8[&6用戶系統&8] &c用法: 《 /captcha <theCaptcha> 》'
|
||||||
wrong_captcha: '&8[&6用戶系統&8] &c你輸入了錯誤的驗證碼,請使用 《 /captcha <驗證碼> 》 再次輸入。'
|
wrong_captcha: '&8[&6用戶系統&8] &c你輸入了錯誤的驗證碼,請使用 《 /captcha <驗證碼> 》 再次輸入。'
|
||||||
valid_captcha: '&8[&6用戶系統&8] &c你所輸入的驗證碼是無效的 !'
|
valid_captcha: '&8[&6用戶系統&8] &c你所輸入的驗證碼是無效的 !'
|
||||||
kick_forvip: '&c因為有VIP玩家登入了伺服器。'
|
kick_forvip: '&c因為有VIP玩家登入了伺服器。'
|
||||||
kick_fullserver: '&c抱歉! 因為伺服器滿人了,所以你目前未能登入伺服器。'
|
kick_fullserver: '&c抱歉! 因為伺服器滿人了,所以你目前未能登入伺服器。'
|
||||||
usage_email_add: '&8[&6用戶系統&8] &f用法: 《 /email add <電郵> <重覆電郵> 》'
|
usage_email_add: '&8[&6用戶系統&8] &f用法: 《 /email add <電郵> <重覆電郵> 》'
|
||||||
usage_email_change: '&8[&6用戶系統&8] &f用法: 《 /email change <舊電郵> <新電郵> 》'
|
usage_email_change: '&8[&6用戶系統&8] &f用法: 《 /email change <舊電郵> <新電郵> 》'
|
||||||
usage_email_recovery: '&8[&6用戶系統&8] &f用法: 《 /email recovery <電郵> 》'
|
usage_email_recovery: '&8[&6用戶系統&8] &f用法: 《 /email recovery <電郵> 》'
|
||||||
new_email_invalid: '&8[&6用戶系統&8] 你所填寫的新電郵地址並不正確。'
|
new_email_invalid: '&8[&6用戶系統&8] 你所填寫的新電郵地址並不正確。'
|
||||||
old_email_invalid: '&8[&6用戶系統&8] 你所填寫的舊電郵地址並不正確。'
|
old_email_invalid: '&8[&6用戶系統&8] 你所填寫的舊電郵地址並不正確。'
|
||||||
email_invalid: '&8[&6用戶系統&8] 你所填寫的電郵地址並不正確。'
|
email_invalid: '&8[&6用戶系統&8] 你所填寫的電郵地址並不正確。'
|
||||||
email_added: '&8[&6用戶系統&8] 已加入你的電郵地址記錄。'
|
email_added: '&8[&6用戶系統&8] 已加入你的電郵地址記錄。'
|
||||||
email_confirm: '&8[&6用戶系統&8] 請重覆輸入你的電郵地址。'
|
email_confirm: '&8[&6用戶系統&8] 請重覆輸入你的電郵地址。'
|
||||||
email_changed: '&8[&6用戶系統&8] 你的電郵地址記錄已更改。'
|
email_changed: '&8[&6用戶系統&8] 你的電郵地址記錄已更改。'
|
||||||
email_send: '&8[&6用戶系統&8] 忘記密碼信件已寄出,請查收。'
|
email_send: '&8[&6用戶系統&8] 忘記密碼信件已寄出,請查收。'
|
||||||
country_banned: '&8[&6用戶系統&8] 本伺服器已停止對你的國家提供遊戲服務。'
|
country_banned: '&8[&6用戶系統&8] 本伺服器已停止對你的國家提供遊戲服務。'
|
||||||
antibot_auto_enabled: '&8[&6用戶系統&8] 防止機械人程序已因應現時大量不尋常的連線而啟用。'
|
antibot_auto_enabled: '&8[&6用戶系統&8] 防止機械人程序已因應現時大量不尋常的連線而啟用。'
|
||||||
antibot_auto_disabled: '&8[&6用戶系統&8] 防止機械人程序檢查到不正常連接數已減少,並於 %m 分鐘後停止運作。'
|
antibot_auto_disabled: '&8[&6用戶系統&8] 防止機械人程序檢查到不正常連接數已減少,並於 %m 分鐘後停止運作。'
|
@ -1,62 +1,62 @@
|
|||||||
# Translator: MineWolf50
|
# Translator: MineWolf50
|
||||||
# Last Time Edit : 2015 / 7 / 14 , A.M.10:14
|
# Last Time Edit : 2015 / 7 / 14 , A.M.10:14
|
||||||
# = = = = = = = = = = = = = = = = = = = = = = = #
|
# = = = = = = = = = = = = = = = = = = = = = = = #
|
||||||
unknown_user: "&b【AuthMe】&6沒有在資料庫內找到該玩家。"
|
unknown_user: "&b【AuthMe】&6沒有在資料庫內找到該玩家。"
|
||||||
unsafe_spawn: '&b【AuthMe】&6你登出的地點不安全,已傳送你到安全的地點。'
|
unsafe_spawn: '&b【AuthMe】&6你登出的地點不安全,已傳送你到安全的地點。'
|
||||||
not_logged_in: '&b【AuthMe】&6你還沒有登入!'
|
not_logged_in: '&b【AuthMe】&6你還沒有登入!'
|
||||||
reg_voluntarily: '&b【AuthMe】&6使用 &c"/register <密碼> <確認密碼>" &6來註冊你的暱稱'
|
reg_voluntarily: '&b【AuthMe】&6使用 &c"/register <密碼> <確認密碼>" &6來註冊你的暱稱'
|
||||||
usage_log: '&b【AuthMe】&6用法: &c"/login <密碼>"'
|
usage_log: '&b【AuthMe】&6用法: &c"/login <密碼>"'
|
||||||
wrong_pwd: '&b【AuthMe】&6密碼錯誤!'
|
wrong_pwd: '&b【AuthMe】&6密碼錯誤!'
|
||||||
unregistered: '&b【AuthMe】&6你已經成功取消註冊。'
|
unregistered: '&b【AuthMe】&6你已經成功取消註冊。'
|
||||||
reg_disabled: '&b【AuthMe】&6已關閉註冊功能'
|
reg_disabled: '&b【AuthMe】&6已關閉註冊功能'
|
||||||
password_error_nick: '&b【AuthMe】&6你不可以用你的 ID ( 名稱 ) 來當作密碼 !'
|
password_error_nick: '&b【AuthMe】&6你不可以用你的 ID ( 名稱 ) 來當作密碼 !'
|
||||||
password_error_unsafe: '&b【AuthMe】&6你不可以使用這個不安全的密碼'
|
password_error_unsafe: '&b【AuthMe】&6你不可以使用這個不安全的密碼'
|
||||||
valid_session: '&b【AuthMe】&6你已經成功登入!'
|
valid_session: '&b【AuthMe】&6你已經成功登入!'
|
||||||
login: '&b【AuthMe】&6密碼正確,你已成功登入!'
|
login: '&b【AuthMe】&6密碼正確,你已成功登入!'
|
||||||
vb_nonActiv: '&b【AuthMe】&6你的帳號還沒有經過驗證! 檢查看看你的電子信箱 (Email) 吧!'
|
vb_nonActiv: '&b【AuthMe】&6你的帳號還沒有經過驗證! 檢查看看你的電子信箱 (Email) 吧!'
|
||||||
user_regged: '&b【AuthMe】&6這個帳號已經被註冊過了!'
|
user_regged: '&b【AuthMe】&6這個帳號已經被註冊過了!'
|
||||||
usage_reg: '&b【AuthMe】&6用法: &c"/register <密碼> <確認密碼>"'
|
usage_reg: '&b【AuthMe】&6用法: &c"/register <密碼> <確認密碼>"'
|
||||||
max_reg: '&b【AuthMe】&6你的 IP 位置所註冊的帳號數量已經達到最大。'
|
max_reg: '&b【AuthMe】&6你的 IP 位置所註冊的帳號數量已經達到最大。'
|
||||||
no_perm: '&b【AuthMe】&6你沒有使用該指令的權限。'
|
no_perm: '&b【AuthMe】&6你沒有使用該指令的權限。'
|
||||||
error: '&b【AuthMe】&6發生錯誤,請聯繫管理員'
|
error: '&b【AuthMe】&6發生錯誤,請聯繫管理員'
|
||||||
login_msg: '&b【AuthMe】&6請使用 &c"/login <密碼>" &6來登入。'
|
login_msg: '&b【AuthMe】&6請使用 &c"/login <密碼>" &6來登入。'
|
||||||
reg_msg: '&b【AuthMe】&6請使用 "&c/register <密碼> <確認密碼>" 來註冊。'
|
reg_msg: '&b【AuthMe】&6請使用 "&c/register <密碼> <確認密碼>" 來註冊。'
|
||||||
reg_email_msg: '&b【AuthMe】&6請使用 &c"/register <email> <重複Email>" 來註冊'
|
reg_email_msg: '&b【AuthMe】&6請使用 &c"/register <email> <重複Email>" 來註冊'
|
||||||
usage_unreg: '&b【AuthMe】&6用法: &c"/unregister <密碼>"'
|
usage_unreg: '&b【AuthMe】&6用法: &c"/unregister <密碼>"'
|
||||||
pwd_changed: '&b【AuthMe】&6密碼變更成功!'
|
pwd_changed: '&b【AuthMe】&6密碼變更成功!'
|
||||||
user_unknown: '&b【AuthMe】&6這個帳號還沒有註冊過'
|
user_unknown: '&b【AuthMe】&6這個帳號還沒有註冊過'
|
||||||
password_error: '&b【AuthMe】&6兩次輸入的密碼不一致!'
|
password_error: '&b【AuthMe】&6兩次輸入的密碼不一致!'
|
||||||
invalid_session: '&b【AuthMe】&6憑證日期不相符!'
|
invalid_session: '&b【AuthMe】&6憑證日期不相符!'
|
||||||
reg_only: '&b【AuthMe】&6請到下列網站 :「 http://example.com 」 進行註冊'
|
reg_only: '&b【AuthMe】&6請到下列網站 :「 http://example.com 」 進行註冊'
|
||||||
logged_in: '&b【AuthMe】&6你已經登入了!'
|
logged_in: '&b【AuthMe】&6你已經登入了!'
|
||||||
logout: '&b【AuthMe】&6你已成功登出'
|
logout: '&b【AuthMe】&6你已成功登出'
|
||||||
same_nick: '&b【AuthMe】&6有同樣帳號的玩家在線上!'
|
same_nick: '&b【AuthMe】&6有同樣帳號的玩家在線上!'
|
||||||
registered: '&b【AuthMe】&6你已成功註冊'
|
registered: '&b【AuthMe】&6你已成功註冊'
|
||||||
pass_len: '&b【AuthMe】&6你的密碼 超過最大字數 / 小於最小字數'
|
pass_len: '&b【AuthMe】&6你的密碼 超過最大字數 / 小於最小字數'
|
||||||
reload: '&b【AuthMe】&6已重新讀取設定檔及資料庫'
|
reload: '&b【AuthMe】&6已重新讀取設定檔及資料庫'
|
||||||
timeout: '&b【AuthMe】&6超過登入時間,請稍後再試一次'
|
timeout: '&b【AuthMe】&6超過登入時間,請稍後再試一次'
|
||||||
usage_changepassword: '&b【AuthMe】&6用法: &c"/changepassword <舊密碼> <新密碼>"'
|
usage_changepassword: '&b【AuthMe】&6用法: &c"/changepassword <舊密碼> <新密碼>"'
|
||||||
name_len: '&b【AuthMe】&6你的暱稱 太長 / 太短 了!'
|
name_len: '&b【AuthMe】&6你的暱稱 太長 / 太短 了!'
|
||||||
regex: '&b【AuthMe】&6暱稱裡包含不能使用的字符'
|
regex: '&b【AuthMe】&6暱稱裡包含不能使用的字符'
|
||||||
add_email: '&b【AuthMe】&6請使用 &c"/email add <你的Email> <再次輸入你的Email>" &6來添加 Email'
|
add_email: '&b【AuthMe】&6請使用 &c"/email add <你的Email> <再次輸入你的Email>" &6來添加 Email'
|
||||||
bad_database_email: '&b【AuthMe】&6此指令只適用於有使用MySQL和SQLite的伺服器。'
|
bad_database_email: '&b【AuthMe】&6此指令只適用於有使用MySQL和SQLite的伺服器。'
|
||||||
recovery_email: '&b【AuthMe】&6忘記密碼了嗎? 使用 &c"/email recovery <你的Email>"'
|
recovery_email: '&b【AuthMe】&6忘記密碼了嗎? 使用 &c"/email recovery <你的Email>"'
|
||||||
usage_captcha: '&b【AuthMe】&6請用 &c"/captcha <theCaptcha>" &6來輸入你的驗證碼'
|
usage_captcha: '&b【AuthMe】&6請用 &c"/captcha <theCaptcha>" &6來輸入你的驗證碼'
|
||||||
wrong_captcha: '&b【AuthMe】&6錯誤的驗證碼'
|
wrong_captcha: '&b【AuthMe】&6錯誤的驗證碼'
|
||||||
valid_captcha: '&b【AuthMe】&6驗證碼無效!'
|
valid_captcha: '&b【AuthMe】&6驗證碼無效!'
|
||||||
kick_forvip: '&b【AuthMe】&6你已經被請出。&c原因 : 有 VIP 玩家登入伺服器'
|
kick_forvip: '&b【AuthMe】&6你已經被請出。&c原因 : 有 VIP 玩家登入伺服器'
|
||||||
kick_fullserver: '&b【AuthMe】&6伺服器已經滿了,請等等再試一次'
|
kick_fullserver: '&b【AuthMe】&6伺服器已經滿了,請等等再試一次'
|
||||||
usage_email_add: '&b【AuthMe】&6用法: &c"/email add <你的Email> <重複Email>"'
|
usage_email_add: '&b【AuthMe】&6用法: &c"/email add <你的Email> <重複Email>"'
|
||||||
usage_email_change: '&b【AuthMe】&6用法: &c"/email change <舊的Email> <新的Email>"'
|
usage_email_change: '&b【AuthMe】&6用法: &c"/email change <舊的Email> <新的Email>"'
|
||||||
usage_email_recovery: '&b【AuthMe】&6用法: &c"/email recovery <你的Email>"'
|
usage_email_recovery: '&b【AuthMe】&6用法: &c"/email recovery <你的Email>"'
|
||||||
new_email_invalid: '&b【AuthMe】&6新的Email無效!'
|
new_email_invalid: '&b【AuthMe】&6新的Email無效!'
|
||||||
old_email_invalid: '&b【AuthMe】&6舊的Email無效!'
|
old_email_invalid: '&b【AuthMe】&6舊的Email無效!'
|
||||||
email_invalid: '&b【AuthMe】&6無效的Email!'
|
email_invalid: '&b【AuthMe】&6無效的Email!'
|
||||||
email_added: '&b【AuthMe】&6已添加Email!'
|
email_added: '&b【AuthMe】&6已添加Email!'
|
||||||
email_confirm: '&b【AuthMe】&6請驗證你的Email!'
|
email_confirm: '&b【AuthMe】&6請驗證你的Email!'
|
||||||
email_changed: '&b【AuthMe】&6Email已變更!'
|
email_changed: '&b【AuthMe】&6Email已變更!'
|
||||||
email_send: '&b【AuthMe】&6已經送出重設密碼要求至你的Email , 請查收。'
|
email_send: '&b【AuthMe】&6已經送出重設密碼要求至你的Email , 請查收。'
|
||||||
email_exists: '&b【AuthMe】&6這個帳戶已經有設定電子郵件了'
|
email_exists: '&b【AuthMe】&6這個帳戶已經有設定電子郵件了'
|
||||||
country_banned: '&b【AuthMe】&6你所在的地區無法進入此伺服器'
|
country_banned: '&b【AuthMe】&6你所在的地區無法進入此伺服器'
|
||||||
antibot_auto_enabled: '&b【AuthMe】&6AntiBotMod已自動啟用!'
|
antibot_auto_enabled: '&b【AuthMe】&6AntiBotMod已自動啟用!'
|
||||||
antibot_auto_disabled: '&b【AuthMe】&6AntiBotMod將會於 &c%m &6分鐘後自動關閉'
|
antibot_auto_disabled: '&b【AuthMe】&6AntiBotMod將會於 &c%m &6分鐘後自動關閉'
|
Loading…
Reference in New Issue
Block a user