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 ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void CreateEct(
const FPgosServerCreateEctParams& Params,
TFunction<void(const FPgosResult& Ret, const FPgosServerEctInfo* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| Params | const FPgosServerCreateEctParams& | |
| ResultCallback | TFunction<void(const FPgosResult& Ret, const FPgosServerEctInfo* Data)> | The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject. |
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 ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void UpdateEct(
const FPgosServerUpdateEctParams& Params,
TFunction<void(const FPgosResult& Ret, const FPgosServerEctInfo* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| Params | const FPgosServerUpdateEctParams& | |
| ResultCallback | TFunction<void(const FPgosResult& Ret, const FPgosServerEctInfo* Data)> | The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject. |
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 ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void UpdateEctActions(
const FPgosServerUpdateEctActionsParams& Params,
TFunction<void(const FPgosResult& Ret, const FPgosServerEctInfo* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| Params | const FPgosServerUpdateEctActionsParams& | |
| ResultCallback | TFunction<void(const FPgosResult& Ret, const FPgosServerEctInfo* Data)> | The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject. |
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 ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void CancelEct(
const FPgosServerCancelEctParams& Params,
TFunction<void(const FPgosResult& Ret, const FPgosServerEctInfo* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| Params | const FPgosServerCancelEctParams& | |
| ResultCallback | TFunction<void(const FPgosResult& Ret, const FPgosServerEctInfo* Data)> | The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject. |
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 ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void GetEctInfo(
const FPgosServerGetEctInfoParams& Params,
TFunction<void(const FPgosResult& Ret, const FPgosServerEctInfo* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| Params | const FPgosServerGetEctInfoParams& | |
| ResultCallback | TFunction<void(const FPgosResult& Ret, const FPgosServerEctInfo* Data)> | The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject. |
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 ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void GetPlayerUncompletedEcts(
const FPgosServerGetPlayerUncompletedEctsParams& Params,
TFunction<void(const FPgosResult& Ret, const FPgosServerGetPlayerUncompletedEctsResult* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| Params | const FPgosServerGetPlayerUncompletedEctsParams& | |
| ResultCallback | TFunction<void(const FPgosResult& Ret, const FPgosServerGetPlayerUncompletedEctsResult* Data)> | The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject. |
Return: void