util

package
v0.0.23 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Opts

type Opts struct {
	// Addr is the address to listen on.
	Addr string `yaml:"addr"`
	// AutoLogin determines whether automatic login should be enabled.
	AutoLogin bool `yaml:"auto_login"`
	// LatencyInterval is the interval at which the latency of the connection is updated in milliseconds.
	// Lower intervals provide more accurate latency but use more bandwidth.
	LatencyInterval int64 `yaml:"latency_interval"`
	// Token is the authentication token that Spectrum uses to authenticate with servers.
	Token string `yaml:"token"`
}

Opts defines the configuration options for Spectrum.

func DefaultOpts

func DefaultOpts() *Opts

DefaultOpts returns the default configuration options for Spectrum.

type StatusProvider

type StatusProvider struct {
	// contains filtered or unexported fields
}

StatusProvider implements the minecraft.ServerStatusProvider interface. It provides server status information including the server name, sub-name, player count, and max players.

func NewStatusProvider

func NewStatusProvider(serverName string, serverSubName string) *StatusProvider

NewStatusProvider creates a new StatusProvider with the given server name and sub-name.

func (*StatusProvider) ServerStatus

func (s *StatusProvider) ServerStatus(playerCount int, maxPlayers int) minecraft.ServerStatus

ServerStatus ...

Jump to

Keyboard shortcuts

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