Skip to main content

FarAwayController.PlayerData

A private class in Root.Township, the global namespace. Reach it through att-stubs' publicized assemblies or Harmony's AccessTools.

A player's chunk and head position as sent by FarAwayController, so clients can draw markers for players too far away to be loaded.

Constructors​

MemberWhat it is
PlayerData(Player targetPlayer)Creates a FarAwayController.PlayerData with default values.
PlayerData()Creates a FarAwayController.PlayerData with default values.

Fields​

3 private and internal fields
MemberWhat it is
private Chunk chunkThe chunk the player's controller is in, or the global chunk when empty.
private int idBacking field for Id.
private Vector3 positionBacking field for Position.

Properties​

MemberWhat it is
int Id { get; }The player's user id.
bool IsEmpty { get; private set; }True when the player has no usable position (no head, no chunk, or in the global chunk).
Vector3 Position { get; }The player's head position in its chunk.
IPlayer TargetPlayer { get; private set; }The player this data is for.

Methods​

MemberWhat it is
void Serialize(Stream stream)Syncs the id, chunk and position, and looks up the Player for the id on read.
void Update()Server: refreshes chunk and head position from the player, or marks it empty.

Used in​

Members of other types that take, return or hold a PlayerData: