d2localclient

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: 8 Imported by: 0

Documentation

Overview

Package d2localclient facilitates communication between a local client and server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LocalClientConnection

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

LocalClientConnection is the implementation of ClientConnection for a local client.

func Create

func Create(
	asset *d2asset.AssetManager,
	l d2util.LogLevel,
	openNetworkServer bool) (*LocalClientConnection, error)

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

func (*LocalClientConnection) Close

func (l *LocalClientConnection) Close() error

Close disconnects from the server and destroys it.

func (*LocalClientConnection) GetConnectionType

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

func (*LocalClientConnection) GetPlayerState

func (l *LocalClientConnection) GetPlayerState() *d2hero.HeroState

GetPlayerState returns LocalClientConnection.playerState.

func (*LocalClientConnection) GetUniqueID

func (l *LocalClientConnection) GetUniqueID() string

GetUniqueID returns LocalClientConnection.uniqueID.

func (*LocalClientConnection) Open

func (l *LocalClientConnection) Open(_, saveFilePath string) error

Open creates a new GameServer, runs the server and connects this client to it.

func (*LocalClientConnection) SendPacketToClient

func (l *LocalClientConnection) SendPacketToClient(packet d2netpacket.NetPacket) error

SendPacketToClient passes a packet to the game client for processing.

func (*LocalClientConnection) SendPacketToServer

func (l *LocalClientConnection) SendPacketToServer(packet d2netpacket.NetPacket) error

SendPacketToServer calls d2server.OnPacketReceived with the given packet.

func (*LocalClientConnection) SetClientListener

func (l *LocalClientConnection) SetClientListener(listener d2networking.ClientListener)

SetClientListener sets LocalClientConnection.clientListener to the given value.

func (*LocalClientConnection) SetPlayerState

func (l *LocalClientConnection) SetPlayerState(playerState *d2hero.HeroState)

SetPlayerState sets LocalClientConnection.playerState to the given value.

Jump to

Keyboard shortcuts

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