Cleanup random debug messages

This commit is contained in:
Luck 2016-10-02 15:43:44 +01:00
parent 1b3b50c113
commit 3442372281
No known key found for this signature in database
GPG Key ID: EFA9B3EC5FD90F8B
3 changed files with 4 additions and 11 deletions

View File

@ -234,6 +234,7 @@ public class VaultPermissionHook extends Permission implements Runnable {
@Override
public boolean playerAddGroup(String world, @NonNull String player, @NonNull String groupName) {
log("Adding player " + player + " to group: '" + groupName + "' on world " + world + ", server " + server);
final User user = plugin.getUserManager().get(player);
if (user == null) return false;
@ -241,7 +242,6 @@ public class VaultPermissionHook extends Permission implements Runnable {
if (group == null) return false;
scheduleTask(() -> {
log("Adding player " + player + " to group: '" + groupName + "' on world " + world + ", server " + server); // todo move
try {
if (world != null && !world.equals("")) {
user.addGroup(group, server, world);
@ -256,6 +256,7 @@ public class VaultPermissionHook extends Permission implements Runnable {
@Override
public boolean playerRemoveGroup(String world, @NonNull String player, @NonNull String groupName) {
log("Removing player " + player + " from group: '" + groupName + "' on world " + world + ", server " + server);
final User user = plugin.getUserManager().get(player);
if (user == null) return false;
@ -263,8 +264,6 @@ public class VaultPermissionHook extends Permission implements Runnable {
if (group == null) return false;
scheduleTask(() -> {
log("Removing player " + player + " from group: '" + groupName + "' on world " + world + ", server " + server); // todo move
plugin.getLog().info("before: " + user.getNodes().toString());
try {
if (world != null && !world.equals("")) {
user.removeGroup(group, server, world);
@ -272,7 +271,6 @@ public class VaultPermissionHook extends Permission implements Runnable {
user.removeGroup(group, server);
}
} catch (ObjectLacksException ignored) {}
plugin.getLog().info("after: " + user.getNodes().toString());
save(user);
});
return true;

View File

@ -658,11 +658,11 @@ public abstract class PermissionHolder {
}
public static Map<String, Boolean> exportToLegacy(Set<Node> nodes) {
ImmutableMap.Builder<String, Boolean> m = ImmutableMap.builder();
Map<String, Boolean> m = new HashMap<>();
for (Node node : nodes) {
m.put(node.toSerializedNode(), node.getValue());
}
return m.build();
return m;
}
private static Node.Builder buildNode(String permission) {

View File

@ -79,7 +79,6 @@ public class JSONDatastore extends FlatfileDatastore {
public boolean loadUser(UUID uuid, String username) {
User user = plugin.getUserManager().getOrMake(UserIdentifier.of(uuid, username));
user.getIoLock().lock();
plugin.getLog().info("#loadUser for: " + user.getName());
try {
return call(() -> {
File userFile = new File(usersDir, uuid.toString() + ".json");
@ -140,7 +139,6 @@ public class JSONDatastore extends FlatfileDatastore {
}
}, false);
} finally {
plugin.getLog().info("#loadUser finished for: " + user.getName());
user.getIoLock().unlock();
}
}
@ -148,7 +146,6 @@ public class JSONDatastore extends FlatfileDatastore {
@Override
public boolean saveUser(User user) {
user.getIoLock().lock();
plugin.getLog().info("#saveUser for: " + user.getName());
try {
return call(() -> {
File userFile = new File(usersDir, user.getUuid().toString() + ".json");
@ -176,7 +173,6 @@ public class JSONDatastore extends FlatfileDatastore {
writer.name("perms");
writer.beginObject();
for (Map.Entry<String, Boolean> e : exportToLegacy(user.getNodes()).entrySet()) {
plugin.getLog().info("entry: " + e.toString());
writer.name(e.getKey()).value(e.getValue().booleanValue());
}
writer.endObject();
@ -185,7 +181,6 @@ public class JSONDatastore extends FlatfileDatastore {
});
}, false);
} finally {
plugin.getLog().info("#saveUser ended for: " + user.getName());
user.getIoLock().unlock();
}
}