Skip to main content

PlayerProductOwnershipOverrideUtils

Helpers for the replicated ownership-override map that PlayerAssetOwnershipTracker maintains.

Each ownership tracker owns one JSONAttributeValue on the player, named per asset type, holding a map of { [assetIdString] = ownsAsset }. The server writes it (authoritative) and Roblox replicates it read-only to clients, where every realm's tracker applies it. Storing the asset id as the (string) map key lets non-numeric ids (subscriptions) survive the JSON round-trip.

Functions

attributeName

PlayerProductOwnershipOverrideUtils.attributeName(assetTypestring) → string

The attribute name that carries a given asset type's override map.

sanitizeState

PlayerProductOwnershipOverrideUtils.sanitizeState(valueany) → OwnershipOverrideState

Coerces an arbitrary decoded attribute value into a well-formed override map, dropping any malformed entries. Returns a fresh mutable table (so callers may edit it), and treats nil (no attribute yet) as an empty map.

Show raw api
{
    "functions": [
        {
            "name": "attributeName",
            "desc": "The attribute name that carries a given asset type's override map.",
            "params": [
                {
                    "name": "assetType",
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 27,
                "path": "src/gameproductservice/src/Shared/Ownership/PlayerProductOwnershipOverrideUtils.lua"
            }
        },
        {
            "name": "sanitizeState",
            "desc": "Coerces an arbitrary decoded attribute value into a well-formed override map, dropping any\nmalformed entries. Returns a fresh mutable table (so callers may edit it), and treats nil (no\nattribute yet) as an empty map.",
            "params": [
                {
                    "name": "value",
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "OwnershipOverrideState"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 41,
                "path": "src/gameproductservice/src/Shared/Ownership/PlayerProductOwnershipOverrideUtils.lua"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "PlayerProductOwnershipOverrideUtils",
    "desc": "Helpers for the replicated ownership-override map that [PlayerAssetOwnershipTracker] maintains.\n\nEach ownership tracker owns one [JSONAttributeValue] on the player, named per asset type, holding\na map of `{ [assetIdString] = ownsAsset }`. The server writes it (authoritative) and Roblox\nreplicates it read-only to clients, where every realm's tracker applies it. Storing the asset id\nas the (string) map key lets non-numeric ids (subscriptions) survive the JSON round-trip.",
    "source": {
        "line": 12,
        "path": "src/gameproductservice/src/Shared/Ownership/PlayerProductOwnershipOverrideUtils.lua"
    }
}