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
PlayerTypeendPoint
EndPoint
Fields
NetworkStats
Network stats for the peer
public PeerNetworkStats NetworkStats
Field Value
- See Also
Type
Player type
public readonly PlayerType Type
Field Value
Properties
CustomId
Custom user id value
public int CustomId { get; set; }
Property Value
EndPoint
Holds data for a player IP Endpoint
public EndPoint? EndPoint { get; }
Property Value
Id
Player unique ID
public Guid Id { get; }
Property Value
Index
public int Index { get; }
Property Value
Number
Player number (starting from 1
)
public int Number { get; }
Property Value
Methods
CreateLocal()
Create new NetcodePlayer of type Local
public static NetcodePlayer CreateLocal()
Returns
CreateRemote(int)
Create new localhost NetcodePlayer of type Remote
public static NetcodePlayer CreateRemote(int port)
Parameters
port
int
Returns
CreateRemote(EndPoint)
Create new NetcodePlayer of type Remote
public static NetcodePlayer CreateRemote(EndPoint endPoint)
Parameters
endPoint
EndPoint
Returns
CreateRemote(IPAddress, int)
Create new NetcodePlayer of type Remote
public static NetcodePlayer CreateRemote(IPAddress address, int port)
Parameters
Returns
CreateSpectator(int)
Create new localhost NetcodePlayer of type Spectator
public static NetcodePlayer CreateSpectator(int port)
Parameters
port
int
Returns
CreateSpectator(EndPoint)
Create new NetcodePlayer of type Spectator
public static NetcodePlayer CreateSpectator(EndPoint endPoint)
Parameters
endPoint
EndPoint
Returns
CreateSpectator(IPAddress, int)
Create new NetcodePlayer of type Spectator
public static NetcodePlayer CreateSpectator(IPAddress address, int port)
Parameters
Returns
Equals(NetcodePlayer?)
public virtual bool Equals(NetcodePlayer? other)
Parameters
other
NetcodePlayer
Returns
Equals(object?)
public override sealed bool Equals(object? obj)
Parameters
obj
object
Returns
GetHashCode()
public override sealed int GetHashCode()
Returns
IsLocal()
public bool IsLocal()
Returns
IsRemote()
public bool IsRemote()
Returns
IsSpectator()
public bool IsSpectator()
Returns
ToString()
public override string ToString()
Returns
Explicit Interface Implementations
operator ==(NetcodePlayer?, NetcodePlayer?)
static bool operator ==(NetcodePlayer? left, NetcodePlayer? right)
Parameters
left
NetcodePlayerright
NetcodePlayer
Returns
operator !=(NetcodePlayer?, NetcodePlayer?)
static bool operator !=(NetcodePlayer? left, NetcodePlayer? right)
Parameters
left
NetcodePlayerright
NetcodePlayer