Starlight-30036225 / ChessTCP

FILLMELATER
0 stars 0 forks source link

Define Packet headers #2

Closed Starlight-30036225 closed 7 months ago

Starlight-30036225 commented 8 months ago

I need to define which packet headers will be used in communication between server and client.

Starlight-30036225 commented 8 months ago

The best way to decide which packet headers are important is by writing out the game loop.

Two players enter a lobby

Game starts, both players are sent the initial game state (Board state packet)

Player 1 (White) is sent a prompt packet to tell them its their turn

Player 1 selects a piece (Select piece packet)

Server returns all possible moves (Possible moves packet)

Player 1 makes a move (Move packet)

Server updates both players on the state of the board (Board state packet)

Server sends player 2 a prompt packet

Loops until there is a checkmate or stalemate likely sent as part of board state.

Starlight-30036225 commented 8 months ago

A packet header for new connections will give a chance for usernames to be sent to the server and shared. While this version of the game will not include usernames, I will include the functionality

Starlight-30036225 commented 8 months ago

image This is the packetheader.java file so far, I will leave this issue open for a while and comment each of these enums.