All pages
Powered by GitBook
1 of 1

Loading...

SPersistence

Index

Functions Index

Function Name

Functions

UpdateInfo

void UpdateInfo (Closure onComplete)

Call the onComplete function upon the server saving a value.

Parameter
Type
Description

RetrieveValue

string RetrieveValue (string key)

Returns the saved value with the key.

Parameter
Type
Description

SetValue

void SetValue (string key, string value)

Save a value to the storage record that is accessed with key.

Parameter
Type
Description

UpdateRegionInfo

void UpdateRegionInfo (Action onComplete) void UpdateRegionInfo (Closure onComplete)

Updates your local cache with the most up-to-date values from the server. This function should be called before using the function.

Parameter
Type
Description

RetrieveRegionValue

string RetrieveRegionValue (string key)

Retrieves the saved value from "key" from your local cache. The function should be called first to update your local cache with the most up-to-date values from the server.

Parameter
Type
Description

SetRegionValue

void SetRegionValue (string key, string value)

Save the "value" to "key" on both your local cache and on the server.

Parameter
Type
Description

void UpdateInfo (Closure onComplete)

string RetrieveValue (string key)

void SetValue (string key, string value)

void UpdateRegionInfo (Action onComplete) void UpdateRegionInfo (Closure onComplete)

string RetrieveRegionValue (string key)

void SetRegionValue (string key, string value)

key

string

Max length 48

value

string

Max length 255

key

string

Max length 48

value

string

Max length 255

RetrieveRegionValue
UpdateRegionInfo
function OnCompleteFunction()
--
end

Space.Persistence.UpdateInfo(OnCompleteFunction)
Space.Persistence.SetValue("TestValue","123");

Space.Persistence.UpdateInfo(function ()
    local value = Space.Persistence.RetrieveValue("TestValue")
    Space.Log(value)
end)
--print "123" to console.
Space.Persistence.RetrieveValue("TestValue")
Space.Persistence.SetValue("MyValue", "Hello World");
Space.Persistence.SetRegionValue("TestRegionValue","456")

Space.Persistence.UpdateRegionInfo(function ()
    local value = Space.Persistence.RetrieveRegionValue("TestRegionValue")
    Space.Log(value)
end)
--print "456" to console.
Space.Persistence.RetrieveRegionValue("TestRegionValue");
Space.Persistence.SetRegionValue("TestRegionValue","456");