GS2-Limit Transaction Actions
VerifyAction
Gs2Limit:VerifyCounterByUserId
Verify Counter value by specifying a user ID
Verifies that the specified user’s counter value satisfies the given condition. Supports 6 comparison operators: less, lessEqual, greater, greaterEqual, equal, notEqual.
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. | ||||||||||||||||
| limitName | string | ✓ | ~ 128 chars | Usage Limit Model Name The name of the limit model that this counter belongs to. Determines the reset schedule (daily, weekly, monthly, etc.) applied to this counter’s value. | ||||||||||||||||
| counterName | string | ✓ | ~ 128 chars | Counter Name A unique identifier for this counter within the limit model. Multiple counters can share the same limit model with different names, allowing separate usage tracking (e.g., one counter per quest or per product) without creating separate limit models. | ||||||||||||||||
| verifyType | String Enum enum { “less”, “lessEqual”, “greater”, “greaterEqual”, “equal”, “notEqual” } | ✓ | Type of verification
| |||||||||||||||||
| count | int | 0 | 0 ~ 2147483646 | Count Value The current usage count for this counter. Incremented by the countUp operation and compared against the maximum value specified at that time. Automatically reset to zero when the limit model’s reset timing is reached. | ||||||||||||||||
| multiplyValueSpecifyingQuantity | bool | true | Whether to multiply the value used for verification when specifying the quantity | |||||||||||||||||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
{
"action": "Gs2Limit:VerifyCounterByUserId",
"request": {
"namespaceName": "[string]Namespace name",
"userId": "[string]User ID",
"limitName": "[string]Usage Limit Model Name",
"counterName": "[string]Counter Name",
"verifyType": "[string]Type of verification",
"count": "[int]Count Value",
"multiplyValueSpecifyingQuantity": "[bool]Whether to multiply the value used for verification when specifying the quantity",
"timeOffsetToken": "[string]Time offset token"
}
}action: Gs2Limit:VerifyCounterByUserId
request:
namespaceName: "[string]Namespace name"
userId: "[string]User ID"
limitName: "[string]Usage Limit Model Name"
counterName: "[string]Counter Name"
verifyType: "[string]Type of verification"
count: "[int]Count Value"
multiplyValueSpecifyingQuantity: "[bool]Whether to multiply the value used for verification when specifying the quantity"
timeOffsetToken: "[string]Time offset token"transaction.service("limit").verify.verify_counter_by_user_id({
namespaceName="[string]Namespace name",
userId="[string]User ID",
limitName="[string]Usage Limit Model Name",
counterName="[string]Counter Name",
verifyType="[string]Type of verification",
count="[int]Count Value",
multiplyValueSpecifyingQuantity="[bool]Whether to multiply the value used for verification when specifying the quantity",
timeOffsetToken="[string]Time offset token",
})ConsumeAction
Gs2Limit:CountUpByUserId
Count-up by specifying a user ID
Increments the specified user’s counter by the specified count-up value. If maxValue is specified, the counter will not exceed that limit; an Overflow error is returned if the operation would exceed the maximum. If the counter does not yet exist, it is automatically created.
Whether the action allows quantity specification: YES
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 (.). | ||
| limitName | string | ✓ | ~ 128 chars | Usage Limit Model Name The name of the limit model that this counter belongs to. Determines the reset schedule (daily, weekly, monthly, etc.) applied to this counter’s value. | ||
| counterName | string | ✓ | ~ 128 chars | Counter Name A unique identifier for this counter within the limit model. Multiple counters can share the same limit model with different names, allowing separate usage tracking (e.g., one counter per quest or per product) without creating separate limit models. | ||
| userId | string | ✓ | ~ 128 chars | User ID Set #{userId} to replace the currently logged in user ID. | ||
| countUpValue | int | 1 | 1 ~ 2147483646 | Amount to count up | ||
| maxValue | int | 1 ~ 2147483646 | Maximum value allowed to count up | |||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
{
"action": "Gs2Limit:CountUpByUserId",
"request": {
"namespaceName": "[string]Namespace name",
"limitName": "[string]Usage Limit Model Name",
"counterName": "[string]Counter Name",
"userId": "[string]User ID",
"countUpValue": "[int]Amount to count up",
"maxValue": "[int]Maximum value allowed to count up",
"timeOffsetToken": "[string]Time offset token"
}
}action: Gs2Limit:CountUpByUserId
request:
namespaceName: "[string]Namespace name"
limitName: "[string]Usage Limit Model Name"
counterName: "[string]Counter Name"
userId: "[string]User ID"
countUpValue: "[int]Amount to count up"
maxValue: "[int]Maximum value allowed to count up"
timeOffsetToken: "[string]Time offset token"transaction.service("limit").consume.count_up_by_user_id({
namespaceName="[string]Namespace name",
limitName="[string]Usage Limit Model Name",
counterName="[string]Counter Name",
userId="[string]User ID",
countUpValue="[int]Amount to count up",
maxValue="[int]Maximum value allowed to count up",
timeOffsetToken="[string]Time offset token",
})AcquireAction
Gs2Limit:CountDownByUserId
Count-down by specifying a user ID
Decrements the specified user’s counter by the specified count-down value. The counter value will not go below 0.
Whether the action allows quantity specification: YES
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 (.). | ||
| limitName | string | ✓ | ~ 128 chars | Usage Limit Model Name The name of the limit model that this counter belongs to. Determines the reset schedule (daily, weekly, monthly, etc.) applied to this counter’s value. | ||
| counterName | string | ✓ | ~ 128 chars | Counter Name A unique identifier for this counter within the limit model. Multiple counters can share the same limit model with different names, allowing separate usage tracking (e.g., one counter per quest or per product) without creating separate limit models. | ||
| userId | string | ✓ | ~ 128 chars | User ID Set #{userId} to replace the currently logged in user ID. | ||
| countDownValue | int | 1 | 1 ~ 2147483646 | Amount to count down | ||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
{
"action": "Gs2Limit:CountDownByUserId",
"request": {
"namespaceName": "[string]Namespace name",
"limitName": "[string]Usage Limit Model Name",
"counterName": "[string]Counter Name",
"userId": "[string]User ID",
"countDownValue": "[int]Amount to count down",
"timeOffsetToken": "[string]Time offset token"
}
}action: Gs2Limit:CountDownByUserId
request:
namespaceName: "[string]Namespace name"
limitName: "[string]Usage Limit Model Name"
counterName: "[string]Counter Name"
userId: "[string]User ID"
countDownValue: "[int]Amount to count down"
timeOffsetToken: "[string]Time offset token"transaction.service("limit").acquire.count_down_by_user_id({
namespaceName="[string]Namespace name",
limitName="[string]Usage Limit Model Name",
counterName="[string]Counter Name",
userId="[string]User ID",
countDownValue="[int]Amount to count down",
timeOffsetToken="[string]Time offset token",
})Gs2Limit:DeleteCounterByUserId
Delete Counter by specifying a user ID
Deletes the specified user’s counter, resetting the usage count. This effectively removes the limit restriction for this counter, allowing the user to start counting from 0 again.
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 (.). | ||
| limitName | string | ✓ | ~ 128 chars | Usage Limit Model Name The name of the limit model that this counter belongs to. Determines the reset schedule (daily, weekly, monthly, etc.) applied to this counter’s value. | ||
| userId | string | ✓ | ~ 128 chars | User ID Set #{userId} to replace the currently logged in user ID. | ||
| counterName | string | ✓ | ~ 128 chars | Counter Name A unique identifier for this counter within the limit model. Multiple counters can share the same limit model with different names, allowing separate usage tracking (e.g., one counter per quest or per product) without creating separate limit models. | ||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
{
"action": "Gs2Limit:DeleteCounterByUserId",
"request": {
"namespaceName": "[string]Namespace name",
"limitName": "[string]Usage Limit Model Name",
"userId": "[string]User ID",
"counterName": "[string]Counter Name",
"timeOffsetToken": "[string]Time offset token"
}
}action: Gs2Limit:DeleteCounterByUserId
request:
namespaceName: "[string]Namespace name"
limitName: "[string]Usage Limit Model Name"
userId: "[string]User ID"
counterName: "[string]Counter Name"
timeOffsetToken: "[string]Time offset token"transaction.service("limit").acquire.delete_counter_by_user_id({
namespaceName="[string]Namespace name",
limitName="[string]Usage Limit Model Name",
userId="[string]User ID",
counterName="[string]Counter Name",
timeOffsetToken="[string]Time offset token",
})