Transaction Action of GS2-SerialKey
Specification of verify/consume/acquire transaction actions
VerifyAction
Gs2SerialKey:VerifyCodeByUserId
Verify the validity of the Serial Code by specifying a user ID
Whether the action allows quantity specification: NO
| Type | Condition | Required | Default | Value Limits | Description | |||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||||||||
| userId | string | ✓ | ~ 128 chars | User ID Set #{userId} to replace the currently logged in user ID. | ||||||||
| code | string | ✓ | ~ 48 chars | Serial Code | ||||||||
| campaignModelName | string | ~ 128 chars | Campaign name | |||||||||
| verifyType | String Enum enum { “active”, “inactive” } | ✓ | Verification type
| |||||||||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
{
"action": "Gs2SerialKey:VerifyCodeByUserId",
"request": {
"namespaceName": "[string]Namespace name",
"userId": "[string]User ID",
"code": "[string]Serial Code",
"campaignModelName": "[string]Campaign name",
"verifyType": "[string]Verification type",
"timeOffsetToken": "[string]Time offset token"
}
}action: Gs2SerialKey:VerifyCodeByUserId
request:
namespaceName: "[string]Namespace name"
userId: "[string]User ID"
code: "[string]Serial Code"
campaignModelName: "[string]Campaign name"
verifyType: "[string]Verification type"
timeOffsetToken: "[string]Time offset token"transaction.service("serialKey").verify.verify_code_by_user_id({
namespaceName="[string]Namespace name",
userId="[string]User ID",
code="[string]Serial Code",
campaignModelName="[string]Campaign name",
verifyType="[string]Verification type",
timeOffsetToken="[string]Time offset token",
})ConsumeAction
Gs2SerialKey:UseByUserId
Using Serial Code by specifying a user ID
Whether the action allows quantity specification: NO
Whether the action is reversible: YES
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| userId | string | ✓ | ~ 128 chars | User ID Set #{userId} to replace the currently logged in user ID. | ||
| code | string | ✓ | ~ 48 chars | Serial Code | ||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
{
"action": "Gs2SerialKey:UseByUserId",
"request": {
"namespaceName": "[string]Namespace name",
"userId": "[string]User ID",
"code": "[string]Serial Code",
"timeOffsetToken": "[string]Time offset token"
}
}action: Gs2SerialKey:UseByUserId
request:
namespaceName: "[string]Namespace name"
userId: "[string]User ID"
code: "[string]Serial Code"
timeOffsetToken: "[string]Time offset token"transaction.service("serialKey").consume.use_by_user_id({
namespaceName="[string]Namespace name",
userId="[string]User ID",
code="[string]Serial Code",
timeOffsetToken="[string]Time offset token",
})AcquireAction
Gs2SerialKey:RevertUseByUserId
Serial Code set to unused by specifying a user ID
Whether the action allows quantity specification: NO
Whether the action is reversible: YES
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| userId | string | ✓ | ~ 128 chars | User ID Set #{userId} to replace the currently logged in user ID. | ||
| code | string | ✓ | ~ 48 chars | Serial Code | ||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
{
"action": "Gs2SerialKey:RevertUseByUserId",
"request": {
"namespaceName": "[string]Namespace name",
"userId": "[string]User ID",
"code": "[string]Serial Code",
"timeOffsetToken": "[string]Time offset token"
}
}action: Gs2SerialKey:RevertUseByUserId
request:
namespaceName: "[string]Namespace name"
userId: "[string]User ID"
code: "[string]Serial Code"
timeOffsetToken: "[string]Time offset token"transaction.service("serialKey").acquire.revert_use_by_user_id({
namespaceName="[string]Namespace name",
userId="[string]User ID",
code="[string]Serial Code",
timeOffsetToken="[string]Time offset token",
})Gs2SerialKey:IssueOnce
Issue a serial code
Whether the action allows quantity specification: NO
Whether the action is reversible: NO
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| campaignModelName | string | ✓ | ~ 128 chars | Campaign name | ||
| metadata | string | ~ 2048 chars | Metadata Arbitrary values can be set in the metadata. Since they do not affect GS2’s behavior, they can be used to store information used in the game. |
{
"action": "Gs2SerialKey:IssueOnce",
"request": {
"namespaceName": "[string]Namespace name",
"campaignModelName": "[string]Campaign name",
"metadata": "[string]Metadata"
}
}action: Gs2SerialKey:IssueOnce
request:
namespaceName: "[string]Namespace name"
campaignModelName: "[string]Campaign name"
metadata: "[string]Metadata"transaction.service("serialKey").acquire.issue_once({
namespaceName="[string]Namespace name",
campaignModelName="[string]Campaign name",
metadata="[string]Metadata",
})