Help us shape the future of Go! Take the 2026 Go Developer Survey

go-mindustry-ping

module
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 5, 2026 License: MIT

README

go-mindustry-ping v1.0.2

Go Mindustry Ping - command-line tool to query and display information about a Mindustry server without any external dependency.

CLI Usage

# Windows usage example
$ go-mindustry-ping --host 121.127.37.17 --refresh 5000

# Linux & MacOS usage examples
$ ./go-mindustry-ping --host 121.127.37.17 --refresh 5000
  • --host <host> - server host; (Default: 127.0.0.1)
  • --port <port> - server port; (Default: 6567)
  • --raw - show fields as-is (without formatting); (Default: false)
  • --refresh <ms> - refresh interval, in ms (0 - no refresh); (Default: 0)
  • --indent <size> - indent size; (Default: 3)
  • --no-ansi - prevent printing ANSI-codes; (Default: false)

Example of CLI usage

Direct API Usage

package main

import (
	"log"
	"time"

	"github.com/altwine/go-mindustry-ping/pkg/serverinfo"
)

func main() {
	si, err := serverinfo.GetServerInfo("omnidustry.ru", 6567)
	if err != nil {
		log.Fatalf("Error fetching server info: %v", err)
	}
	log.Printf("%d players are playing on the omnidustry server right now!", si.Players)

	// Wait for 5 seconds before updating server info
	time.Sleep(5 * time.Second)

	if err := si.Update(); err != nil {
		log.Fatalf("Error updating server info: %v", err)
	}
	log.Printf("%d players are playing on the omnidustry server 5 seconds later!", si.Players)
}

Building

  1. Install required tools: Go compiler
  2. Run build.sh v1.0.2 in the scripts directory.
  3. Find binaries in the build directory.

Plans

This project is essentially done. No further plans, only bug fixes.

License

MIT. See the LICENSE file.

Directories

Path Synopsis
cmd
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL