HoverEX utilizes the ClanNetSession system to organize the network stuff. The main thing that it uses is the “channel” system to split data of different type into different “channel”. This allows easy coding and organising of network transfer. HoverEX also utilizes ClanLib’s advance NetStream system for easy communication protocol between server and client under circumstances like Handshakes and file transfers.
Since HoverEX requires a very precise no lag network game play, a very close precise timesync is required. Hence, a time synchonization technique is used to estimate the server time.
: Describe the Diagram more thoughroughly
Bellow is a reference of what was described above.
http://www.mine-control.com/zack/timesync/timesync.html
Bellow are a list of Protocol planned (WIP):
Using CL_NetStream to do handshake
Channel name: handshake
Client: Server:
1. Connect to server (CL_NetSession) ----> Receive connection
2. Checks client limit
3. Receive success/failure <---- Returns true(bool8) if can connect else false
4. If false(bool8) then break If false then disconnect client and break
5. Send player name ----> Receive player name and push it into client list
6. Receive lobby status <---- Send lobby status
player-id uint8 // this is the id that is assigned to the client by server
player count int8
<loop>
player-n-id uint8
player-n-name string
player-n-team uint8
</loop>
7. Get map filename <---- Send map filename (string)
8a. If map exist [0(int8)] ----> Get client status (0 : has map, 1 : no map, can't download, 2 : no map, want download)
8b. If map doesn't exist and download
map not implemented.
Tell server no map ----> Get client status (0 : has map, 1 : no map, can't download, 2 : no map, want download)
and not downloading map [1(int8)]
8c. If map doesn't exist and download
map implemented
Tell server no map ----> Get client status (0 : has map, 1 : no map, can't download, 2 : no map, want download)
and want to download [2(int8)]
9a. break If 0 break
9b. break If 1 disconnect client and break
9c. begin downloading map <---- If 2 Send mapdata
Using CL_NetComputer reliable send (tcp)
Channel name: chat
Client: Server:
1. Send message to server (string) ----> Receive message
3. Receive message from server <---- Send message to all client : user_id(uint8), message(string)
4. Display message to screen
Using CL_NetComputer reliable send (tcp)
Channel name: team_state
Client: Server:
1. Send which team to change to (int8) ----> Receive message
2. If not changable, break
3. Receive state change <---- Send state change to all client
player-id uint8
player-team uint8
4. Refresh team state
Using CL_NetComputer reliable send (tcp)
Channel name: user_ready
Client: Server:
1. Send ready toggle signal [1(int8)] ----> Receive message
2. Toggle client ready state and do other nessesity checks
3. Receive ready state <---- Send ready state to all client
player-id uint8
player-ready bool8
4. Refresh ready state
Using CL_NetComputer reliable send (tcp)
Channel name: chat (for sending countdown message use)
Channel name: game_state
Client: Server:
1. When all clients are in ready state, start countdown
2. Receive message from server <---- For every 1000ms interval, send countdown message to all clients (string)
3. If not all in ready state, stop countdown
4. Receive start game signal <---- When coundown reach 0, send start game signal [1(int8)]