Fixed: RMI 2.0?

This commit is contained in:
rubenpirreram
2026-05-17 18:17:38 +02:00
parent 4c3d9ac7b8
commit 9c2bbf1421
@@ -63,7 +63,7 @@ public class ClientLauncherTUI {
int networkType = scanner.nextInt(); int networkType = scanner.nextInt();
System.out.println("Insert server IP: "); System.out.println("Insert server IP: ");
String IP = scanner.next(); String IP = scanner.next();
System.setProperty("java.rmi.server.hostname", IP);
// RMI // RMI
if (networkType == 0) { if (networkType == 0) {
// Connect // Connect
@@ -73,6 +73,7 @@ public class ClientLauncherTUI {
} catch (Exception e) { } catch (Exception e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} }
System.setProperty("java.rmi.server.hostname", myIP);
RMIClient client = new RMIClient(controller, IP, 1099, myIP); RMIClient client = new RMIClient(controller, IP, 1099, myIP);
if (client.connect(username, proposedNumPlayers)) { if (client.connect(username, proposedNumPlayers)) {
System.out.println("Succesfully connected to RMI server\n\n"); System.out.println("Succesfully connected to RMI server\n\n");