@quenty/datastore 13.20.4-canary.559.9f38947.0 → 13.21.0-canary.0a5db80.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 +3 -11
- package/package.json +14 -14
- package/src/Server/DataStore.lua +4 -18
- package/src/Server/GameDataStoreService.lua +1 -1
- package/src/Server/Modules/DataStoreDeleteToken.lua +1 -1
- package/src/Server/Modules/DataStoreSnapshotUtils.lua +1 -1
- package/src/Server/Modules/DataStoreStage.lua +2 -2
- package/src/Server/Modules/DataStoreWriter.lua +4 -4
- package/src/Server/PlayerDataStoreManager.lua +3 -3
- package/src/Server/PlayerDataStoreService.lua +3 -3
- package/src/Server/PrivateServerDataStoreService.lua +2 -2
- package/src/Server/Utility/DataStorePromises.lua +4 -10
- package/test/scripts/Client/ClientMain.client.lua +1 -1
- package/test/scripts/Server/ServerMain.server.lua +6 -5
package/CHANGELOG.md
CHANGED
|
@@ -3,25 +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
|
-
|
|
6
|
+
# [13.21.0-canary.0a5db80.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/datastore@13.20.2...@quenty/datastore@13.21.0-canary.0a5db80.0) (2025-05-10)
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
### Bug Fixes
|
|
10
10
|
|
|
11
|
-
* Additional type checking updates ([
|
|
11
|
+
* Additional type checking updates ([7e008c5](https://github.com/Quenty/NevermoreEngine/commit/7e008c58547bd00b5904e56541454a38c8d72ccc))
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
### Features
|
|
15
15
|
|
|
16
|
-
* Add even more types ([
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
## [13.20.3](https://github.com/Quenty/NevermoreEngine/compare/@quenty/datastore@13.20.2...@quenty/datastore@13.20.3) (2025-04-10)
|
|
23
|
-
|
|
24
|
-
**Note:** Version bump only for package @quenty/datastore
|
|
16
|
+
* Add even more types ([0a5db80](https://github.com/Quenty/NevermoreEngine/commit/0a5db8004684dc3e76fd5944599a22602d48cfa9))
|
|
25
17
|
|
|
26
18
|
|
|
27
19
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/datastore",
|
|
3
|
-
"version": "13.
|
|
3
|
+
"version": "13.21.0-canary.0a5db80.0",
|
|
4
4
|
"description": "Quenty's Datastore implementation for Roblox",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Roblox",
|
|
@@ -26,22 +26,22 @@
|
|
|
26
26
|
"Quenty"
|
|
27
27
|
],
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@quenty/baseobject": "10.
|
|
30
|
-
"@quenty/bindtocloseservice": "8.
|
|
31
|
-
"@quenty/loader": "10.
|
|
32
|
-
"@quenty/maid": "3.
|
|
29
|
+
"@quenty/baseobject": "10.9.0-canary.0a5db80.0",
|
|
30
|
+
"@quenty/bindtocloseservice": "8.18.0-canary.0a5db80.0",
|
|
31
|
+
"@quenty/loader": "10.9.0-canary.0a5db80.0",
|
|
32
|
+
"@quenty/maid": "3.5.0-canary.0a5db80.0",
|
|
33
33
|
"@quenty/math": "2.7.3",
|
|
34
|
-
"@quenty/pagesutils": "5.
|
|
35
|
-
"@quenty/promise": "10.
|
|
36
|
-
"@quenty/rx": "13.
|
|
37
|
-
"@quenty/servicebag": "11.
|
|
38
|
-
"@quenty/signal": "7.
|
|
39
|
-
"@quenty/symbol": "3.4.
|
|
40
|
-
"@quenty/table": "3.
|
|
41
|
-
"@quenty/valueobject": "13.
|
|
34
|
+
"@quenty/pagesutils": "5.12.0-canary.0a5db80.0",
|
|
35
|
+
"@quenty/promise": "10.11.0-canary.0a5db80.0",
|
|
36
|
+
"@quenty/rx": "13.18.0-canary.0a5db80.0",
|
|
37
|
+
"@quenty/servicebag": "11.12.0-canary.0a5db80.0",
|
|
38
|
+
"@quenty/signal": "7.11.0-canary.0a5db80.0",
|
|
39
|
+
"@quenty/symbol": "3.4.2",
|
|
40
|
+
"@quenty/table": "3.8.0-canary.0a5db80.0",
|
|
41
|
+
"@quenty/valueobject": "13.18.0-canary.0a5db80.0"
|
|
42
42
|
},
|
|
43
43
|
"publishConfig": {
|
|
44
44
|
"access": "public"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "0a5db8004684dc3e76fd5944599a22602d48cfa9"
|
|
47
47
|
}
|
package/src/Server/DataStore.lua
CHANGED
|
@@ -455,16 +455,9 @@ function DataStore._doDataSync(self: DataStore, writer, doMergeNewData: boolean)
|
|
|
455
455
|
end
|
|
456
456
|
|
|
457
457
|
function DataStore._promiseGetAsyncNoCache(self: DataStore): Promise.Promise<()>
|
|
458
|
-
return self._maid
|
|
459
|
-
:GivePromise(DataStorePromises.getAsync(self._robloxDataStore, self._key))
|
|
458
|
+
return self._maid:GivePromise(DataStorePromises.getAsync(self._robloxDataStore, self._key))
|
|
460
459
|
:Catch(function(err)
|
|
461
|
-
warn(
|
|
462
|
-
string.format(
|
|
463
|
-
"DataStorePromises.getAsync(%q) -> warning - %s",
|
|
464
|
-
tostring(self._key),
|
|
465
|
-
tostring(err or "empty error")
|
|
466
|
-
)
|
|
467
|
-
)
|
|
460
|
+
warn(string.format("DataStorePromises.getAsync(%q) -> warning - %s", tostring(self._key), tostring(err or "empty error")))
|
|
468
461
|
return Promise.rejected(err)
|
|
469
462
|
end)
|
|
470
463
|
:Then(function(data)
|
|
@@ -474,17 +467,10 @@ function DataStore._promiseGetAsyncNoCache(self: DataStore): Promise.Promise<()>
|
|
|
474
467
|
self:MergeDiffSnapshot(diffSnapshot)
|
|
475
468
|
|
|
476
469
|
if self._debugWriting then
|
|
477
|
-
print(
|
|
478
|
-
string.format("DataStorePromises.getAsync(%q) -> Got ", tostring(self._key)),
|
|
479
|
-
data,
|
|
480
|
-
"with diff snapshot",
|
|
481
|
-
diffSnapshot,
|
|
482
|
-
"to view",
|
|
483
|
-
self._viewSnapshot
|
|
484
|
-
)
|
|
470
|
+
print(string.format("DataStorePromises.getAsync(%q) -> Got ", tostring(self._key)), data, "with diff snapshot", diffSnapshot, "to view", self._viewSnapshot)
|
|
485
471
|
-- print(string.format("DataStorePromises.getAsync(%q) -> Got ", self._key), data)
|
|
486
472
|
end
|
|
487
473
|
end)
|
|
488
474
|
end
|
|
489
475
|
|
|
490
|
-
return DataStore
|
|
476
|
+
return DataStore
|
|
@@ -21,13 +21,13 @@ local BaseObject = require("BaseObject")
|
|
|
21
21
|
local DataStoreDeleteToken = require("DataStoreDeleteToken")
|
|
22
22
|
local DataStoreSnapshotUtils = require("DataStoreSnapshotUtils")
|
|
23
23
|
local DataStoreWriter = require("DataStoreWriter")
|
|
24
|
+
local Signal = require("Signal")
|
|
24
25
|
local Maid = require("Maid")
|
|
25
26
|
local Observable = require("Observable")
|
|
26
27
|
local ObservableSubscriptionTable = require("ObservableSubscriptionTable")
|
|
27
28
|
local Promise = require("Promise")
|
|
28
29
|
local PromiseUtils = require("PromiseUtils")
|
|
29
30
|
local Set = require("Set")
|
|
30
|
-
local Signal = require("Signal")
|
|
31
31
|
local Symbol = require("Symbol")
|
|
32
32
|
local Table = require("Table")
|
|
33
33
|
|
|
@@ -1082,4 +1082,4 @@ function DataStoreStage._checkIntegrity(self: DataStoreStage)
|
|
|
1082
1082
|
end
|
|
1083
1083
|
end
|
|
1084
1084
|
|
|
1085
|
-
return DataStoreStage
|
|
1085
|
+
return DataStoreStage
|
|
@@ -7,11 +7,11 @@
|
|
|
7
7
|
|
|
8
8
|
local require = require(script.Parent.loader).load(script)
|
|
9
9
|
|
|
10
|
+
local Table = require("Table")
|
|
10
11
|
local DataStoreDeleteToken = require("DataStoreDeleteToken")
|
|
11
|
-
local DataStoreSnapshotUtils = require("DataStoreSnapshotUtils")
|
|
12
|
-
local Set = require("Set")
|
|
13
12
|
local Symbol = require("Symbol")
|
|
14
|
-
local
|
|
13
|
+
local Set = require("Set")
|
|
14
|
+
local DataStoreSnapshotUtils = require("DataStoreSnapshotUtils")
|
|
15
15
|
|
|
16
16
|
local UNSET_TOKEN = Symbol.named("unsetValue")
|
|
17
17
|
|
|
@@ -328,4 +328,4 @@ function DataStoreWriter.IsCompleteWipe(self: DataStoreWriter): boolean
|
|
|
328
328
|
return false
|
|
329
329
|
end
|
|
330
330
|
|
|
331
|
-
return DataStoreWriter
|
|
331
|
+
return DataStoreWriter
|
|
@@ -56,10 +56,10 @@ local RunService = game:GetService("RunService")
|
|
|
56
56
|
|
|
57
57
|
local BaseObject = require("BaseObject")
|
|
58
58
|
local DataStore = require("DataStore")
|
|
59
|
-
local
|
|
59
|
+
local PromiseUtils = require("PromiseUtils")
|
|
60
60
|
local PendingPromiseTracker = require("PendingPromiseTracker")
|
|
61
|
+
local Maid = require("Maid")
|
|
61
62
|
local Promise = require("Promise")
|
|
62
|
-
local PromiseUtils = require("PromiseUtils")
|
|
63
63
|
|
|
64
64
|
local PlayerDataStoreManager = setmetatable({}, BaseObject)
|
|
65
65
|
PlayerDataStoreManager.ClassName = "PlayerDataStoreManager"
|
|
@@ -244,4 +244,4 @@ function PlayerDataStoreManager._getKey(self: PlayerDataStoreManager, player: Pl
|
|
|
244
244
|
return self._keyGenerator(player)
|
|
245
245
|
end
|
|
246
246
|
|
|
247
|
-
return PlayerDataStoreManager
|
|
247
|
+
return PlayerDataStoreManager
|
|
@@ -8,12 +8,12 @@
|
|
|
8
8
|
|
|
9
9
|
local require = require(script.Parent.loader).load(script)
|
|
10
10
|
|
|
11
|
-
local DataStore = require("DataStore")
|
|
12
|
-
local DataStorePromises = require("DataStorePromises")
|
|
13
|
-
local Maid = require("Maid")
|
|
14
11
|
local PlayerDataStoreManager = require("PlayerDataStoreManager")
|
|
12
|
+
local DataStorePromises = require("DataStorePromises")
|
|
15
13
|
local Promise = require("Promise")
|
|
14
|
+
local Maid = require("Maid")
|
|
16
15
|
local ServiceBag = require("ServiceBag")
|
|
16
|
+
local DataStore = require("DataStore")
|
|
17
17
|
|
|
18
18
|
local PlayerDataStoreService = {}
|
|
19
19
|
PlayerDataStoreService.ServiceName = "PlayerDataStoreService"
|
|
@@ -11,8 +11,8 @@ local require = require(script.Parent.loader).load(script)
|
|
|
11
11
|
local DataStore = require("DataStore")
|
|
12
12
|
local DataStorePromises = require("DataStorePromises")
|
|
13
13
|
local Maid = require("Maid")
|
|
14
|
-
local Promise = require("Promise")
|
|
15
14
|
local ServiceBag = require("ServiceBag")
|
|
15
|
+
local Promise = require("Promise")
|
|
16
16
|
|
|
17
17
|
local PrivateServerDataStoreService = {}
|
|
18
18
|
PrivateServerDataStoreService.ServiceName = "PrivateServerDataStoreService"
|
|
@@ -85,4 +85,4 @@ function PrivateServerDataStoreService:Destroy(): ()
|
|
|
85
85
|
self._maid:DoCleaning()
|
|
86
86
|
end
|
|
87
87
|
|
|
88
|
-
return PrivateServerDataStoreService
|
|
88
|
+
return PrivateServerDataStoreService
|
|
@@ -9,8 +9,8 @@ local require = require(script.Parent.loader).load(script)
|
|
|
9
9
|
|
|
10
10
|
local DataStoreService = game:GetService("DataStoreService")
|
|
11
11
|
|
|
12
|
-
local PagesUtils = require("PagesUtils")
|
|
13
12
|
local Promise = require("Promise")
|
|
13
|
+
local PagesUtils = require("PagesUtils")
|
|
14
14
|
local Table = require("Table")
|
|
15
15
|
|
|
16
16
|
local DataStorePromises = {}
|
|
@@ -260,6 +260,7 @@ local function areEquivalentPageData(data: { OrderedDataStoreEntry }, otherData:
|
|
|
260
260
|
return Table.deepEquivalent(map, otherMap)
|
|
261
261
|
end
|
|
262
262
|
|
|
263
|
+
|
|
263
264
|
--[=[
|
|
264
265
|
Returns a DataStorePages object. The sort order is determined by ascending,
|
|
265
266
|
the length of each page by pageSize, and minValue/maxValue are
|
|
@@ -273,14 +274,7 @@ end
|
|
|
273
274
|
@param maxValue number?
|
|
274
275
|
@return Promise<OrderedDataStoreEntry>
|
|
275
276
|
]=]
|
|
276
|
-
function DataStorePromises.promiseOrderedEntries(
|
|
277
|
-
orderedDataStore: OrderedDataStore,
|
|
278
|
-
ascending: boolean,
|
|
279
|
-
pagesize: number,
|
|
280
|
-
entries: number,
|
|
281
|
-
minValue: number?,
|
|
282
|
-
maxValue: number?
|
|
283
|
-
): Promise.Promise<OrderedDataStoreEntry>
|
|
277
|
+
function DataStorePromises.promiseOrderedEntries(orderedDataStore: OrderedDataStore, ascending: boolean, pagesize: number, entries: number, minValue: number?, maxValue: number?): Promise.Promise<OrderedDataStoreEntry>
|
|
284
278
|
assert(typeof(orderedDataStore) == "Instance" and orderedDataStore:IsA("OrderedDataStore"), "Bad orderedDataStore")
|
|
285
279
|
assert(type(ascending) == "boolean", "Bad ascending")
|
|
286
280
|
assert(type(entries) == "number", "Bad entries")
|
|
@@ -328,4 +322,4 @@ function DataStorePromises.promiseOrderedEntries(
|
|
|
328
322
|
end)
|
|
329
323
|
end
|
|
330
324
|
|
|
331
|
-
return DataStorePromises
|
|
325
|
+
return DataStorePromises
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
@class ServerMain
|
|
3
3
|
]]
|
|
4
4
|
|
|
5
|
-
local HttpService = game:GetService("HttpService")
|
|
6
5
|
local ServerScriptService = game:GetService("ServerScriptService")
|
|
6
|
+
local HttpService = game:GetService("HttpService")
|
|
7
7
|
|
|
8
8
|
local loader = ServerScriptService:FindFirstChild("LoaderUtils", true).Parent
|
|
9
9
|
local require = require(loader).bootstrapGame(ServerScriptService.datastore)
|
|
@@ -48,7 +48,7 @@ local function spinUpGameCopy(prefix: string)
|
|
|
48
48
|
-- print(string.format("(%s) dataStore:Observe()", prefix), viewSnapshot)
|
|
49
49
|
-- end))
|
|
50
50
|
|
|
51
|
-
task.delay(4
|
|
51
|
+
task.delay(4*TURN_TIME, function()
|
|
52
52
|
warn("Blue server is restoring data")
|
|
53
53
|
|
|
54
54
|
substore:Store(guid, true)
|
|
@@ -71,8 +71,8 @@ local function spinUpGameCopy(prefix: string)
|
|
|
71
71
|
warn(string.format("%s server is adding substore data", prefix))
|
|
72
72
|
|
|
73
73
|
substore:Store(guid, {
|
|
74
|
-
playerCount = 5
|
|
75
|
-
startTime = DateTime.now().UnixTimestamp
|
|
74
|
+
playerCount = 5;
|
|
75
|
+
startTime = DateTime.now().UnixTimestamp
|
|
76
76
|
})
|
|
77
77
|
-- dataStore:Save()
|
|
78
78
|
|
|
@@ -109,6 +109,7 @@ local function spinUpGameCopy(prefix: string)
|
|
|
109
109
|
substore:Delete(guid)
|
|
110
110
|
return Promise.resolved()
|
|
111
111
|
end))
|
|
112
|
+
|
|
112
113
|
end)
|
|
113
114
|
|
|
114
115
|
return maid
|
|
@@ -116,4 +117,4 @@ end
|
|
|
116
117
|
|
|
117
118
|
spinUpGameCopy("red")
|
|
118
119
|
spinUpGameCopy("blue")
|
|
119
|
-
spinUpGameCopy("green")
|
|
120
|
+
spinUpGameCopy("green")
|