message

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2023 License: Apache-2.0, BSD-3-Clause, ISC Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ClientMessageTable = common.NewMessageTable(map[uint16]ClientMessage{
	0x0012: &ClientAuth{},
})
View Source
var ServerMessageTable = common.NewMessageTable(map[uint16]ServerMessage{
	0x0001: &Server0001{},
})

Functions

This section is empty.

Types

type ClientAuth

type ClientAuth struct {
	ClientMessage_
	Cookie   uint32
	Nickname common.PString
}

ClientAuthMessage is sent at connection start to authenticate a session.

type ClientMessage

type ClientMessage interface {
	common.Message
	// contains filtered or unexported methods
}

type ClientMessage_

type ClientMessage_ struct{}

type Conn

type Conn struct {
	*common.ServerConn[ClientMessage, ServerMessage]
}

Conn holds the state for a connection to the server.

func (*Conn) Handle

func (c *Conn) Handle() error

Handle runs the main connection loop.

type ConnectMessage

type ConnectMessage struct {
	Unknown1 uint16
	Unknown2 uint16
	Unknown3 uint16
	Unknown4 uint16
	Key      uint16
	Unknown5 uint16
}

ConnectMessage is the message sent by the server when connecting.

func (*ConnectMessage) SetKey added in v0.0.2

func (c *ConnectMessage) SetKey(key uint8)

type Options

type Options struct {
	Logger          zerolog.Logger
	TopologyClient  topologypbconnect.TopologyServiceClient
	AccountsService *accounts.Service
}

Options specify the options to use to instantiate the message server.

type Server

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

Server provides an implementation of the PangYa message server.

func New

func New(opts Options) *Server

New creates a new instance of the Message server.

func (*Server) Listen

func (s *Server) Listen(ctx context.Context, addr string) error

Listen listens for new connections on the provided address and blocks.

func (*Server) Shutdown

func (s *Server) Shutdown(shutdownCtx context.Context) error

type Server0001

type Server0001 struct {
	ServerMessage_
}

Server0001 is an unknown message.

type ServerMessage

type ServerMessage interface {
	common.Message
	// contains filtered or unexported methods
}

type ServerMessage_

type ServerMessage_ struct{}

Jump to

Keyboard shortcuts

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