util

package
v0.0.35 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2025 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"`
	// ClientDecode is a list of client packet identifiers that need to be decoded by the proxy.
	ClientDecode []uint32
	// 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"`
	// ShutdownMessage is the message displayed to clients when Spectrum shuts down.
	ShutdownMessage string `yaml:"shutdown_message"`
	// SyncProtocol determines the protocol version the proxy should use when communicating with servers.
	// When enabled, the proxy uses the client's protocol version (minecraft.Protocol) for reading and
	// writing packets. If disabled, the proxy defaults to using the latest protocol version (minecraft.DefaultProtocol).
	SyncProtocol bool `yaml:"sync_protocol"`
	// 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