@quenty/gameconfig 12.24.3 → 12.24.4-canary.559.339cfa7.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.
Files changed (27) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/package.json +27 -27
  3. package/src/Client/Cmdr/GameConfigCommandServiceClient.lua +21 -19
  4. package/src/Client/Config/Asset/GameConfigAssetClient.lua +20 -19
  5. package/src/Client/Config/Config/GameConfigClient.lua +4 -4
  6. package/src/Client/GameConfigBindersClient.lua +2 -2
  7. package/src/Client/GameConfigServiceClient.lua +7 -8
  8. package/src/Server/Cmdr/GameConfigCommandService.lua +30 -30
  9. package/src/Server/Config/Asset/GameConfigAsset.lua +20 -9
  10. package/src/Server/Config/Config/GameConfig.lua +7 -6
  11. package/src/Server/GameConfigBindersServer.lua +2 -2
  12. package/src/Server/GameConfigService.lua +16 -11
  13. package/src/Server/GameConfigServiceConstants.lua +3 -2
  14. package/src/Server/Mantle/MantleConfigProvider.lua +6 -7
  15. package/src/Shared/Cmdr/GameConfigCmdrUtils.lua +1 -1
  16. package/src/Shared/Config/Asset/GameConfigAssetBase.lua +29 -29
  17. package/src/Shared/Config/Asset/GameConfigAssetConstants.lua +4 -3
  18. package/src/Shared/Config/Asset/GameConfigAssetUtils.lua +12 -6
  19. package/src/Shared/Config/AssetTypes/GameConfigAssetTypeUtils.lua +15 -14
  20. package/src/Shared/Config/AssetTypes/GameConfigAssetTypes.lua +1 -0
  21. package/src/Shared/Config/Config/GameConfigBase.lua +13 -13
  22. package/src/Shared/Config/Config/GameConfigConstants.lua +3 -2
  23. package/src/Shared/Config/Config/GameConfigUtils.lua +10 -7
  24. package/src/Shared/Config/Picker/GameConfigPicker.lua +25 -28
  25. package/src/Shared/GameConfigDataService.lua +18 -7
  26. package/src/Shared/GameConfigTranslator.lua +7 -6
  27. package/test/modules/Server/TestMantleConfigProvider/init.lua +1 -1
@@ -6,20 +6,17 @@
6
6
  local require = require(script.Parent.loader).load(script)
7
7
 
8
8
  local BaseObject = require("BaseObject")
9
- local RxBinderUtils = require("RxBinderUtils")
10
- local ObservableMapSet = require("ObservableMapSet")
11
- local RxBrioUtils = require("RxBrioUtils")
9
+ local Brio = require("Brio")
10
+ local GameConfigAssetBase = require("GameConfigAssetBase")
12
11
  local GameConfigAssetTypeUtils = require("GameConfigAssetTypeUtils")
13
- local Promise = require("Promise")
12
+ local GameConfigAssetTypes = require("GameConfigAssetTypes")
14
13
  local GameConfigAssetUtils = require("GameConfigAssetUtils")
15
- local _ServiceBag = require("ServiceBag")
16
- local _GameConfigAssetTypes = require("GameConfigAssetTypes")
17
- local _Observable = require("Observable")
18
- local _Brio = require("Brio")
19
- local _GameConfigAssetBase = require("GameConfigAssetBase")
20
- local _Promise = require("Promise")
21
- local _Binder = require("Binder")
22
- local _Maid = require("Maid")
14
+ local Observable = require("Observable")
15
+ local ObservableMapSet = require("ObservableMapSet")
16
+ local Promise = require("Promise")
17
+ local RxBinderUtils = require("RxBinderUtils")
18
+ local RxBrioUtils = require("RxBrioUtils")
19
+ local ServiceBag = require("ServiceBag")
23
20
 
24
21
  local GameConfigPicker = setmetatable({}, BaseObject)
25
22
  GameConfigPicker.ClassName = "GameConfigPicker"
@@ -27,12 +24,12 @@ GameConfigPicker.__index = GameConfigPicker
27
24
 
28
25
  export type GameConfigPicker = typeof(setmetatable(
29
26
  {} :: {
30
- _serviceBag: _ServiceBag.ServiceBag,
27
+ _serviceBag: ServiceBag.ServiceBag,
31
28
  },
32
29
  {} :: typeof({ __index = GameConfigPicker })
33
30
  )) & BaseObject.BaseObject
34
- type GameConfigAssetType = _GameConfigAssetTypes.GameConfigAssetType
35
- type GameConfigAssetBase = _GameConfigAssetBase.GameConfigAssetBase
31
+ type GameConfigAssetType = GameConfigAssetTypes.GameConfigAssetType
32
+ type GameConfigAssetBase = GameConfigAssetBase.GameConfigAssetBase
36
33
 
37
34
  --[=[
38
35
  Constructs a new game config picker. Should be gotten by [GameConfigService].
@@ -43,7 +40,7 @@ type GameConfigAssetBase = _GameConfigAssetBase.GameConfigAssetBase
43
40
  @return GameConfigPicker
44
41
  ]=]
45
42
  function GameConfigPicker.new(
46
- serviceBag: _ServiceBag.ServiceBag,
43
+ serviceBag: ServiceBag.ServiceBag,
47
44
  gameConfigBinder,
48
45
  gameConfigAssetBinder
49
46
  ): GameConfigPicker
@@ -77,7 +74,7 @@ end
77
74
  function GameConfigPicker.ObserveActiveAssetOfTypeBrio(
78
75
  self: GameConfigPicker,
79
76
  assetType: string
80
- ): _Observable.Observable<_Brio.Brio<GameConfigAssetBase>>
77
+ ): Observable.Observable<Brio.Brio<GameConfigAssetBase>>
81
78
  assert(GameConfigAssetTypeUtils.isAssetType(assetType), "Bad assetType")
82
79
 
83
80
  return self:ObserveActiveConfigsBrio(game.GameId):Pipe({
@@ -147,7 +144,7 @@ end
147
144
  function GameConfigPicker.ObserveActiveAssetOfAssetIdBrio(
148
145
  self: GameConfigPicker,
149
146
  assetId: number
150
- ): _Observable.Observable<_Brio.Brio<GameConfigAssetBase>>
147
+ ): Observable.Observable<Brio.Brio<GameConfigAssetBase>>
151
148
  assert(type(assetId) == "number", "Bad assetId")
152
149
 
153
150
  return self:ObserveActiveConfigsBrio(game.GameId):Pipe({
@@ -166,7 +163,7 @@ end
166
163
  function GameConfigPicker.ObserveActiveAssetOfKeyBrio(
167
164
  self: GameConfigPicker,
168
165
  assetKey: string
169
- ): _Observable.Observable<_Brio.Brio<GameConfigAssetBase>>
166
+ ): Observable.Observable<Brio.Brio<GameConfigAssetBase>>
170
167
  assert(type(assetKey) == "string", "Bad assetKey")
171
168
 
172
169
  return self:ObserveActiveConfigsBrio(game.GameId):Pipe({
@@ -183,7 +180,7 @@ end
183
180
  ]=]
184
181
  function GameConfigPicker.ObserveActiveConfigsBrio(
185
182
  self: GameConfigPicker
186
- ): _Observable.Observable<_Brio.Brio<GameConfigAssetBase>>
183
+ ): Observable.Observable<Brio.Brio<GameConfigAssetBase>>
187
184
  return self:_observeConfigsForGameIdBrio(game.GameId)
188
185
  end
189
186
 
@@ -229,9 +226,9 @@ end
229
226
  ]=]
230
227
  function GameConfigPicker.PromisePriceInRobux(
231
228
  self: GameConfigPicker,
232
- assetType: _GameConfigAssetTypes.GameConfigAssetType,
229
+ assetType: GameConfigAssetTypes.GameConfigAssetType,
233
230
  assetIdOrKey
234
- ): _Promise.Promise<number>
231
+ ): Promise.Promise<number>
235
232
  assert(GameConfigAssetTypeUtils.isAssetType(assetType), "Bad assetType")
236
233
  assert(type(assetIdOrKey) == "number" or type(assetIdOrKey) == "string", "Bad assetIdOrKey")
237
234
 
@@ -271,7 +268,7 @@ end
271
268
  ]=]
272
269
  function GameConfigPicker.FindFirstActiveAssetOfKey(
273
270
  self: GameConfigPicker,
274
- assetType: _GameConfigAssetTypes.GameConfigAssetType,
271
+ assetType: GameConfigAssetTypes.GameConfigAssetType,
275
272
  assetKey: string
276
273
  ): GameConfigAssetBase?
277
274
  assert(GameConfigAssetTypeUtils.isAssetType(assetType), "Bad assetType")
@@ -294,7 +291,7 @@ end
294
291
  ]=]
295
292
  function GameConfigPicker.GetAllActiveAssetsOfType(
296
293
  self: GameConfigPicker,
297
- assetType: _GameConfigAssetTypes.GameConfigAssetType
294
+ assetType: GameConfigAssetTypes.GameConfigAssetType
298
295
  )
299
296
  local assetList = {}
300
297
  for _, gameConfig in self:GetActiveConfigs() do
@@ -308,7 +305,7 @@ end
308
305
  function GameConfigPicker._observeConfigsForGameIdBrio(
309
306
  self: GameConfigPicker,
310
307
  gameId: number
311
- ): _Observable.Observable<_Brio.Brio<GameConfigAssetBase>>
308
+ ): Observable.Observable<Brio.Brio<GameConfigAssetBase>>
312
309
  assert(type(gameId) == "number", "Bad gameId")
313
310
 
314
311
  return self._gameIdToConfigSet:ObserveItemsForKeyBrio(gameId)
@@ -329,7 +326,7 @@ end
329
326
  ]=]
330
327
  function GameConfigPicker.ToAssetId(
331
328
  self: GameConfigPicker,
332
- assetType: _GameConfigAssetTypes.GameConfigAssetType,
329
+ assetType: GameConfigAssetTypes.GameConfigAssetType,
333
330
  assetIdOrKey: string | number
334
331
  ): number?
335
332
  assert(GameConfigAssetTypeUtils.isAssetType(assetType), "Bad assetType")
@@ -356,9 +353,9 @@ end
356
353
  ]=]
357
354
  function GameConfigPicker.ObserveToAssetIdBrio(
358
355
  self: GameConfigPicker,
359
- assetType: _GameConfigAssetTypes.GameConfigAssetType,
356
+ assetType: GameConfigAssetTypes.GameConfigAssetType,
360
357
  assetIdOrKey: string | number
361
- ): _Observable.Observable<_Brio.Brio<number>>
358
+ ): Observable.Observable<Brio.Brio<number>>
362
359
  assert(GameConfigAssetTypeUtils.isAssetType(assetType), "Bad assetType")
363
360
  assert(type(assetIdOrKey) == "number" or type(assetIdOrKey) == "string", "Bad assetIdOrKey")
364
361
 
@@ -1,27 +1,38 @@
1
+ --!strict
1
2
  --[=[
2
3
  @class GameConfigDataService
3
4
  ]=]
4
5
 
5
6
  local require = require(script.Parent.loader).load(script)
6
7
 
7
- local _ServiceBag = require("ServiceBag")
8
+ local GameConfigPicker = require("GameConfigPicker")
9
+ local ServiceBag = require("ServiceBag")
8
10
 
9
11
  local GameConfigDataService = {}
10
12
  GameConfigDataService.ServiceName = "GameConfigDataService"
11
13
 
12
- function GameConfigDataService:Init(serviceBag: _ServiceBag.ServiceBag)
14
+ export type GameConfigDataService = typeof(setmetatable(
15
+ {} :: {
16
+ _serviceBag: ServiceBag.ServiceBag,
17
+ _configPicker: GameConfigPicker.GameConfigPicker,
18
+ },
19
+ {} :: typeof({ __index = GameConfigDataService })
20
+ ))
21
+
22
+ function GameConfigDataService.Init(self: GameConfigDataService, serviceBag: ServiceBag.ServiceBag)
13
23
  assert(not self._serviceBag, "Already initialized")
14
24
  self._serviceBag = assert(serviceBag, "No serviceBag")
15
-
16
-
17
25
  end
18
26
 
19
- function GameConfigDataService:SetConfigPicker(configPicker)
27
+ function GameConfigDataService.SetConfigPicker(
28
+ self: GameConfigDataService,
29
+ configPicker: GameConfigPicker.GameConfigPicker
30
+ )
20
31
  self._configPicker = configPicker
21
32
  end
22
33
 
23
- function GameConfigDataService:GetConfigPicker()
34
+ function GameConfigDataService.GetConfigPicker(self: GameConfigDataService): GameConfigPicker.GameConfigPicker
24
35
  return self._configPicker
25
36
  end
26
37
 
27
- return GameConfigDataService
38
+ return GameConfigDataService
@@ -1,3 +1,4 @@
1
+ --!strict
1
2
  --[[
2
3
  Provides translations for game configuration
3
4
  @class GameConfigTranslator
@@ -8,10 +9,10 @@ local require = require(script.Parent.loader).load(script)
8
9
  return require("JSONTranslator").new("GameConfigTranslator", "en", {
9
10
  assetKeys = {
10
11
  name = {
11
- unknown = "???";
12
- };
12
+ unknown = "???",
13
+ },
13
14
  description = {
14
- unknown = "???";
15
- };
16
- };
17
- })
15
+ unknown = "???",
16
+ },
17
+ },
18
+ })
@@ -6,4 +6,4 @@ local require = require(script.Parent.loader).load(script)
6
6
 
7
7
  local MantleConfigProvider = require("MantleConfigProvider")
8
8
 
9
- return MantleConfigProvider.new(script)
9
+ return MantleConfigProvider.new(script)