Documentation ¶
Overview ¶
Package d2localclient facilitates communication between a local client and server.
Index ¶
- type LocalClientConnection
- func (l *LocalClientConnection) Close() error
- func (l *LocalClientConnection) GetConnectionType() d2clientconnectiontype.ClientConnectionType
- func (l *LocalClientConnection) GetPlayerState() *d2hero.HeroState
- func (l *LocalClientConnection) GetUniqueID() string
- func (l *LocalClientConnection) Open(_, saveFilePath string) error
- func (l *LocalClientConnection) SendPacketToClient(packet d2netpacket.NetPacket) error
- func (l *LocalClientConnection) SendPacketToServer(packet d2netpacket.NetPacket) error
- func (l *LocalClientConnection) SetClientListener(listener d2networking.ClientListener)
- func (l *LocalClientConnection) SetPlayerState(playerState *d2hero.HeroState)
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 ¶
func (l *LocalClientConnection) GetConnectionType() d2clientconnectiontype.ClientConnectionType
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.