TPStashEvent.PlayStage

public int PlayStage(
    string player_uuid,
    string character_uuids,
    stageType stage_type,
    string stage_slug,
    [string stage_category_slug = null],
    [string stage_level = null],
    [int? stage_score = null],
    [stageStatus stage_status = stageStatus.Unknown],
    [int? stage_playtime = null]
);

Description

PlayStage collects the data of various stages that the character plays in the game. It needs to be called when an stage begins or ends. It can be used for the analysis of personas about stage playing.

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

When there is a difference in time between event occurrence and method call of a stage event

PlayerStage is mostly expected to be called at the same time when the event occurs, that is, in the beginning or end of a stage. There are times, however, when the method cannot be called right on the occurrence due to the nature of the game. In that case, put a value in the stage_playtime parameter to prevent a wrong calculation of play hours that would cause an incorrect data analysis as a result. The value doesn’t need to be the precise amount of time spent to complete the stage. Just an approximate value will do.

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_uuids

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

stage_type

Stage type

public enum stageType {
    Unknown,
    PvP,
    PvE
}

Required

stage_slug

Unique identifier of the stage

Required

stage_category_slug

Category of the stage type

Optional

stage_level

String of the stage level

Optional

stage_score

Stage score when the stage ends

Optional

stage_status

Stage status

public enum stageStatus {
    Start,
    Win,
    Lose,
    Draw,
    Quit,   //Exit in the middle of play
    Timeout,
    Error   //Abnormal termination
}

Optional

stage_playtime

Stage play time until the stage ends

Optional