跳到主要内容

Server Ect API Reference

ECT(Eventual Consistent Transaction) is used for tracking the game transaction. When a game needs to execute a transaction that contains several ordered actions to modify player data or inventory, the game can create an ECT Instance to track the transaction status on the backend side(game server or virtual server).

API List

APIDescription
CreateEctCreate an ECT. Once created, the status of the ECT will be 'Uncompleted' and the actions will be 'Init'.
UpdateEctUpdate the ECT information and actions. The status of the ECT will be updated to 'Done' if the status of all actions were updated to 'Success'. The possible state transitions for action are as follows: Init->Failed, Init->Success, Failed->Success, Failed->Failed, Success->Success. Any other state transition will result in an error.
UpdateEctActionsUpdate the ECT's actions. The status of the ECT will be updated to 'Done' if the status of all actions are updated to 'Success'. The possible state transitions for action are as follows: Init->Failed, Init->Success, Failed->Success, Failed->Failed, Success->Success. Any other state transition will result in an error.
CancelEctCancel the ECT. Once canceled, it will not trigger a auto retry event, and the game will not be able to update it either.
GetEctInfoGet information about the specified ECT. When the ECT status is Uncompleted it can always be queried. If the ECT status changes to a terminal state (Done, Canceled, or Expired) and more than a few days pass, it can no longer be queried. However, the ECT details can still be viewed on the Portal at this time.
GetPlayerUncompletedEctsRetrieve ECTs of a player that are in an Uncompleted status.

API Details

CreateEct

Create an ECT. Once created, the status of the ECT will be 'Uncompleted' and the actions will be 'Init'.

/// <summary>Create an ECT. Once created, the status of the ECT will be 'Uncompleted' and the actions will be 'Init'.</summary>
public void CreateEct(CreateEctParams pgos_params, EctDelegate0 callback);

Parameters:

ParamTypeDescription
pgos_paramsCreateEctParams
callbackEctDelegate0

Return: void

UpdateEct

Update the ECT information and actions. The status of the ECT will be updated to 'Done' if the status of all actions were updated to 'Success'. The possible state transitions for action are as follows: Init->Failed, Init->Success, Failed->Success, Failed->Failed, Success->Success. Any other state transition will result in an error.

/// <summary>
/// Update the ECT information and actions. The status of the ECT will be updated to 'Done' if the status of all actions were updated to 'Success'.
/// The possible state transitions for `action` are as follows: Init->Failed, Init->Success, Failed->Success, Failed->Failed, Success->Success. Any other state transition will result in an error.
/// </summary>
public void UpdateEct(UpdateEctParams pgos_params, EctDelegate0 callback);

Parameters:

ParamTypeDescription
pgos_paramsUpdateEctParams
callbackEctDelegate0

Return: void

UpdateEctActions

Update the ECT's actions. The status of the ECT will be updated to 'Done' if the status of all actions are updated to 'Success'. The possible state transitions for action are as follows: Init->Failed, Init->Success, Failed->Success, Failed->Failed, Success->Success. Any other state transition will result in an error.

/// <summary>
/// Update the ECT's actions. The status of the ECT will be updated to 'Done' if the status of all actions are updated to 'Success'.
/// The possible state transitions for `action` are as follows: Init->Failed, Init->Success, Failed->Success, Failed->Failed, Success->Success. Any other state transition will result in an error.
/// </summary>
public void UpdateEctActions(UpdateEctActionsParams pgos_params, EctDelegate0 callback);

Parameters:

ParamTypeDescription
pgos_paramsUpdateEctActionsParams
callbackEctDelegate0

Return: void

CancelEct

Cancel the ECT. Once canceled, it will not trigger a auto retry event, and the game will not be able to update it either.

/// <summary>Cancel the ECT. Once canceled, it will not trigger a auto retry event, and the game will not be able to update it either.</summary>
public void CancelEct(CancelEctParams pgos_params, EctDelegate0 callback);

Parameters:

ParamTypeDescription
pgos_paramsCancelEctParams
callbackEctDelegate0

Return: void

GetEctInfo

Get information about the specified ECT. When the ECT status is Uncompleted it can always be queried. If the ECT status changes to a terminal state (Done, Canceled, or Expired) and more than a few days pass, it can no longer be queried. However, the ECT details can still be viewed on the Portal at this time.

/// <summary>
/// Get information about the specified ECT.
/// When the ECT status is `Uncompleted` it can always be queried.
/// If the ECT status changes to a terminal state (`Done`, `Canceled`, or `Expired`) and more than a few days pass, it can no longer be queried. However, the ECT details can still be viewed on the Portal at this time.
/// </summary>
public void GetEctInfo(GetEctInfoParams pgos_params, EctDelegate0 callback);

Parameters:

ParamTypeDescription
pgos_paramsGetEctInfoParams
callbackEctDelegate0

Return: void

GetPlayerUncompletedEcts

Retrieve ECTs of a player that are in an Uncompleted status.

/// <summary>Retrieve ECTs of a player that are in an `Uncompleted` status.</summary>
public void GetPlayerUncompletedEcts(GetPlayerUncompletedEctsParams pgos_params, EctDelegate1 callback);

Parameters:

ParamTypeDescription
pgos_paramsGetPlayerUncompletedEctsParams
callbackEctDelegate1

Return: void

All Delegates

public delegate void EctDelegate0(PgosResult a0, EctInfo a1);
public delegate void EctDelegate1(PgosResult a0, GetPlayerUncompletedEctsResult a1);

Type Reference: