SNetwork
Index
Functions Index
void SendNetworkMessage (string key, Table message, bool serverOnly, bool loopback) void SendNetworkMessage (string key, Table message, bool serverOnly) void SendNetworkMessage (string key, Table message)
void SendNetworkMessageToUser (string key, Table message, uint userID)
void SubscribeToRegionPropertyUpdate (string key, DynValue onRecieve)
void SubscribeToNetwork (string key, DynValue onRecieve)
void SetRegionProperty (string key, string value)
string GetRegionProperty (string key)
void SetShardProperty (string key, string value)
string GetShardProperty (string key)
Properties Index
bool HasShardProperties get
Returns True upon successful connection to the Region/Shard properties' storage. Region/Shard property operations may not be ready when used during initialization and this function ill help determine readiness.
Functions
SendNetworkMessage
void SendNetworkMessage (string key, Table message)
void SendNetworkMessage (string key, Table message, bool serverOnly)
void SendNetworkMessage (string key, Table message, bool serverOnly, bool loopback)
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)
SendNetworkMessageToUser
void SendNetworkMessageToUser (string key, Table message)
Sends a networked message to a specific user 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)
SubscribeToRegionPropertyUpdate
void SubscribeToRegionPropertyUpdate (string key, DynValue onRecieve)
Subscribes to region property updates on 'key'.
onRecieve
Callback Closure
onRecieve(NetworkPropertyUpdate) will be called when a Region Property is updated. NetworkPropertyUpdate = { Key: "property_name", Message: "property_value" }
SubscribeToNetwork
void SubscribeToNetwork (string key, Action< SNetworkMessageLua > onRecieve) void SubscribeToNetwork (string key, DynValue onRecieve)
Subscribes to network messages on 'key', will fire a SNetworkMessage whenever a matching message is received
SetRegionProperty
void SetRegionProperty (string key, string value)
Stores a key/value pair in the Regions semi-permanent memory. Will be erased when all players exit the region, but will persist as long as the region is open. Subject to rate limiting (10/second on the main grid and 20/second on white-label grids)
GetRegionProperty
string GetRegionProperty (string key)
Retrieves the last set value for 'key' in this region. If you have just joined the region, this may not be populated immedietely.
SetShardProperty
void SetShardProperty (string key, string value)
Sets a property named 'key' of the Shard to 'value'. Will persist until the Shard is shut down or restarted. (Use SPersistence for longer term storage)
GetShardProperty
string GetShardProperty (string key)
Gets a previously set key.
Properties
HasShardProperties
bool HasShardProperties get
Returns True upon successful connection to the Region/Shard properties' storage. Region/Shard property operations may not be ready when used during initialization and this function ill help determine readiness.
