cdf375ba80c902a1bf3e2d70d3680c64c5febbf3
gamestatus
Small Go library for querying game server status.
Current support:
- Minecraft Java
- Minecraft Bedrock
- Source / A2S servers
- Rust servers
- Counter-Strike 2 servers
- Valve/Source servers
The project is structured so other game protocols can be added later. Rust currently uses the same A2S-based transport layer as Source-style servers.
Features
- Java status ping
- Java full query
- Bedrock RakNet ping
- Bedrock full query
- Source A2S info
- Source A2S players and rules via full query
- Rust query via the same Source/A2S layer
- CS2 query via the same Source/A2S layer
- Valve query via the same Source/A2S layer
- Optional SRV lookup
- Simple MOTD cleanup helper
Install
go get github.com/VexoraDevelopment/gamestatus
CLI
The repository also ships a small CLI in cmd/gamestatus.
Build locally:
go build -o gamestatus ./cmd/gamestatus
Examples:
gamestatus mc.hypixel.net
gamestatus java -json mc.hypixel.net
gamestatus bedrock -query play.example.com:19132
gamestatus source 127.0.0.1:27015
gamestatus rust 127.0.0.1:28015
gamestatus cs2 127.0.0.1:27015
gamestatus valve 127.0.0.1:27015
gamestatus auto -pretty localhost
gamestatus java -motd-raw mc.hypixel.net
If you prefer prebuilt binaries, use the files attached to GitHub Releases.
Quick Start
package main
import (
"fmt"
"time"
"github.com/VexoraDevelopment/gamestatus"
)
func main() {
client := gamestatus.NewAll(3 * time.Second)
info, err := client.Java.Connect("hypixel.net", 25565)
if err != nil {
panic(err)
}
fmt.Println(info.Edition)
fmt.Println(info.Address, info.Port)
fmt.Println(info.Version)
fmt.Println(info.Online, "/", info.Slots)
fmt.Println(info.MOTD)
}
Packages
github.com/VexoraDevelopment/gamestatusgithub.com/VexoraDevelopment/gamestatus/javagithub.com/VexoraDevelopment/gamestatus/bedrockgithub.com/VexoraDevelopment/gamestatus/sourcegithub.com/VexoraDevelopment/gamestatus/text
Releases
Pushing a tag like v1.0.1 triggers GitHub Actions and publishes release archives for:
- Windows
- Linux
- macOS
using the gamestatus CLI binary from cmd/gamestatus.
Notes
ServerInfois a plain struct and can be stored however you want.
Description
Languages
Go
100%