3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-10-05 01:11:08 +02:00

Go back to normal thread for now using MSA auth, and only toggle leak detector on standalone

Dieser Commit ist enthalten in:
Redned 2021-07-18 17:41:47 -05:00 committet von RednedEpic
Ursprung ae4e4397e3
Commit 39324ce95d
2 geänderte Dateien mit 5 neuen und 8 gelöschten Zeilen

Datei anzeigen

@ -126,7 +126,7 @@ public class GeyserConnector {
private Metrics metrics;
private GeyserConnector(PlatformType platformType, GeyserBootstrap bootstrap) {
if (System.getProperty("io.netty.leakDetection.level") == null) {
if (platformType == PlatformType.STANDALONE && System.getProperty("io.netty.leakDetection.level") == null) {
ResourceLeakDetector.setLevel(ResourceLeakDetector.Level.DISABLED); // Can eat performance
}

Datei anzeigen

@ -609,10 +609,8 @@ public class GeyserSession implements CommandSender {
}
loggingIn = true;
// Use a future to prevent timeouts as all the authentication is handled sync
// This will be changed with the new protocol library.
CompletableFuture.supplyAsync(() -> {
// new thread so clients don't timeout
new Thread(() -> {
try {
MsaAuthenticationService msaAuthenticationService = new MsaAuthenticationService(GeyserConnector.OAUTH_CLIENT_ID);
@ -632,8 +630,7 @@ public class GeyserSession implements CommandSender {
} catch (RequestException ex) {
ex.printStackTrace();
}
return null;
}).whenComplete((aVoid, ex) -> connectDownstream());
}).start();
}
/**
@ -650,7 +647,7 @@ public class GeyserSession implements CommandSender {
connectDownstream();
} catch (RequestException e) {
if (!(e instanceof AuthPendingException)) {
e.printStackTrace();
throw new RuntimeException("Failed to log in with Microsoft code!", e);
} else {
// Wait one second before trying again
connector.getGeneralThreadPool().schedule(() -> attemptCodeAuthentication(msaAuthenticationService), 1, TimeUnit.SECONDS);