Class NetKeys
- Namespace
- Unity.Multiplayer.Core
The rules for a networked object's key (UM-T60): the stable name a game gives an object on the server (a level's
block id, a door's name, "chest:3") that every peer looks the object up by, instead of guessing it from spawn
order or a network object id. The adapter's NetKey carries it and NetRegistry indexes it.
public static class NetKeys
- Inheritance
-
NetKeys
- Inherited Members
Remarks
Keys are compared ordinally (case matters) and are unique among the objects spawned at any one time.
Fields
MaxLength
The longest key, in characters.
public const int MaxLength = 128
Field Value
Methods
Describe(string)
key quoted for a message (null shown as such).
public static string Describe(string key)
Parameters
keystring
Returns
DuplicateMessage(string, string, string)
The error for a second object spawned with a key a live object already has.
public static string DuplicateMessage(string key, string holder, string newcomer)
Parameters
keystringThe key both claim.
holderstringThe object that has it (for the message).
newcomerstringThe object that was refused (for the message).
Returns
IsValid(string)
True when key can be a key (Validate(string) finds nothing wrong).
public static bool IsValid(string key)
Parameters
keystring
Returns
NotFoundMessage(string)
The error for a lookup of a key no spawned object has.
public static string NotFoundMessage(string key)
Parameters
keystring
Returns
Validate(string)
Why key cannot be a key, or null when it can.
public static string Validate(string key)
Parameters
keystring