IFluxRoom
public interface IFluxRoomNamespace NodeWorld.SDK.Client.Flux.
The room of the local player, as the FL# scripts of the world see it: the other players, the master, the server clock, the owners of the synchronized objects, the synced states and network events of the scripts. The client is backed by the server; Play mode in a world project has the local player alone.
Properties
LocalPlayerId
uint LocalPlayerId { get; }The id of the local player in the room.
LocalAccountId
string LocalAccountId { get; }The NodeWorld account of the local player (empty if unknown).
LocalDisplayName
string LocalDisplayName { get; }The display name of the local player.
LocalJoinedAt
double LocalJoinedAt { get; }When the local player entered the room (server clock): with FluxRoomPlayer.JoinedAt, the order of arrival.
MasterId
uint MasterId { get; }The master of the room: the player in it the longest (the local player when alone).
ServerTime
double ServerTime { get; }The server clock, in seconds (0 until known).
Players
IReadOnlyList<FluxRoomPlayer> Players { get; }The other players of the room, in the order they entered it, with their last pose.
Methods
RequestOwnership
void RequestOwnership(string objectId)Asks the server for the ownership of the object.
AnswerOwnership
void AnswerOwnership(string objectId, uint requesterId, bool accept)Answers a player who asks for an object the local player owns (OwnershipQueried).
SendObjectState
void SendObjectState(string objectId, Vector3 position, Quaternion rotation, Vector3 velocity)Sends the transform of an object the local player owns.
SendScriptState
void SendScriptState(string objectId, byte slot, byte[] data, bool reliable)Sends the synced state of a script (slot: its index among the FL# scripts of the object); reliable or the latest wins.
SendScriptEvent
void SendScriptEvent(string objectId, byte slot, byte target, uint toPlayerId, string name, byte[] data)target: 1 others, 2 owner, 3 one player, 4 master, 5 the server's scripts (an event to All is sent to the others and run here).
SetVoiceHearing
void SetVoiceHearing(uint speakerId, float far)Up to which distance the local player hears that speaker (far below 0: the room's range).
SpawnObject
void SpawnObject(uint requestId, string templateId, Vector3 position, Quaternion rotation)Asks the server to spawn a copy of a network template for the room; the answer carries requestId back.
DespawnObject
void DespawnObject(string networkId)Asks the server to remove a spawned copy for the room (its owner or the master).
Events
PlayerJoined
event Action<uint> PlayerJoinedAnother player entered the room.
PlayerLeft
event Action<uint> PlayerLeftA player left the room.
MasterChanged
event Action<uint> MasterChangedThe master of the room changed.
ObjectStateReceived
event Action<FluxObjectState> ObjectStateReceivedThe owner of a synced object sent its transform.
OwnershipChanged
event Action<FluxOwnershipChange> OwnershipChangedA synced object changed owner.
OwnershipQueried
event Action<string, uint> OwnershipQueriedA player asks for an object the local player owns: answer with AnswerOwnership.
ScriptStateReceived
event Action<FluxScriptState> ScriptStateReceivedThe owner of an object sent the synced state of one of its scripts (a player who arrives gets the last ones).
ScriptEventReceived
event Action<FluxScriptEvent> ScriptEventReceivedA network event of a script came from a player.
ObjectSpawned
event Action<FluxSpawnedObject> ObjectSpawnedA copy of a network template lives in the room: spawned now, or there before the local player came (FL# Networking.Instantiate).
ObjectSpawnRefused
event Action<uint, byte> ObjectSpawnRefusedThe server refused a spawn of the local player: its request id and why (FluxSpawnRefusals).
ObjectDespawned
event Action<string> ObjectDespawnedA spawned copy was removed from the room (its network id).
