Show raw api
{
"functions": [
{
"name": "Init",
"desc": "Initializes the service. Should be done via [ServiceBag]",
"params": [
{
"name": "serviceBag",
"desc": "",
"lua_type": "ServiceBag"
}
],
"returns": [],
"function_type": "method",
"source": {
"line": 26,
"path": "src/gameproductservice/src/Server/GameProductService.lua"
}
},
{
"name": "ObservePlayerAssetPurchased",
"desc": "Fires when the specified player purchases an asset",
"params": [
{
"name": "assetType",
"desc": "",
"lua_type": "GameConfigAssetType"
},
{
"name": "idOrKey",
"desc": "",
"lua_type": "string | number"
}
],
"returns": [
{
"desc": "",
"lua_type": "Observable<>"
}
],
"function_type": "method",
"source": {
"line": 59,
"path": "src/gameproductservice/src/Server/GameProductService.lua"
}
},
{
"name": "ObserveAssetPurchased",
"desc": "Fires when any player purchases an asset",
"params": [
{
"name": "assetType",
"desc": "",
"lua_type": "GameConfigAssetType"
},
{
"name": "idOrKey",
"desc": "",
"lua_type": "string | number"
}
],
"returns": [
{
"desc": "",
"lua_type": "Observable<Player>"
}
],
"function_type": "method",
"source": {
"line": 73,
"path": "src/gameproductservice/src/Server/GameProductService.lua"
}
},
{
"name": "HasPlayerPurchasedThisSession",
"desc": "Returns true if item has been purchased this session",
"params": [
{
"name": "player",
"desc": "",
"lua_type": "Player"
},
{
"name": "assetType",
"desc": "",
"lua_type": "GameConfigAssetType"
},
{
"name": "idOrKey",
"desc": "",
"lua_type": "string | number"
}
],
"returns": [
{
"desc": "",
"lua_type": "boolean"
}
],
"function_type": "method",
"source": {
"line": 88,
"path": "src/gameproductservice/src/Server/GameProductService.lua"
}
},
{
"name": "PromisePlayerIsPromptOpen",
"desc": "Returns true if the prompt is open",
"params": [
{
"name": "player",
"desc": "",
"lua_type": "Player"
}
],
"returns": [
{
"desc": "",
"lua_type": "Promise<boolean>"
}
],
"function_type": "method",
"source": {
"line": 102,
"path": "src/gameproductservice/src/Server/GameProductService.lua"
}
},
{
"name": "PromisePlayerPromptClosed",
"desc": "Returns a promise that will resolve when all prompts are closed",
"params": [
{
"name": "player",
"desc": "",
"lua_type": "Player"
}
],
"returns": [
{
"desc": "",
"lua_type": "Promise"
}
],
"function_type": "method",
"source": {
"line": 115,
"path": "src/gameproductservice/src/Server/GameProductService.lua"
}
},
{
"name": "PromisePlayerPromptPurchase",
"desc": "Prompts the user to purchase the asset, and returns true if purchased",
"params": [
{
"name": "player",
"desc": "",
"lua_type": "Player"
},
{
"name": "assetType",
"desc": "",
"lua_type": "GameConfigAssetType"
},
{
"name": "idOrKey",
"desc": "",
"lua_type": "string | number"
}
],
"returns": [
{
"desc": "",
"lua_type": "boolean"
}
],
"function_type": "method",
"source": {
"line": 130,
"path": "src/gameproductservice/src/Server/GameProductService.lua"
}
},
{
"name": "PromisePlayerOwnership",
"desc": "Returns true if item has been purchased this session",
"params": [
{
"name": "player",
"desc": "",
"lua_type": "Player"
},
{
"name": "assetType",
"desc": "",
"lua_type": "GameConfigAssetType"
},
{
"name": "idOrKey",
"desc": "",
"lua_type": "string | number"
}
],
"returns": [
{
"desc": "",
"lua_type": "Promise<boolean>"
}
],
"function_type": "method",
"source": {
"line": 146,
"path": "src/gameproductservice/src/Server/GameProductService.lua"
}
},
{
"name": "PromisePlayerOwnershipOrPrompt",
"desc": "Checks if the asset is ownable and if it is, checks player ownership. Otherwise, it checks if the asset\nhas been purchased this session. If the asset has not been purchased this session it prompts the user to\npurchase the item.",
"params": [
{
"name": "player",
"desc": "",
"lua_type": "Player"
},
{
"name": "assetType",
"desc": "",
"lua_type": "GameConfigAssetType"
},
{
"name": "idOrKey",
"desc": "",
"lua_type": "string | number"
}
],
"returns": [
{
"desc": "",
"lua_type": "Promise<boolean>"
}
],
"function_type": "method",
"source": {
"line": 164,
"path": "src/gameproductservice/src/Server/GameProductService.lua"
}
},
{
"name": "ObservePlayerOwnership",
"desc": "Observes if the player owns this cloud asset or not",
"params": [
{
"name": "player",
"desc": "",
"lua_type": "Player"
},
{
"name": "assetType",
"desc": "",
"lua_type": "GameConfigAssetType"
},
{
"name": "idOrKey",
"desc": "",
"lua_type": "string | number"
}
],
"returns": [
{
"desc": "",
"lua_type": "Observable<boolean>"
}
],
"function_type": "method",
"source": {
"line": 180,
"path": "src/gameproductservice/src/Server/GameProductService.lua"
}
},
{
"name": "Destroy",
"desc": "Cleans up the game product service",
"params": [],
"returns": [],
"function_type": "method",
"source": {
"line": 191,
"path": "src/gameproductservice/src/Server/GameProductService.lua"
}
}
],
"properties": [],
"types": [],
"name": "GameProductService",
"desc": "This service provides an interface to purchase produces, assets, and other\nmarketplace items. This listens to events, handles requests between server and\nclient, and takes in both assetKeys from GameConfigService, as well as\nassetIds.\n\nSee [GameProductServiceClient] for the client equivalent. The API surface should be\neffectively the same between the two.",
"realm": [
"Server"
],
"source": {
"line": 13,
"path": "src/gameproductservice/src/Server/GameProductService.lua"
}
}