From b35d7abf53c4d2b58fe564ecf3ed495fb60d12ff Mon Sep 17 00:00:00 2001 From: Rsl1122 Date: Sat, 16 Dec 2017 12:43:44 +0200 Subject: [PATCH] Fixed plugin bugs caused by poor refactor copy of Hack table for AAC #474 #473 #471 Renamed plan_viaversion_protocol to plan_version_protocol Renamed HackerTable from plan_viaversion_protocol to plan_aac_hack_table And use of wrong method for enum name #470 --- Plan/pom.xml | 2 +- .../com/djrapitops/pluginbridge/plan/aac/HackerTable.java | 6 +++--- .../pluginbridge/plan/aac/PlayerHackKickListener.java | 2 +- .../plan/protocolsupport/PlayerVersionListener.java | 2 +- .../pluginbridge/plan/viaversion/ProtocolTable.java | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Plan/pom.xml b/Plan/pom.xml index 769682f9f..9b48d1b4e 100644 --- a/Plan/pom.xml +++ b/Plan/pom.xml @@ -4,7 +4,7 @@ 4.0.0 com.djrapitops Plan - 4.1.3 + 4.1.3.2 jar diff --git a/PlanPluginBridge/src/main/java/com/djrapitops/pluginbridge/plan/aac/HackerTable.java b/PlanPluginBridge/src/main/java/com/djrapitops/pluginbridge/plan/aac/HackerTable.java index aa39a3dd1..45a868d85 100644 --- a/PlanPluginBridge/src/main/java/com/djrapitops/pluginbridge/plan/aac/HackerTable.java +++ b/PlanPluginBridge/src/main/java/com/djrapitops/pluginbridge/plan/aac/HackerTable.java @@ -33,7 +33,7 @@ public class HackerTable extends Table { private final String columnViolations; public HackerTable(SQLDB db) { - super("plan_viaversion_protocol", db, db.isUsingMySQL()); + super("plan_aac_hack_table", db, db.isUsingMySQL()); columnUUID = "uuid"; columnDate = "date"; columnHackType = "hack_type"; @@ -43,7 +43,7 @@ public class HackerTable extends Table { @Override public void createTable() throws DBCreateTableException { createTable("CREATE TABLE IF NOT EXISTS " + tableName + " (" - + columnUUID + " varchar(36) NOT NULL UNIQUE, " + + columnUUID + " varchar(36) NOT NULL, " + columnDate + " bigint NOT NULL, " + columnHackType + " varchar(100) NOT NULL, " + columnViolations + " integer NOT NULL" @@ -107,7 +107,7 @@ public class HackerTable extends Table { public void prepare(PreparedStatement statement) throws SQLException { statement.setString(1, hackObject.getUuid().toString()); statement.setLong(2, hackObject.getDate()); - statement.setString(3, hackObject.getHackType().getName()); + statement.setString(3, hackObject.getHackType().name()); statement.setInt(4, hackObject.getViolationLevel()); } }); diff --git a/PlanPluginBridge/src/main/java/com/djrapitops/pluginbridge/plan/aac/PlayerHackKickListener.java b/PlanPluginBridge/src/main/java/com/djrapitops/pluginbridge/plan/aac/PlayerHackKickListener.java index 5eeb3e674..28a234e7c 100644 --- a/PlanPluginBridge/src/main/java/com/djrapitops/pluginbridge/plan/aac/PlayerHackKickListener.java +++ b/PlanPluginBridge/src/main/java/com/djrapitops/pluginbridge/plan/aac/PlayerHackKickListener.java @@ -50,7 +50,7 @@ public class PlayerHackKickListener implements Listener { try { new HackerTable((SQLDB) plan.getDB()).insertHackRow(hackObject); } catch (SQLException e) { - Log.toLog(this.getClass().getName() + ":PlanViaVersionJoinListener", e); + Log.toLog(this.getClass().getName(), e); } } }); diff --git a/PlanPluginBridge/src/main/java/com/djrapitops/pluginbridge/plan/protocolsupport/PlayerVersionListener.java b/PlanPluginBridge/src/main/java/com/djrapitops/pluginbridge/plan/protocolsupport/PlayerVersionListener.java index 0b3847455..7ade96ac6 100644 --- a/PlanPluginBridge/src/main/java/com/djrapitops/pluginbridge/plan/protocolsupport/PlayerVersionListener.java +++ b/PlanPluginBridge/src/main/java/com/djrapitops/pluginbridge/plan/protocolsupport/PlayerVersionListener.java @@ -46,7 +46,7 @@ public class PlayerVersionListener implements Listener { try { new ProtocolTable((SQLDB) plan.getDB()).saveProtocolVersion(uuid, playerVersion); } catch (SQLException e) { - Log.toLog(this.getClass().getName() + ":PlanViaVersionJoinListener", e); + Log.toLog(this.getClass().getName(), e); } } }); diff --git a/PlanPluginBridge/src/main/java/com/djrapitops/pluginbridge/plan/viaversion/ProtocolTable.java b/PlanPluginBridge/src/main/java/com/djrapitops/pluginbridge/plan/viaversion/ProtocolTable.java index e3aae8f92..3abdf690c 100644 --- a/PlanPluginBridge/src/main/java/com/djrapitops/pluginbridge/plan/viaversion/ProtocolTable.java +++ b/PlanPluginBridge/src/main/java/com/djrapitops/pluginbridge/plan/viaversion/ProtocolTable.java @@ -32,7 +32,7 @@ public class ProtocolTable extends Table { private final String columnProtocolVersion; public ProtocolTable(SQLDB db) { - super("plan_viaversion_protocol", db, db.isUsingMySQL()); + super("plan_version_protocol", db, db.isUsingMySQL()); columnUUID = "uuid"; columnProtocolVersion = "protocol_version"; }