question

Ozan Yilmaz avatar image
Ozan Yilmaz asked

Can a player call a function that is scheduled?

Hello,

We want to update a title data weekly, but we don't want to update it by hands every week. So far, we have found the "Scheduled Task" in the Game Manager. It looks like we have to write the required function in the Cloud Script.

We wonder if a player can call that function somehow by using ExecuteCloudScript function in the game? If so, is there a way to prevent the function from being called by clients?

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Seth Du avatar image
Seth Du answered

Theoretically, it is possible but in very low possibility because the Scheduled Task configuration is inaccessible to players while the Function Name is also unknown to players. Even a malicious client won’t be able to access the Game Manager configuration contents. The only way seems to be brute force, which will reach the API limit easily.

Moreover, there are additional steps that can prevent clients from calling those APIs. You may notice there are 2 parameters for every Cloud Script functions, that are “args” and “context”. “context” will contain information about whether this function is triggered by Task, which is something clients won’t be able to manipulate. A sample shows as the following.

"playStreamEvent": null,
"triggeredByTask": null,
"currentEntity": {
    "Entity": {
        "Id": "xxx",
        "Type": "title_player_account",
        "TypeString": "title_player_account"
    },
    "EntityChain": "xxxxx”
    "VersionNumber": 1,
    "DisplayName": null,
    "Permissions": null,
    "Objects": null,
    "Files": null,
    "Statistics": null,
    "Language": "xx",
    "Lineage": {
        "NamespaceId": "xxx",
        "TitleId": "2B3F",
        "MasterPlayerAccountId": "xxx",
        "TitlePlayerAccountId": "xxx",
        "CharacterId": null,
        "GroupId": null,
        "CloudRootId": null
    },
    "Created": "2019-10-01T04:25:31.449Z",
    "AvatarUrl": null,
    "LeaderboardMetadata": null,
    "ExperimentVariants": null
},
"callingEntityKey": {
    "Id": "xxx",
    "Type": "title_player_account",
    "TypeString": "title_player_account"
}

“triggeredByTask” property won’t be null if it is triggered by a Task. I will suggest you doing more tests on this if you are uncertain about the use of ‘context’.

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Ozan Yilmaz avatar image Ozan Yilmaz commented ·

Thank you. It looks like one if statement will be enough for this

1 Like 1 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.