Table of Contents

Class NetcodePlayer

Namespace
Backdash
Assembly
Backdash.dll

Holds data of a player to be added to INetcodeSession<TInput>.

public class NetcodePlayer : IUtf8SpanFormattable, IEquatable<NetcodePlayer>, IEqualityOperators<NetcodePlayer, NetcodePlayer, bool>
Inheritance
NetcodePlayer
Implements
Inherited Members

Constructors

NetcodePlayer()

Initializes a new netcode player

public NetcodePlayer()

NetcodePlayer(PlayerType, EndPoint?)

Initializes a new netcode player

public NetcodePlayer(PlayerType type, EndPoint? endPoint = null)

Parameters

type PlayerType
endPoint EndPoint

Fields

NetworkStats

Network stats for the peer

public PeerNetworkStats NetworkStats

Field Value

PeerNetworkStats
See Also

Type

Player type

public readonly PlayerType Type

Field Value

PlayerType

Properties

CustomId

Custom user id value

public int CustomId { get; set; }

Property Value

int

EndPoint

Holds data for a player IP Endpoint

public EndPoint? EndPoint { get; }

Property Value

EndPoint

Id

Player unique ID

public Guid Id { get; }

Property Value

Guid

Index

public int Index { get; }

Property Value

int

Number

Player number (starting from 1)

public int Number { get; }

Property Value

int

Methods

CreateLocal()

Create new NetcodePlayer of type Local

public static NetcodePlayer CreateLocal()

Returns

NetcodePlayer

CreateRemote(int)

Create new localhost NetcodePlayer of type Remote

public static NetcodePlayer CreateRemote(int port)

Parameters

port int

Returns

NetcodePlayer

CreateRemote(EndPoint)

Create new NetcodePlayer of type Remote

public static NetcodePlayer CreateRemote(EndPoint endPoint)

Parameters

endPoint EndPoint

Returns

NetcodePlayer

CreateRemote(IPAddress, int)

Create new NetcodePlayer of type Remote

public static NetcodePlayer CreateRemote(IPAddress address, int port)

Parameters

address IPAddress
port int

Returns

NetcodePlayer

CreateSpectator(int)

Create new localhost NetcodePlayer of type Spectator

public static NetcodePlayer CreateSpectator(int port)

Parameters

port int

Returns

NetcodePlayer

CreateSpectator(EndPoint)

Create new NetcodePlayer of type Spectator

public static NetcodePlayer CreateSpectator(EndPoint endPoint)

Parameters

endPoint EndPoint

Returns

NetcodePlayer

CreateSpectator(IPAddress, int)

Create new NetcodePlayer of type Spectator

public static NetcodePlayer CreateSpectator(IPAddress address, int port)

Parameters

address IPAddress
port int

Returns

NetcodePlayer

Equals(NetcodePlayer?)

public virtual bool Equals(NetcodePlayer? other)

Parameters

other NetcodePlayer

Returns

bool

Equals(object?)

public override sealed bool Equals(object? obj)

Parameters

obj object

Returns

bool

GetHashCode()

public override sealed int GetHashCode()

Returns

int

IsLocal()

Returns true if player is Local

public bool IsLocal()

Returns

bool

IsRemote()

Returns true if player is Remote

public bool IsRemote()

Returns

bool

IsSpectator()

Returns true if player is Spectator

public bool IsSpectator()

Returns

bool

ToString()

public override string ToString()

Returns

string

Explicit Interface Implementations

operator ==(NetcodePlayer?, NetcodePlayer?)

static bool operator ==(NetcodePlayer? left, NetcodePlayer? right)

Parameters

left NetcodePlayer
right NetcodePlayer

Returns

bool

operator !=(NetcodePlayer?, NetcodePlayer?)

static bool operator !=(NetcodePlayer? left, NetcodePlayer? right)

Parameters

left NetcodePlayer
right NetcodePlayer

Returns

bool