Class Player
Represents one accepted authenticated player login.
public sealed class Player : ICommandSender, IPermissionHolder
- Inheritance
-
Player
- Implements
- Inherited Members
Properties
Id
Gets the authenticated player identifier.
public Guid Id { get; }
Property Value
Language
Gets the client's selected BCP-47 language.
public string Language { get; }
Property Value
Name
Gets the normalized player name accepted during setup.
public string Name { get; }
Property Value
Skin
Gets the validated Character Creator selection supplied by authentication.
public PlayerSkinSelection? Skin { get; }
Property Value
Methods
HasPermission(string, bool)
Checks one permission for the authenticated player identifier.
public bool HasPermission(string permission, bool defaultValue)
Parameters
Returns
- bool
The configured result or
defaultValuewhen no service owns it.
SendMessage(FormattedMessage)
Sends a localized protocol message to this Player's active connection.
public void SendMessage(FormattedMessage message)
Parameters
messageFormattedMessage
SendMessage(string)
Best-effort sends one chat message to this Player's active connection.
public void SendMessage(string message)
Parameters
messagestring
Remarks
A concurrent disconnect may reject or drop the message without failing the caller.
TryDisconnectForProtocolViolation()
Attempts to disconnect this login after invalid protocol input.
public bool TryDisconnectForProtocolViolation()
Returns
TrySend(IToClientPacket)
Attempts to send one targeted packet through this login's active connection.
public bool TrySend(IToClientPacket packet)
Parameters
packetIToClientPacket
Returns
Remarks
The packet is sent only through this Player's connection. When the connection accepts it, the caller must not mutate the packet afterward.