This commit is contained in:
Gabriele C 2015-09-07 20:38:29 +02:00
parent b83d141758
commit c0eb15ee49
3 changed files with 14 additions and 5 deletions

View File

@ -61,6 +61,7 @@ import fr.xephi.authme.datasource.DatabaseCalls;
import fr.xephi.authme.datasource.FlatFile; import fr.xephi.authme.datasource.FlatFile;
import fr.xephi.authme.datasource.MySQL; import fr.xephi.authme.datasource.MySQL;
import fr.xephi.authme.datasource.SQLite; import fr.xephi.authme.datasource.SQLite;
import fr.xephi.authme.datasource.SQLite_HIKARI;
import fr.xephi.authme.listener.AuthMeBlockListener; import fr.xephi.authme.listener.AuthMeBlockListener;
import fr.xephi.authme.listener.AuthMeChestShopListener; import fr.xephi.authme.listener.AuthMeChestShopListener;
import fr.xephi.authme.listener.AuthMeEntityListener; import fr.xephi.authme.listener.AuthMeEntityListener;
@ -307,9 +308,10 @@ public class AuthMe extends JavaPlugin {
// Start Email recall task if needed // Start Email recall task if needed
recallEmail(); recallEmail();
// Sponsor message // Sponsor messages
ConsoleLogger.info("AuthMe hooks perfectly with the VERYGAMES server hosting!"); ConsoleLogger.info("AuthMe hooks perfectly with the VERYGAMES server hosting!");
ConsoleLogger.info("Development builds are available on our jenkins, thanks to our sponsor GameHosting.it - leader in Italy as Game Server Provider"); ConsoleLogger.info("Development builds are available on our jenkins, thanks to f14stelt.");
ConsoleLogger.info("Do you want a good gameserver? Look at our sponsor GameHosting.it leader in Italy as Game Server Provider!");
ConsoleLogger.info("AuthMe " + this.getDescription().getVersion() + " correctly enabled!"); ConsoleLogger.info("AuthMe " + this.getDescription().getVersion() + " correctly enabled!");
} }
@ -816,7 +818,7 @@ public class AuthMe extends JavaPlugin {
public void setupDatabase() throws ClassNotFoundException, PoolInitializationException, SQLException { public void setupDatabase() throws ClassNotFoundException, PoolInitializationException, SQLException {
/* /*
* Backend MYSQL - FILE - SQLITE * Backend MYSQL - FILE - SQLITE - SQLITEHIKARI
*/ */
switch (Settings.getDataSource) { switch (Settings.getDataSource) {
case FILE: case FILE:
@ -831,6 +833,12 @@ public class AuthMe extends JavaPlugin {
if (b >= 4000) if (b >= 4000)
ConsoleLogger.showError("YOU'RE USING THE SQLITE DATABASE WITH " + b + "+ ACCOUNTS, FOR BETTER PERFORMANCES, PLEASE UPGRADE TO MYSQL!!"); ConsoleLogger.showError("YOU'RE USING THE SQLITE DATABASE WITH " + b + "+ ACCOUNTS, FOR BETTER PERFORMANCES, PLEASE UPGRADE TO MYSQL!!");
break; break;
case SQLITEHIKARI:
database = new SQLite_HIKARI();
final int b2 = database.getAccountsRegistered();
if (b2 >= 8000)
ConsoleLogger.showError("YOU'RE USING THE SQLITE DATABASE WITH " + b2 + "+ ACCOUNTS, FOR BETTER PERFORMANCES, PLEASE UPGRADE TO MYSQL!!");
break;
} }
if (Settings.isCachingEnabled) { if (Settings.isCachingEnabled) {

View File

@ -33,7 +33,7 @@ public class ConsoleLogger {
public static void showError(String message) { public static void showError(String message) {
if (AuthMe.getInstance().isEnabled()) { if (AuthMe.getInstance().isEnabled()) {
log.warning("[AuthMe] ERROR: " + message); log.warning("[AuthMe] " + message);
if (Settings.useLogging) { if (Settings.useLogging) {
Calendar date = Calendar.getInstance(); Calendar date = Calendar.getInstance();
final String actually = "[" + DateFormat.getDateInstance().format(date.getTime()) + ", " + date.get(Calendar.HOUR_OF_DAY) + ":" + date.get(Calendar.MINUTE) + ":" + date.get(Calendar.SECOND) + "] ERROR : " + message; final String actually = "[" + DateFormat.getDateInstance().format(date.getTime()) + ", " + date.get(Calendar.HOUR_OF_DAY) + ":" + date.get(Calendar.MINUTE) + ":" + date.get(Calendar.SECOND) + "] ERROR : " + message;

View File

@ -9,7 +9,8 @@ public interface DataSource {
public enum DataSourceType { public enum DataSourceType {
MYSQL, MYSQL,
FILE, FILE,
SQLITE SQLITE,
SQLITEHIKARI
} }
boolean isAuthAvailable(String user); boolean isAuthAvailable(String user);