diff --git a/SpigotCore_Main/src/de/steamwar/core/Core.java b/SpigotCore_Main/src/de/steamwar/core/Core.java
index bbd8644..957605f 100644
--- a/SpigotCore_Main/src/de/steamwar/core/Core.java
+++ b/SpigotCore_Main/src/de/steamwar/core/Core.java
@@ -139,9 +139,4 @@ public class Core extends JavaPlugin{
if(crashDetector.onMainThread())
Statement.closeAll();
}
-
- private static void setSqlConfig() {
- sqlConfig = new File(System.getProperty("user.home"), "MySQL.yml");
- standalone = !sqlConfig.exists();
- }
}
diff --git a/SpigotCore_Main/src/de/steamwar/core/CrashDetector.java b/SpigotCore_Main/src/de/steamwar/core/CrashDetector.java
index b4f612e..a0bb826 100644
--- a/SpigotCore_Main/src/de/steamwar/core/CrashDetector.java
+++ b/SpigotCore_Main/src/de/steamwar/core/CrashDetector.java
@@ -20,7 +20,7 @@
package de.steamwar.core;
import de.steamwar.sql.SWException;
-import de.steamwar.sql.Statement;
+import de.steamwar.sql.internal.Statement;
import org.bukkit.Bukkit;
import java.util.Arrays;
@@ -64,7 +64,7 @@ public class CrashDetector {
if(Core.getInstance().isEnabled()) {
Core.getInstance().onDisable();
}
- Statement.close();
+ Statement.closeAll();
//System.exit(0); Does freeze, potential freezing issues: ConsoleRestoreHook, ApplicationShutdownHooks or DeleteOnExitHook
Runtime.getRuntime().halt(0);
}
diff --git a/SpigotCore_Main/src/de/steamwar/sql/Replay.java b/SpigotCore_Main/src/de/steamwar/sql/Replay.java
deleted file mode 100644
index c3bc96f..0000000
--- a/SpigotCore_Main/src/de/steamwar/sql/Replay.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * This file is a part of the SteamWar software.
- *
- * Copyright (C) 2022 SteamWar.de-Serverteam
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-package de.steamwar.sql;
-
-import lombok.AllArgsConstructor;
-import lombok.Getter;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.nio.file.Files;
-import java.sql.SQLException;
-
-@AllArgsConstructor
-public class Replay {
-
- private static final Statement get = new Statement("SELECT Replay FROM Replay WHERE FightID = ?");
- private static final Statement insert = new Statement("INSERT INTO Replay (FightID, Replay) VALUES (?, ?)");
-
- public static Replay get(int fightID) {
- return get.select(rs -> {
- rs.next();
-
- File file;
- try {
- file = File.createTempFile("replay", "replay");
- file.deleteOnExit();
- Files.copy(rs.getBinaryStream("Replay"), file.toPath());
- } catch (IOException e) {
- throw new SQLException(e);
- }
- return new Replay(fightID, file);
- }, fightID);
- }
-
- public static void save(int fightID, File file) {
- try {
- insert.update(fightID, new FileInputStream(file));
- } catch (FileNotFoundException e) {
- throw new SecurityException("Could not save replay", e);
- }
- }
-
- private final int fightID;
- @Getter
- private final File replay;
-}
\ No newline at end of file
diff --git a/SpigotCore_Main/src/de/steamwar/sql/SWException.java b/SpigotCore_Main/src/de/steamwar/sql/SWException.java
deleted file mode 100644
index c370744..0000000
--- a/SpigotCore_Main/src/de/steamwar/sql/SWException.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- This file is a part of the SteamWar software.
-
- Copyright (C) 2020 SteamWar.de-Serverteam
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see .
-*/
-
-package de.steamwar.sql;
-
-import org.bukkit.Bukkit;
-import org.bukkit.World;
-import org.bukkit.entity.Player;
-
-import java.io.File;
-
-public class SWException {
- private SWException(){}
-
- private static final String serverVersion = Bukkit.getServer().getVersion();
- private static final String cwd = System.getProperty("user.dir");
- private static final String server = new File(cwd).getName();
-
- public static void init() {
- //force class loading
- }
-
- public static void log(String message, String stacktrace){
- StringBuilder msgBuilder = new StringBuilder(message).append("\nPlayers: ");
- for(Player player : Bukkit.getOnlinePlayers())
- msgBuilder.append(player.getName()).append(" ");
- msgBuilder.append("\nWorlds: ");
- for(World world : Bukkit.getWorlds())
- msgBuilder.append(world.getName()).append(" ");
- msgBuilder.append("\nServer: ").append(serverVersion);
- msgBuilder.append("\nCWD: ").append(cwd);
-
- Provider.impl.logException(server, msgBuilder.toString(), stacktrace);
- }
-}