-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathTCP Packets.txt
100 lines (82 loc) · 1.97 KB
/
TCP Packets.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
TCP Packets
===========
Data Types:
¯¯¯¯¯¯¯¯¯¯¯
char - char, 1 byte
short - short int, 2 bytes
int - int, 4 bytes
float - float, 4 bytes
double - double, 8 bytes
Common TCP Packet Header:
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Packet Length in Bytes (short) - 2 bytes
Packet Type (char) - 1 bytes
----------------------------------------
Total TCP Packet Header Length - 3 bytes
Client -> Server TCP Packets:
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
1. Join Server Request (size == 18 + SIGNATURE_SIZE):
Version (short) = 1
Passphrase (16 char) = "somerandompass01"
Signature (SIGNATURE_SIZE = 8 char)
7. Entered Game Notification (size == 0):
Empty
10. Send Text Message (size >= 1):
Message (* char)
27. Join Team Request (size == 1 {+ 1}):
{ Player Number (char) }
Team (char)
30. Local Player Info (size >= 4):
Name Length (char)
Name (* char)
Command Rate (char)
Update Rate (char)
Server -> Client TCP Packets:
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
2. Join Server Accept (size == 2):
Your Player Id (char)
TotalPlayerCount (char)
3. Join Server Refuse (size == 1):
Refuse Reason (char)
5. UDP Connection Established (size == 0):
Empty
6. Enter Game Permission (size == 0):
Empty
11. Broadcast Text Message (size >= 2):
Player Id (char)
Message (* char)
20. Load Level (size >= 1):
Level Filename (* char)
21. Current Players Info (size >= nPlayerCount):
[
Name Length (char) >= 1
Name (* char)
Team (char)
[ if (Team != 2)
Last Command Sequence Number (char)
fX (float)
fY (float)
fZ (float)
]
] else
[
Name Length (char) = 0
]
25. Player Joined Server (size >= 3):
Player Id (char)
Name Length (char)
Name (* char)
26. Player Left Server (size == 1):
Player Id (char)
28. Player Joined Team (size >= 2):
Player Id (char)
Team (char)
[ if (Team != 2)
Last Command Sequence Number (char)
fX (float)
fY (float)
fZ (float)
]
40. Player Was Hit (size == 5):
Player Id (char)
Health Given (float)