TPStashEvent.GetBonus

public int GetBonus(
    string player_uuid,
    string character_uuid,
    string bonus_slug,
    bool is_automated,
    [string bonus_category_slug = null]
);

Description

GetBonus collects the data of the character’s acquisition of a bonus in the game.

A bonus denotes an effortless reward that a player or character obtains regardless of whether they play in-game content or not.

For example, players or characters can be given either a reward or an opportunity to get a reward by logging in to the game with some restrictions like "Every N minutes" or "Only N times a day". They can also get rewards by using a coupon or any free giveaway.

It returns 1 for success and -1 for failure. If -1 is returned, you can see the following message in the Unity editor console in TentuPlay debug mode:

TPError||ERROR inserting table_name: exception_error_message

Parameters

Name Description Required

player_uuid

Player’s unique ID (not a character’s ID) such as Steam user ID and Google Play user ID

Required

character_uuid

Player’s character’s unique lD

If there is no character in the game or If you want to use it for the player, not a character, set character_uuid to TentuPlayKeyword._DUMMY_CHARACTER_ID_.

Required

bonus_slug

Unique identifier of the bonus

Required

bonus_category_slug

Category of the bonus

Optional

is_automated

Whether the bonus is acquired automatically or manually

  • True: The bonus is automatically acquired without any user interactions

  • False: The user must take an action to get the bonus, such as spinning a roulette wheel or pressing a button

Required