Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
b463d38e66 | |||
b34986d594 | |||
20478e3c1f | |||
049ab265d3 | |||
71cddf0aca |
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,3 +1,4 @@
|
|||||||
mcstatus
|
mcstatus
|
||||||
|
mcstatus.exe
|
||||||
run.sh
|
run.sh
|
||||||
go.sum
|
go.sum
|
5
Makefile
5
Makefile
@ -22,6 +22,9 @@ clean:
|
|||||||
go clean
|
go clean
|
||||||
|
|
||||||
proto:
|
proto:
|
||||||
protoc --go_out=/home/michael/go/src response.proto
|
protoc \
|
||||||
|
--proto_path=/usr/local/include/google/protobuf \
|
||||||
|
--proto_path=protobuf/ \
|
||||||
|
--go_out=$(GOPATH)/src protobuf/*.proto
|
||||||
|
|
||||||
.PHONY: run doc build debs update-debs fmt proto
|
.PHONY: run doc build debs update-debs fmt proto
|
@ -7,8 +7,8 @@ import (
|
|||||||
"strconv"
|
"strconv"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"git.0cd.xyz/michael/mcstatus/pb"
|
"git.0cd.xyz/michael/mcstatus/mcstatuspb"
|
||||||
"github.com/golang/protobuf/jsonpb"
|
"google.golang.org/protobuf/encoding/protojson"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Client TCP client
|
// Client TCP client
|
||||||
@ -37,12 +37,18 @@ func (client *Client) write() error {
|
|||||||
if err := client.Conn.SetWriteDeadline(time.Now().Add(10 * time.Second)); err != nil {
|
if err := client.Conn.SetWriteDeadline(time.Now().Add(10 * time.Second)); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
client.Conn.Write(handshake(client.Addr, client.Port, client.Version))
|
_, err := client.Conn.Write(handshake(client.Addr, client.Port, client.Version))
|
||||||
|
if err != nil {
|
||||||
|
if netErr, ok := err.(net.Error); ok && netErr.Timeout() {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (client *Client) read() (*pb.Response, error) {
|
func (client *Client) read() (*mcstatuspb.Response, error) {
|
||||||
var response pb.Response
|
var response mcstatuspb.Response
|
||||||
buf := make([]byte, 1024)
|
buf := make([]byte, 1024)
|
||||||
n, err := client.Conn.Read(buf)
|
n, err := client.Conn.Read(buf)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -54,8 +60,8 @@ func (client *Client) read() (*pb.Response, error) {
|
|||||||
b := bytes.Split(buf[:n], []byte("{"))
|
b := bytes.Split(buf[:n], []byte("{"))
|
||||||
ne := bytes.SplitAfterN(buf[:n], b[0], 2)
|
ne := bytes.SplitAfterN(buf[:n], b[0], 2)
|
||||||
trim := bytes.TrimSuffix(ne[1], []byte("\x00"))
|
trim := bytes.TrimSuffix(ne[1], []byte("\x00"))
|
||||||
js := &jsonpb.Unmarshaler{AllowUnknownFields: true}
|
js := &protojson.UnmarshalOptions{DiscardUnknown: true}
|
||||||
if err := js.Unmarshal(bytes.NewBuffer(trim), &response); err != nil {
|
if err := js.Unmarshal(trim, &response); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return &response, nil
|
return &response, nil
|
||||||
|
@ -3,29 +3,29 @@ package client
|
|||||||
import (
|
import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"git.0cd.xyz/michael/mcstatus/pb"
|
"git.0cd.xyz/michael/mcstatus/mcstatuspb"
|
||||||
)
|
)
|
||||||
|
|
||||||
// GetStatus gets minecraft server status
|
// GetStatus gets minecraft server status
|
||||||
func (client *Client) GetStatus() (*pb.Response, error) {
|
func (client *Client) GetStatus() (*mcstatuspb.Response, error) {
|
||||||
for {
|
if err := client.write(); err != nil {
|
||||||
if err := client.write(); err != nil {
|
return nil, err
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
resp, err := client.read()
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return resp, nil
|
|
||||||
}
|
}
|
||||||
|
resp, err := client.read()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return resp, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// PingServer pings Minecraft server
|
// PingServer pings Minecraft server
|
||||||
func (client *Client) PingServer() time.Duration {
|
func (client *Client) PingServer() (time.Duration, error) {
|
||||||
ping := make([]byte, 1)
|
ping := make([]byte, 1)
|
||||||
start := time.Now()
|
start := time.Now()
|
||||||
client.Conn.Write([]byte{0x01, 0x00})
|
if _, err := client.Conn.Write([]byte{0x01, 0x00}); err != nil {
|
||||||
_, _ = client.Conn.Read(ping[:])
|
return 0, err
|
||||||
diff := time.Now().Sub(start)
|
}
|
||||||
return diff
|
client.Conn.Read(ping[:])
|
||||||
|
diff := time.Since(start)
|
||||||
|
return diff, nil
|
||||||
}
|
}
|
||||||
|
15
go.mod
15
go.mod
@ -3,6 +3,17 @@ module git.0cd.xyz/michael/mcstatus
|
|||||||
go 1.15
|
go 1.15
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/golang/protobuf v1.4.3
|
git.0cd.xyz/michael/toolbox v0.0.0-20220604033144-2bef86c689f1
|
||||||
google.golang.org/protobuf v1.25.0
|
github.com/gin-contrib/cors v1.3.1
|
||||||
|
github.com/gin-gonic/gin v1.8.1
|
||||||
|
github.com/go-playground/validator/v10 v10.11.0 // indirect
|
||||||
|
github.com/golang/protobuf v1.5.2 // indirect
|
||||||
|
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
||||||
|
github.com/pelletier/go-toml/v2 v2.0.2 // indirect
|
||||||
|
golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e // indirect
|
||||||
|
golang.org/x/net v0.0.0-20220621193019-9d032be2e588 // indirect
|
||||||
|
golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c // indirect
|
||||||
|
google.golang.org/protobuf v1.28.0
|
||||||
|
gopkg.in/go-playground/validator.v9 v9.31.0 // indirect
|
||||||
|
gopkg.in/yaml.v3 v3.0.1
|
||||||
)
|
)
|
||||||
|
29
main.go
29
main.go
@ -28,19 +28,27 @@ func run() error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if cmd.ping {
|
if cmd.ping {
|
||||||
fmt.Printf("Ping: %+v\n", client.PingServer())
|
ping, err := client.PingServer()
|
||||||
return nil
|
|
||||||
}
|
|
||||||
if cmd.raw {
|
|
||||||
json, err := json.MarshalIndent(&status, "", " ")
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
fmt.Printf("%s\n", string(json))
|
fmt.Printf("Ping: %+v\n", ping)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
if cmd.raw {
|
||||||
|
encoder := json.NewEncoder(os.Stdout)
|
||||||
|
encoder.SetIndent("", " ")
|
||||||
|
if err := encoder.Encode(status); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
name := status.Description.Text
|
||||||
|
if name == "" {
|
||||||
|
name = status.Description.Extra[0].Text
|
||||||
|
}
|
||||||
fmt.Printf("Name: %s\nPlayers: %d/%d\nVersion: %s\n",
|
fmt.Printf("Name: %s\nPlayers: %d/%d\nVersion: %s\n",
|
||||||
status.Description.Text,
|
name,
|
||||||
status.Players.Online,
|
status.Players.Online,
|
||||||
status.Players.Max,
|
status.Players.Max,
|
||||||
status.Version.Name)
|
status.Version.Name)
|
||||||
@ -50,7 +58,10 @@ func run() error {
|
|||||||
fmt.Printf("\t%s\n", player.Name)
|
fmt.Printf("\t%s\n", player.Name)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fmt.Printf("Ping: %+v\n", client.PingServer())
|
ping, err := client.PingServer()
|
||||||
return nil
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
fmt.Printf("Ping: %+v\n", ping)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-go v1.25.0-devel
|
// protoc-gen-go v1.28.0
|
||||||
// protoc v3.14.0
|
// protoc v3.21.1
|
||||||
// source: response.proto
|
// source: response.proto
|
||||||
|
|
||||||
package pb
|
package mcstatuspb
|
||||||
|
|
||||||
import (
|
import (
|
||||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||||
@ -370,42 +370,48 @@ var File_response_proto protoreflect.FileDescriptor
|
|||||||
|
|
||||||
var file_response_proto_rawDesc = []byte{
|
var file_response_proto_rawDesc = []byte{
|
||||||
0x0a, 0x0e, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
0x0a, 0x0e, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||||
0x12, 0x02, 0x70, 0x62, 0x22, 0x8a, 0x04, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
|
0x12, 0x11, 0x6d, 0x63, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||||
0x65, 0x12, 0x2e, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01,
|
0x62, 0x75, 0x66, 0x22, 0xd6, 0x04, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
|
||||||
0x28, 0x0b, 0x32, 0x14, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
|
0x12, 0x3d, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28,
|
||||||
0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f,
|
0x0b, 0x32, 0x23, 0x2e, 0x6d, 0x63, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f,
|
||||||
0x6e, 0x12, 0x2e, 0x0a, 0x07, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x01,
|
0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x56,
|
||||||
0x28, 0x0b, 0x32, 0x14, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
|
0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12,
|
||||||
0x2e, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x52, 0x07, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72,
|
0x3d, 0x0a, 0x07, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b,
|
||||||
0x73, 0x12, 0x3a, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e,
|
0x32, 0x23, 0x2e, 0x6d, 0x63, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
||||||
0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x73, 0x70,
|
0x6f, 0x62, 0x75, 0x66, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x50, 0x6c,
|
||||||
0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e,
|
0x61, 0x79, 0x65, 0x72, 0x73, 0x52, 0x07, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x12, 0x49,
|
||||||
0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a,
|
0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20,
|
||||||
0x07, 0x66, 0x61, 0x76, 0x69, 0x63, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07,
|
0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x6d, 0x63, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x70,
|
||||||
0x66, 0x61, 0x76, 0x69, 0x63, 0x6f, 0x6e, 0x1a, 0x39, 0x0a, 0x07, 0x56, 0x65, 0x72, 0x73, 0x69,
|
0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
|
||||||
0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
|
0x2e, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x64, 0x65,
|
||||||
0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63,
|
0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x66, 0x61, 0x76,
|
||||||
0x6f, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63,
|
0x69, 0x63, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x66, 0x61, 0x76, 0x69,
|
||||||
0x6f, 0x6c, 0x1a, 0x96, 0x01, 0x0a, 0x07, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x12, 0x10,
|
0x63, 0x6f, 0x6e, 0x1a, 0x39, 0x0a, 0x07, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x12,
|
||||||
0x0a, 0x03, 0x6d, 0x61, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6d, 0x61, 0x78,
|
0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61,
|
||||||
0x12, 0x16, 0x0a, 0x06, 0x6f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05,
|
0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x18, 0x02,
|
||||||
0x52, 0x06, 0x6f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x33, 0x0a, 0x06, 0x73, 0x61, 0x6d, 0x70,
|
0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x1a, 0xa5,
|
||||||
0x6c, 0x65, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x65,
|
0x01, 0x0a, 0x07, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x61,
|
||||||
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x2e, 0x53,
|
0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6d, 0x61, 0x78, 0x12, 0x16, 0x0a, 0x06,
|
||||||
0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x06, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x1a, 0x2c, 0x0a,
|
0x6f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x6f, 0x6e,
|
||||||
0x06, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18,
|
0x6c, 0x69, 0x6e, 0x65, 0x12, 0x42, 0x0a, 0x06, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x18, 0x03,
|
||||||
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69,
|
0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x6d, 0x63, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e,
|
||||||
0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x1a, 0x74, 0x0a, 0x0b, 0x44,
|
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
|
||||||
0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x34, 0x0a, 0x05, 0x65, 0x78,
|
0x65, 0x2e, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x2e, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65,
|
||||||
0x74, 0x72, 0x61, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x70, 0x62, 0x2e, 0x52,
|
0x52, 0x06, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x1a, 0x2c, 0x0a, 0x06, 0x53, 0x61, 0x6d, 0x70,
|
||||||
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74,
|
0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
|
||||||
0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x78, 0x74, 0x72, 0x61, 0x52, 0x05, 0x65, 0x78, 0x74, 0x72, 0x61,
|
0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01,
|
||||||
0x12, 0x12, 0x0a, 0x04, 0x74, 0x65, 0x78, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04,
|
0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x1a, 0x83, 0x01, 0x0a, 0x0b, 0x44, 0x65, 0x73, 0x63, 0x72,
|
||||||
0x74, 0x65, 0x78, 0x74, 0x1a, 0x1b, 0x0a, 0x05, 0x45, 0x78, 0x74, 0x72, 0x61, 0x12, 0x12, 0x0a,
|
0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x43, 0x0a, 0x05, 0x65, 0x78, 0x74, 0x72, 0x61, 0x18,
|
||||||
0x04, 0x74, 0x65, 0x78, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x65, 0x78,
|
0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x6d, 0x63, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73,
|
||||||
0x74, 0x42, 0x21, 0x5a, 0x1f, 0x67, 0x69, 0x74, 0x2e, 0x30, 0x63, 0x64, 0x2e, 0x78, 0x79, 0x7a,
|
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
|
||||||
0x2f, 0x6d, 0x69, 0x63, 0x68, 0x61, 0x65, 0x6c, 0x2f, 0x6d, 0x63, 0x73, 0x74, 0x61, 0x74, 0x75,
|
0x73, 0x65, 0x2e, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x45,
|
||||||
0x73, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
0x78, 0x74, 0x72, 0x61, 0x52, 0x05, 0x65, 0x78, 0x74, 0x72, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x74,
|
||||||
|
0x65, 0x78, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x65, 0x78, 0x74, 0x1a,
|
||||||
|
0x1b, 0x0a, 0x05, 0x45, 0x78, 0x74, 0x72, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x65, 0x78, 0x74,
|
||||||
|
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x65, 0x78, 0x74, 0x42, 0x29, 0x5a, 0x27,
|
||||||
|
0x67, 0x69, 0x74, 0x2e, 0x30, 0x63, 0x64, 0x2e, 0x78, 0x79, 0x7a, 0x2f, 0x6d, 0x69, 0x63, 0x68,
|
||||||
|
0x61, 0x65, 0x6c, 0x2f, 0x6d, 0x63, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2f, 0x6d, 0x63, 0x73,
|
||||||
|
0x74, 0x61, 0x74, 0x75, 0x73, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -422,19 +428,19 @@ func file_response_proto_rawDescGZIP() []byte {
|
|||||||
|
|
||||||
var file_response_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
|
var file_response_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
|
||||||
var file_response_proto_goTypes = []interface{}{
|
var file_response_proto_goTypes = []interface{}{
|
||||||
(*Response)(nil), // 0: pb.Response
|
(*Response)(nil), // 0: mcstatus.protobuf.Response
|
||||||
(*Response_Version)(nil), // 1: pb.Response.Version
|
(*Response_Version)(nil), // 1: mcstatus.protobuf.Response.Version
|
||||||
(*Response_Players)(nil), // 2: pb.Response.Players
|
(*Response_Players)(nil), // 2: mcstatus.protobuf.Response.Players
|
||||||
(*Response_Description)(nil), // 3: pb.Response.Description
|
(*Response_Description)(nil), // 3: mcstatus.protobuf.Response.Description
|
||||||
(*Response_Players_Sample)(nil), // 4: pb.Response.Players.Sample
|
(*Response_Players_Sample)(nil), // 4: mcstatus.protobuf.Response.Players.Sample
|
||||||
(*Response_Description_Extra)(nil), // 5: pb.Response.Description.Extra
|
(*Response_Description_Extra)(nil), // 5: mcstatus.protobuf.Response.Description.Extra
|
||||||
}
|
}
|
||||||
var file_response_proto_depIdxs = []int32{
|
var file_response_proto_depIdxs = []int32{
|
||||||
1, // 0: pb.Response.version:type_name -> pb.Response.Version
|
1, // 0: mcstatus.protobuf.Response.version:type_name -> mcstatus.protobuf.Response.Version
|
||||||
2, // 1: pb.Response.players:type_name -> pb.Response.Players
|
2, // 1: mcstatus.protobuf.Response.players:type_name -> mcstatus.protobuf.Response.Players
|
||||||
3, // 2: pb.Response.description:type_name -> pb.Response.Description
|
3, // 2: mcstatus.protobuf.Response.description:type_name -> mcstatus.protobuf.Response.Description
|
||||||
4, // 3: pb.Response.Players.sample:type_name -> pb.Response.Players.Sample
|
4, // 3: mcstatus.protobuf.Response.Players.sample:type_name -> mcstatus.protobuf.Response.Players.Sample
|
||||||
5, // 4: pb.Response.Description.extra:type_name -> pb.Response.Description.Extra
|
5, // 4: mcstatus.protobuf.Response.Description.extra:type_name -> mcstatus.protobuf.Response.Description.Extra
|
||||||
5, // [5:5] is the sub-list for method output_type
|
5, // [5:5] is the sub-list for method output_type
|
||||||
5, // [5:5] is the sub-list for method input_type
|
5, // [5:5] is the sub-list for method input_type
|
||||||
5, // [5:5] is the sub-list for extension type_name
|
5, // [5:5] is the sub-list for extension type_name
|
@ -1,8 +1,8 @@
|
|||||||
syntax="proto3";
|
syntax="proto3";
|
||||||
|
|
||||||
package pb;
|
package mcstatus.protobuf;
|
||||||
|
|
||||||
option go_package = "git.0cd.xyz/michael/mcstatus/pb";
|
option go_package = "git.0cd.xyz/michael/mcstatus/mcstatuspb";
|
||||||
|
|
||||||
message Response {
|
message Response {
|
||||||
message Version {
|
message Version {
|
Loading…
Reference in New Issue
Block a user