basic multiplayer
Some checks failed
Linux arm64 / Build (push) Failing after 5m3s

This commit is contained in:
2025-01-26 18:53:45 +01:00
parent 6658b0e884
commit df07f11a9c
11 changed files with 149 additions and 20 deletions

View File

@@ -12,6 +12,8 @@ import network.protocol.packets.KeepAlivePacket;
import network.protocol.packets.LoginPacket;
import network.protocol.packets.PlayerJoinPacket;
import network.protocol.packets.PlayerLeavePacket;
import network.protocol.packets.StartGamePacket;
import sudoku.io.SudokuSerializer;
public class ClientConnexion extends Connexion {
@@ -65,4 +67,10 @@ public class ClientConnexion extends Connexion {
this.client.getGame().removePlayer(packet.getPlayer());
}
@Override
public void visitPacket(StartGamePacket packet) {
this.client.getGame().startGame(SudokuSerializer.deserializeSudoku(packet.getSerializedSudoku()));
this.client.onGameStarted.emit();
}
}