mirror of
https://github.com/GeyserMC/Floodgate.git
synced 2025-12-19 14:59:20 +00:00
Fixes #303 and changed some metrics
This commit is contained in:
@@ -90,6 +90,10 @@ public final class LinkAccountCommand implements FloodgateCommand {
|
||||
return;
|
||||
}
|
||||
|
||||
ProfileAudience targetUser = context.get("player");
|
||||
// allowUuid is false so username cannot be null
|
||||
String targetName = targetUser.username();
|
||||
|
||||
// when the player is a Bedrock player
|
||||
if (api.isFloodgatePlayer(sender.uuid())) {
|
||||
if (!context.contains("code")) {
|
||||
@@ -97,8 +101,6 @@ public final class LinkAccountCommand implements FloodgateCommand {
|
||||
return;
|
||||
}
|
||||
|
||||
UserAudience targetUser = context.get("player");
|
||||
String targetName = targetUser.username();
|
||||
String code = context.get("code");
|
||||
|
||||
link.verifyLinkRequest(sender.uuid(), targetName, sender.username(), code)
|
||||
@@ -137,9 +139,6 @@ public final class LinkAccountCommand implements FloodgateCommand {
|
||||
return;
|
||||
}
|
||||
|
||||
ProfileAudience targetUser = context.get("player");
|
||||
String targetName = targetUser.username();
|
||||
|
||||
link.createLinkRequest(sender.uuid(), sender.username(), targetName)
|
||||
.whenComplete((result, throwable) -> {
|
||||
if (throwable != null || result == LinkRequestResult.UNKNOWN_ERROR) {
|
||||
|
||||
@@ -81,8 +81,8 @@ public final class Metrics {
|
||||
String categoryName = category + " - " + (category + 4);
|
||||
|
||||
return Collections.singletonMap(
|
||||
categoryName,
|
||||
Collections.singletonMap(implementationName, 1)
|
||||
implementationName,
|
||||
Collections.singletonMap(categoryName, 1)
|
||||
);
|
||||
})
|
||||
);
|
||||
@@ -106,8 +106,8 @@ public final class Metrics {
|
||||
new DrilldownPie("minecraft_version", () -> {
|
||||
// e.g.: 1.16.5 => (Spigot, 1)
|
||||
return Collections.singletonMap(
|
||||
platformUtils.minecraftVersion(),
|
||||
Collections.singletonMap(implementationName, 1)
|
||||
implementationName,
|
||||
Collections.singletonMap(platformUtils.minecraftVersion(), 1)
|
||||
);
|
||||
})
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user