atleast sql works now!
This commit is contained in:
@@ -20,8 +20,8 @@ public class ChatImplementation implements ChatAPI{
|
||||
Config.init();
|
||||
|
||||
luckPerms = getLuckPerms();
|
||||
//databaseConnection = getDataBase(); // todo fix sql
|
||||
//Queries.createTables(); // todo fix sql
|
||||
databaseConnection = getDataBase(); // todo fix sql
|
||||
Queries.createTables(); // todo fix sql
|
||||
|
||||
ChatUserManager.initialize(); // loads all the users from the db and adds them.
|
||||
RegexManager.initialize(); // load the filters and regexes from config
|
||||
|
||||
@@ -236,14 +236,12 @@ public final class Config {
|
||||
|
||||
}
|
||||
|
||||
public static String DRIVER = "mysql";
|
||||
public static String IP = "0.0.0.0";
|
||||
public static String PORT = "3306";
|
||||
public static String DATABASE = "database";
|
||||
public static String USERNAME = "root";
|
||||
public static String PASSWORD = "root";
|
||||
private static void database() {
|
||||
DRIVER = getString("database.driver" , DRIVER);
|
||||
IP = getString("database.ip", IP);
|
||||
PORT = getString("database.port", PORT);
|
||||
DATABASE = getString("database.name", DATABASE);
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.alttd.chat.database;
|
||||
|
||||
|
||||
import com.alttd.chat.config.Config;
|
||||
import com.alttd.chat.util.ALogger;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.DriverManager;
|
||||
@@ -44,8 +45,11 @@ public class DatabaseConnection {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
ALogger.info("jdbc:mysql://" + Config.IP + ":" + Config.PORT + "/" + Config.DATABASE + "?autoReconnect=true"+
|
||||
"&useSSL=false");
|
||||
connection = DriverManager.getConnection(
|
||||
"jdbc:" + Config.DRIVER + "://" + Config.IP + ":" + Config.PORT + "/" + Config.DATABASE + "?autoReconnect=true&enabledTLSProtocols=TLSv1.1",
|
||||
"jdbc:mysql://" + Config.IP + ":" + Config.PORT + "/" + Config.DATABASE + "?autoReconnect=true"+
|
||||
"&useSSL=false",
|
||||
Config.USERNAME, Config.PASSWORD);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,6 @@ public class RegexManager {
|
||||
}
|
||||
|
||||
public static void addFilter(ChatFilter filter) {
|
||||
ALogger.info("Adding " + filter.getName());
|
||||
chatFilters.add(filter);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user