go-svrquery

module
v1.7.2 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2026 License: BSD-2-Clause

README

go-svrquery Go Report Card License GoDoc Build Status

go-svrquery is a Go client for talking to game servers using various query protocols.

Features

  • Support for various game server query protocol's including: ** SQP, TF2E

Installation

go get -u github.com/multiplay/go-svrquery

Examples

Using go-svrquery is simple just create a client and then send commands e.g.

package main

import (
	"log"
	"time"

	"github.com/multiplay/go-svrquery/lib/svrquery"
)

func main() {
	c, err := svrquery.NewClient("tf2e", "192.168.1.102:10011")
	if err != nil {
		log.Fatal(err)
	}
	defer c.Close()

	r, err := c.Query()
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("%#v\n", r)
}

CLI

A cli is available in github releases and also at https://github.com/multiplay/go-svrquery/tree/master/cmd/cli

This enables you make queries to servers using the specified protocol, and returns the response in pretty json.

Client
./go-svrquery -addr localhost:12121 -proto sqp
{
        "version": 1,
        "address": "localhost:12121",
        "server_info": {
                "current_players": 1,
                "max_players": 2,
                "server_name": "Name",
                "game_type": "Game Type",
                "build_id": "",
                "map": "Map",
                "port": 1000
        }
}
Example Server

This tool also provides the ability to start a very basic sample server using a given protocol.

Currently, only sqp is supported

./go-svrquery -server :12121 -proto sqp
Starting sample server using protocol sqp on :12121

Documentation

License

go-svrquery is available under the BSD 2-Clause License.

Directories

Path Synopsis
cmd
cli command
lib
svrquery/common
Package common provides utilities that are common to query protocols such as binary decoding and error handling.
Package common provides utilities that are common to query protocols such as binary decoding and error handling.
svrquery/protocol
Package protocol provides a registry for all known protocols.
Package protocol provides a registry for all known protocols.
svrquery/protocol/all
Package all provides access to all available protocols.
Package all provides access to all available protocols.
svrquery/protocol/sqp
Package sqp provides the protocol implementation for the Unity Server Query Protocol.
Package sqp provides the protocol implementation for the Unity Server Query Protocol.
svrquery/protocol/titanfall
Package titanfall provides the protocol implementation for the titanfall series of games from Respawn.
Package titanfall provides the protocol implementation for the titanfall series of games from Respawn.

Jump to

Keyboard shortcuts

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