protocol

package
v2.2.1 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2025 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package protocol implements the Rating protocol

Package protocol implements the Rating protocol

Package protocol implements the Rating protocol

Index

Constants

View Source
const (
	// ProtocolID is the protocol ID for the Rating protocol
	ProtocolID = 0x76

	// MethodUnk1 is the method ID for the method Unk1
	// TODO: find name if possible
	MethodUnk1 = 0x1

	// MethodUnk2 is the method ID for the method Unk2
	// TODO: find name if possible
	MethodUnk2 = 0x2
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Interface

type Interface interface {
	Endpoint() nex.EndpointInterface
	SetEndpoint(endpoint nex.EndpointInterface)
	SetHandlerUnk1(handler func(err error, packet nex.PacketInterface, callID uint32) (*nex.RMCMessage, *nex.Error)) // TODO: find name if possible
	SetHandlerUnk2(handler func(err error, packet nex.PacketInterface, callID uint32) (*nex.RMCMessage, *nex.Error)) // TODO: find name if possible
}

Interface implements the methods present on the Rating protocol struct

type Protocol

type Protocol struct {
	Unk1           func(err error, packet nex.PacketInterface, callID uint32) (*nex.RMCMessage, *nex.Error) // TODO: find name if possible
	Unk2           func(err error, packet nex.PacketInterface, callID uint32) (*nex.RMCMessage, *nex.Error) // TODO: find name if possible
	Patches        nex.ServiceProtocol
	PatchedMethods []uint32
	// contains filtered or unexported fields
}

Protocol handles the Rating protocol

func NewProtocol

func NewProtocol() *Protocol

NewProtocol returns a new Rating protocol

func (*Protocol) Endpoint

func (protocol *Protocol) Endpoint() nex.EndpointInterface

Endpoint returns the endpoint implementing the protocol

func (*Protocol) HandlePacket

func (protocol *Protocol) HandlePacket(packet nex.PacketInterface)

HandlePacket sends the packet to the correct RMC method handler

func (*Protocol) SetEndpoint

func (protocol *Protocol) SetEndpoint(endpoint nex.EndpointInterface)

SetEndpoint sets the endpoint implementing the protocol

func (*Protocol) SetHandlerUnk1

func (protocol *Protocol) SetHandlerUnk1(handler func(err error, packet nex.PacketInterface, callID uint32) (*nex.RMCMessage, *nex.Error))

SetHandlerUnk1 sets the handler for the Unk1 method TODO: find name if possible

func (*Protocol) SetHandlerUnk2

func (protocol *Protocol) SetHandlerUnk2(handler func(err error, packet nex.PacketInterface, callID uint32) (*nex.RMCMessage, *nex.Error))

SetHandlerUnk2 sets the handler for the Unk2 method TODO: find name if possible

Jump to

Keyboard shortcuts

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