-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathprotocol_description.txt
34 lines (30 loc) · 1.7 KB
/
protocol_description.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
Protocol description:
Packet format
ServerPacket:
A ServerPacket is a packet comming from the server -> client
It contains:
crc: a crc of the message The crc has not been implemented yeet. It is always set to 45
offset: A offset number to the data starting at 0 when the connection is initiated.
recivedoffset: The last offset the clinet sent to the server. Used to determine if there has been packetloss.
commado: a number describing the purpose of the packet
1,3 & 4 are for sending and reciving data.
2 is for reciving a session id.
4 is the server saying there is more data to retrive on the server.
5 is used to indicate server error
data: where the data part of the packet is.
ClientPacket
A ClientPacket is a packet comming crom the client -> server
It is very simmilar to the ServerPacket the main diffrenace is the sessionId.
It contains:
crc: a crc of the message The crc has not been implemented yeet. It is always set to 45
sessionId: used to identify which client sent the message
offset: A offset number to the data starting at 0 when the connection is initiated.
recivedoffset: The last offset the server sent to the client. Used to determine if there has been packetloss.
commado: a number describing the purpose of the packet
1,3 & 4 are for sending and reciving data.
2 is for requesting a session id.
4 is the server saying there is more data to retrive on the server.
5 is used to indicate client error
data: where the data part of the packet is.
As the client starts it will ask the server for a sessionId. For the rest of the session it will use the sessionId that it recived from the server to identify itself.
When it has recived it's sessionId it will start to poll the server for data.