@quenty/gameproductservice 7.1.1 → 7.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
+ # [7.2.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/gameproductservice@7.1.1...@quenty/gameproductservice@7.2.0) (2023-04-20)
7
+
8
+
9
+ ### Features
10
+
11
+ * Add ReceiptProcessing ([6590e0f](https://github.com/Quenty/NevermoreEngine/commit/6590e0fbb091956f903ddebc3110e4f86ec020d1))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [7.1.1](https://github.com/Quenty/NevermoreEngine/compare/@quenty/gameproductservice@7.1.0...@quenty/gameproductservice@7.1.1) (2023-04-13)
7
18
 
8
19
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quenty/gameproductservice",
3
- "version": "7.1.1",
3
+ "version": "7.2.0",
4
4
  "description": "Generalized monetization system for handling products and purchases correctly.",
5
5
  "keywords": [
6
6
  "Roblox",
@@ -27,17 +27,18 @@
27
27
  "access": "public"
28
28
  },
29
29
  "dependencies": {
30
- "@quenty/attributeutils": "^8.12.0",
30
+ "@quenty/attributeutils": "^8.13.0",
31
31
  "@quenty/baseobject": "^6.2.1",
32
32
  "@quenty/binder": "^8.14.0",
33
- "@quenty/gameconfig": "^5.23.0",
33
+ "@quenty/gameconfig": "^5.24.0",
34
34
  "@quenty/instanceutils": "^7.12.0",
35
35
  "@quenty/loader": "^6.2.1",
36
36
  "@quenty/maid": "^2.5.0",
37
37
  "@quenty/marketplaceutils": "^6.6.0",
38
- "@quenty/observablecollection": "^5.13.0",
38
+ "@quenty/observablecollection": "^5.14.0",
39
39
  "@quenty/playerbinder": "^8.14.0",
40
40
  "@quenty/promise": "^6.5.0",
41
+ "@quenty/receiptprocessing": "^1.1.0",
41
42
  "@quenty/remoting": "^6.5.0",
42
43
  "@quenty/rx": "^7.10.0",
43
44
  "@quenty/rxbinderutils": "^8.15.0",
@@ -48,5 +49,5 @@
48
49
  "@quenty/table": "^3.2.0",
49
50
  "@quenty/valueobject": "^7.12.0"
50
51
  },
51
- "gitHead": "1e4be3b2924ee63bfad9a0a00c4ad538af0470dc"
52
+ "gitHead": "15d1274fffdaef706f849fd5dca2f14364c1264e"
52
53
  }
@@ -69,10 +69,10 @@ function GameProductServiceClient:Start()
69
69
 
70
70
  local maid = brio:ToMaid()
71
71
  local playerProductManager = brio:GetValue()
72
- local playerMrketeer = playerProductManager:GetMarketeer()
72
+ local playerMarketeer = playerProductManager:GetMarketeer()
73
73
 
74
74
  local function exposeSignal(signal, assetType)
75
- maid:GiveTask(playerMrketeer:GetAssetTrackerOrError(assetType).Purchased:Connect(function(...)
75
+ maid:GiveTask(playerMarketeer:GetAssetTrackerOrError(assetType).Purchased:Connect(function(...)
76
76
  signal:Fire(...)
77
77
  end))
78
78
  end
@@ -14,7 +14,6 @@
14
14
  local require = require(script.Parent.loader).load(script)
15
15
 
16
16
  local Players = game:GetService("Players")
17
- local MarketplaceService = game:GetService("MarketplaceService")
18
17
 
19
18
  local Maid = require("Maid")
20
19
  local GameProductServiceHelper = require("GameProductServiceHelper")
@@ -38,6 +37,7 @@ function GameProductService:Init(serviceBag)
38
37
 
39
38
  -- External
40
39
  self._gameConfigService = self._serviceBag:GetService(require("GameConfigService"))
40
+ self._receiptProcessingService = self._serviceBag:GetService(require("ReceiptProcessingService"))
41
41
 
42
42
  -- Internal
43
43
  self._binders = self._serviceBag:GetService(require("GameProductBindersServer"))
@@ -84,21 +84,13 @@ function GameProductService:Start()
84
84
  exposeSignal(self.AssetPurchased, GameConfigAssetTypes.ASSET)
85
85
  exposeSignal(self.BundlePurchased, GameConfigAssetTypes.BUNDLE)
86
86
  end))
87
- end
88
-
89
- function GameProductService:BindProcessReceipt()
90
- MarketplaceService.ProcessReceipt = function(...)
91
- return self:HandleProcessReceipt(...)
92
- end
93
87
 
94
- self._maid:GiveTask(function()
95
- task.spawn(function()
96
- -- This might be unsafe
97
- MarketplaceService.ProcessReceipt = nil
98
- end)
99
- end)
88
+ self._maid:GiveTask(self._receiptProcessingService:RegisterReceiptProcessor(function(receiptInfo)
89
+ self:_handleProcessReceipt(receiptInfo)
90
+ end))
100
91
  end
101
92
 
93
+
102
94
  --[=[
103
95
  Returns true if item has been purchased this session
104
96
 
@@ -181,7 +173,7 @@ function GameProductService:ObservePlayerOwnership(player, assetType, idOrKey)
181
173
  return self._helper:ObservePlayerOwnership(player, assetType, idOrKey)
182
174
  end
183
175
 
184
- function GameProductService:HandleProcessReceipt(receiptInfo)
176
+ function GameProductService:_handleProcessReceipt(receiptInfo)
185
177
  local player = Players:GetPlayerByUserId(receiptInfo.PlayerId)
186
178
  if not player then
187
179
  -- The player probably left the game