server

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2026 License: GPL-3.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

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

func New

func New(cfg *config.Config, logger *slog.Logger) (*Server, error)

func (*Server) BroadcastCreatePlayer added in v0.2.0

func (s *Server) BroadcastCreatePlayer(p *player.Player)

func (*Server) BroadcastProgressBar

func (s *Server) BroadcastProgressBar(entityID, capturingTeam uint8, rate int8, progress float32)

func (*Server) BroadcastShortPlayerData

func (s *Server) BroadcastShortPlayerData(p *player.Player)

func (*Server) BroadcastTerritoryCapture

func (s *Server) BroadcastTerritoryCapture(playerID, entityID, winning, state uint8)

func (*Server) CancelVote

func (s *Server) CancelVote(p *player.Player) error

func (*Server) CastVote

func (s *Server) CastVote(p *player.Player, choice interface{}) error

func (*Server) DisconnectPlayerWithReason

func (s *Server) DisconnectPlayerWithReason(p *player.Player, reason uint32)

func (*Server) FindTopBlock

func (s *Server) FindTopBlock(x, y int) int

func (*Server) GetActiveVote

func (s *Server) GetActiveVote() vote.Vote

func (*Server) GetConfigPassword

func (s *Server) GetConfigPassword(role string) string

func (*Server) GetCurrentMapName

func (s *Server) GetCurrentMapName() string

func (*Server) GetMapBlock

func (s *Server) GetMapBlock(x, y, z int) uint32

func (*Server) GetServerName

func (s *Server) GetServerName() string

func (*Server) GetUptime

func (s *Server) GetUptime() time.Duration

func (*Server) HasActiveVote

func (s *Server) HasActiveVote() bool

func (*Server) IsMapSolid

func (s *Server) IsMapSolid(x, y, z int) bool

func (*Server) KickPlayer

func (s *Server) KickPlayer(playerID uint8, reason string)

func (*Server) KillPlayer

func (s *Server) KillPlayer(victimID uint8, killerID uint8, killType protocol.KillType)

func (*Server) RegisterCallbacks

func (s *Server) RegisterCallbacks(cb callbacks.Callbacks)

func (*Server) ReloadCommands

func (s *Server) ReloadCommands() error

func (*Server) ReloadGamemode

func (s *Server) ReloadGamemode() error

func (*Server) RespawnPlayer

func (s *Server) RespawnPlayer(playerID uint8)

func (*Server) RestockPlayer

func (s *Server) RestockPlayer(playerID uint8)

func (*Server) SaveMap

func (s *Server) SaveMap(filename string) (string, error)

func (*Server) SendChatToAll

func (s *Server) SendChatToAll(message string)

func (*Server) SendChatToPlayer

func (s *Server) SendChatToPlayer(p *player.Player, message string)

func (*Server) SendChatWithType

func (s *Server) SendChatWithType(message string, chatType protocol.ChatType)

func (*Server) SendIntelPositionPacketOnly added in v0.2.0

func (s *Server) SendIntelPositionPacketOnly(objectID uint8, team uint8, position protocol.Vector3f)

func (*Server) SendPlayerHP added in v0.2.2

func (s *Server) SendPlayerHP(playerID uint8, hp uint8)

func (*Server) SendPlayerLeftPacket

func (s *Server) SendPlayerLeftPacket(playerID uint8)

func (*Server) SendPlayerPositionPacketTo added in v0.2.0

func (s *Server) SendPlayerPositionPacketTo(playerID uint8, pos, ori protocol.Vector3f, toPlayerID uint8)

sends a position/orientation packet for a player without updating server state if player id is 255, broadcasts to all players

func (*Server) SetMapBlock

func (s *Server) SetMapBlock(x, y, z int, color uint32)

func (*Server) SetPlayerTeam

func (s *Server) SetPlayerTeam(playerID uint8, team uint8)

func (*Server) Start

func (s *Server) Start() error

func (*Server) StartVotekick

func (s *Server) StartVotekick(instigator *player.Player, victimID uint8, reason string) error

func (*Server) StartVotemap

func (s *Server) StartVotemap(instigator *player.Player) error

func (*Server) Stop

func (s *Server) Stop()

Jump to

Keyboard shortcuts

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