Documentation ¶
Index ¶
- func EncodeLoginPayload(payload LoginPayload) (val string)
- func FormatUUID(uuid string) (val string)
- func GenNameUUID(name string) (val string)
- func GenSalt() (str string, err error)
- func MinecraftVersion() string
- func RandomBytes(size int) (bytes []byte, err error)
- func RandomInt(max int) (val int)
- func Sha1Hex(str string) (val string)
- type Localizer
- type LoginPayload
- type LoginPayloadProperty
- type Router
- type Server
- type Session
- func (this *Session) Authenticated() (val bool)
- func (this *Session) Disconnect(reason string)
- func (this *Session) DisconnectJson(json string)
- func (this *Session) ErrorCaught(err error)
- func (this *Session) HandlePacket(packet packet.Packet) (err error)
- func (this *Session) Initializing() (val bool)
- func (this *Session) Redirect(server *connect.Server)
- func (this *Session) Serve()
- func (this *Session) SetAuthenticated(result bool)
- func (this *Session) SetCompression(threshold int)
- func (this *Session) Write(packet packet.Packet) (err error)
- type SessionOutBridge
- func (this *SessionOutBridge) EnsureCompression()
- func (this *SessionOutBridge) ErrorCaught(err error)
- func (this *SessionOutBridge) HandlePacket(packet packet.Packet) (err error)
- func (this *SessionOutBridge) Serve()
- func (this *SessionOutBridge) SetCompression(threshold int)
- func (this *SessionOutBridge) Write(packet packet.Packet) (err error)
- type SessionRegistry
- func (this *SessionRegistry) Clear()
- func (this *SessionRegistry) GetAll() (sessions []*Session)
- func (this *SessionRegistry) GetByName(name string) (session *Session)
- func (this *SessionRegistry) HasName(name string) (val bool)
- func (this *SessionRegistry) Len() (val int)
- func (this *SessionRegistry) Register(session *Session)
- func (this *SessionRegistry) Unregister(session *Session)
- type SessionState
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EncodeLoginPayload ¶
func EncodeLoginPayload(payload LoginPayload) (val string)
func FormatUUID ¶
func GenNameUUID ¶
func MinecraftVersion ¶
func MinecraftVersion() string
func RandomBytes ¶
Types ¶
type LoginPayload ¶
type LoginPayload struct { SecurityKey string `json:"s"` Host string `json:"h"` RealIp string `json:"rIp"` RealPort int `json:"rP"` Name string `json:"n"` UUID string `json:"u"` Properties []LoginPayloadProperty `json:"p"` }
func DecodeLoginPayload ¶
func DecodeLoginPayload(val string) (payload LoginPayload)
type LoginPayloadProperty ¶
type Server ¶
type Server struct { SessionRegistry *SessionRegistry // contains filtered or unexported fields }
func (*Server) Authenticate ¶
func (*Server) ListenAndServe ¶
func (*Server) MaxPlayers ¶
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
func (*Session) Authenticated ¶
func (*Session) Disconnect ¶
func (*Session) DisconnectJson ¶
func (*Session) ErrorCaught ¶
func (*Session) Initializing ¶
func (*Session) SetAuthenticated ¶
func (*Session) SetCompression ¶
type SessionOutBridge ¶
type SessionOutBridge struct {
// contains filtered or unexported fields
}
func NewSessionOutBridge ¶
func (*SessionOutBridge) EnsureCompression ¶
func (this *SessionOutBridge) EnsureCompression()
func (*SessionOutBridge) ErrorCaught ¶
func (this *SessionOutBridge) ErrorCaught(err error)
func (*SessionOutBridge) HandlePacket ¶
func (this *SessionOutBridge) HandlePacket(packet packet.Packet) (err error)
func (*SessionOutBridge) Serve ¶
func (this *SessionOutBridge) Serve()
func (*SessionOutBridge) SetCompression ¶
func (this *SessionOutBridge) SetCompression(threshold int)
type SessionRegistry ¶
func NewSessionRegistry ¶
func NewSessionRegistry() (this *SessionRegistry)
func (*SessionRegistry) Clear ¶
func (this *SessionRegistry) Clear()
func (*SessionRegistry) GetAll ¶
func (this *SessionRegistry) GetAll() (sessions []*Session)
func (*SessionRegistry) GetByName ¶
func (this *SessionRegistry) GetByName(name string) (session *Session)
func (*SessionRegistry) HasName ¶
func (this *SessionRegistry) HasName(name string) (val bool)
func (*SessionRegistry) Len ¶
func (this *SessionRegistry) Len() (val int)
func (*SessionRegistry) Register ¶
func (this *SessionRegistry) Register(session *Session)
func (*SessionRegistry) Unregister ¶
func (this *SessionRegistry) Unregister(session *Session)
type SessionState ¶
type SessionState int
const ( STATE_DISCONNECTED SessionState = iota STATE_STATUS STATE_STATUS_PING STATE_LOGIN STATE_LOGIN_ENCRYPT STATE_INIT STATE_CONNECTED )
Source Files ¶
Click to show internal directories.
Click to hide internal directories.