TPStashEvent.Record
public int Record(
string method_name,
params KeyValuePair<string, object>[] param_pairs
);
Description
TPStashEvent.Record is a method that accepts a TPStashEvent method and its parameters as its arguments.
Here is a code example of the Record method that contains Join and its parameter pair.
TPStashEvent myStashEvent = new TPStashEvent();
KeyValuePair<string, object>[] parameters = new KeyValuePair<string, object>[]
{
new KeyValuePair<string, object>("player_uuid", "myPlayerID"),
};
myStashEvent.Record("Join", parameters);
|
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:
|
Parameter storage
The parameter storage is a feature available when using Record() that allows you to skip the most frequently used parameters (that is, player_uuid and character_uuid) in TPStashEvent methods under certain conditions.
When calling LoginAsCharacter using Record method, the player_uuidand character_uuid parameter values are stored in the parameter storage in memory. After that, they don’t have to include these two parameters repeatedly even though thery are required when you call other subsequent methods except Join, LoginApp and LoginAsCharacter.
To use the parameter storage correctly, make sure that LoginAsCharacter is called first before other methods (except Join and LoginApp) are called via Record. For the Join, LoginApp, and LoginAsCharacter methods, player_uuid and character_uuid are still required.
|
|
Parameters
| Name | Description | Required | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
method_name |
The name of a method in the TPStashEvent class
|
Required |
||||||||
param_pairs |
A variable number of parameters consisting of Key-Value pairs
Key is the name of a parameter that belongs to the method in the TPStashEvent class.
Value is the value of the parameter.
|
Required |