@quenty/gameconfig 12.11.0 → 12.12.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 +16 -0
- package/package.json +23 -23
- package/src/Client/GameConfigServiceClient.lua +1 -1
- package/src/Server/GameConfigService.lua +1 -1
- package/src/Shared/Config/Asset/GameConfigAssetBase.lua +1 -1
- package/src/Shared/Config/Asset/GameConfigAssetUtils.lua +10 -7
- package/src/Shared/Config/Picker/GameConfigPicker.lua +5 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,22 @@
|
|
|
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
|
+
# [12.12.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/gameconfig@12.11.0...@quenty/gameconfig@12.12.0) (2024-10-04)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* Fix stuff ([016376c](https://github.com/Quenty/NevermoreEngine/commit/016376c87911329b9059f7644bcb4f9de8245f2f))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Performance Improvements
|
|
15
|
+
|
|
16
|
+
* Use marketplace info cache when querying cloud data ([12ed4a6](https://github.com/Quenty/NevermoreEngine/commit/12ed4a60ef5d908a99dc2a96134024db659077bf))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
6
22
|
# [12.11.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/gameconfig@12.10.0...@quenty/gameconfig@12.11.0) (2024-09-25)
|
|
7
23
|
|
|
8
24
|
**Note:** Version bump only for package @quenty/gameconfig
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/gameconfig",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.12.0",
|
|
4
4
|
"description": "Configuration service to specify Roblox badges, products, and other specific assets.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Roblox",
|
|
@@ -27,31 +27,31 @@
|
|
|
27
27
|
"access": "public"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@quenty/attributeutils": "^14.
|
|
31
|
-
"@quenty/badgeutils": "^10.
|
|
32
|
-
"@quenty/baseobject": "^10.
|
|
33
|
-
"@quenty/binder": "^14.
|
|
34
|
-
"@quenty/brio": "^14.
|
|
35
|
-
"@quenty/clienttranslator": "^14.
|
|
36
|
-
"@quenty/cmdrservice": "^13.
|
|
37
|
-
"@quenty/instanceutils": "^13.
|
|
38
|
-
"@quenty/loader": "^10.
|
|
39
|
-
"@quenty/maid": "^3.
|
|
40
|
-
"@quenty/marketplaceutils": "^11.
|
|
41
|
-
"@quenty/observablecollection": "^12.
|
|
42
|
-
"@quenty/playerutils": "^8.
|
|
30
|
+
"@quenty/attributeutils": "^14.8.0",
|
|
31
|
+
"@quenty/badgeutils": "^10.6.0",
|
|
32
|
+
"@quenty/baseobject": "^10.6.0",
|
|
33
|
+
"@quenty/binder": "^14.9.0",
|
|
34
|
+
"@quenty/brio": "^14.8.0",
|
|
35
|
+
"@quenty/clienttranslator": "^14.9.0",
|
|
36
|
+
"@quenty/cmdrservice": "^13.10.0",
|
|
37
|
+
"@quenty/instanceutils": "^13.8.0",
|
|
38
|
+
"@quenty/loader": "^10.6.0",
|
|
39
|
+
"@quenty/maid": "^3.4.0",
|
|
40
|
+
"@quenty/marketplaceutils": "^11.7.0",
|
|
41
|
+
"@quenty/observablecollection": "^12.8.0",
|
|
42
|
+
"@quenty/playerutils": "^8.8.0",
|
|
43
43
|
"@quenty/preferredparentutils": "^4.3.0",
|
|
44
|
-
"@quenty/promise": "^10.
|
|
44
|
+
"@quenty/promise": "^10.6.0",
|
|
45
45
|
"@quenty/pseudolocalize": "^3.4.0",
|
|
46
|
-
"@quenty/remotefunctionutils": "^10.
|
|
47
|
-
"@quenty/remoting": "^12.
|
|
48
|
-
"@quenty/rx": "^13.
|
|
49
|
-
"@quenty/rxbinderutils": "^14.
|
|
50
|
-
"@quenty/servicebag": "^11.
|
|
51
|
-
"@quenty/statestack": "^14.
|
|
46
|
+
"@quenty/remotefunctionutils": "^10.6.0",
|
|
47
|
+
"@quenty/remoting": "^12.9.0",
|
|
48
|
+
"@quenty/rx": "^13.8.0",
|
|
49
|
+
"@quenty/rxbinderutils": "^14.9.0",
|
|
50
|
+
"@quenty/servicebag": "^11.8.0",
|
|
51
|
+
"@quenty/statestack": "^14.9.0",
|
|
52
52
|
"@quenty/string": "^3.3.0",
|
|
53
53
|
"@quenty/table": "^3.5.0",
|
|
54
|
-
"@quenty/valueobject": "^13.
|
|
54
|
+
"@quenty/valueobject": "^13.8.0"
|
|
55
55
|
},
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "035abfa088c854a73e1c65b350267eaa17669646"
|
|
57
57
|
}
|
|
@@ -24,7 +24,7 @@ function GameConfigServiceClient:Init(serviceBag)
|
|
|
24
24
|
self._serviceBag:GetService(require("GameConfigDataService"))
|
|
25
25
|
self._binders = self._serviceBag:GetService(require("GameConfigBindersClient"))
|
|
26
26
|
|
|
27
|
-
self._configPicker = self._maid:Add(GameConfigPicker.new(self._binders.GameConfig, self._binders.GameConfigAsset))
|
|
27
|
+
self._configPicker = self._maid:Add(GameConfigPicker.new(self._serviceBag, self._binders.GameConfig, self._binders.GameConfigAsset))
|
|
28
28
|
|
|
29
29
|
self._serviceBag:GetService(require("GameConfigDataService")):SetConfigPicker(self._configPicker)
|
|
30
30
|
end
|
|
@@ -37,7 +37,7 @@ function GameConfigService:Init(serviceBag)
|
|
|
37
37
|
self._binders = self._serviceBag:GetService(require("GameConfigBindersServer"))
|
|
38
38
|
|
|
39
39
|
-- Setup picker
|
|
40
|
-
self._configPicker = self._maid:Add(GameConfigPicker.new(self._binders.GameConfig, self._binders.GameConfigAsset))
|
|
40
|
+
self._configPicker = self._maid:Add(GameConfigPicker.new(self._serviceBag, self._binders.GameConfig, self._binders.GameConfigAsset))
|
|
41
41
|
|
|
42
42
|
self._getPreferredParent = PreferredParentUtils.createPreferredParentRetriever(ReplicatedStorage, "GameConfigs")
|
|
43
43
|
|
|
@@ -259,7 +259,7 @@ function GameConfigAssetBase:_observeCloudDataFromState()
|
|
|
259
259
|
end
|
|
260
260
|
|
|
261
261
|
function GameConfigAssetBase:_promiseCloudDataForState(state)
|
|
262
|
-
return GameConfigAssetUtils.promiseCloudDataForAssetType(state.assetType, state.assetId)
|
|
262
|
+
return GameConfigAssetUtils.promiseCloudDataForAssetType(self._serviceBag, state.assetType, state.assetId)
|
|
263
263
|
end
|
|
264
264
|
|
|
265
265
|
return GameConfigAssetBase
|
|
@@ -8,7 +8,7 @@ local AttributeUtils = require("AttributeUtils")
|
|
|
8
8
|
local GameConfigAssetConstants = require("GameConfigAssetConstants")
|
|
9
9
|
local BadgeUtils = require("BadgeUtils")
|
|
10
10
|
local GameConfigAssetTypes = require("GameConfigAssetTypes")
|
|
11
|
-
local
|
|
11
|
+
local MarketplaceServiceCache = require("MarketplaceServiceCache")
|
|
12
12
|
local Promise = require("Promise")
|
|
13
13
|
|
|
14
14
|
local GameConfigAssetUtils = {}
|
|
@@ -36,27 +36,30 @@ end
|
|
|
36
36
|
--[=[
|
|
37
37
|
Promises cloud data for a given asset type
|
|
38
38
|
|
|
39
|
+
@param serviceBag ServiceBag
|
|
39
40
|
@param assetType GameConfigAssetType
|
|
40
41
|
@param assetId number
|
|
41
42
|
@return Promise<any>
|
|
42
43
|
]=]
|
|
43
|
-
function GameConfigAssetUtils.promiseCloudDataForAssetType(assetType, assetId)
|
|
44
|
+
function GameConfigAssetUtils.promiseCloudDataForAssetType(serviceBag, assetType, assetId)
|
|
44
45
|
assert(type(assetType) == "string", "Bad assetType")
|
|
45
46
|
assert(type(assetId) == "number", "Bad assetId")
|
|
46
47
|
|
|
48
|
+
local marketplaceServiceCache = serviceBag:GetService(MarketplaceServiceCache)
|
|
49
|
+
|
|
47
50
|
-- We really hope this stuff is cached
|
|
48
51
|
if assetType == GameConfigAssetTypes.BADGE then
|
|
49
52
|
return BadgeUtils.promiseBadgeInfo(assetId)
|
|
50
53
|
elseif assetType == GameConfigAssetTypes.PRODUCT then
|
|
51
|
-
return
|
|
54
|
+
return marketplaceServiceCache:PromiseProductInfo(assetId, Enum.InfoType.Product)
|
|
52
55
|
elseif assetType == GameConfigAssetTypes.PASS then
|
|
53
|
-
return
|
|
56
|
+
return marketplaceServiceCache:PromiseProductInfo(assetId, Enum.InfoType.GamePass)
|
|
54
57
|
elseif assetType == GameConfigAssetTypes.PLACE then
|
|
55
|
-
return
|
|
58
|
+
return marketplaceServiceCache:PromiseProductInfo(assetId, Enum.InfoType.Asset)
|
|
56
59
|
elseif assetType == GameConfigAssetTypes.ASSET then
|
|
57
|
-
return
|
|
60
|
+
return marketplaceServiceCache:PromiseProductInfo(assetId, Enum.InfoType.Asset)
|
|
58
61
|
elseif assetType == GameConfigAssetTypes.BUNDLE then
|
|
59
|
-
return
|
|
62
|
+
return marketplaceServiceCache:PromiseProductInfo(assetId, Enum.InfoType.Bundle)
|
|
60
63
|
else
|
|
61
64
|
local errorMessage = string.format("[GameConfigAssetUtils.promiseCloudDataForAssetType] - Unknown GameConfigAssetType %q. Ignoring asset.",
|
|
62
65
|
tostring(assetType))
|
|
@@ -20,14 +20,17 @@ GameConfigPicker.__index = GameConfigPicker
|
|
|
20
20
|
--[=[
|
|
21
21
|
Constructs a new game config picker. Should be gotten by [GameConfigService].
|
|
22
22
|
|
|
23
|
+
@param serviceBag ServiceBag
|
|
23
24
|
@param gameConfigBinder Binder<GameConfig>
|
|
24
25
|
@param gameConfigAssetBinder Binder<GameConfigAsset>
|
|
26
|
+
@return GameConfigPicker
|
|
25
27
|
]=]
|
|
26
|
-
function GameConfigPicker.new(gameConfigBinder, gameConfigAssetBinder)
|
|
28
|
+
function GameConfigPicker.new(serviceBag, gameConfigBinder, gameConfigAssetBinder)
|
|
27
29
|
local self = setmetatable(BaseObject.new(), GameConfigPicker)
|
|
28
30
|
|
|
29
31
|
self._gameConfigBinder = assert(gameConfigBinder, "No gameConfigBinder")
|
|
30
32
|
self._gameConfigAssetBinder = assert(gameConfigAssetBinder, "No gameConfigAssetBinder")
|
|
33
|
+
self._serviceBag = assert(serviceBag, "No serviceBag")
|
|
31
34
|
|
|
32
35
|
self._gameIdToConfigSet = self._maid:Add(ObservableMapSet.new())
|
|
33
36
|
|
|
@@ -204,7 +207,7 @@ function GameConfigPicker:PromisePriceInRobux(assetType, assetIdOrKey)
|
|
|
204
207
|
return asset:PromiseCloudPriceInRobux()
|
|
205
208
|
end
|
|
206
209
|
|
|
207
|
-
return GameConfigAssetUtils.promiseCloudDataForAssetType(assetType, assetIdOrKey)
|
|
210
|
+
return GameConfigAssetUtils.promiseCloudDataForAssetType(self._serviceBag, assetType, assetIdOrKey)
|
|
208
211
|
:Then(function(cloudData)
|
|
209
212
|
if type(cloudData.PriceInRobux) == "number" then
|
|
210
213
|
return cloudData.PriceInRobux
|