/
handshaking.go
48 lines (40 loc) · 961 Bytes
/
handshaking.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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package minecraftgo
// CLIENT
type Handshake struct {
Version VarInt
Address String
Port uint16
Next VarInt
}
// SERVER
type PingResponse struct {
Description PingText `json:"description"`
Players PingPlayers `json:"players"`
Version PingVersionInfo `json:"version"`
Favicon string `json:"favicon"`
ModInfo PingModInfo `json:"modinfo,omitempty"`
}
type PingText struct {
Text string `json:"text"`
}
type PingPlayers struct {
Max int `json:"max"`
Online int `json:"online"`
Sample []PingPlayer `json:"sample"`
}
type PingPlayer struct {
ID string `json:"id"`
Name string `json:"name"`
}
type PingVersionInfo struct {
Name string `json:"name"`
Protocol int `json:"protocol"`
}
type PingModInfo struct {
Type string `json:"type"`
ModList []PingMod `json:"modList"`
}
type PingMod struct {
ModID string `json:"modid"`
Version string `json:"version"`
}