Documentation ¶
Index ¶
- func GenKey() string
- func LoadResourcePacks(path string) []*resource.Pack
- type Balancer
- type Config
- type Handler
- type LoadBalancer
- type NopHandler
- type OverflowBalancer
- type StatusProvider
- type Sun
- func (s *Sun) AddPlanet(planet *planet.Planet)
- func (s *Sun) BreakRay(ray *ray.Ray)
- func (s *Sun) ConnectToHub(ray *ray.Ray) (*minecraft.Conn, error)
- func (s *Sun) Dial(ray *ray.Ray, addr ip_addr.IpAddr) (*minecraft.Conn, error)
- func (s *Sun) Handle(handler Handler)
- func (s *Sun) Handler() Handler
- func (s *Sun) MakeRay(ray *ray.Ray)
- func (s *Sun) MotdForward() (*minecraft.ForeignStatusProvider, error)
- func (s *Sun) SendMessage(Message string)
- func (s *Sun) SendMessageToServers(Message string, Servers []string)
- func (s *Sun) Start()
- func (s *Sun) TransferRay(ray *ray.Ray, addr ip_addr.IpAddr) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadResourcePacks ¶
Types ¶
type Config ¶
type Config struct { Status minecraft.ServerStatus /* The First Server the proxy will redirect players too (after @see LoadBalancer) */ Hub ip_addr.IpAddr Proxy struct { /* The port the Sun Proxy should run on. */ Port uint16 /* A boolean representing wether or not the proxy should use Xbox Auth. */ XboxAuthentication bool /* Unused as of now. */ IpForwarding bool TransferCommand struct { /* A boolean value representing if sun should enable the transfer command. */ Enabled bool /* An array of servers that the transfer command should be using. */ Servers map[string]ip_addr.IpAddr } /* Used to redirect players to a new server after the hub is unusable. */ LoadBalancer struct { /* A boolean value representing if sun should use LoadBalancing */ Enabled bool /* A list of servers to try to balance too after the hub is unusable. */ Balancers []ip_addr.IpAddr } /* A boolean value representing if the /status command should be overridden. */ StatusCommand bool /* A struct used to indicate if the proxy should enable ppof profiling and what port the webserver should run on. */ Ppof struct { /* A boolean representing whether or not the ppof webserver should be started. */ Enabled bool /* The port at which the ppof webserver should run on. */ Port uint16 } Logger struct { /* The path to the file which the logger entries should be written to */ File string /* Represents if the logger should display debug messages! */ Debug bool } /* A boolean representing whether or not to forward the motd to the hub or the first open LoadBalancer */ MOTDForward bool } /* The configuration for the tcp server in sun */ Tcp struct { /* Specifies if the proxy should run the tcp server */ Enabled bool /* Used to login into the tcp server */ Key string } }
* The basic Config file struct.
func LoadConfig ¶
func LoadGobConfig ¶
func LoadJsonConfig ¶
func LoadTomlConfig ¶
func LoadXmlConfig ¶
func LoadYamlConfig ¶
type LoadBalancer ¶
type LoadBalancer struct { Servers []ip_addr.IpAddr Overflow *OverflowBalancer Enabled bool }
type NopHandler ¶
type NopHandler struct{}
func (NopHandler) HandlePlanetConnect ¶
func (n NopHandler) HandlePlanetConnect(*event.Context, *planet.Planet)
func (NopHandler) HandleRayJoin ¶
func (n NopHandler) HandleRayJoin(*event.Context, *ray.Ray)
type OverflowBalancer ¶
type OverflowBalancer struct {
// contains filtered or unexported fields
}
func NewOverflowBalancer ¶
func NewOverflowBalancer(servers []ip_addr.IpAddr) *OverflowBalancer
type StatusProvider ¶
type StatusProvider struct {
// contains filtered or unexported fields
}
func (StatusProvider) ServerStatus ¶
func (s StatusProvider) ServerStatus(_ int, _ int) minecraft.ServerStatus
type Sun ¶
type Sun struct { Listener *minecraft.Listener Rays map[string]*ray.Ray Hub ip_addr.IpAddr Planets map[uuid.UUID]*planet.Planet PListener net.Listener Status StatusProvider Key string PWarnings map[string]int PCooldowns map[string]time.Time Servers map[string]ip_addr.IpAddr TransferCommand bool LoadBalancer LoadBalancer StatusCommand bool Logger logger.Logger PluginManager *plugin.Manager CmdProcessor command.Processor // contains filtered or unexported fields }
func (*Sun) ConnectToHub ¶
* ConnectToHub will attempt to connect a ray to the hub server. If the said hub server rejects the connection for any reason the proxy will then go through the overflow Balancer to find the next usable ip until it runs out.
func (*Sun) MotdForward ¶
func (s *Sun) MotdForward() (*minecraft.ForeignStatusProvider, error)
func (*Sun) SendMessage ¶
SendMessage is used for sending a Sun wide message to all the connected clients
func (*Sun) SendMessageToServers ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.