3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-10-05 09:20:07 +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 Metrics metrics;
private GeyserConnector(PlatformType platformType, GeyserBootstrap bootstrap) { 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 ResourceLeakDetector.setLevel(ResourceLeakDetector.Level.DISABLED); // Can eat performance
} }

Datei anzeigen

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