@quenty/datastore 13.1.0 → 13.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [13.2.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/datastore@13.1.0...@quenty/datastore@13.2.0) (2024-03-11)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* custom key for private server datastore ([45dc12d](https://github.com/Quenty/NevermoreEngine/commit/45dc12d46f5901e448cced518e3dace16e0c5b6a))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
# [13.1.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/datastore@13.0.0...@quenty/datastore@13.1.0) (2024-03-09)
|
|
7
18
|
|
|
8
19
|
**Note:** Version bump only for package @quenty/datastore
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/datastore",
|
|
3
|
-
"version": "13.
|
|
3
|
+
"version": "13.2.0",
|
|
4
4
|
"description": "Quenty's Datastore implementation for Roblox",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Roblox",
|
|
@@ -42,5 +42,5 @@
|
|
|
42
42
|
"publishConfig": {
|
|
43
43
|
"access": "public"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "484ca2789ab74cd772d5f31c23dd823ce3d3a353"
|
|
46
46
|
}
|
|
@@ -33,6 +33,10 @@ function PrivateServerDataStoreService:PromiseDataStore()
|
|
|
33
33
|
local dataStore = DataStore.new(robloxDataStore, self:_getKey())
|
|
34
34
|
self._maid:GiveTask(dataStore)
|
|
35
35
|
|
|
36
|
+
if game.PrivateServerOwnerId ~= 0 then
|
|
37
|
+
dataStore:Store("LastPrivateServerOwnerId", game.PrivateServerOwnerId)
|
|
38
|
+
end
|
|
39
|
+
|
|
36
40
|
self._maid:GiveTask(self._bindToCloseService:RegisterPromiseOnCloseCallback(function()
|
|
37
41
|
return dataStore:Save()
|
|
38
42
|
end))
|
|
@@ -43,6 +47,12 @@ function PrivateServerDataStoreService:PromiseDataStore()
|
|
|
43
47
|
return self._dataStorePromise
|
|
44
48
|
end
|
|
45
49
|
|
|
50
|
+
function PrivateServerDataStoreService:SetCustomKey(customKey)
|
|
51
|
+
assert(self._dataStorePromise == nil, "[PrivateServerDataStoreService] - Already got datastore, cannot set custom key")
|
|
52
|
+
|
|
53
|
+
self._customKey = customKey
|
|
54
|
+
end
|
|
55
|
+
|
|
46
56
|
function PrivateServerDataStoreService:_promiseRobloxDataStore()
|
|
47
57
|
if self._robloxDataStorePromise then
|
|
48
58
|
return self._robloxDataStorePromise
|
|
@@ -55,6 +65,9 @@ function PrivateServerDataStoreService:_promiseRobloxDataStore()
|
|
|
55
65
|
end
|
|
56
66
|
|
|
57
67
|
function PrivateServerDataStoreService:_getKey()
|
|
68
|
+
if self._customKey then
|
|
69
|
+
return self._customKey
|
|
70
|
+
end
|
|
58
71
|
if game.PrivateServerId ~= "" then
|
|
59
72
|
return game.PrivateServerId
|
|
60
73
|
else
|