Nebula
Bootstrap

EditorRoster

What one virtual player knows about the others of the Multiplayer Play Mode window, read from the project's Library/VP/SystemData.json (EditorRosterReader).

generated from the sources
public readonly struct EditorRoster

What one virtual player knows about the others of the Multiplayer Play Mode window, read from the project's Library/VP/SystemData.json (EditorRosterReader). EditorRunPlan.Resolve uses it so that exactly one virtual player hosts the server: an untagged virtual player hosts only when it is the active one with the lowest index, and every other one is a client.

Constructors

EditorRoster

public EditorRoster(bool anyServerTagged, bool lowerIndexServerTagged, bool isFirstHostCandidate, string playerName = null);

Properties

Known

public bool Known { get; }

Whether this player was found in the roster. When false the other facts mean nothing and the plan keeps the older rule: an untagged virtual player hosts.

AnyServerTagged

public bool AnyServerTagged { get; }

Whether any active player carries EditorRunPlan.ServerTag, which makes every untagged virtual player a client.

LowerIndexServerTagged

public bool LowerIndexServerTagged { get; }

Whether another active player with EditorRunPlan.ServerTag has a lower index than this one.

IsFirstHostCandidate

public bool IsFirstHostCandidate { get; }

Whether no other active virtual player without EditorRunPlan.ClientTag has a lower index than this one.

PlayerName

public string PlayerName { get; }

This player's name in the Multiplayer Play Mode window (for example Player 3); null when the roster does not give one.

Unknown

public static EditorRoster Unknown { get; }

No roster: the older rule applies.

Methods

Parse

public static EditorRoster Parse(string json, string playerFolder, out string problem);

Work out the roster facts for the virtual player that runs from Library/VP/<playerFolder> (the folder is the player's m_Prefix followed by its m_Id) from the text of SystemData.json. Tolerant: anything unreadable gives Unknown and a reason in problem; null when the roster was read.

On this page