Add login debug option
This commit is contained in:
parent
39aaa8a292
commit
509826949d
@ -71,6 +71,10 @@ public class BukkitListener implements Listener {
|
|||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (plugin.getConfiguration().get(ConfigKeys.DEBUG_LOGINS)) {
|
||||||
|
plugin.getLog().info("Processing pre-login for " + e.getUniqueId() + " - " + e.getName());
|
||||||
|
}
|
||||||
|
|
||||||
/* there was an issue connecting to the DB, performing file i/o, etc.
|
/* there was an issue connecting to the DB, performing file i/o, etc.
|
||||||
we don't let players join in this case, because it means they can connect to the server without their permissions data.
|
we don't let players join in this case, because it means they can connect to the server without their permissions data.
|
||||||
some server admins rely on negating perms to stop users from causing damage etc, so it's really important that
|
some server admins rely on negating perms to stop users from causing damage etc, so it's really important that
|
||||||
@ -139,6 +143,11 @@ public class BukkitListener implements Listener {
|
|||||||
At this point, the users data should be present and loaded. */
|
At this point, the users data should be present and loaded. */
|
||||||
|
|
||||||
final Player player = e.getPlayer();
|
final Player player = e.getPlayer();
|
||||||
|
|
||||||
|
if (plugin.getConfiguration().get(ConfigKeys.DEBUG_LOGINS)) {
|
||||||
|
plugin.getLog().info("Processing login for " + player.getUniqueId() + " - " + player.getName());
|
||||||
|
}
|
||||||
|
|
||||||
final User user = plugin.getUserManager().getIfLoaded(plugin.getUuidCache().getUUID(player.getUniqueId()));
|
final User user = plugin.getUserManager().getIfLoaded(plugin.getUuidCache().getUUID(player.getUniqueId()));
|
||||||
|
|
||||||
/* User instance is null for whatever reason. Could be that it was unloaded between asyncpre and now. */
|
/* User instance is null for whatever reason. Could be that it was unloaded between asyncpre and now. */
|
||||||
|
@ -70,6 +70,10 @@ use-server-uuids: true
|
|||||||
# in the LuckPerms cache.
|
# in the LuckPerms cache.
|
||||||
use-server-uuid-cache: false
|
use-server-uuid-cache: false
|
||||||
|
|
||||||
|
# If LuckPerms should produce extra logging output when it handles logins.
|
||||||
|
# Useful if you're having issues with UUID forwarding or data not being loaded.
|
||||||
|
debug-logins: false
|
||||||
|
|
||||||
# If the plugin should send log notifications to users whenever permissions are modified.
|
# If the plugin should send log notifications to users whenever permissions are modified.
|
||||||
log-notify: true
|
log-notify: true
|
||||||
|
|
||||||
|
@ -70,6 +70,10 @@ public class BungeeListener implements Listener {
|
|||||||
|
|
||||||
final PendingConnection c = e.getConnection();
|
final PendingConnection c = e.getConnection();
|
||||||
|
|
||||||
|
if (plugin.getConfiguration().get(ConfigKeys.DEBUG_LOGINS)) {
|
||||||
|
plugin.getLog().info("Processing pre-login for " + c.getUniqueId() + " - " + c.getName());
|
||||||
|
}
|
||||||
|
|
||||||
/* there was an issue connecting to the DB, performing file i/o, etc.
|
/* there was an issue connecting to the DB, performing file i/o, etc.
|
||||||
as this is bungeecord, we will still allow the login, as players can't really do much harm without permissions data.
|
as this is bungeecord, we will still allow the login, as players can't really do much harm without permissions data.
|
||||||
the proxy will just fallback to using the config file perms. */
|
the proxy will just fallback to using the config file perms. */
|
||||||
@ -118,6 +122,10 @@ public class BungeeListener implements Listener {
|
|||||||
final ProxiedPlayer player = e.getPlayer();
|
final ProxiedPlayer player = e.getPlayer();
|
||||||
final User user = plugin.getUserManager().getIfLoaded(plugin.getUuidCache().getUUID(e.getPlayer().getUniqueId()));
|
final User user = plugin.getUserManager().getIfLoaded(plugin.getUuidCache().getUUID(e.getPlayer().getUniqueId()));
|
||||||
|
|
||||||
|
if (plugin.getConfiguration().get(ConfigKeys.DEBUG_LOGINS)) {
|
||||||
|
plugin.getLog().info("Processing post-login for " + player.getUniqueId() + " - " + player.getName());
|
||||||
|
}
|
||||||
|
|
||||||
if (user == null) {
|
if (user == null) {
|
||||||
plugin.getProxy().getScheduler().schedule(plugin, () -> {
|
plugin.getProxy().getScheduler().schedule(plugin, () -> {
|
||||||
if (!player.isConnected()) {
|
if (!player.isConnected()) {
|
||||||
|
@ -73,6 +73,10 @@ use-server-uuids: true
|
|||||||
# try to find a uuid for a username using RedisBungee, if installed.
|
# try to find a uuid for a username using RedisBungee, if installed.
|
||||||
use-server-uuid-cache: false
|
use-server-uuid-cache: false
|
||||||
|
|
||||||
|
# If LuckPerms should produce extra logging output when it handles logins.
|
||||||
|
# Useful if you're having issues with UUID forwarding or data not being loaded.
|
||||||
|
debug-logins: false
|
||||||
|
|
||||||
# If the plugin should send log notifications to users whenever permissions are modified.
|
# If the plugin should send log notifications to users whenever permissions are modified.
|
||||||
log-notify: true
|
log-notify: true
|
||||||
|
|
||||||
|
@ -122,6 +122,11 @@ public class ConfigKeys {
|
|||||||
*/
|
*/
|
||||||
public static final ConfigKey<Boolean> USE_SERVER_UUID_CACHE = BooleanKey.of("use-server-uuid-cache", false);
|
public static final ConfigKey<Boolean> USE_SERVER_UUID_CACHE = BooleanKey.of("use-server-uuid-cache", false);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If LuckPerms should produce extra logging output when it handles logins.
|
||||||
|
*/
|
||||||
|
public static final ConfigKey<Boolean> DEBUG_LOGINS = BooleanKey.of("debug-logins", false);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Controls how temporary add commands should behave
|
* Controls how temporary add commands should behave
|
||||||
*/
|
*/
|
||||||
|
@ -29,6 +29,7 @@ import lombok.RequiredArgsConstructor;
|
|||||||
|
|
||||||
import me.lucko.luckperms.api.caching.UserData;
|
import me.lucko.luckperms.api.caching.UserData;
|
||||||
import me.lucko.luckperms.api.context.MutableContextSet;
|
import me.lucko.luckperms.api.context.MutableContextSet;
|
||||||
|
import me.lucko.luckperms.common.config.ConfigKeys;
|
||||||
import me.lucko.luckperms.common.locale.Message;
|
import me.lucko.luckperms.common.locale.Message;
|
||||||
import me.lucko.luckperms.common.model.User;
|
import me.lucko.luckperms.common.model.User;
|
||||||
import me.lucko.luckperms.common.utils.LoginHelper;
|
import me.lucko.luckperms.common.utils.LoginHelper;
|
||||||
@ -72,6 +73,10 @@ public class SpongeListener {
|
|||||||
|
|
||||||
final GameProfile p = e.getProfile();
|
final GameProfile p = e.getProfile();
|
||||||
|
|
||||||
|
if (plugin.getConfiguration().get(ConfigKeys.DEBUG_LOGINS)) {
|
||||||
|
plugin.getLog().info("Processing auth event for " + p.getUniqueId() + " - " + p.getName());
|
||||||
|
}
|
||||||
|
|
||||||
/* either the plugin hasn't finished starting yet, or there was an issue connecting to the DB, performing file i/o, etc.
|
/* either the plugin hasn't finished starting yet, or there was an issue connecting to the DB, performing file i/o, etc.
|
||||||
we don't let players join in this case, because it means they can connect to the server without their permissions data.
|
we don't let players join in this case, because it means they can connect to the server without their permissions data.
|
||||||
some server admins rely on negating perms to stop users from causing damage etc, so it's really important that
|
some server admins rely on negating perms to stop users from causing damage etc, so it's really important that
|
||||||
@ -142,6 +147,10 @@ public class SpongeListener {
|
|||||||
|
|
||||||
final GameProfile player = e.getProfile();
|
final GameProfile player = e.getProfile();
|
||||||
|
|
||||||
|
if (plugin.getConfiguration().get(ConfigKeys.DEBUG_LOGINS)) {
|
||||||
|
plugin.getLog().info("Processing login event for " + player.getUniqueId() + " - " + player.getName());
|
||||||
|
}
|
||||||
|
|
||||||
final User user = plugin.getUserManager().getIfLoaded(plugin.getUuidCache().getUUID(player.getUniqueId()));
|
final User user = plugin.getUserManager().getIfLoaded(plugin.getUuidCache().getUUID(player.getUniqueId()));
|
||||||
|
|
||||||
/* User instance is null for whatever reason. Could be that it was unloaded between asyncpre and now. */
|
/* User instance is null for whatever reason. Could be that it was unloaded between asyncpre and now. */
|
||||||
|
@ -69,6 +69,10 @@ use-server-uuids=true
|
|||||||
# in the LuckPerms cache.
|
# in the LuckPerms cache.
|
||||||
use-server-uuid-cache=false
|
use-server-uuid-cache=false
|
||||||
|
|
||||||
|
# If LuckPerms should produce extra logging output when it handles logins.
|
||||||
|
# Useful if you're having issues with UUID forwarding or data not being loaded.
|
||||||
|
debug-logins=false
|
||||||
|
|
||||||
# If the plugin should send log notifications to users whenever permissions are modified.
|
# If the plugin should send log notifications to users whenever permissions are modified.
|
||||||
log-notify=true
|
log-notify=true
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user