Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { ID() string GetPlayer() Player SetPlayer(Player) GetReader() io.Reader GetWriter() io.Writer ReadPacket() (*protocol.Packet, error) WritePacket(protocol.Packet) error HandleConnection(Server) error RemoteAddr() net.Addr SetCipher(encode, decode cipher.Stream) SetCompressionThreshold(int32) StartKeepAlive(time.Duration) OnReceiveKeepAlive(int64) error Latency() int64 Close() error }
type Configuration ¶
type Configuration struct { Host string `yaml:"host"` Port uint16 `yaml:"port"` OnlineMode bool `yaml:"online_mode"` MOTD string `yaml:"motd"` MaxPlayers int `yaml:"max_players"` Difficulty string `yaml:"difficulty"` CompressionThreshold int32 `yaml:"compression_threshold"` Seed string `yaml:"seed"` Hardcore bool `yaml:"hardcore"` DefaultGamemode string `yaml:"default_gamemode"` ViewDistance int `yaml:"view_distance"` SimulationDistance int `yaml:"simulation_distance"` KeepAliveInterval int `yaml:"keep_alive_interval"` EnableQuery bool `yaml:"enable_query"` QueryHost string `yaml:"query_host"` QueryPort uint16 `yaml:"query_port"` }
func NewConfiguration ¶
func NewConfiguration() (*Configuration, error)
func (*Configuration) ReadFromFile ¶
func (c *Configuration) ReadFromFile(path string) error
func (Configuration) Validate ¶
func (c Configuration) Validate() error
func (Configuration) WriteToFile ¶
func (c Configuration) WriteToFile(config string) error
type Player ¶
type Player interface { EntityID() int64 Username() string UUID() proto.UUID Gamemode() enum.Gamemode Position() proto.AbsolutePosition SetPosition(proto.AbsolutePosition) Chunk() proto.RelativePosition SetSentChunk(int64, int64) HasSentChunk(int64, int64) bool Rotation() Rotation SetRotation(Rotation) }
type QueryServer ¶
type Server ¶
type Server interface { Running() bool Initialize() error Start() error Close() error GetSocket() Socket AcceptConnections() ProcessConsoleCommand(string, *chan os.Signal) error AddClient(Client) RemoveClient(Client) OnlinePlayers() int MaxPlayers() int SamplePlayers() []data.StatusResponseSamplePlayer MOTD() proto.Chat Favicon() (*string, error) NextEntityID() int64 OnlineMode() bool Difficulty() enum.Difficulty Hardcore() bool DefaultGamemode() enum.Gamemode DefaultWorld() *world.World ViewDistance() int SimulationDistance() int KeepAliveInterval() time.Duration Players() []Player Clients() []Client Host() string Port() uint16 WorldManager() *world.WorldManager }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.