Class MinecraftPlayer
Namespace: Void.Minecraft.Players
Assembly: Void.Minecraft.dll
public class MinecraftPlayer : IPlayer, IEquatable<IPlayer>, ICommandSource, IAsyncDisposable, IDisposableInheritance
Implements
IPlayer, IEquatable<IPlayer>, ICommandSource, IAsyncDisposable, IDisposable
Inherited Members
object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()
Constructors
MinecraftPlayer(TcpClient, IPlayerContext, string, DateTimeOffset, ProtocolVersion)
public MinecraftPlayer(TcpClient client, IPlayerContext context, string remoteEndPoint, DateTimeOffset connectedAt, ProtocolVersion protocolVersion)Parameters
client TcpClient
context IPlayerContext
remoteEndPoint string
connectedAt DateTimeOffset
protocolVersion ProtocolVersion
Properties
Client
Gets the underlying
public TcpClient Client { get; }Property Value
ConnectedAt
Gets the date and time when the player connected to the proxy.
public DateTimeOffset ConnectedAt { get; }Property Value
Context
Gets the context containing services and state associated with the player.
public IPlayerContext Context { get; }Property Value
IdentifiedKey
public IdentifiedKey? IdentifiedKey { get; set; }Property Value
Name
Gets the name of the player. Falls back to IP address if unavailable.
public string Name { get; }Property Value
Phase
public Phase Phase { get; set; }Property Value
Profile
public GameProfile? Profile { get; set; }Property Value
ProtocolVersion
public ProtocolVersion ProtocolVersion { get; }Property Value
RemoteEndPoint
Gets the textual representation of the client’s remote endpoint.
public string RemoteEndPoint { get; }Property Value
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()DisposeAsync()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources asynchronously.
public ValueTask DisposeAsync()Returns
A task that represents the asynchronous dispose operation.
Equals(IPlayer?)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(IPlayer? other)Parameters
other IPlayer?
An object to compare with this object.
Returns
true if the current object is equal to the other parameter; otherwise, false.
ToString()
Returns a string that represents the current object.
public override string ToString()Returns
A string that represents the current object.