feat: uggly leaderboard
All checks were successful
Linux arm64 / Build (push) Successful in 27s

This commit is contained in:
2025-01-31 13:48:51 +01:00
parent 25c2270a37
commit a160042ef4
12 changed files with 61 additions and 14 deletions

View File

@@ -22,6 +22,8 @@ public class Client {
public final Signal onClosed = new Signal();
public final Signal onGameStarted = new Signal();
Player player;
String disconnectReason = null;
public Client(String address, short port) throws UnknownHostException, IOException {
@@ -70,4 +72,8 @@ public class Client {
}
}
public Player getPlayer() {
return player;
}
}

View File

@@ -21,7 +21,6 @@ import sudoku.io.SudokuSerializer;
public class ClientConnexion extends Connexion {
private final Client client;
private Player player = null;
public ClientConnexion(String address, short port, Client client) throws UnknownHostException, IOException {
super(new Socket(address, port));
@@ -38,7 +37,7 @@ public class ClientConnexion extends Connexion {
@Override
public void visitPacket(ConnexionInfoPacket packet) {
this.player = this.client.getGame().getPlayerById(packet.getConnectionId());
this.client.player = this.client.getGame().getPlayerById(packet.getConnectionId());
client.onConnect.emit();
}