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
| API | Description |
|---|---|
| CreateEct | Create an ECT. Once created, the status of the ECT will be 'Uncompleted' and the actions will be 'Init'. |
| 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. |
| 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. |
| 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. |
| 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. |
| GetPlayerUncompletedEcts | Retrieve 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'.
/**
* Create an ECT. Once created, the status of the ECT will be 'Uncompleted' and the actions will be 'Init'.
*
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void CreateEct(
const CreateEctParams& params,
PgosDataCallback<EctInfo> result_callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| params | const CreateEctParams& | |
| result_callback | PgosDataCallback<EctInfo> | The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD. |
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.
/**
* 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.
*
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void UpdateEct(
const UpdateEctParams& params,
PgosDataCallback<EctInfo> result_callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| params | const UpdateEctParams& | |
| result_callback | PgosDataCallback<EctInfo> | The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD. |
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.
/**
* 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.
*
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void UpdateEctActions(
const UpdateEctActionsParams& params,
PgosDataCallback<EctInfo> result_callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| params | const UpdateEctActionsParams& | |
| result_callback | PgosDataCallback<EctInfo> | The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD. |
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.
/**
* Cancel the ECT. Once canceled, it will not trigger a auto retry event, and the game will not be able to update it either.
*
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void CancelEct(
const CancelEctParams& params,
PgosDataCallback<EctInfo> result_callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| params | const CancelEctParams& | |
| result_callback | PgosDataCallback<EctInfo> | The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD. |
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.
/**
* 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.
*
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void GetEctInfo(
const GetEctInfoParams& params,
PgosDataCallback<EctInfo> result_callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| params | const GetEctInfoParams& | |
| result_callback | PgosDataCallback<EctInfo> | The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD. |
Return: void
GetPlayerUncompletedEcts
Retrieve ECTs of a player that are in an Uncompleted status.
/**
* Retrieve ECTs of a player that are in an `Uncompleted` status.
*
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void GetPlayerUncompletedEcts(
const GetPlayerUncompletedEctsParams& params,
PgosDataCallback<GetPlayerUncompletedEctsResult> result_callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| params | const GetPlayerUncompletedEctsParams& | |
| result_callback | PgosDataCallback<GetPlayerUncompletedEctsResult> | The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD. |
Return: void