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

View File

@ -658,11 +658,11 @@ public abstract class PermissionHolder {
} }
public static Map<String, Boolean> exportToLegacy(Set<Node> nodes) { 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) { for (Node node : nodes) {
m.put(node.toSerializedNode(), node.getValue()); m.put(node.toSerializedNode(), node.getValue());
} }
return m.build(); return m;
} }
private static Node.Builder buildNode(String permission) { 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) { public boolean loadUser(UUID uuid, String username) {
User user = plugin.getUserManager().getOrMake(UserIdentifier.of(uuid, username)); User user = plugin.getUserManager().getOrMake(UserIdentifier.of(uuid, username));
user.getIoLock().lock(); user.getIoLock().lock();
plugin.getLog().info("#loadUser for: " + user.getName());
try { try {
return call(() -> { return call(() -> {
File userFile = new File(usersDir, uuid.toString() + ".json"); File userFile = new File(usersDir, uuid.toString() + ".json");
@ -140,7 +139,6 @@ public class JSONDatastore extends FlatfileDatastore {
} }
}, false); }, false);
} finally { } finally {
plugin.getLog().info("#loadUser finished for: " + user.getName());
user.getIoLock().unlock(); user.getIoLock().unlock();
} }
} }
@ -148,7 +146,6 @@ public class JSONDatastore extends FlatfileDatastore {
@Override @Override
public boolean saveUser(User user) { public boolean saveUser(User user) {
user.getIoLock().lock(); user.getIoLock().lock();
plugin.getLog().info("#saveUser for: " + user.getName());
try { try {
return call(() -> { return call(() -> {
File userFile = new File(usersDir, user.getUuid().toString() + ".json"); File userFile = new File(usersDir, user.getUuid().toString() + ".json");
@ -176,7 +173,6 @@ public class JSONDatastore extends FlatfileDatastore {
writer.name("perms"); writer.name("perms");
writer.beginObject(); writer.beginObject();
for (Map.Entry<String, Boolean> e : exportToLegacy(user.getNodes()).entrySet()) { 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.name(e.getKey()).value(e.getValue().booleanValue());
} }
writer.endObject(); writer.endObject();
@ -185,7 +181,6 @@ public class JSONDatastore extends FlatfileDatastore {
}); });
}, false); }, false);
} finally { } finally {
plugin.getLog().info("#saveUser ended for: " + user.getName());
user.getIoLock().unlock(); user.getIoLock().unlock();
} }
} }