login

package
v0.0.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 11, 2024 License: GPL-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package login provides a login protocol server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChangeLoginServer

func ChangeLoginServer(w *net.Message) error

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

func CharacterList

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

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

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

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.

Types

type CharacterListEntry

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

CharacterListEntry represents a single character presented on the character list.

type LoginServer

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

func NewServer

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

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL