Skip to main content

PlayerAssetOwnershipTracker

This tracking is relatively complicated because we want to track both ownership from attributes (can be customized locally), as well as async cloud services.

Functions

SetQueryOwnershipCallback

PlayerAssetOwnershipTracker:SetQueryOwnershipCallback(promiseOwnsAssetfunction) → ()

Sets the callback which will query ownership

SetOwnership

PlayerAssetOwnershipTracker:SetOwnership(
idOrKeynumber,
ownsAssetboolean
) → ()

Sets the players ownership of a the asset

PromiseOwnsAsset

PlayerAssetOwnershipTracker:PromiseOwnsAsset(idOrKeystring | number) → Promise<boolean>

Promises true if the user owns the asset and false otherwise

ObserveOwnsAsset

PlayerAssetOwnershipTracker:ObserveOwnsAsset(idOrKeynumber | number) → Observable<boolean>

Observes whether the player owns the asset or not

Show raw api
{
    "functions": [
        {
            "name": "SetQueryOwnershipCallback",
            "desc": "Sets the callback which will query ownership",
            "params": [
                {
                    "name": "promiseOwnsAsset",
                    "desc": "",
                    "lua_type": "function"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 49,
                "path": "src/gameproductservice/src/Shared/Ownership/PlayerAssetOwnershipTracker.lua"
            }
        },
        {
            "name": "SetOwnership",
            "desc": "Sets the players ownership of a the asset",
            "params": [
                {
                    "name": "idOrKey",
                    "desc": "",
                    "lua_type": "number"
                },
                {
                    "name": "ownsAsset",
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 101,
                "path": "src/gameproductservice/src/Shared/Ownership/PlayerAssetOwnershipTracker.lua"
            }
        },
        {
            "name": "PromiseOwnsAsset",
            "desc": "Promises true if the user owns the asset and false otherwise",
            "params": [
                {
                    "name": "idOrKey",
                    "desc": "",
                    "lua_type": "string | number"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Promise<boolean>"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 124,
                "path": "src/gameproductservice/src/Shared/Ownership/PlayerAssetOwnershipTracker.lua"
            }
        },
        {
            "name": "ObserveOwnsAsset",
            "desc": "Observes whether the player owns the asset or not",
            "params": [
                {
                    "name": "idOrKey",
                    "desc": "",
                    "lua_type": "number | number"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Observable<boolean>"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 151,
                "path": "src/gameproductservice/src/Shared/Ownership/PlayerAssetOwnershipTracker.lua"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "PlayerAssetOwnershipTracker",
    "desc": "This tracking is relatively complicated because we want to track both\nownership from attributes (can be customized locally), as well as async\ncloud services.",
    "source": {
        "line": 8,
        "path": "src/gameproductservice/src/Shared/Ownership/PlayerAssetOwnershipTracker.lua"
    }
}