added server event enum
This commit is contained in:
@@ -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;
|
||||||
|
|
||||||
|
|||||||
20
server/src/server_event.rs
Normal file
20
server/src/server_event.rs
Normal 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),
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user