mumble

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2026 License: MIT Imports: 24 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
}

Server holds Mumble server state and builds the handler table.

func NewServer

func NewServer(cfg *config.Config, db *gorm.DB, serverID uint, udpConn net.PacketConn) *Server

NewServer creates a Mumble protocol server.

func (*Server) ACLEvaluator

func (s *Server) ACLEvaluator() *acl.Evaluator

ACLEvaluator returns the ACL evaluator for cache invalidation.

func (*Server) AllChannelCryptoModes

func (s *Server) AllChannelCryptoModes() map[uint32]string

AllChannelCryptoModes returns a snapshot of all channel crypto modes.

func (*Server) BanAndKickSession

func (s *Server) BanAndKickSession(sessionID uint32, reason string) bool

BanAndKickSession bans the user by IP and kicks them.

func (*Server) BanManager

func (s *Server) BanManager() *ban.Manager

BanManager returns the ban manager (for cache invalidation when bans change via REST).

func (*Server) Broadcast

func (s *Server) Broadcast(skipSession uint32, msgType protocol.MessageType, msg messages.Message)

Broadcast sends a message to all connections except skipSession.

func (*Server) BroadcastChannelRemove

func (s *Server) BroadcastChannelRemove(channelID uint32)

BroadcastChannelRemove broadcasts a channel removal to all connected clients.

func (*Server) BroadcastChannelState

func (s *Server) BroadcastChannelState(ch *mumble.Channel)

BroadcastChannelState broadcasts a channel's state to all connected clients. Used when channels are created/updated via REST so Mumble clients see the changes.

func (*Server) ChanManager

func (s *Server) ChanManager() *channel.Manager

UserManager returns the user manager. ChanManager returns the channel manager for REST API channel CRUD.

func (*Server) ChannelCryptoMode

func (s *Server) ChannelCryptoMode(channelID uint32) string

ChannelCryptoMode returns the aggregate crypto mode string for a channel. Returns "legacy", "lite", "secure", "mixed", or "" (no active users).

func (*Server) HandleUDP

func (s *Server) HandleUDP(addr net.Addr, data []byte)

HandleUDP processes an incoming UDP voice or ping packet.

func (*Server) HandlerTable

func (s *Server) HandlerTable() protocol.HandlerTable

HandlerTable returns the handler table.

func (*Server) HasUDPAddress

func (s *Server) HasUDPAddress(sessionID uint32) bool

HasUDPAddress returns true if the session has sent at least one UDP packet (voice or ping), indicating the client is using native UDP transport rather than TCP tunnel.

func (*Server) KickSession

func (s *Server) KickSession(sessionID uint32, reason string) bool

KickSession kicks a user (server-initiated, e.g. from REST API). Actor 0 = server.

func (*Server) MuteSession

func (s *Server) MuteSession(sessionID uint32, mute bool) bool

MuteSession sets server mute state for a user.

func (*Server) RegisterConn

func (s *Server) RegisterConn(sessionID uint32, c *connection.Conn)

RegisterConn registers a connection for broadcasting.

func (*Server) SendAudio

func (s *Server) SendAudio(sessionID uint32, packet []byte) error

SendAudio implements audio.RecipientSender. Encrypts with recipient's key and sends via UDP, or TCP fallback. When the recipient's channel has mixed crypto modes, UDP is skipped to force TCP tunnel relay.

func (*Server) SetVoiceDebug

func (s *Server) SetVoiceDebug(enabled bool)

SetVoiceDebug enables or disables voice path debug logging (UDP, TCP tunnel, routing). Callable at runtime when server config is updated via REST.

func (*Server) UnregisterConn

func (s *Server) UnregisterConn(sessionID uint32)

UnregisterConn removes a connection. Callers must call UpdateChannelCrypto for the user's channel after removing the user (UnregisterConn cannot see the user if callers remove first).

func (*Server) UpdateChannelCrypto

func (s *Server) UpdateChannelCrypto(channelID uint32)

UpdateChannelCrypto recomputes the aggregate crypto mode string for a channel. Must be called whenever the channel's user set changes (join, leave, move, disconnect).

func (*Server) UserManager

func (s *Server) UserManager() *user.Manager

Jump to

Keyboard shortcuts

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