d2udpclientconnection

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

Documentation

Overview

Package d2udpclientconnection provides an implementation of a UDP client connection with a game state.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type UDPClientConnection

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

UDPClientConnection is the implementation of the d2server.ClientConnection interface to represent remote client from the server perspective.

func CreateUDPClientConnection

func CreateUDPClientConnection(udpConnection *net.UDPConn, id string, l d2util.LogLevel, address *net.UDPAddr) *UDPClientConnection

CreateUDPClientConnection constructs a new UDPClientConnection and returns a pointer to it.

func (UDPClientConnection) GetConnectionType

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

func (*UDPClientConnection) GetHeroState

func (u *UDPClientConnection) GetHeroState() *d2hero.HeroState

GetHeroState returns UDPClientConnection.playerState.

func (UDPClientConnection) GetUniqueID

func (u UDPClientConnection) GetUniqueID() string

GetUniqueID returns UDPClientConnection.id

func (*UDPClientConnection) SendPacketToClient

func (u *UDPClientConnection) SendPacketToClient(packet d2netpacket.NetPacket) error

SendPacketToClient compresses the JSON encoding of a NetPacket and sends it to the client.

func (*UDPClientConnection) SetHeroState

func (u *UDPClientConnection) SetHeroState(playerState *d2hero.HeroState)

SetHeroState sets UDP.playerState to the given value.

Jump to

Keyboard shortcuts

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