SDK

GS2-SDK Transaction Processing

About GS2-SDK for Game Engine transaction processing

Please refer to the for Game Engine document for the basic concept and processing flow. On the other hand, GS2-SDK does not provide as extensive support as for Game Engine.

Specifically, there is no cache function or EzTransactionDomain.

Transaction Execution.

If auto-execution is enabled

You must explicitly set a user ID on GS2-Gateway in order to receive completion notifications.

GS2-Gateway::setUserId

Need to handle completion notification. The Gs2WebSocketSession class provides notification handling functions, so use those. Some programming languages may not have a WebSocket client implementation.

When you receive notification from GS2-Distributor that the transaction has completed execution, you must explicitly retrieve the results. The execution result may contain errors and the execution result may be updated until it succeeds.

GS2-Distributor::getStampSheetResult

Once you receive notification from GS2-JobQueue that the job has completed execution, you must explicitly retrieve the results. The execution result may contain errors, and since the latest result can be retrieved if tryNumber is not specified, you must use it and wait until it succeeds.

GS2-JobQueue::getJobResult

If auto-execution is disabled

When calling a transaction issuing API such as GS2-Showcase::Buy, the stampSheet variable will respond with the transaction data and the stampSheetEncryptionKeyId with the ID of the encryption key used to calculate the signature of the transaction data The transaction data and the encryption key information are stored in the stampSheet variable.

The transaction data and encryption key information must be passed to GS2-Distributor to explicitly execute the transaction. If you wish to log to GS2-Log, call runStampSheetExpress with the namespace of the GS2-Distributor that you have configured to export the log, or call runStampSheetExpressWithoutNamespace If not required, call runStampSheetExpressWithoutNamespace.

GS2-Distributor::runStampSheetExpress GS2-Distributor::runStampSheetExpressWithoutNamespace

If the result of running runStampSheetExpress or runStampSheetExpressWithoutNamespace contains stampSheet, that transaction must also be explicitly executed.

If the action to obtain the stamp sheet was “Gs2JobQueue:PushByUserId”, then GS2-JobQueue must also be executed.

GS2-JobQueue::run