Skip to content

Networking#45

Open
KuSpa wants to merge 2 commits into
mainfrom
networking
Open

Networking#45
KuSpa wants to merge 2 commits into
mainfrom
networking

Conversation

@KuSpa

@KuSpa KuSpa commented Aug 22, 2021

Copy link
Copy Markdown
Owner

Client turn

  • start turn (triggered by servermessage NewState(State))
  • render
  • wait command
  • send command Place(Which, Position, Rotation, Mirror, SelfID)
  • receive server event Place(PlayerID, Which, Position, Rotation, Mirror) (PlayerID is own id)
  • render
  • post turn idle -- wait for other players (get Place events for other players)

Server turn

  • start turn send event NewState(State)
  • wait and acknowledge all Place commands (if not ok help client recover)
  • if all are finished: NewState(State)

Events:

C -> S

  • Place(Which, Position, Rotation, Mirror, SelfID)
  • Connect(PlayerName)

S -> C

  • Place(PlayerID, Which, Position, Rotation, Mirror)
  • NewState(State)
  • ConnectOK(PlayerID, DefaultGrid)
  • ConnectPlayer(PlayerID, Grid)
pub enum State{
	NewCard(Card),
	Score(Scorings), 
	EndGame,
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant