mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-04-06 18:10:29 +08:00
Light reformat, map now really scales (Wasn't pushed last time)
This commit is contained in:
parent
1e1180280b
commit
3c63fde839
@ -1,13 +1,13 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: com.djrapitops:abstract-plugin-framework:2.0.0">
|
||||
<library name="Maven: com.djrapitops:abstract-plugin-framework:2.0.1">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/djrapitops/abstract-plugin-framework/2.0.0/abstract-plugin-framework-2.0.0.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/djrapitops/abstract-plugin-framework/2.0.1/abstract-plugin-framework-2.0.1.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/djrapitops/abstract-plugin-framework/2.0.0/abstract-plugin-framework-2.0.0-javadoc.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/djrapitops/abstract-plugin-framework/2.0.1/abstract-plugin-framework-2.0.1-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/djrapitops/abstract-plugin-framework/2.0.0/abstract-plugin-framework-2.0.0-sources.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/djrapitops/abstract-plugin-framework/2.0.1/abstract-plugin-framework-2.0.1-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
@ -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);
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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());
|
||||
|
@ -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;
|
||||
|
@ -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<UUID> 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());
|
||||
|
@ -37,7 +37,6 @@ public class WebListUsersCommand extends SubCommand {
|
||||
try {
|
||||
ColorScheme cs = plugin.getColorScheme();
|
||||
String mCol = cs.getMainColor();
|
||||
String sCol = cs.getSecondaryColor();
|
||||
List<WebUser> users = plugin.getDB().getSecurityTable().getUsers();
|
||||
users.sort(new WebUserComparator());
|
||||
sender.sendMessage(Phrase.CMD_FOOTER.parse() + mCol + " WebUsers (" + users.size() + ")");
|
||||
|
@ -87,7 +87,5 @@ public class GeolocationCacheHandler {
|
||||
} finally {
|
||||
Benchmark.stop("getUncachedCountry");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user