feat(multiplayer): more logs.

This commit is contained in:
huanghongxun
2021-10-12 14:03:46 +08:00
parent 04a68d0b95
commit 28278c091d
2 changed files with 5 additions and 1 deletions

View File

@@ -92,6 +92,8 @@ public final class MultiplayerManager {
throw new IllegalStateException("Cato file not found");
}
LOG.info(String.format("Joining session (token=%s,version=%s,sessionName=%s,peer=%s,mode=%s,remotePort=%d,localPort=%d)", token, version, sessionName, peer, mode, remotePort, localPort));
return CompletableFuture.completedFuture(null).thenComposeAsync(unused -> {
if (!isPortAvailable(3478)) {
throw new CatoAlreadyStartedException();
@@ -186,6 +188,8 @@ public final class MultiplayerManager {
throw new CatoAlreadyStartedException();
}
LOG.info(String.format("Creating session (token=%s,sessionName=%s,gamePort=%d)", token, sessionName, gamePort));
MultiplayerServer server = new MultiplayerServer(gamePort, allowAllJoinRequests);
server.startServer();

View File

@@ -129,7 +129,7 @@ public class MultiplayerPage extends DecoratorAnimatedPage implements DecoratorP
private void testNAT() {
Task.supplyAsync(() -> {
FastDiscoveryTest tester = new FastDiscoveryTest(null, 0, "stun.qq.com", 3478);
FastDiscoveryTest tester = new FastDiscoveryTest(null, 0, "stun.stunprotocol.org", 3478);
return tester.test();
}).whenComplete(Schedulers.javafx(), (info, exception) -> {
LOG.log(Level.INFO, "Nat test result " + MultiplayerPageSkin.getNATType(info), exception);