Skip to content
WoozyMastaPublic

About

A lightweight, dependency-free Go toolkit for BattlEye RCon: client, server, resilient multi-server connections, and typed game response parsers.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

bercon

bercon is a Go client and server for the BattlEye RCon protocol. It handles UDP framing, authentication, response assembly, and reconnects using only the Go standard library. See the protocol specification.

Use it for a single administrative client, a service polling many game servers, or a controlled RCon endpoint for integration tests. Each managed target has an independent authenticated client and UDP socket.

  • Client and fleet: bercon sends RCon commands, receives server messages, and supervises connections to multiple servers.
  • Server: bercon/server accepts RCon commands and sends server messages through a reusable UDP endpoint.
  • Response parsers: bercon/parser provides shared parser errors and groups parsers by response format.
  • BattlEye config: bercon/beconfig reads server settings and locates BattlEye configuration files.

Install

go get github.com/woozymasta/bercon

Minimal client

Pass the RCon address as host:port and provide the password. This example runs players and prints the response:

ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)
defer cancel()

client, err := bercon.Dial(
    ctx, "127.0.0.1:2305", os.Getenv("BERCON_PASSWORD"), nil,
)
if err != nil {
    return err
}
defer func() { _ = client.Close() }()

response, err := client.Command(ctx, "players")
if err != nil {
    return err
}
fmt.Println(string(response))

Important behavior

  • Fleet retries unavailable targets with jittered backoff. Retries continue until Fleet.Run's context is canceled, unless ExpireAfter is set.
  • Commands are sent once. If cancellation or timeout occurs after transmission, ErrCommandOutcomeUnknown means the server may still execute the command.

About

A lightweight, dependency-free Go toolkit for BattlEye RCon: client, server, resilient multi-server connections, and typed game response parsers.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages