Versions in this module Expand all Collapse all v0 v0.18.3 Apr 18, 2022 v0.18.2 Apr 18, 2022 Changes in this version + var ErrClosedConn = errors.New("connection is closed") + var ErrNoBackendConnection = errors.New("player has no backend server connection yet") + var ErrProxyAlreadyRun = errors.New("proxy was already run, create a new one") + var ErrServerAlreadyExists = errors.New("server already exists") + var ErrServerOnlineMode = errors.New("backend server is online mode, but should be offline") + var ErrTooLongChatMessage = errors.New("server bound chat message can not exceed 256 characters") + var LegacyForge connectionType = &legacyForgeConnType + var Plugins []Plugin + func RegisteredServerEqual(a, b RegisteredServer) bool + func ServerInfoEqual(a, b ServerInfo) bool + type ChannelRegistrar struct + func NewChannelRegistrar() *ChannelRegistrar + func (r *ChannelRegistrar) ChannelsForProtocol(protocol proto.Protocol) sets.String + func (r *ChannelRegistrar) FromID(channel string) (message.ChannelIdentifier, bool) + func (r *ChannelRegistrar) LegacyChannelIDs() sets.String + func (r *ChannelRegistrar) ModernChannelIDs() sets.String + type CommandExecuteEvent struct + func (c *CommandExecuteEvent) Allowed() bool + func (c *CommandExecuteEvent) Command() string + func (c *CommandExecuteEvent) Forward() bool + func (c *CommandExecuteEvent) OriginalCommand() string + func (c *CommandExecuteEvent) SetAllowed(allowed bool) + func (c *CommandExecuteEvent) SetCommand(commandline string) + func (c *CommandExecuteEvent) SetForward(forward bool) + func (c *CommandExecuteEvent) Source() command.Source + type ConnectionHandshakeEvent struct + func (e *ConnectionHandshakeEvent) Connection() Inbound + type ConnectionRequest interface + Connect func(ctx context.Context) (ConnectionResult, error) + ConnectWithIndication func(ctx context.Context) (successful bool) + Server func() RegisteredServer + type ConnectionResult interface + Reason func() Component + Status func() ConnectionStatus + type ConnectionStatus uint8 + const AlreadyConnectedConnectionStatus + const CanceledConnectionStatus + const InProgressConnectionStatus + const ServerDisconnectedConnectionStatus + const SuccessConnectionStatus + func (r ConnectionStatus) AlreadyConnected() bool + func (r ConnectionStatus) Canceled() bool + func (r ConnectionStatus) ConnectionInProgress() bool + func (r ConnectionStatus) ServerDisconnected() bool + func (r ConnectionStatus) Successful() bool + type DisconnectEvent struct + func (e *DisconnectEvent) LoginStatus() LoginStatus + func (e *DisconnectEvent) Player() Player + type DisconnectPlayerKickResult struct + Reason component.Component + type GameProfileProvider interface + GameProfile func() (profile *profile.GameProfile) + type GameProfileRequestEvent struct + func NewGameProfileRequestEvent(inbound Inbound, original profile.GameProfile, onlineMode bool) *GameProfileRequestEvent + func (e *GameProfileRequestEvent) Conn() Inbound + func (e *GameProfileRequestEvent) GameProfile() profile.GameProfile + func (e *GameProfileRequestEvent) OnlineMode() bool + func (e *GameProfileRequestEvent) Original() profile.GameProfile + func (e *GameProfileRequestEvent) SetGameProfile(p profile.GameProfile) + type HandshakeAddresser interface + HandshakeAddr func(defaultPlayerVirtualHost string, player Player) (newPlayerVirtualHost string) + type Inbound interface + Active func() bool + Closed func() <-chan struct{} + Protocol func() proto.Protocol + RemoteAddr func() net.Addr + VirtualHost func() net.Addr + type KickedFromServerEvent struct + func (e *KickedFromServerEvent) KickedDuringServerConnect() bool + func (e *KickedFromServerEvent) OriginalReason() component.Component + func (e *KickedFromServerEvent) Player() Player + func (e *KickedFromServerEvent) Result() ServerKickResult + func (e *KickedFromServerEvent) Server() RegisteredServer + func (e *KickedFromServerEvent) SetResult(result ServerKickResult) + type LoginEvent struct + func (e *LoginEvent) Allow() + func (e *LoginEvent) Allowed() bool + func (e *LoginEvent) Deny(reason component.Component) + func (e *LoginEvent) Player() Player + func (e *LoginEvent) Reason() component.Component + type LoginStatus uint8 + const CanceledByProxyLoginStatus + const CanceledByUserBeforeCompleteLoginStatus + const CanceledByUserLoginStatus + const ConflictingLoginStatus + const SuccessfulLoginStatus + type MessageOption func(c *packet.Chat) + func MessageWithSender(id uuid.UUID) MessageOption + func MessageWithType(t MessageType) MessageOption + type MessageType uint8 + const ChatMessageType + const SystemMessageType + type NotifyKickResult struct + Message component.Component + type Options struct + Authenticator auth.Authenticator + Config *config.Config + EventMgr event.Manager + Logger logr.Logger + type PermissionsSetupEvent struct + func (p *PermissionsSetupEvent) Func() permission.Func + func (p *PermissionsSetupEvent) SetFunc(fn permission.Func) + func (p *PermissionsSetupEvent) Subject() permission.Subject + type PingEvent struct + func (p *PingEvent) Connection() Inbound + func (p *PingEvent) Ping() *ping.ServerPing + func (p *PingEvent) SetPing(ping *ping.ServerPing) + type Player interface + CreateConnectionRequest func(target RegisteredServer) ConnectionRequest + CurrentServer func() ServerConnection + Disconnect func(reason component.Component) + GameProfile func() profile.GameProfile + ID func() uuid.UUID + OnlineMode func() bool + Ping func() time.Duration + SendActionBar func(msg component.Component) error + SendMessageWith func(msg component.Component, opts ...MessageOption) error + SendResourcePack func(url string) error + SendResourcePackWithHash func(url string, sha1Hash []byte) error + Settings func() player.Settings + SpoofChatInput func(input string) error + Username func() string + type PlayerAvailableCommandsEvent struct + func (p *PlayerAvailableCommandsEvent) Player() Player + func (p *PlayerAvailableCommandsEvent) RootNode() *brigodier.RootCommandNode + type PlayerChatEvent struct + func (c *PlayerChatEvent) Allowed() bool + func (c *PlayerChatEvent) Message() string + func (c *PlayerChatEvent) Player() Player + func (c *PlayerChatEvent) SetAllowed(allowed bool) + type PlayerChooseInitialServerEvent struct + func (e *PlayerChooseInitialServerEvent) InitialServer() RegisteredServer + func (e *PlayerChooseInitialServerEvent) Player() Player + func (e *PlayerChooseInitialServerEvent) SetInitialServer(server RegisteredServer) + type PlayerModInfoEvent struct + func (e *PlayerModInfoEvent) ModInfo() modinfo.ModInfo + func (e *PlayerModInfoEvent) Player() Player + type PlayerSettingsChangedEvent struct + func (s *PlayerSettingsChangedEvent) Player() Player + func (s *PlayerSettingsChangedEvent) Settings() player.Settings + type Players interface + Len func() int + Range func(func(p Player) bool) + type Plugin struct + Init func(proxy *Proxy) error + Name string + type PluginMessageEvent struct + func (p *PluginMessageEvent) Allowed() bool + func (p *PluginMessageEvent) Data() []byte + func (p *PluginMessageEvent) Identifier() message.ChannelIdentifier + func (p *PluginMessageEvent) SetForward(forward bool) + func (p *PluginMessageEvent) Source() message.ChannelMessageSource + func (p *PluginMessageEvent) Target() message.ChannelMessageSink + type PluginMessageForwardResult struct + type PostLoginEvent struct + func (e *PostLoginEvent) Player() Player + type PreLoginEvent struct + func (e *PreLoginEvent) Allow() + func (e *PreLoginEvent) Conn() Inbound + func (e *PreLoginEvent) Deny(reason component.Component) + func (e *PreLoginEvent) ForceOfflineMode() + func (e *PreLoginEvent) ForceOnlineMode() + func (e *PreLoginEvent) Reason() component.Component + func (e *PreLoginEvent) Result() PreLoginResult + func (e *PreLoginEvent) Username() string + type PreLoginResult uint8 + const AllowedPreLogin + const DeniedPreLogin + const ForceOfflineModePreLogin + const ForceOnlineModePreLogin + type PreShutdownEvent struct + func (s *PreShutdownEvent) Reason() component.Component + func (s *PreShutdownEvent) SetReason(reason component.Component) + type Proxy struct + func New(options Options) (p *Proxy, err error) + func (p *Proxy) ChannelRegistrar() *ChannelRegistrar + func (p *Proxy) Command() *command.Manager + func (p *Proxy) Config() config.Config + func (p *Proxy) DisconnectAll(reason component.Component) + func (p *Proxy) Event() event.Manager + func (p *Proxy) HandleConn(raw net.Conn) + func (p *Proxy) Player(id uuid.UUID) Player + func (p *Proxy) PlayerByName(username string) Player + func (p *Proxy) PlayerCount() int + func (p *Proxy) Players() []Player + func (p *Proxy) Register(info ServerInfo) (RegisteredServer, error) + func (p *Proxy) Server(name string) RegisteredServer + func (p *Proxy) Servers() []RegisteredServer + func (p *Proxy) Shutdown(reason component.Component) + func (p *Proxy) Start(stop <-chan struct{}) error + func (p *Proxy) Unregister(info ServerInfo) bool + type ReadyEvent struct + type RedirectPlayerKickResult struct + Message component.Component + Server RegisteredServer + type RegisteredServer interface + Equals func(RegisteredServer) bool + Players func() Players + ServerInfo func() ServerInfo + type ServerConnectedEvent struct + func (s *ServerConnectedEvent) Player() Player + func (s *ServerConnectedEvent) PreviousServer() RegisteredServer + func (s *ServerConnectedEvent) Server() RegisteredServer + type ServerConnection interface + Player func() Player + Server func() RegisteredServer + type ServerDialer interface + Dial func(ctx context.Context, player Player) (net.Conn, error) + type ServerInfo interface + Addr func() net.Addr + Name func() string + func NewServerInfo(name string, addr net.Addr) ServerInfo + type ServerKickResult interface + type ServerPostConnectEvent struct + func (s *ServerPostConnectEvent) Player() Player + func (s *ServerPostConnectEvent) PreviousServer() RegisteredServer + type ServerPreConnectEvent struct + func (e *ServerPreConnectEvent) Allow(server RegisteredServer) + func (e *ServerPreConnectEvent) Allowed() bool + func (e *ServerPreConnectEvent) Deny() + func (e *ServerPreConnectEvent) OriginalServer() RegisteredServer + func (e *ServerPreConnectEvent) Player() Player + func (e *ServerPreConnectEvent) Server() RegisteredServer + type ServerRegistrar interface + Register func(info ServerInfo) (RegisteredServer, error) + Unregister func(info ServerInfo) bool + type ServerRegistry interface + Server func(name string) RegisteredServer + type ShutdownEvent struct + type TabCompleteEvent struct + func (t *TabCompleteEvent) PartialMessage() string + func (t *TabCompleteEvent) Player() Player + func (t *TabCompleteEvent) SetSuggestions(s []string) + func (t *TabCompleteEvent) Suggestions() []string