SPersistence
في هذا الصنفUpdateInfo
| دالة | UpdateInfo | Call the onComplete function upon the server saving a value. |
| دالة | RetrieveValue | Returns the saved value with the key. |
| دالة | SetValue | Save a value to the storage record that is accessed with key. |
| دالة | UpdateRegionInfo | Updates your local cache with the most up-to-date values from the server. |
| دالة | RetrieveRegionValue | Retrieves the saved value from "key" from your local cache. |
| دالة | SetRegionValue | Save the "value" to "key" on both your local cache and on the server. |
الدوال
UpdateInfo
Call the onComplete function upon the server saving a value.
المعاملات
| الاسم | النوع | القيمة الافتراضية |
|---|---|---|
| onComplete | Closure | – |
القيم المرجعة
void
مثال
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.
RetrieveValue
Returns the saved value with the key.
المعاملات
| الاسم | النوع | القيمة الافتراضية |
|---|---|---|
| key | string | – |
القيم المرجعة
string
مثال
Space.Persistence.RetrieveValue("TestValue")
SetValue
Save a value to the storage record that is accessed with key.
المعاملات
| المعامل | النوع | الوصف |
|---|---|---|
| key | string | Max length 48 |
| value | string | Max length 255 |
القيم المرجعة
void
مثال
Space.Persistence.SetValue("MyValue", "Hello World");
UpdateRegionInfo
Updates your local cache with the most up-to-date values from the server. This function should be called before using the RetrieveRegionValue function.
المعاملات
| الاسم | النوع | القيمة الافتراضية |
|---|---|---|
| onComplete | Action | – |
| onComplete | Closure | – |
القيم المرجعة
void
مثال
Space.Persistence.SetRegionValue("TestRegionValue","456")
Space.Persistence.UpdateRegionInfo(function ()
local value = Space.Persistence.RetrieveRegionValue("TestRegionValue")
Space.Log(value)
end)
--print "456" to console.
RetrieveRegionValue
Retrieves the saved value from "key" from your local cache. The UpdateRegionInfo function should be called first to update your local cache with the most up-to-date values from the server.
المعاملات
| الاسم | النوع | القيمة الافتراضية |
|---|---|---|
| key | string | – |
القيم المرجعة
string
مثال
Space.Persistence.RetrieveRegionValue("TestRegionValue");
SetRegionValue
Save the "value" to "key" on both your local cache and on the server.
المعاملات
| المعامل | النوع | الوصف |
|---|---|---|
| key | string | Max length 48 |
| value | string | Max length 255 |
القيم المرجعة
void
مثال
Space.Persistence.SetRegionValue("TestRegionValue","456");



