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
This commit is contained in:
Rsl1122 2017-12-16 12:43:44 +02:00
parent 598fdc5d72
commit b35d7abf53
5 changed files with 7 additions and 7 deletions

View File

@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>com.djrapitops</groupId> <groupId>com.djrapitops</groupId>
<artifactId>Plan</artifactId> <artifactId>Plan</artifactId>
<version>4.1.3</version> <version>4.1.3.2</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<repositories> <repositories>
<repository> <repository>

View File

@ -33,7 +33,7 @@ public class HackerTable extends Table {
private final String columnViolations; private final String columnViolations;
public HackerTable(SQLDB db) { public HackerTable(SQLDB db) {
super("plan_viaversion_protocol", db, db.isUsingMySQL()); super("plan_aac_hack_table", db, db.isUsingMySQL());
columnUUID = "uuid"; columnUUID = "uuid";
columnDate = "date"; columnDate = "date";
columnHackType = "hack_type"; columnHackType = "hack_type";
@ -43,7 +43,7 @@ public class HackerTable extends Table {
@Override @Override
public void createTable() throws DBCreateTableException { public void createTable() throws DBCreateTableException {
createTable("CREATE TABLE IF NOT EXISTS " + tableName + " (" createTable("CREATE TABLE IF NOT EXISTS " + tableName + " ("
+ columnUUID + " varchar(36) NOT NULL UNIQUE, " + columnUUID + " varchar(36) NOT NULL, "
+ columnDate + " bigint NOT NULL, " + columnDate + " bigint NOT NULL, "
+ columnHackType + " varchar(100) NOT NULL, " + columnHackType + " varchar(100) NOT NULL, "
+ columnViolations + " integer NOT NULL" + columnViolations + " integer NOT NULL"
@ -107,7 +107,7 @@ public class HackerTable extends Table {
public void prepare(PreparedStatement statement) throws SQLException { public void prepare(PreparedStatement statement) throws SQLException {
statement.setString(1, hackObject.getUuid().toString()); statement.setString(1, hackObject.getUuid().toString());
statement.setLong(2, hackObject.getDate()); statement.setLong(2, hackObject.getDate());
statement.setString(3, hackObject.getHackType().getName()); statement.setString(3, hackObject.getHackType().name());
statement.setInt(4, hackObject.getViolationLevel()); statement.setInt(4, hackObject.getViolationLevel());
} }
}); });

View File

@ -50,7 +50,7 @@ public class PlayerHackKickListener implements Listener {
try { try {
new HackerTable((SQLDB) plan.getDB()).insertHackRow(hackObject); new HackerTable((SQLDB) plan.getDB()).insertHackRow(hackObject);
} catch (SQLException e) { } catch (SQLException e) {
Log.toLog(this.getClass().getName() + ":PlanViaVersionJoinListener", e); Log.toLog(this.getClass().getName(), e);
} }
} }
}); });

View File

@ -46,7 +46,7 @@ public class PlayerVersionListener implements Listener {
try { try {
new ProtocolTable((SQLDB) plan.getDB()).saveProtocolVersion(uuid, playerVersion); new ProtocolTable((SQLDB) plan.getDB()).saveProtocolVersion(uuid, playerVersion);
} catch (SQLException e) { } catch (SQLException e) {
Log.toLog(this.getClass().getName() + ":PlanViaVersionJoinListener", e); Log.toLog(this.getClass().getName(), e);
} }
} }
}); });

View File

@ -32,7 +32,7 @@ public class ProtocolTable extends Table {
private final String columnProtocolVersion; private final String columnProtocolVersion;
public ProtocolTable(SQLDB db) { public ProtocolTable(SQLDB db) {
super("plan_viaversion_protocol", db, db.isUsingMySQL()); super("plan_version_protocol", db, db.isUsingMySQL());
columnUUID = "uuid"; columnUUID = "uuid";
columnProtocolVersion = "protocol_version"; columnProtocolVersion = "protocol_version";
} }