This commit is contained in:
Clément
2025-03-13 10:03:26 +01:00
parent a4c5d3f67b
commit eee63cc5c6
2 changed files with 4 additions and 4 deletions

View File

@@ -53,7 +53,7 @@ public class ClientGuiController implements ClientListener {
@FXML @FXML
public void initialize() throws SocketException { public void initialize() throws SocketException {
client = new Client(new InetSocketAddress("localhost", 6665), this, UsernameSingleton.getInstance().getUsername()); client = new Client(new InetSocketAddress("192.168.163.131", 6665), this, UsernameSingleton.getInstance().getUsername());
Platform.runLater(() -> { Platform.runLater(() -> {
Stage stage = (Stage) vueContainer.getScene().getWindow(); Stage stage = (Stage) vueContainer.getScene().getWindow();
stage.setResizable(true); // Fixed a bug that made the close button disappear under my Wayland setup (don't know if it's the same for x11) stage.setResizable(true); // Fixed a bug that made the close button disappear under my Wayland setup (don't know if it's the same for x11)
@@ -71,7 +71,7 @@ public class ClientGuiController implements ClientListener {
* Request the list of rooms from the server every second. * Request the list of rooms from the server every second.
*/ */
private void requestRoomsRegularly() { private void requestRoomsRegularly() {
Timeline timeline = new Timeline(new KeyFrame(Duration.seconds(1), event -> client.RequestRoomList())); Timeline timeline = new Timeline(new KeyFrame(Duration.seconds(10), event -> client.RequestRoomList()));
timeline.setCycleCount(Timeline.INDEFINITE); timeline.setCycleCount(Timeline.INDEFINITE);
timeline.play(); timeline.play();
} }

View File

@@ -25,7 +25,7 @@ public class PacketPool {
private static int MAX_SEND_TRY = 50; private static int MAX_SEND_TRY = 50;
private static long SEND_DELAY = 10; private static long SEND_DELAY = 10;
private static long RETRY_INTERVAL = SEND_DELAY * 2; private static long RETRY_INTERVAL = SEND_DELAY * 2;
private static float PACKET_LOSS_PROBABILITY = 0.0f; private static float PACKET_LOSS_PROBABILITY = 0.1f;
private static record ReliablePacketAddress(ReliablePacket packet, InetSocketAddress address) { private static record ReliablePacketAddress(ReliablePacket packet, InetSocketAddress address) {
@Override @Override
@@ -97,7 +97,7 @@ public class PacketPool {
} }
private void debugPrint(String msg) { private void debugPrint(String msg) {
System.out.println(msg); // System.out.println(msg);
} }
private void debugSend(ReliablePacket packet, InetSocketAddress address) { private void debugSend(ReliablePacket packet, InetSocketAddress address) {