-
Notifications
You must be signed in to change notification settings - Fork 6
/
status.go
75 lines (64 loc) · 2.2 KB
/
status.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
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
package response
import (
"time"
"github.com/mcstatus-io/mcutil/description"
)
type JavaStatus struct {
Version Version `json:"version"`
Players Players `json:"players"`
MOTD description.Formatting `json:"motd"`
Favicon *string `json:"favicon"`
SRVResult *SRVRecord `json:"srv_result"`
ModInfo *ModInfo `json:"mod_info"`
Latency time.Duration `json:"-"`
}
type Players struct {
Max *int64 `json:"max"`
Online *int64 `json:"online"`
Sample []SamplePlayer `json:"sample"`
}
type SamplePlayer struct {
ID string `json:"id"`
NameRaw string `json:"name_raw"`
NameClean string `json:"name_clean"`
NameHTML string `json:"name_html"`
}
type ModInfo struct {
Type string `json:"type"`
Mods []Mod `json:"mods"`
}
type Mod struct {
ID string `json:"id"`
Version string `json:"version"`
}
type Version struct {
NameRaw string `json:"name_raw"`
NameClean string `json:"name_clean"`
NameHTML string `json:"name_html"`
Protocol int64 `json:"protocol"`
}
type JavaStatusLegacy struct {
Version *Version `json:"version"`
Players LegacyPlayers `json:"players"`
MOTD description.Formatting `json:"motd"`
SRVResult *SRVRecord `json:"srv_result"`
}
type LegacyPlayers struct {
Online int64 `json:"online"`
Max int64 `json:"max"`
}
type BedrockStatus struct {
ServerGUID int64 `json:"server_guid"`
Edition *string `json:"edition"`
MOTD *description.Formatting `json:"motd"`
ProtocolVersion *int64 `json:"protocol_version"`
Version *string `json:"version"`
OnlinePlayers *int64 `json:"online_players"`
MaxPlayers *int64 `json:"max_players"`
ServerID *string `json:"server_id"`
Gamemode *string `json:"gamemode"`
GamemodeID *int64 `json:"gamemode_id"`
PortIPv4 *uint16 `json:"port_ipv4"`
PortIPv6 *uint16 `json:"port_ipv6"`
SRVResult *SRVRecord `json:"srv_result"`
}