@quenty/gameproductservice 6.8.0 → 7.0.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 +11 -0
- package/package.json +2 -2
- package/src/Server/GameProductService.lua +9 -10
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.0.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/gameproductservice@6.8.0...@quenty/gameproductservice@7.0.0) (2023-04-06)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* Add game product service :BindProcessReceipt() call ([0df5062](https://github.com/Quenty/NevermoreEngine/commit/0df50625dbec6fd73bfd67db2933fee810221504))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
# [6.8.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/gameproductservice@6.7.0...@quenty/gameproductservice@6.8.0) (2023-04-06)
|
|
7
18
|
|
|
8
19
|
**Note:** Version bump only for package @quenty/gameproductservice
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/gameproductservice",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0",
|
|
4
4
|
"description": "Generalized monetization system for handling products and purchases correctly.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Roblox",
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"@quenty/string": "^3.1.0",
|
|
47
47
|
"@quenty/table": "^3.2.0"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "1e8d28932c0c449688ea85068adae62eb84d7402"
|
|
50
50
|
}
|
|
@@ -64,13 +64,6 @@ end
|
|
|
64
64
|
Starts the service. Should be done via [ServiceBag]
|
|
65
65
|
]=]
|
|
66
66
|
function GameProductService:Start()
|
|
67
|
-
-- TODO: Avoid binding this unless explicitly asked to
|
|
68
|
-
-- TODO: Provide receipt processing API surface
|
|
69
|
-
|
|
70
|
-
MarketplaceService.ProcessReceipt = function(...)
|
|
71
|
-
return self:_processReceipt(...)
|
|
72
|
-
end
|
|
73
|
-
|
|
74
67
|
self._maid:GiveTask(RxBinderUtils.observeAllBrio(self._binders.PlayerProductManager):Subscribe(function(brio)
|
|
75
68
|
if brio:IsDead() then
|
|
76
69
|
return
|
|
@@ -78,10 +71,10 @@ function GameProductService:Start()
|
|
|
78
71
|
|
|
79
72
|
local maid = brio:ToMaid()
|
|
80
73
|
local playerProductManager = brio:GetValue()
|
|
81
|
-
local
|
|
74
|
+
local playerMarketeer = playerProductManager:GetMarketeer()
|
|
82
75
|
|
|
83
76
|
local function exposeSignal(signal, assetType)
|
|
84
|
-
maid:GiveTask(
|
|
77
|
+
maid:GiveTask(playerMarketeer:GetAssetTrackerOrError(assetType).Purchased:Connect(function(...)
|
|
85
78
|
signal:Fire(playerProductManager:GetPlayer(), ...)
|
|
86
79
|
end))
|
|
87
80
|
end
|
|
@@ -91,6 +84,12 @@ function GameProductService:Start()
|
|
|
91
84
|
exposeSignal(self.AssetPurchased, GameConfigAssetTypes.ASSET)
|
|
92
85
|
exposeSignal(self.BundlePurchased, GameConfigAssetTypes.BUNDLE)
|
|
93
86
|
end))
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
function GameProductService:BindProcessReceipt()
|
|
90
|
+
MarketplaceService.ProcessReceipt = function(...)
|
|
91
|
+
return self:HandleProcessReceipt(...)
|
|
92
|
+
end
|
|
94
93
|
|
|
95
94
|
self._maid:GiveTask(function()
|
|
96
95
|
task.spawn(function()
|
|
@@ -182,7 +181,7 @@ function GameProductService:ObservePlayerOwnership(player, assetType, idOrKey)
|
|
|
182
181
|
return self._helper:ObservePlayerOwnership(player, assetType, idOrKey)
|
|
183
182
|
end
|
|
184
183
|
|
|
185
|
-
function GameProductService:
|
|
184
|
+
function GameProductService:HandleProcessReceipt(receiptInfo)
|
|
186
185
|
local player = Players:GetPlayerByUserId(receiptInfo.PlayerId)
|
|
187
186
|
if not player then
|
|
188
187
|
-- The player probably left the game
|