Documentation ¶
Overview ¶
Package server implements minero's server behavior.
Index ¶
- Constants
- Variables
- func ConfigCreate() *config.Config
- func ConfigDefault() config.Map
- func Handle00(server *Server, sender *player.Player)
- func Handle02(server *Server, sender *player.Player)
- func Handle03(server *Server, sender *player.Player)
- func Handle07(server *Server, sender *player.Player)
- func Handle0A(server *Server, sender *player.Player)
- func Handle0B(server *Server, sender *player.Player)
- func Handle0C(server *Server, sender *player.Player)
- func Handle0D(server *Server, sender *player.Player)
- func Handle0E(server *Server, sender *player.Player)
- func Handle0F(server *Server, sender *player.Player)
- func Handle10(server *Server, sender *player.Player)
- func Handle12(server *Server, sender *player.Player)
- func Handle13(server *Server, sender *player.Player)
- func Handle65(server *Server, sender *player.Player)
- func Handle66(server *Server, sender *player.Player)
- func Handle6A(server *Server, sender *player.Player)
- func Handle6B(server *Server, sender *player.Player)
- func Handle6C(server *Server, sender *player.Player)
- func Handle82(server *Server, sender *player.Player)
- func HandleCA(server *Server, sender *player.Player)
- func HandleCB(server *Server, sender *player.Player)
- func HandleCC(server *Server, sender *player.Player)
- func HandleCD(server *Server, sender *player.Player)
- func HandleFA(server *Server, sender *player.Player)
- func HandleFC(server *Server, sender *player.Player)
- func HandleFE(server *Server, sender *player.Player)
- func HandleFF(server *Server, sender *player.Player)
- func VirtualChunks(x, z, height int32) packet.Packet
- type HandlerFunc
- type Server
- func (s *Server) CheckUser(name string, secret []byte) bool
- func (s *Server) HandleLogin(sender *player.Player)
- func (s Server) Id() string
- func (s *Server) Kick(p *player.Player)
- func (s *Server) PrivateKey() *rsa.PrivateKey
- func (s *Server) PublicKey() []byte
- func (s *Server) Run()
- func (s *Server) Tick(t int64)
- Bugs
Constants ¶
View Source
const ( ReasonPiratedGame = "Failed to login: User not premium." ReasonPiratedGameLong = "" /* 126-byte string literal not displayed */ )
Variables ¶
View Source
var HandlerFor = map[byte]HandlerFunc{ 0x00: HandlerFunc(Handle00), 0x02: HandlerFunc(Handle02), 0x03: HandlerFunc(Handle03), 0x07: HandlerFunc(Handle07), 0x0A: HandlerFunc(Handle0A), 0x0B: HandlerFunc(Handle0B), 0x0C: HandlerFunc(Handle0C), 0x0D: HandlerFunc(Handle0D), 0x0E: HandlerFunc(Handle0E), 0x0F: HandlerFunc(Handle0F), 0x10: HandlerFunc(Handle10), 0x12: HandlerFunc(Handle12), 0x13: HandlerFunc(Handle13), 0x65: HandlerFunc(Handle65), 0x66: HandlerFunc(Handle66), 0x6A: HandlerFunc(Handle6A), 0x6B: HandlerFunc(Handle6B), 0x6C: HandlerFunc(Handle6C), 0x82: HandlerFunc(Handle82), 0xCA: HandlerFunc(HandleCA), 0xCB: HandlerFunc(HandleCB), 0xCC: HandlerFunc(HandleCC), 0xCD: HandlerFunc(HandleCD), 0xFA: HandlerFunc(HandleFA), 0xFC: HandlerFunc(HandleFC), 0xFE: HandlerFunc(HandleFE), 0xFF: HandlerFunc(HandleFF), }
Packet Id is only read for "Client -> Server" packets
Functions ¶
func ConfigCreate ¶
func VirtualChunks ¶
Types ¶
type HandlerFunc ¶
type Server ¶
type Server struct { sync.Mutex // Message of the day. Text appears on server list. Motd string // Stop message. Text appears on server list. Stop string // Embed list handlers Cmds map[string]cmd.Cmder players.Players tickers.Tickers // contains filtered or unexported fields }
func New ¶
New initializes a new server instance and loads server.conf file if one exists, otherwise it'll create a new one.
func (*Server) CheckUser ¶
CheckUser check's if user is premium, only used when config var "server.online_mode" = true.
func (*Server) HandleLogin ¶
func (*Server) PrivateKey ¶
func (s *Server) PrivateKey() *rsa.PrivateKey
PrivateKey returns server's private key.
Notes ¶
Bugs ¶
server: Add online_mode=false support.
NMS handle relative movements with other packet `packet.EntityRelMove` right now we just teleport to the destination.
Load nearby chunks
Source Files ¶
- config.go
- doc.go
- handle_00.go
- handle_02.go
- handle_03.go
- handle_07.go
- handle_0a.go
- handle_0b.go
- handle_0c.go
- handle_0d.go
- handle_0e.go
- handle_0f.go
- handle_10.go
- handle_12.go
- handle_13.go
- handle_65.go
- handle_66.go
- handle_6a.go
- handle_6b.go
- handle_6c.go
- handle_82.go
- handle_ca.go
- handle_cb.go
- handle_cc.go
- handle_cd.go
- handle_fa.go
- handle_fc.go
- handle_fe.go
- handle_ff.go
- handlers.go
- login.go
- server.go
Directories ¶
Path | Synopsis |
---|---|
list
|
|
players
Package players implements a goroutine-safe player list.
|
Package players implements a goroutine-safe player list. |
tickers
Package tickers implements a goroutine-safe ticker list.
|
Package tickers implements a goroutine-safe ticker list. |
Package player implements player entities for a minero server.
|
Package player implements player entities for a minero server. |
Package tick a basic interface to work with tick events.
|
Package tick a basic interface to work with tick events. |
Click to show internal directories.
Click to hide internal directories.