Documentation ¶
Index ¶
- func GenSalt() (str string, err error)
- func GenUUID() (str string, err error)
- func Keepalive(sessionRegistry *SessionRegistry, done chan bool)
- func PasswordAndSaltHash(password string, passwordSalt string) (val string)
- func RandomInt() (n int32)
- func Sha1Hex(str string) (val string)
- type Authenticator
- type NetworkCache
- func (this *NetworkCache) AddPlayer(name string, uuid uuid.UUID, session *Session) (ok bool)
- func (this *NetworkCache) Address() (val string)
- func (this *NetworkCache) MaxPlayers() (val uint16)
- func (this *NetworkCache) Motd() (val string)
- func (this *NetworkCache) Players() (players []string)
- func (this *NetworkCache) Port() (val uint16)
- func (this *NetworkCache) ProxyByPlayer(name string) (session *Session)
- func (this *NetworkCache) Rebuild()
- func (this *NetworkCache) RegisterProxy(session *Session)
- func (this *NetworkCache) RemovePlayer(name string, uuid uuid.UUID)
- func (this *NetworkCache) RemovePlayersByProxy(session *Session)
- func (this *NetworkCache) UnregisterProxy(session *Session)
- func (this *NetworkCache) Version() (val string)
- type Server
- type Session
- func (this *Session) Authorized() (val bool)
- func (this *Session) ErrorCaught(err error)
- func (this *Session) HandlePacket(packet packet.Packet) (err error)
- func (this *Session) Id() (id string)
- func (this *Session) Keepalive() (err error)
- func (this *Session) RegisterAuthorized(username string)
- func (this *Session) RegisterProxy(address string, port uint16, motd string, version string, maxPlayers uint16) (ok bool)
- func (this *Session) RegisterServer(address string, port uint16) (ok bool)
- func (this *Session) Serve()
- func (this *Session) Unregister()
- func (this *Session) Write(packet packet.Packet) (err error)
- type SessionRegistry
- func (this *SessionRegistry) Clear()
- func (this *SessionRegistry) GetAll() (sessions []*Session)
- func (this *SessionRegistry) GetById(id string) (session *Session)
- func (this *SessionRegistry) HasId(id string) (val bool)
- func (this *SessionRegistry) Len() (val int)
- func (this *SessionRegistry) Register(session *Session)
- func (this *SessionRegistry) Unregister(session *Session)
- type SessionRole
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Keepalive ¶
func Keepalive(sessionRegistry *SessionRegistry, done chan bool)
func PasswordAndSaltHash ¶
Types ¶
type Authenticator ¶
type NetworkCache ¶
type NetworkCache struct {
// contains filtered or unexported fields
}
func NewNetworkCache ¶
func NewNetworkCache() (this *NetworkCache)
func (*NetworkCache) Address ¶
func (this *NetworkCache) Address() (val string)
func (*NetworkCache) MaxPlayers ¶
func (this *NetworkCache) MaxPlayers() (val uint16)
func (*NetworkCache) Motd ¶
func (this *NetworkCache) Motd() (val string)
func (*NetworkCache) Players ¶
func (this *NetworkCache) Players() (players []string)
func (*NetworkCache) Port ¶
func (this *NetworkCache) Port() (val uint16)
func (*NetworkCache) ProxyByPlayer ¶
func (this *NetworkCache) ProxyByPlayer(name string) (session *Session)
func (*NetworkCache) Rebuild ¶
func (this *NetworkCache) Rebuild()
func (*NetworkCache) RegisterProxy ¶
func (this *NetworkCache) RegisterProxy(session *Session)
func (*NetworkCache) RemovePlayer ¶
func (this *NetworkCache) RemovePlayer(name string, uuid uuid.UUID)
func (*NetworkCache) RemovePlayersByProxy ¶
func (this *NetworkCache) RemovePlayersByProxy(session *Session)
func (*NetworkCache) UnregisterProxy ¶
func (this *NetworkCache) UnregisterProxy(session *Session)
func (*NetworkCache) Version ¶
func (this *NetworkCache) Version() (val string)
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func NewServer ¶
func NewServer(authenticator Authenticator) (this *Server)
func (*Server) ListenAndServe ¶
func (*Server) SessionRegistry ¶
func (this *Server) SessionRegistry(sessionRole SessionRole) (sessionRegistry *SessionRegistry)
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
func (*Session) Authorized ¶
func (*Session) ErrorCaught ¶
func (*Session) RegisterAuthorized ¶
func (*Session) RegisterProxy ¶
func (*Session) RegisterServer ¶
func (*Session) Unregister ¶
func (this *Session) Unregister()
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) GetById ¶
func (this *SessionRegistry) GetById(id string) (session *Session)
func (*SessionRegistry) HasId ¶
func (this *SessionRegistry) HasId(id 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 SessionRole ¶
type SessionRole int
const ( ROLE_UNAUTHORIZED SessionRole = iota ROLE_AUTHORIZED ROLE_PROXY ROLE_SERVER )
Source Files ¶
Click to show internal directories.
Click to hide internal directories.