go-tibia: badc0de.net/pkg/go-tibia/login Index | Files

package login

import "badc0de.net/pkg/go-tibia/login"

Package login provides a login protocol server.

Index

Package Files

doc.go login.go messages.go

func ChangeLoginServer Uses

func ChangeLoginServer(w *net.Message) error

ChangeLoginServer sends network message with ID 0x28, of uncertain functionality.

func CharacterList Uses

func CharacterList(w *net.Message, chars []CharacterListEntry, premiumDays uint16) error

CharacterList sends the network message containing the passed characters on the character list, and tells the user they have premiumDays left.

func Error Uses

func Error(w *net.Message, errorText string) error

Error writes a login error network message to the passed net.Message.

Passed error text will be included.

func FYI Uses

func FYI(w *net.Message, fyiText string) error

FYI writes an FYI network message to the passed net.Messsage.

Passed FYI text will be included.

func MOTD Uses

func MOTD(w *net.Message, motdText string) error

MOTD writes the message-of-the-day network message to the passed net.Message.

Passed motdText will be included.

The motdText should begin with ascii-encoded decimal number identifying the sequence number of the MOTD, then it should be followed by a newline set of characters (ascii 13+10, \r\n). The number is used by the client to avoid bothering the user with the same message that was already seen.

type CharacterListEntry Uses

type CharacterListEntry struct {
    CharacterName, CharacterWorld string
    GameFrontend                  gonet.TCPAddr
}

CharacterListEntry represents a single character presented on the character list.

type LoginServer Uses

type LoginServer struct {
    // contains filtered or unexported fields
}

func NewServer Uses

func NewServer(pk *rsa.PrivateKey) (*LoginServer, error)

NewServer creates a new LoginServer which can decrypt the initial login message using the passed RSA private key.

func (*LoginServer) Serve Uses

func (c *LoginServer) Serve(conn net.Conn, initialMessage *tnet.Message) error

Serve begins serving the login protocol on the accepted network connection.

User of this method needs to bring their own listening schema and accept the connection, then pass on the control to this method.

Package login imports 8 packages (graph) and is imported by 1 packages. Updated 2020-10-27. Refresh now. Tools for package owners.