added server event enum

This commit is contained in:
2025-11-12 14:01:13 +01:00
parent d8861b66b2
commit 73624baf90
2 changed files with 21 additions and 0 deletions

View File

@@ -9,6 +9,7 @@ use uuid::Uuid;
mod broadcast_message; mod broadcast_message;
mod handle_connection; mod handle_connection;
mod server_event;
use handle_connection::handle_connection; use handle_connection::handle_connection;

View File

@@ -0,0 +1,20 @@
use uuid::Uuid;
struct Step {
from: String,
to: String,
}
enum ServerEvent {
PlayerJoined(Uuid), //tarolja el a kapcsolatot
PlayerLeft(Uuid), //torolje a jatekos a listabol mert kilepett
PlayerJoinedQeue(Uuid), //online jatekra var
PlayerJoinedMatch(Uuid), //player joined a match
PlayerRequestAvailableSteps(Uuid, String), //string board
PlayerSteps(Uuid, Step), //player moves piece
CheckWinner(Uuid, String), //player asks server if they won
PlayerIsInCheck(Uuid, String), //board state
PlayerOpponentUpdateUI(Uuid, String), //board state
PlayerLost(Uuid),
PlayerReturnToMenu(Uuid),
}