From 3c63fde839dc2c893d172bdcb209b00190000e76 Mon Sep 17 00:00:00 2001 From: Fuzzlemann Date: Thu, 27 Jul 2017 13:09:08 +0200 Subject: [PATCH] Light reformat, map now really scales (Wasn't pushed last time) --- ...itops_abstract_plugin_framework_2_0_1.xml} | 8 +- .../commands/manage/ManageCleanCommand.java | 1 + .../commands/manage/ManageImportCommand.java | 1 + .../commands/manage/ManageMoveCommand.java | 4 + .../commands/manage/ManageRemoveCommand.java | 3 + .../commands/manage/ManageRestoreCommand.java | 7 + .../commands/webuser/WebListUsersCommand.java | 1 - .../data/cache/GeolocationCacheHandler.java | 2 - Plan/src/main/resources/analysis.html | 1982 ++++++++--------- 9 files changed, 946 insertions(+), 1063 deletions(-) rename .idea/libraries/{Maven__com_djrapitops_abstract_plugin_framework_2_0_0.xml => Maven__com_djrapitops_abstract_plugin_framework_2_0_1.xml} (67%) diff --git a/.idea/libraries/Maven__com_djrapitops_abstract_plugin_framework_2_0_0.xml b/.idea/libraries/Maven__com_djrapitops_abstract_plugin_framework_2_0_1.xml similarity index 67% rename from .idea/libraries/Maven__com_djrapitops_abstract_plugin_framework_2_0_0.xml rename to .idea/libraries/Maven__com_djrapitops_abstract_plugin_framework_2_0_1.xml index e90b3b519..826d210d1 100644 --- a/.idea/libraries/Maven__com_djrapitops_abstract_plugin_framework_2_0_0.xml +++ b/.idea/libraries/Maven__com_djrapitops_abstract_plugin_framework_2_0_1.xml @@ -1,13 +1,13 @@ - + - + - + - + \ No newline at end of file diff --git a/Plan/src/main/java/com/djrapitops/plan/command/commands/manage/ManageCleanCommand.java b/Plan/src/main/java/com/djrapitops/plan/command/commands/manage/ManageCleanCommand.java index 4da62da1a..d529912f8 100644 --- a/Plan/src/main/java/com/djrapitops/plan/command/commands/manage/ManageCleanCommand.java +++ b/Plan/src/main/java/com/djrapitops/plan/command/commands/manage/ManageCleanCommand.java @@ -39,6 +39,7 @@ public class ManageCleanCommand extends SubCommand { if (!Check.isTrue(args.length != 0, Phrase.COMMAND_REQUIRES_ARGUMENTS_ONE.toString(), sender)) { return true; } + String dbName = args[0].toLowerCase(); boolean isCorrectDB = "sqlite".equals(dbName) || "mysql".equals(dbName); diff --git a/Plan/src/main/java/com/djrapitops/plan/command/commands/manage/ManageImportCommand.java b/Plan/src/main/java/com/djrapitops/plan/command/commands/manage/ManageImportCommand.java index c9dd9dadd..5ac186290 100644 --- a/Plan/src/main/java/com/djrapitops/plan/command/commands/manage/ManageImportCommand.java +++ b/Plan/src/main/java/com/djrapitops/plan/command/commands/manage/ManageImportCommand.java @@ -58,6 +58,7 @@ public class ManageImportCommand extends SubCommand { if (!Check.isTrue(importPlugins.keySet().contains(importFromPlugin), Phrase.MANAGE_ERROR_INCORRECT_PLUGIN + importFromPlugin, sender)) { return true; } + if (!Check.isTrue(ImportUtils.isPluginEnabled(importFromPlugin), Phrase.MANAGE_ERROR_PLUGIN_NOT_ENABLED + importFromPlugin, sender)) { return true; } diff --git a/Plan/src/main/java/com/djrapitops/plan/command/commands/manage/ManageMoveCommand.java b/Plan/src/main/java/com/djrapitops/plan/command/commands/manage/ManageMoveCommand.java index 45e4c7d9a..ffec8a003 100644 --- a/Plan/src/main/java/com/djrapitops/plan/command/commands/manage/ManageMoveCommand.java +++ b/Plan/src/main/java/com/djrapitops/plan/command/commands/manage/ManageMoveCommand.java @@ -58,9 +58,11 @@ public class ManageMoveCommand extends SubCommand { if (!Check.isTrue(isCorrectDB, Phrase.MANAGE_ERROR_INCORRECT_DB + toDB, sender)) { return true; } + if (!Check.isTrue(!Verify.equalsIgnoreCase(fromDB, toDB), Phrase.MANAGE_ERROR_SAME_DB.toString(), sender)) { return true; } + if (!Check.isTrue(Verify.contains("-a", args), Phrase.COMMAND_ADD_CONFIRMATION_ARGUMENT.parse(Phrase.WARN_REMOVE.parse(args[1])), sender)) { return true; } @@ -92,7 +94,9 @@ public class ManageMoveCommand extends SubCommand { if (Check.isTrue(Verify.isEmpty(uuids), Phrase.MANAGE_ERROR_NO_PLAYERS + " (" + fromDatabase.getName() + ")", sender)) { return; } + sender.sendMessage(Phrase.MANAGE_PROCESS_START.parse()); + if (ManageUtils.clearAndCopy(toDatabase, fromDatabase, uuids)) { sender.sendMessage(Phrase.MANAGE_MOVE_SUCCESS + ""); boolean movedToCurrentDatabase = Verify.equalsIgnoreCase(toDatabase.getConfigName(), plugin.getDB().getConfigName()); diff --git a/Plan/src/main/java/com/djrapitops/plan/command/commands/manage/ManageRemoveCommand.java b/Plan/src/main/java/com/djrapitops/plan/command/commands/manage/ManageRemoveCommand.java index a66b6cc52..e5796468e 100644 --- a/Plan/src/main/java/com/djrapitops/plan/command/commands/manage/ManageRemoveCommand.java +++ b/Plan/src/main/java/com/djrapitops/plan/command/commands/manage/ManageRemoveCommand.java @@ -56,13 +56,16 @@ public class ManageRemoveCommand extends SubCommand { try { UUID uuid = UUIDUtility.getUUIDOf(playerName); String message = Phrase.USERNAME_NOT_VALID.toString(); + if (!Check.isTrue(Verify.notNull(uuid), message, sender)) { return; } + message = Phrase.USERNAME_NOT_KNOWN.toString(); if (!Check.isTrue(plugin.getDB().wasSeenBefore(uuid), message, sender)) { return; } + message = Phrase.COMMAND_ADD_CONFIRMATION_ARGUMENT.parse(Phrase.WARN_REMOVE.parse(plugin.getDB().getConfigName())); if (!Check.isTrue(Verify.contains("-a", args), message, sender)) { return; diff --git a/Plan/src/main/java/com/djrapitops/plan/command/commands/manage/ManageRestoreCommand.java b/Plan/src/main/java/com/djrapitops/plan/command/commands/manage/ManageRestoreCommand.java index 3ef71609f..671809b8f 100644 --- a/Plan/src/main/java/com/djrapitops/plan/command/commands/manage/ManageRestoreCommand.java +++ b/Plan/src/main/java/com/djrapitops/plan/command/commands/manage/ManageRestoreCommand.java @@ -44,12 +44,14 @@ public class ManageRestoreCommand extends SubCommand { if (!Check.isTrue(args.length >= 2, Phrase.COMMAND_REQUIRES_ARGUMENTS.parse(Phrase.USE_RESTORE.toString()), sender)) { return true; } + String db = args[1].toLowerCase(); boolean isCorrectDB = "sqlite".equals(db) || "mysql".equals(db); if (!Check.isTrue(isCorrectDB, Phrase.MANAGE_ERROR_INCORRECT_DB + db, sender)) { return true; } + if (!Check.isTrue(Verify.contains("-a", args), Phrase.COMMAND_ADD_CONFIRMATION_ARGUMENT.parse(Phrase.WARN_REWRITE.parse(args[1])), sender)) { return true; } @@ -81,20 +83,25 @@ public class ManageRestoreCommand extends SubCommand { if (containsDBFileExtension) { backupDBName = backupDBName.replace(".db", ""); } + SQLiteDB backupDB = new SQLiteDB(plugin, backupDBName); if (!backupDB.init()) { sender.sendMessage(Phrase.MANAGE_DATABASE_FAILURE.toString()); return; } + sender.sendMessage(Phrase.MANAGE_PROCESS_START.parse()); + final Collection uuids = ManageUtils.getUUIDS(backupDB); if (!Check.isTrue(!Verify.isEmpty(uuids), Phrase.MANAGE_ERROR_NO_PLAYERS + " (" + backupDBName + ")", sender)) { return; } + if (ManageUtils.clearAndCopy(database, backupDB, uuids)) { if (database.getConfigName().equals(plugin.getDB().getConfigName())) { plugin.getHandler().getCommandUseFromDb(); } + sender.sendMessage(Phrase.MANAGE_COPY_SUCCESS.toString()); } else { sender.sendMessage(Phrase.MANAGE_PROCESS_FAIL.toString()); diff --git a/Plan/src/main/java/com/djrapitops/plan/command/commands/webuser/WebListUsersCommand.java b/Plan/src/main/java/com/djrapitops/plan/command/commands/webuser/WebListUsersCommand.java index 1a2a98d60..c34f18b19 100644 --- a/Plan/src/main/java/com/djrapitops/plan/command/commands/webuser/WebListUsersCommand.java +++ b/Plan/src/main/java/com/djrapitops/plan/command/commands/webuser/WebListUsersCommand.java @@ -37,7 +37,6 @@ public class WebListUsersCommand extends SubCommand { try { ColorScheme cs = plugin.getColorScheme(); String mCol = cs.getMainColor(); - String sCol = cs.getSecondaryColor(); List users = plugin.getDB().getSecurityTable().getUsers(); users.sort(new WebUserComparator()); sender.sendMessage(Phrase.CMD_FOOTER.parse() + mCol + " WebUsers (" + users.size() + ")"); diff --git a/Plan/src/main/java/com/djrapitops/plan/data/cache/GeolocationCacheHandler.java b/Plan/src/main/java/com/djrapitops/plan/data/cache/GeolocationCacheHandler.java index 1f9b5a453..f4a7fe0ce 100644 --- a/Plan/src/main/java/com/djrapitops/plan/data/cache/GeolocationCacheHandler.java +++ b/Plan/src/main/java/com/djrapitops/plan/data/cache/GeolocationCacheHandler.java @@ -87,7 +87,5 @@ public class GeolocationCacheHandler { } finally { Benchmark.stop("getUncachedCountry"); } - } - } diff --git a/Plan/src/main/resources/analysis.html b/Plan/src/main/resources/analysis.html index dccc7e5a7..3f4ed8e43 100644 --- a/Plan/src/main/resources/analysis.html +++ b/Plan/src/main/resources/analysis.html @@ -9,274 +9,274 @@ @@ -688,9 +688,6 @@ -
- -
@@ -715,10 +712,6 @@
-
- -

If CPU Graph displays '-1' CPU usage is not available for this platform.

-
@@ -832,50 +825,50 @@
- - - - - - - - + + + + + + - \ No newline at end of file + \ No newline at end of file