d2remoteclient

package
v0.0.0-...-7f92c57 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2021 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Overview

Package d2remoteclient facilitates communication between a remote client and server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RemoteClientConnection

type RemoteClientConnection struct {
	*d2util.Logger
	// contains filtered or unexported fields
}

RemoteClientConnection is the implementation of ClientConnection for a remote client.

func Create

Create constructs a new RemoteClientConnection and returns a pointer to it.

func (*RemoteClientConnection) Close

func (r *RemoteClientConnection) Close() error

Close informs the server that this client has disconnected and sets RemoteClientConnection.active to false.

func (RemoteClientConnection) GetConnectionType

GetConnectionType returns an enum representing the connection type. See: d2clientconnectiontype

func (RemoteClientConnection) GetUniqueID

func (r RemoteClientConnection) GetUniqueID() string

GetUniqueID returns RemoteClientConnection.uniqueID.

func (*RemoteClientConnection) Open

func (r *RemoteClientConnection) Open(connectionString, saveFilePath string) error

Open runs serverListener() in a goroutine to continuously read UDP packets. It also sends a PlayerConnectionRequestPacket packet to the server (see d2netpacket).

func (*RemoteClientConnection) SendPacketToServer

func (r *RemoteClientConnection) SendPacketToServer(packet d2netpacket.NetPacket) error

SendPacketToServer compresses the JSON encoding of a NetPacket and sends it to the server.

func (*RemoteClientConnection) SetClientListener

func (r *RemoteClientConnection) SetClientListener(listener d2networking.ClientListener)

SetClientListener sets RemoteClientConnection.clientListener to the given value.

Jump to

Keyboard shortcuts

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