mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-11-08 03:39:42 +01:00
[#1027] Patch broken 'plan_aac_hack_table's
This commit is contained in:
parent
eb78468f01
commit
2a2e0e57a9
@ -64,6 +64,7 @@ public class AdvancedAntiCheatHook extends Hook {
|
||||
execute(HackerTable.createTableSQL(database.getType()));
|
||||
}
|
||||
});
|
||||
database.executeTransaction(new HackerTableMissingDateColumnPatch());
|
||||
|
||||
plugin.registerListener(new PlayerHackKickListener(database));
|
||||
hookHandler.addPluginDataSource(new AdvancedAntiCheatData(database, formatters.yearLong()));
|
||||
|
@ -51,6 +51,7 @@ public class HackerTable {
|
||||
return CreateTableParser.create(TABLE_NAME, dbType)
|
||||
.column(COL_ID, Sql.INT).primaryKey()
|
||||
.column(COL_UUID, Sql.varchar(36)).notNull()
|
||||
.column(COL_DATE, Sql.LONG).notNull()
|
||||
.column(COL_HACK_TYPE, Sql.varchar(100)).notNull()
|
||||
.column(COL_VIOLATION_LEVEL, Sql.INT).notNull()
|
||||
.build();
|
||||
|
@ -0,0 +1,40 @@
|
||||
/*
|
||||
* This file is part of Player Analytics (Plan).
|
||||
*
|
||||
* Plan is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License v3 as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Plan 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Plan. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.djrapitops.pluginbridge.plan.aac;
|
||||
|
||||
import com.djrapitops.plan.db.patches.Patch;
|
||||
|
||||
/**
|
||||
* Patch to fix a bug
|
||||
* https://github.com/plan-player-analytics/Plan/issues/1027
|
||||
* introduced in commit 530c4a2
|
||||
* https://github.com/plan-player-analytics/Plan/commit/530c4a2ea6fd56fd9a7aa3382f7571f31971dc1a#commitcomment-33415938
|
||||
*
|
||||
* @author Rsl1122
|
||||
*/
|
||||
public class HackerTableMissingDateColumnPatch extends Patch {
|
||||
|
||||
@Override
|
||||
public boolean hasBeenApplied() {
|
||||
return hasColumn(HackerTable.TABLE_NAME, HackerTable.COL_DATE);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void applyPatch() {
|
||||
addColumn(HackerTable.TABLE_NAME, HackerTable.COL_DATE + " bigint NOT NULL DEFAULT 0");
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user