-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathUDP Packets.txt
85 lines (73 loc) · 1.61 KB
/
UDP 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
UDP 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 UDP Packet Header:
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Packet Type (char) - 1 byte
Client -> Server TCP Packets:
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
1. Client Command (size >= 9):
Command Sequence Number (char)
Command Series Number (char)
Moves Count (char)
[ for each move
Move Direction (char)
Stealth (char)
fZ (float)
]
100. Handshake (size == 8):
Signature (SIGNATURE_SIZE = 8 char)
105. Time Request (size == 1):
Sequence Number (char)
11. Pong (size == 4):
Ping Data (4 char)
Server -> Client TCP Packets:
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
2. Server Update (size >= 1 + nPlayerCount):
cCurrentUpdateSequenceNumber (char)
[
active_player (char) = 1
cAckedCommandSequenceNumber (char)
fX (float)
fY (float)
fZ (float)
] else
[
active_player (char) = 0
]
3. Weapon Command (size == 9 | 10 | 13):
Action (char)
Time (double)
[ if (Action == WeaponSystem::FIRE)
fZ (float)
] else
[ if (Action == WeaponSystem::CHANGE_WEAPON)
Weapon Number (char)
]
4. Weapon Action (size == 10 | 11 | 14):
Player Id (char)
Action (char)
Time (double)
[ if (Action == WeaponSystem::FIRE)
fZ (float)
] else
[ if (Action == WeaponSystem::CHANGE_WEAPON)
Weapon Number (char)
]
106. Time Response (size == 9):
Sequence Number (char)
Time (double)
10. Ping (size == 4 + 2 * nPlayerCount):
Ping Data (4 char)
[ for each player
nLastLatency (short)
]
12. Pung (size == 12):
Ping Data (4 char)
Time (double)