-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsize.go
26 lines (21 loc) · 805 Bytes
/
size.go
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
package grcon
// size of a packet or a field.
type size int32
// Sizes of the individual fields.
// https://developer.valvesoftware.com/wiki/Source_RCON_Protocol#Basic_Packet_Structure
const (
sizeField size = 4
idField size = 4
typeField size = 4
minBodyField size = 1
endField size = 1
)
// MinPacket contains all fields except the size field.
// https://developer.valvesoftware.com/wiki/Source_RCON_Protocol#Packet_Size
const MinPacket size = idField + typeField + minBodyField + endField
// MaxPacket of a request/response packet.
// This size does not include the size field.
// https://developer.valvesoftware.com/wiki/Source_RCON_Protocol#Packet_Size
const MaxPacket size = 4096
// MaxBody is the maximal size of the packet body.
const MaxBody size = MaxPacket - MinPacket