After a lobby starts, a new match is started.
Each match consists of a number of boards which equals to the total number of players in the match.
Players executes an input (move, rotate, drop, etc), client-side board interprets it, then client sends the command to the server, which also interprets it.
Each move is sent to all players in the match to replicate the board's state so a player sees other's boards.
Server-side simulation is needed to guarantee game consistency, e.g. a player cheats and modifies his game client, which makes pieces move and rotate freely ignoring current board state.
If a move results in an error:
|
pub fn hard_drop(&mut self) -> Result<MoveResult, BoardErrorReason> { |
or the board is dead:
then the player has lost the match.
Also, all attacks are going through the server and it calculates outgoing garbage and selects a player to send the garbage to.
Subtasks:
After a lobby starts, a new match is started.
Each match consists of a number of boards which equals to the total number of players in the match.
Players executes an input (move, rotate, drop, etc), client-side board interprets it, then client sends the command to the server, which also interprets it.
Each move is sent to all players in the match to replicate the board's state so a player sees other's boards.
Server-side simulation is needed to guarantee game consistency, e.g. a player cheats and modifies his game client, which makes pieces move and rotate freely ignoring current board state.
If a move results in an error:
Quader/src/engine/src/board.rs
Line 181 in c552734
or the board is dead:
Quader/src/engine/src/board.rs
Line 30 in c552734
then the player has lost the match.
Also, all attacks are going through the server and it calculates outgoing garbage and selects a player to send the garbage to.
Subtasks: