Skip to content

Class MinecraftPlayer

Namespace: Void.Minecraft.Players
Assembly: Void.Minecraft.dll

public class MinecraftPlayer : IPlayer, IEquatable<IPlayer>, ICommandSource, IAsyncDisposable, IDisposable

Inheritance

objectMinecraftPlayer

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 used for network. communication.

public TcpClient Client { get; }

Property Value

TcpClient

ConnectedAt

Gets the date and time when the player connected to the proxy.

public DateTimeOffset ConnectedAt { get; }

Property Value

DateTimeOffset

Context

Gets the context containing services and state associated with the player.

public IPlayerContext Context { get; }

Property Value

IPlayerContext

IdentifiedKey

public IdentifiedKey? IdentifiedKey { get; set; }

Property Value

IdentifiedKey?

Name

Gets the name of the player. Falls back to IP address if unavailable.

public string Name { get; }

Property Value

string

Phase

public Phase Phase { get; set; }

Property Value

Phase

Profile

public GameProfile? Profile { get; set; }

Property Value

GameProfile?

ProtocolVersion

public ProtocolVersion ProtocolVersion { get; }

Property Value

ProtocolVersion

RemoteEndPoint

Gets the textual representation of the client’s remote endpoint.

public string RemoteEndPoint { get; }

Property Value

string

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

ValueTask

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

bool

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

string

A string that represents the current object.