Interface IPlayerCharacter
Interface for player-controlled character entities, extending ICharacter with player-specific properties and methods. Includes networking, instance, race, chat, hotkey, and teleportation features.
public interface IPlayerCharacter : ICharacter
- Inherited Members
- Extension Methods
Fields
OnReadPayload
Event triggered when a payload is read for this player character.
public static Action<IPlayerCharacter> OnReadPayload
Field Value
Remarks
Memory leak risk: Static events hold strong references to all subscribers.
Callers MUST unsubscribe via -= when no longer needed (e.g., OnDestroy, OnStopClient)
or the subscriber and its entire closure chain will never be garbage collected.
OnStartLocalClient
Event triggered when the local client starts for this player character.
public static Action<IPlayerCharacter> OnStartLocalClient
Field Value
Remarks
Memory leak risk: Static events hold strong references to all subscribers.
Callers MUST unsubscribe via -= when no longer needed (e.g., OnDestroy, OnStopClient)
or the subscriber and its entire closure chain will never be garbage collected.
OnStopLocalClient
Event triggered when the local client stops for this player character.
public static Action<IPlayerCharacter> OnStopLocalClient
Field Value
Remarks
Memory leak risk: Static events hold strong references to all subscribers.
Callers MUST unsubscribe via -= when no longer needed (e.g., OnDestroy, OnStopClient)
or the subscriber and its entire closure chain will never be garbage collected.
OnTeleport
Event triggered when this player character teleports.
public static Action<IPlayerCharacter> OnTeleport
Field Value
Remarks
Memory leak risk: Static events hold strong references to all subscribers.
Callers MUST unsubscribe via -= when no longer needed (e.g., OnDestroy, OnStopClient)
or the subscriber and its entire closure chain will never be garbage collected.
Properties
AccessLevel
The access level of the player (e.g., admin, moderator, player).
AccessLevel AccessLevel { get; set; }
Property Value
Account
The account name associated with this character.
string Account { get; set; }
Property Value
BindPosition
The position in the bind scene where the character will respawn.
Vector3 BindPosition { get; set; }
Property Value
- Vector3
BindScene
The name of the scene where the character is bound (e.g., respawn location).
string BindScene { get; set; }
Property Value
CharacterController
The controller for kinematic character movement.
KCCController CharacterController { get; }
Property Value
CharacterName
The display name of the character.
string CharacterName { get; set; }
Property Value
CharacterNameLower
Lowercase version of the character's name for case-insensitive comparisons.
string CharacterNameLower { get; set; }
Property Value
ChatTokenLastRefillTicks
UTC ticks of the last token bucket refill. Used to calculate how many tokens to add based on elapsed time. Stored as ticks to avoid per-message DateTime allocation.
long ChatTokenLastRefillTicks { get; set; }
Property Value
ChatTokens
Current number of chat tokens available in the token bucket (double for precision on long-uptime servers). Consumed on each sent message; refilled at a configurable rate. Server-side anti-spam: when below 1.0 the message is silently dropped.
double ChatTokens { get; set; }
Property Value
EquipmentViewCamera
The camera used for equipment view (e.g., inspecting gear).
Camera EquipmentViewCamera { get; set; }
Property Value
- Camera
Hotkeys
The list of hotkey data for this character.
List<HotkeyData> Hotkeys { get; set; }
Property Value
InstanceID
Unique identifier for the instance the character is in.
long InstanceID { get; set; }
Property Value
InstancePosition
The position in the instance scene.
Vector3 InstancePosition { get; set; }
Property Value
- Vector3
InstanceRotation
The rotation in the instance scene.
Quaternion InstanceRotation { get; set; }
Property Value
- Quaternion
InstanceSceneHandle
Identity of the instance scene the character is inside — the scenes.id of its
row. See SceneHandle.
long InstanceSceneHandle { get; set; }
Property Value
InstanceSceneName
The name of the instance scene.
string InstanceSceneName { get; set; }
Property Value
IsChatTokensFull
Indicates whether ChatTokens is in its initial "filled to capacity" state (i.e. no token
refill has been applied since construction/reset). When true, the first token refill
should fill to bucket capacity instead of incrementing from a stale starting value.
Replaces the previous sentinel of double.MaxValue which overflowed to Infinity
on the first add operation.
bool IsChatTokensFull { get; set; }
Property Value
KCCPlayer
The player controller for kinematic character movement.
KCCPlayer KCCPlayer { get; }
Property Value
LastChatMessage
The last chat message sent by the character.
string LastChatMessage { get; set; }
Property Value
LastWorldPosition
Where the character stood in the open world before entering an instance, and where it is put back when it leaves one.
Vector3 LastWorldPosition { get; set; }
Property Value
- Vector3
Remarks
The character row carries two positions — the open-world one and the instance one — but a spawned character has only one transform, so while it is inside an instance the transform describes the instance and something has to remember the other. Without this, every save taken inside a dungeon overwrote the open-world position with dungeon coordinates, and a character released from a dead instance was placed at those coordinates in the open world: through terrain, or outside the playable bounds entirely, until the out-of-bounds sweep noticed and relocated them.
LastWorldRotation
Rotation to restore alongside LastWorldPosition.
Quaternion LastWorldRotation { get; set; }
Property Value
- Quaternion
ModelIndex
The model index for the character's race appearance.
int ModelIndex { get; set; }
Property Value
Motor
The motor for kinematic character movement.
KinematicCharacterMotor Motor { get; }
Property Value
- KinematicCharacterMotor
NextChatMessageTicks
The next time the character is allowed to send a chat message, stored as UTC ticks. Avoids DateTime allocation on every message comparison.
long NextChatMessageTicks { get; set; }
Property Value
NextInteractTime
The next time the character is allowed to interact with objects.
DateTime NextInteractTime { get; set; }
Property Value
RaceID
The race ID of the character.
int RaceID { get; set; }
Property Value
RaceName
The name of the character's race.
string RaceName { get; set; }
Property Value
SceneHandle
Identity of the scene instance the character belongs to: the scenes.id of the
row describing it.
long SceneHandle { get; set; }
Property Value
Remarks
This used to hold the hosting scene server's local scene-manager handle, which is only meaningful inside that one process. Two scene servers running the same build routinely allocate identical handles, so the value could not tell one server's instance from another's: the world server's routing map collided between them, and a scene server accepted a character routed to a different server's instance whenever the handle and scene name happened to match. The row ID is unique by construction.
SceneName
The name of the current scene the character is in.
string SceneName { get; set; }
Property Value
TeleporterName
The name of the teleporter used for the last teleport action.
string TeleporterName { get; set; }
Property Value
TimeCreated
The date and time when this character was created.
DateTime TimeCreated { get; set; }
Property Value
Version
The current Version of the character data, used for optimistic concurrency control.
long Version { get; set; }
Property Value
WorldServerID
Unique identifier for the world server this character belongs to.
long WorldServerID { get; set; }
Property Value
Methods
IsInInstance()
Returns true if the character is currently inside an instance.
bool IsInInstance()
Returns
IsLoaded()
Returns true if the character is currently loaded in the scene and active.
bool IsLoaded()
Returns
ResetHotkeys()
Resets all hotkeys to their default state.
void ResetHotkeys()
SetGuildName(string)
Sets the guild name for this character.
void SetGuildName(string guildName)
Parameters
guildNamestringThe name of the guild to set.
Teleport(string)
Teleports the character using the specified teleporter name.
void Teleport(string teleporterName)
Parameters
teleporterNamestringThe name of the teleporter to use.