wiki.sine.space | sinespace

Scripting/SNetwork

From wiki.sine.space
Revision as of 13:28, 17 January 2017 by Sinewave (Talk | contribs) (Created page with "The SNetwork class allows you to send messages to other users in the region, and persist/retrieve variables which have been stored within the region. ==Members== {{ScriptFunc...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

The SNetwork class allows you to send messages to other users in the region, and persist/retrieve variables which have been stored within the region.

Members

SendNetworkMessage

void SendNetworkMessage (string key, IDictionary<object,object>);

Sends a networked message to every client with a subscriber listening on 'key'. The message itself can be a dictionary/table containing two columns and any network serializable type (string, float, int, byte, bool and arrays of those types)

No example provided yet


SetShardProperty

void SetShardProperty (string key, string value);

Sets a property named 'key' of the region to 'value'. Will persist until the region is shut down or restarted. (Use SPersistence for longer term storage)

No example provided yet


GetShardProperty

string GetShardProperty (string key);

Gets a previously set key.

No example provided yet


SubscribeToNetwork

void SubscribeToNetwork (string key, Action<SNetworkMessage> callback);

Subscribes to network messages on 'key', will fire a Scripting/SNetworkMessage whenever a matching message is received

No example provided yet