misc cleanup
This commit is contained in:
parent
1707f333bf
commit
e8c0c43e9d
@ -66,6 +66,7 @@ class BukkitListener extends AbstractListener implements Listener {
|
||||
deniedAsyncLogin.add(e.getUniqueId());
|
||||
|
||||
// The datastore is disabled, prevent players from joining the server
|
||||
plugin.getLog().warn("The plugin storage is not loaded. Denying connection from: " + e.getUniqueId() + " - " + e.getName());
|
||||
e.disallow(AsyncPlayerPreLoginEvent.Result.KICK_OTHER, Message.LOADING_ERROR.toString());
|
||||
return;
|
||||
}
|
||||
@ -81,9 +82,8 @@ class BukkitListener extends AbstractListener implements Listener {
|
||||
return;
|
||||
}
|
||||
|
||||
// Login event was cancelled by another plugin
|
||||
if (plugin.isStarted() && plugin.getStorage().isAcceptingLogins() && e.getLoginResult() != AsyncPlayerPreLoginEvent.Result.ALLOWED) {
|
||||
|
||||
// Login event was cancelled by another plugin
|
||||
onLeave(e.getUniqueId());
|
||||
}
|
||||
}
|
||||
@ -102,6 +102,7 @@ class BukkitListener extends AbstractListener implements Listener {
|
||||
deniedLogin.add(e.getPlayer().getUniqueId());
|
||||
|
||||
// User wasn't loaded for whatever reason.
|
||||
plugin.getLog().warn("User " + player.getUniqueId() + " - " + player.getName() + " could not be loaded. - denying login.");
|
||||
e.disallow(PlayerLoginEvent.Result.KICK_OTHER, Message.LOADING_ERROR.toString());
|
||||
return;
|
||||
}
|
||||
|
@ -66,7 +66,6 @@ import java.util.function.Consumer;
|
||||
|
||||
import static me.lucko.luckperms.common.constants.Permission.MIGRATION;
|
||||
|
||||
|
||||
public class MigrationPowerfulPerms extends SubCommand<Object> {
|
||||
private static Method getPlayerPermissionsMethod = null;
|
||||
private static Method getPlayerGroupsMethod = null;
|
||||
|
@ -3,4 +3,3 @@ version: ${release.version}.${patch.version}
|
||||
description: A permissions plugin
|
||||
author: Luck
|
||||
main: me.lucko.luckperms.bungee.LPBungeePlugin
|
||||
softdepends: [PowerfulPerms] # For migration
|
||||
|
@ -44,6 +44,7 @@ import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
@ -129,25 +130,32 @@ public class ExportCommand extends SingleCommand {
|
||||
// Export tracks
|
||||
log.log("Starting track export.");
|
||||
|
||||
// Create the actual tracks first
|
||||
write(writer, "# Create tracks");
|
||||
for (Track track : plugin.getTrackManager().getAll().values()) {
|
||||
write(writer, "/luckperms createtrack " + track.getName());
|
||||
}
|
||||
Collection<? extends Track> tracks = plugin.getTrackManager().getAll().values();
|
||||
if (!tracks.isEmpty()) {
|
||||
|
||||
AtomicInteger trackCount = new AtomicInteger(0);
|
||||
for (Track track : plugin.getTrackManager().getAll().values()) {
|
||||
write(writer, "# Export track: " + track.getName());
|
||||
for (String group : track.getGroups()) {
|
||||
write(writer, "/luckperms track " + track.getName() + " append " + group);
|
||||
// Create the actual tracks first
|
||||
write(writer, "# Create tracks");
|
||||
for (Track track : tracks) {
|
||||
write(writer, "/luckperms createtrack " + track.getName());
|
||||
}
|
||||
write(writer, "");
|
||||
log.logAllProgress("Exported {} tracks so far.", trackCount.incrementAndGet());
|
||||
}
|
||||
log.log("Exported " + trackCount.get() + " tracks.");
|
||||
|
||||
write(writer, "");
|
||||
write(writer, "");
|
||||
write(writer, "");
|
||||
|
||||
AtomicInteger trackCount = new AtomicInteger(0);
|
||||
for (Track track : plugin.getTrackManager().getAll().values()) {
|
||||
write(writer, "# Export track: " + track.getName());
|
||||
for (String group : track.getGroups()) {
|
||||
write(writer, "/luckperms track " + track.getName() + " append " + group);
|
||||
}
|
||||
write(writer, "");
|
||||
log.logAllProgress("Exported {} tracks so far.", trackCount.incrementAndGet());
|
||||
}
|
||||
|
||||
write(writer, "");
|
||||
write(writer, "");
|
||||
}
|
||||
|
||||
log.log("Exported " + tracks.size() + " tracks.");
|
||||
|
||||
// Export users
|
||||
log.log("Starting user export. Finding a list of unique users to export.");
|
||||
|
@ -81,6 +81,7 @@ public class Importer {
|
||||
this.notify = ImmutableSet.of(executor, commandManager.getPlugin().getConsoleSender());
|
||||
}
|
||||
this.commands = commands.stream()
|
||||
.map(String::trim)
|
||||
.filter(s -> !s.isEmpty())
|
||||
.filter(s -> !s.startsWith("#"))
|
||||
.filter(s -> !s.startsWith("//"))
|
||||
|
@ -240,7 +240,7 @@ public class LPSpongePlugin implements LuckPermsPlugin {
|
||||
getLog().info("Registering commands...");
|
||||
CommandManager cmdService = game.getCommandManager();
|
||||
SpongeCommand commandManager = new SpongeCommand(this);
|
||||
cmdService.register(this, commandManager, "luckperms", "perms", "lp", "permissions", "p", "perm");
|
||||
cmdService.register(this, commandManager, "luckperms", "perms", "lp", "permissions", "perm");
|
||||
|
||||
// load internal managers
|
||||
getLog().info("Loading internal permission managers...");
|
||||
|
@ -46,6 +46,7 @@ import java.util.Set;
|
||||
public class MigrationUtils {
|
||||
|
||||
public static void migrateSubject(Subject subject, PermissionHolder holder, int priority) {
|
||||
|
||||
// Migrate permissions
|
||||
Map<Set<Context>, Map<String, Boolean>> perms = subject.getSubjectData().getAllPermissions();
|
||||
for (Map.Entry<Set<Context>, Map<String, Boolean>> e : perms.entrySet()) {
|
||||
@ -94,7 +95,6 @@ public class MigrationUtils {
|
||||
// Ignore. This is just so older versions of Sponge API can be used.
|
||||
}
|
||||
|
||||
|
||||
// Migrate parents
|
||||
Map<Set<Context>, List<Subject>> parents = subject.getSubjectData().getAllParents();
|
||||
for (Map.Entry<Set<Context>, List<Subject>> e : parents.entrySet()) {
|
||||
|
Loading…
Reference in New Issue
Block a user