From dc9bb39644140773e04566eecc1dd8f2d21bb060 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Mon, 4 Apr 2022 18:18:46 +0200 Subject: [PATCH 1/3] Update replay stuff --- SpigotCore_Main/src/de/steamwar/sql/SQLProvider.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SpigotCore_Main/src/de/steamwar/sql/SQLProvider.java b/SpigotCore_Main/src/de/steamwar/sql/SQLProvider.java index 50ee401..bc153e3 100644 --- a/SpigotCore_Main/src/de/steamwar/sql/SQLProvider.java +++ b/SpigotCore_Main/src/de/steamwar/sql/SQLProvider.java @@ -148,7 +148,7 @@ public class SQLProvider implements Provider { }); } - private static final Statement getReplay = new Statement("SELECT Replay FROM Fight WHERE FightID = ?"); + private static final Statement getReplay = new Statement("SELECT Replay FROM Replay WHERE id = ?"); @Override public void getReplay(int fightID, Consumer reader) { getReplay.select(rs -> { @@ -158,7 +158,7 @@ public class SQLProvider implements Provider { }, fightID); } - private static final Statement setReplay = new Statement("UPDATE Fight SET Replay = ? WHERE FightID = ?"); + private static final Statement setReplay = new Statement("UPDATE Replay SET Replay = ? WHERE id = ?"); @Override public void setReplay(int fightID, InputStream data) { setReplay.update(data, fightID); -- 2.39.2 From 1ebc8d9c0678b80371e3cf9557ea3010791a745e Mon Sep 17 00:00:00 2001 From: yoyosource Date: Sat, 9 Apr 2022 21:31:58 +0200 Subject: [PATCH 2/3] Update replay stuff --- SpigotCore_Main/src/de/steamwar/sql/SQLProvider.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SpigotCore_Main/src/de/steamwar/sql/SQLProvider.java b/SpigotCore_Main/src/de/steamwar/sql/SQLProvider.java index bc153e3..52dcb1a 100644 --- a/SpigotCore_Main/src/de/steamwar/sql/SQLProvider.java +++ b/SpigotCore_Main/src/de/steamwar/sql/SQLProvider.java @@ -148,7 +148,7 @@ public class SQLProvider implements Provider { }); } - private static final Statement getReplay = new Statement("SELECT Replay FROM Replay WHERE id = ?"); + private static final Statement getReplay = new Statement("SELECT Replay FROM Replay WHERE FightID = ?"); @Override public void getReplay(int fightID, Consumer reader) { getReplay.select(rs -> { @@ -158,7 +158,7 @@ public class SQLProvider implements Provider { }, fightID); } - private static final Statement setReplay = new Statement("UPDATE Replay SET Replay = ? WHERE id = ?"); + private static final Statement setReplay = new Statement("UPDATE Replay SET Replay = ? WHERE FightID = ?"); @Override public void setReplay(int fightID, InputStream data) { setReplay.update(data, fightID); -- 2.39.2 From 0a606c824970612275e744456e66b83ad03d192e Mon Sep 17 00:00:00 2001 From: yoyosource Date: Sat, 9 Apr 2022 21:33:57 +0200 Subject: [PATCH 3/3] Update replay stuff --- SpigotCore_Main/src/de/steamwar/sql/SQLProvider.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SpigotCore_Main/src/de/steamwar/sql/SQLProvider.java b/SpigotCore_Main/src/de/steamwar/sql/SQLProvider.java index 52dcb1a..adef988 100644 --- a/SpigotCore_Main/src/de/steamwar/sql/SQLProvider.java +++ b/SpigotCore_Main/src/de/steamwar/sql/SQLProvider.java @@ -158,10 +158,10 @@ public class SQLProvider implements Provider { }, fightID); } - private static final Statement setReplay = new Statement("UPDATE Replay SET Replay = ? WHERE FightID = ?"); + private static final Statement setReplay = new Statement("INSERT INTO Replay (FightID, Replay) SET FightID = ?, Replay = ?"); @Override public void setReplay(int fightID, InputStream data) { - setReplay.update(data, fightID); + setReplay.update(fightID, data); } private static final Statement create = new Statement("INSERT INTO FightPlayer (FightID, UserID, Team, Kit, Kills, IsOut) VALUES (?, ?, ?, ?, ?, ?)"); -- 2.39.2