GS2-Ranking2 Deploy/CDK Reference
Entities
Resources targeted by the Deploy operation
Namespace
Namespace
A Namespace allows multiple independent instances of the same service within a single project by separating data spaces and usage contexts. Each GS2 service is managed on a per-namespace basis. Even when using the same service, if the namespace differs, the data is treated as a completely independent data space.
Therefore, you must create a namespace before you can start using each service.
Request
Resource creation and update requests
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| name | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| description | string | ~ 1024 chars | Description | |||
| transactionSetting | TransactionSetting | ✓ | Transaction Setting Settings for distributed transactions used to grant ranking rewards. Supports auto-run to automatically execute transactions and atomic commit for all-or-nothing guarantee. | |||
| logSetting | LogSetting | Log Output Setting Specifies the GS2-Log namespace for outputting API request and response logs. Used for tracking score submissions and ranking reward distributions. |
GetAttr
Resource creation results that can be retrieved using the !GetAttr tag
| Type | Description | |
|---|---|---|
| Item | Namespace | Namespace created |
Implementation Example
Type: GS2::Ranking2::Namespace
Properties:
Name: namespace-0001
Description: null
TransactionSetting: null
LogSetting:
LoggingNamespaceId: grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001import (
"github.com/gs2io/gs2-golang-cdk/core"
"github.com/gs2io/gs2-golang-cdk/ranking2"
)
SampleStack := core.NewStack()
ranking2.NewNamespace(
&SampleStack,
"namespace-0001",
ranking2.NamespaceOptions{
LogSetting: &core.LogSetting{
LoggingNamespaceId: "grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001",
},
},
)
println(SampleStack.Yaml()) // Generate Templateclass SampleStack extends \Gs2Cdk\Core\Model\Stack
{
function __construct() {
parent::__construct();
new \Gs2Cdk\Ranking2\Model\Namespace_(
stack: $this,
name: "namespace-0001",
options: new \Gs2Cdk\Ranking2\Model\Options\NamespaceOptions(
logSetting: new \Gs2Cdk\Core\Model\LogSetting(
loggingNamespaceId: "grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"
)
)
);
}
}
print((new SampleStack())->yaml()); // Generate Templateclass SampleStack extends io.gs2.cdk.core.model.Stack
{
public SampleStack() {
super();
new io.gs2.cdk.ranking2.model.Namespace(
this,
"namespace-0001",
new io.gs2.cdk.ranking2.model.options.NamespaceOptions()
.withLogSetting(new io.gs2.cdk.core.model.LogSetting(
"grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"
))
);
}
}
System.out.println(new SampleStack().yaml()); // Generate Templatepublic class SampleStack : Gs2Cdk.Core.Model.Stack
{
public SampleStack() {
new Gs2Cdk.Gs2Ranking2.Model.Namespace(
stack: this,
name: "namespace-0001",
options: new Gs2Cdk.Gs2Ranking2.Model.Options.NamespaceOptions
{
logSetting = new Gs2Cdk.Core.Model.LogSetting(
loggingNamespaceId: "grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"
)
}
);
}
}
Debug.Log(new SampleStack().Yaml()); // Generate Templateimport core from "@/gs2cdk/core";
import ranking2 from "@/gs2cdk/ranking2";
class SampleStack extends core.Stack
{
public constructor() {
super();
new ranking2.model.Namespace(
this,
"namespace-0001",
{
logSetting: new core.LogSetting(
"grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"
)
}
);
}
}
console.log(new SampleStack().yaml()); // Generate Templatefrom gs2_cdk import Stack, core, ranking2
class SampleStack(Stack):
def __init__(self):
super().__init__()
ranking2.Namespace(
stack=self,
name='namespace-0001',
options=ranking2.NamespaceOptions(
log_setting=core.LogSetting(
logging_namespace_id='grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001',
),
),
)
print(SampleStack().yaml()) # Generate TemplateTransactionSetting
Transaction Setting
Transaction Setting controls how transactions are executed, including their consistency, asynchronous processing, and conflict avoidance mechanisms. Combining features like AutoRun, AtomicCommit, asynchronous execution using GS2-Distributor, batch application of script results, and asynchronous Acquire Actions via GS2-JobQueue enables robust transaction management tailored to game logic.
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| enableAutoRun | bool | false | Whether to automatically execute issued transactions on the server side | |||
| enableAtomicCommit | bool | {enableAutoRun} == true | false | Whether to commit the execution of transactions atomically * Applicable only if enableAutoRun is true | ||
| transactionUseDistributor | bool | {enableAtomicCommit} == true | false | Whether to execute transactions asynchronously * Applicable only if enableAtomicCommit is true | ||
| commitScriptResultInUseDistributor | bool | {transactionUseDistributor} == true | false | Whether to execute the commit processing of the script result asynchronously * Applicable only if transactionUseDistributor is true | ||
| acquireActionUseJobQueue | bool | {enableAtomicCommit} == true | false | Whether to use GS2-JobQueue to execute the acquire action * Applicable only if enableAtomicCommit is true | ||
| distributorNamespaceId | string | “grn:gs2:{region}:{ownerId}:distributor:default” | ~ 1024 chars | GS2-Distributor Namespace GRN used to execute transactions | ||
| queueNamespaceId | string | “grn:gs2:{region}:{ownerId}:queue:default” | ~ 1024 chars | GS2-JobQueue Namespace GRN used to execute transactions |
LogSetting
Log Output Setting
Log Output Setting defines how log data is exported. This type holds the GS2-Log namespace identifier (Namespace ID) used to export log data. Specify the GS2-Log namespace where log data is collected and stored in the GRN format for the Log Namespace ID (loggingNamespaceId). Configuring this setting ensures that log data for API requests and responses occurring within the specified namespace is output to the target GS2-Log namespace. GS2-Log provides real-time logs that can be used for system monitoring, analysis, debugging, and other operational purposes.
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| loggingNamespaceId | string | ✓ | ~ 1024 chars | GS2-Log namespace GRN
to output logs Must be specified in GRN format starting with “grn:gs2:”. |
CurrentRankingMaster
Currently active Ranking Model master data
This master data describes the definitions of Ranking Models currently active within the namespace. GS2 uses JSON format files for managing master data. By uploading these files, the master data settings are updated on the server.
To create JSON files, GS2 provides a master data editor within the management console. Additionally, you can create tools better suited for game operations and export JSON files in the appropriate format.
Note
Please refer to Master Data Reference of GS2-Ranking2 for the JSON file format.Request
Resource creation and update requests
| Type | Condition | Required | Default | Value Limits | Description | |||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||||||||
| mode | String Enum enum { “direct”, “preUpload” } | “direct” | Update mode
| |||||||||
| settings | string | {mode} == “direct” | ✓* | ~ 5242880 chars | Master Data * Required if mode is “direct” | |||||||
| uploadToken | string | {mode} == “preUpload” | ✓* | ~ 1024 chars | Token obtained by pre-upload Used to apply the uploaded master data. * Required if mode is “preUpload” |
GetAttr
Resource creation results that can be retrieved using the !GetAttr tag
| Type | Description | |
|---|---|---|
| Item | CurrentRankingMaster | Updated master data of the currently active Ranking Models |
Implementation Example
Type: GS2::Ranking2::CurrentRankingMaster
Properties:
NamespaceName: namespace-0001
Mode: direct
Settings: {
"version": "2024-05-30",
"globalRankingModels": [
{
"name": "ranking-0001",
"orderDirection": "asc"
},
{
"name": "ranking-0002",
"orderDirection": "desc"
}
],
"clusterRankingModels": [
{
"name": "ranking-0001",
"clusterType": "Raw",
"orderDirection": "asc"
},
{
"name": "ranking-0002",
"clusterType": "Gs2Guild::Guild",
"orderDirection": "desc"
}
],
"subscribeRankingModels": [
{
"name": "ranking-0001",
"orderDirection": "asc"
},
{
"name": "ranking-0002",
"orderDirection": "desc"
}
]
}
UploadToken: nullimport (
"github.com/gs2io/gs2-golang-cdk/core"
"github.com/gs2io/gs2-golang-cdk/ranking2"
)
SampleStack := core.NewStack()
ranking2.NewNamespace(
&SampleStack,
"namespace-0001",
ranking2.NamespaceOptions{},
).MasterData(
[]ranking2.GlobalRankingModel{
ranking2.NewGlobalRankingModel(
"ranking-0001",
false,
ranking2.GlobalRankingModelOrderDirectionAsc,
ranking2.GlobalRankingModelRewardCalculationIndexRank,
ranking2.GlobalRankingModelOptions{
},
),
ranking2.NewGlobalRankingModel(
"ranking-0002",
false,
ranking2.GlobalRankingModelOrderDirectionDesc,
ranking2.GlobalRankingModelRewardCalculationIndexRank,
ranking2.GlobalRankingModelOptions{
},
),
},
[]ranking2.ClusterRankingModel{
ranking2.NewClusterRankingModel(
"ranking-0001",
ranking2.ClusterRankingModelClusterTypeRaw,
false,
ranking2.ClusterRankingModelOrderDirectionAsc,
ranking2.ClusterRankingModelRewardCalculationIndexRank,
ranking2.ClusterRankingModelOptions{
},
),
ranking2.NewClusterRankingModel(
"ranking-0002",
ranking2.ClusterRankingModelClusterTypeGs2Guild_guild,
false,
ranking2.ClusterRankingModelOrderDirectionDesc,
ranking2.ClusterRankingModelRewardCalculationIndexRank,
ranking2.ClusterRankingModelOptions{
},
),
},
[]ranking2.SubscribeRankingModel{
ranking2.NewSubscribeRankingModel(
"ranking-0001",
false,
ranking2.SubscribeRankingModelOrderDirectionAsc,
ranking2.SubscribeRankingModelOptions{
},
),
ranking2.NewSubscribeRankingModel(
"ranking-0002",
false,
ranking2.SubscribeRankingModelOrderDirectionDesc,
ranking2.SubscribeRankingModelOptions{
},
),
},
)
println(SampleStack.Yaml()) // Generate Templateclass SampleStack extends \Gs2Cdk\Core\Model\Stack
{
function __construct() {
parent::__construct();
(new \Gs2Cdk\Ranking2\Model\Namespace_(
stack: $this,
name: "namespace-0001"
))->masterData(
[
new \Gs2Cdk\Ranking2\Model\GlobalRankingModel(
name:"ranking-0001",
sum: false,
orderDirection: \Gs2Cdk\Ranking2\Model\Enums\GlobalRankingModelOrderDirection::ASC,
rewardCalculationIndex: \Gs2Cdk\Ranking2\Model\Enums\GlobalRankingModelRewardCalculationIndex::RANK
),
new \Gs2Cdk\Ranking2\Model\GlobalRankingModel(
name:"ranking-0002",
sum: false,
orderDirection: \Gs2Cdk\Ranking2\Model\Enums\GlobalRankingModelOrderDirection::DESC,
rewardCalculationIndex: \Gs2Cdk\Ranking2\Model\Enums\GlobalRankingModelRewardCalculationIndex::RANK
)
],
[
new \Gs2Cdk\Ranking2\Model\ClusterRankingModel(
name:"ranking-0001",
clusterType: \Gs2Cdk\Ranking2\Model\Enums\ClusterRankingModelClusterType::RAW,
sum: false,
orderDirection: \Gs2Cdk\Ranking2\Model\Enums\ClusterRankingModelOrderDirection::ASC,
rewardCalculationIndex: \Gs2Cdk\Ranking2\Model\Enums\ClusterRankingModelRewardCalculationIndex::RANK
),
new \Gs2Cdk\Ranking2\Model\ClusterRankingModel(
name:"ranking-0002",
clusterType: \Gs2Cdk\Ranking2\Model\Enums\ClusterRankingModelClusterType::GS2_GUILD__GUILD,
sum: false,
orderDirection: \Gs2Cdk\Ranking2\Model\Enums\ClusterRankingModelOrderDirection::DESC,
rewardCalculationIndex: \Gs2Cdk\Ranking2\Model\Enums\ClusterRankingModelRewardCalculationIndex::RANK
)
],
[
new \Gs2Cdk\Ranking2\Model\SubscribeRankingModel(
name:"ranking-0001",
sum: false,
orderDirection: \Gs2Cdk\Ranking2\Model\Enums\SubscribeRankingModelOrderDirection::ASC
),
new \Gs2Cdk\Ranking2\Model\SubscribeRankingModel(
name:"ranking-0002",
sum: false,
orderDirection: \Gs2Cdk\Ranking2\Model\Enums\SubscribeRankingModelOrderDirection::DESC
)
]
);
}
}
print((new SampleStack())->yaml()); // Generate Templateclass SampleStack extends io.gs2.cdk.core.model.Stack
{
public SampleStack() {
super();
new io.gs2.cdk.ranking2.model.Namespace(
this,
"namespace-0001"
).masterData(
Arrays.asList(
new io.gs2.cdk.ranking2.model.GlobalRankingModel(
"ranking-0001",
false,
io.gs2.cdk.ranking2.model.enums.GlobalRankingModelOrderDirection.ASC,
io.gs2.cdk.ranking2.model.enums.GlobalRankingModelRewardCalculationIndex.RANK
),
new io.gs2.cdk.ranking2.model.GlobalRankingModel(
"ranking-0002",
false,
io.gs2.cdk.ranking2.model.enums.GlobalRankingModelOrderDirection.DESC,
io.gs2.cdk.ranking2.model.enums.GlobalRankingModelRewardCalculationIndex.RANK
)
),
Arrays.asList(
new io.gs2.cdk.ranking2.model.ClusterRankingModel(
"ranking-0001",
io.gs2.cdk.ranking2.model.enums.ClusterRankingModelClusterType.RAW,
false,
io.gs2.cdk.ranking2.model.enums.ClusterRankingModelOrderDirection.ASC,
io.gs2.cdk.ranking2.model.enums.ClusterRankingModelRewardCalculationIndex.RANK
),
new io.gs2.cdk.ranking2.model.ClusterRankingModel(
"ranking-0002",
io.gs2.cdk.ranking2.model.enums.ClusterRankingModelClusterType.GS2_GUILD__GUILD,
false,
io.gs2.cdk.ranking2.model.enums.ClusterRankingModelOrderDirection.DESC,
io.gs2.cdk.ranking2.model.enums.ClusterRankingModelRewardCalculationIndex.RANK
)
),
Arrays.asList(
new io.gs2.cdk.ranking2.model.SubscribeRankingModel(
"ranking-0001",
false,
io.gs2.cdk.ranking2.model.enums.SubscribeRankingModelOrderDirection.ASC
),
new io.gs2.cdk.ranking2.model.SubscribeRankingModel(
"ranking-0002",
false,
io.gs2.cdk.ranking2.model.enums.SubscribeRankingModelOrderDirection.DESC
)
)
);
}
}
System.out.println(new SampleStack().yaml()); // Generate Templatepublic class SampleStack : Gs2Cdk.Core.Model.Stack
{
public SampleStack() {
new Gs2Cdk.Gs2Ranking2.Model.Namespace(
stack: this,
name: "namespace-0001"
).MasterData(
new Gs2Cdk.Gs2Ranking2.Model.GlobalRankingModel[] {
new Gs2Cdk.Gs2Ranking2.Model.GlobalRankingModel(
name: "ranking-0001",
sum: false,
orderDirection: Gs2Cdk.Gs2Ranking2.Model.Enums.GlobalRankingModelOrderDirection.Asc,
rewardCalculationIndex: Gs2Cdk.Gs2Ranking2.Model.Enums.GlobalRankingModelRewardCalculationIndex.Rank
),
new Gs2Cdk.Gs2Ranking2.Model.GlobalRankingModel(
name: "ranking-0002",
sum: false,
orderDirection: Gs2Cdk.Gs2Ranking2.Model.Enums.GlobalRankingModelOrderDirection.Desc,
rewardCalculationIndex: Gs2Cdk.Gs2Ranking2.Model.Enums.GlobalRankingModelRewardCalculationIndex.Rank
)
},
new Gs2Cdk.Gs2Ranking2.Model.ClusterRankingModel[] {
new Gs2Cdk.Gs2Ranking2.Model.ClusterRankingModel(
name: "ranking-0001",
clusterType: Gs2Cdk.Gs2Ranking2.Model.Enums.ClusterRankingModelClusterType.Raw,
sum: false,
orderDirection: Gs2Cdk.Gs2Ranking2.Model.Enums.ClusterRankingModelOrderDirection.Asc,
rewardCalculationIndex: Gs2Cdk.Gs2Ranking2.Model.Enums.ClusterRankingModelRewardCalculationIndex.Rank
),
new Gs2Cdk.Gs2Ranking2.Model.ClusterRankingModel(
name: "ranking-0002",
clusterType: Gs2Cdk.Gs2Ranking2.Model.Enums.ClusterRankingModelClusterType.Gs2Guild_guild,
sum: false,
orderDirection: Gs2Cdk.Gs2Ranking2.Model.Enums.ClusterRankingModelOrderDirection.Desc,
rewardCalculationIndex: Gs2Cdk.Gs2Ranking2.Model.Enums.ClusterRankingModelRewardCalculationIndex.Rank
)
},
new Gs2Cdk.Gs2Ranking2.Model.SubscribeRankingModel[] {
new Gs2Cdk.Gs2Ranking2.Model.SubscribeRankingModel(
name: "ranking-0001",
sum: false,
orderDirection: Gs2Cdk.Gs2Ranking2.Model.Enums.SubscribeRankingModelOrderDirection.Asc
),
new Gs2Cdk.Gs2Ranking2.Model.SubscribeRankingModel(
name: "ranking-0002",
sum: false,
orderDirection: Gs2Cdk.Gs2Ranking2.Model.Enums.SubscribeRankingModelOrderDirection.Desc
)
}
);
}
}
Debug.Log(new SampleStack().Yaml()); // Generate Templateimport core from "@/gs2cdk/core";
import ranking2 from "@/gs2cdk/ranking2";
class SampleStack extends core.Stack
{
public constructor() {
super();
new ranking2.model.Namespace(
this,
"namespace-0001",
).masterData(
[
new ranking2.model.GlobalRankingModel(
"ranking-0001",
false,
ranking2.model.GlobalRankingModelOrderDirection.ASC,
ranking2.model.GlobalRankingModelRewardCalculationIndex.RANK
),
new ranking2.model.GlobalRankingModel(
"ranking-0002",
false,
ranking2.model.GlobalRankingModelOrderDirection.DESC,
ranking2.model.GlobalRankingModelRewardCalculationIndex.RANK
)
],
[
new ranking2.model.ClusterRankingModel(
"ranking-0001",
ranking2.model.ClusterRankingModelClusterType.RAW,
false,
ranking2.model.ClusterRankingModelOrderDirection.ASC,
ranking2.model.ClusterRankingModelRewardCalculationIndex.RANK
),
new ranking2.model.ClusterRankingModel(
"ranking-0002",
ranking2.model.ClusterRankingModelClusterType.GS2_GUILD__GUILD,
false,
ranking2.model.ClusterRankingModelOrderDirection.DESC,
ranking2.model.ClusterRankingModelRewardCalculationIndex.RANK
)
],
[
new ranking2.model.SubscribeRankingModel(
"ranking-0001",
false,
ranking2.model.SubscribeRankingModelOrderDirection.ASC
),
new ranking2.model.SubscribeRankingModel(
"ranking-0002",
false,
ranking2.model.SubscribeRankingModelOrderDirection.DESC
)
]
);
}
}
console.log(new SampleStack().yaml()); // Generate Templatefrom gs2_cdk import Stack, core, ranking2
class SampleStack(Stack):
def __init__(self):
super().__init__()
ranking2.Namespace(
stack=self,
name="namespace-0001",
).master_data(
global_ranking_models=[
ranking2.GlobalRankingModel(
name='ranking-0001',
sum=False,
order_direction=ranking2.GlobalRankingModelOrderDirection.ASC,
reward_calculation_index=ranking2.GlobalRankingModelRewardCalculationIndex.RANK
),
ranking2.GlobalRankingModel(
name='ranking-0002',
sum=False,
order_direction=ranking2.GlobalRankingModelOrderDirection.DESC,
reward_calculation_index=ranking2.GlobalRankingModelRewardCalculationIndex.RANK
),
],
cluster_ranking_models=[
ranking2.ClusterRankingModel(
name='ranking-0001',
cluster_type=ranking2.ClusterRankingModelClusterType.RAW,
sum=False,
order_direction=ranking2.ClusterRankingModelOrderDirection.ASC,
reward_calculation_index=ranking2.ClusterRankingModelRewardCalculationIndex.RANK
),
ranking2.ClusterRankingModel(
name='ranking-0002',
cluster_type=ranking2.ClusterRankingModelClusterType.GS2_GUILD__GUILD,
sum=False,
order_direction=ranking2.ClusterRankingModelOrderDirection.DESC,
reward_calculation_index=ranking2.ClusterRankingModelRewardCalculationIndex.RANK
),
],
subscribe_ranking_models=[
ranking2.SubscribeRankingModel(
name='ranking-0001',
sum=False,
order_direction=ranking2.SubscribeRankingModelOrderDirection.ASC
),
ranking2.SubscribeRankingModel(
name='ranking-0002',
sum=False,
order_direction=ranking2.SubscribeRankingModelOrderDirection.DESC
),
],
)
print(SampleStack().yaml()) # Generate TemplateGlobalRankingModel
Global Ranking Model
The global ranking is a model that allows you to create a ranking that targets all players. You can display the top 1000 rankings.
By associating it with the repeat event of GS2-Schedule, you can reset the ranking according to the number of repetitions.
| Type | Condition | Required | Default | Value Limits | Description | |||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| globalRankingModelId | string | * | ~ 1024 chars | Global Ranking GRN * Set automatically by the server | ||||||||
| name | string | ✓ | ~ 128 chars | Global Ranking Model name Global Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||||||||
| metadata | string | ~ 1024 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. | |||||||||
| minimumValue | long | 0 ~ 9223372036854775805 | Minimum Score The minimum allowed score value. Scores below this value will be rejected when submitted. Used to filter out invalid or unintended score values. | |||||||||
| maximumValue | long | 0 ~ 9223372036854775805 | Maximum Score The maximum allowed score value. Scores above this value will be rejected when submitted. Used to prevent abnormally high scores from being registered. | |||||||||
| sum | bool | false | Sum Scores When enabled, all submitted scores are accumulated and the ranking is determined by the total value. When disabled, only the best score (highest or lowest depending on sort direction) is used for ranking. | |||||||||
| orderDirection | String Enum enum { “asc”, “desc” } | ✓ | Order Direction The sort direction for ranking scores. Use “asc” for rankings where lower scores are better (e.g., time trials), or “desc” for rankings where higher scores are better (e.g., high scores).
| |||||||||
| entryPeriodEventId | string | ~ 1024 chars | Entry Period Event GRN GS2-Schedule event GRN that defines the period during which scores can be submitted. When linked to a repeating event, the ranking resets with each repeat cycle, enabling seasonal rankings. | |||||||||
| rankingRewards | List<RankingReward> | {entryPeriodEventId} != null | [] | 0 ~ 100 items | Ranking Rewards List of rewards granted based on ranking position at the end of each season. Only available when an entry period event is configured. Each reward defines a rank threshold and the acquire actions to execute. | |||||||
| accessPeriodEventId | string | ~ 1024 chars | Access Period Event GRN GS2-Schedule event GRN that defines the period during which ranking results can be viewed and rewards can be claimed. Typically set to the interval between score entry periods. | |||||||||
| rewardCalculationIndex | String Enum enum { “rank”, “index” } | “rank” | Reward Calculation Index Determines how rewards are matched to players. “rank” uses the 1-based ranking position (players with tied scores share the same rank), while “index” uses the 0-based unique sorted position (no ties). Choose “rank” for most typical use cases.
|
RankingReward
Ranking Reward
Set the rewards that can be received during the reference period when the score registration period is set in the ranking. If the repeat setting is enabled, the most recently ended period ranking will be the target for receiving rewards.
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| thresholdRank | int | ✓ | 1 ~ 1001 | Rank Threshold The rank threshold for this reward tier. Players whose rank (or index, depending on rewardCalculationIndex setting) is at or above this threshold receive this reward. Set to 1001 to define rewards for unranked players (those outside the top 1000). | ||
| metadata | string | ~ 1024 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. | |||
| acquireActions | List<AcquireAction> | [] | 0 ~ 100 items | Acquire Actions List of acquire actions executed when the player claims this ranking reward. These define the actual items, currency, or other resources granted as the reward for achieving this rank threshold. |
ClusterRankingModel
Cluster Ranking Model
The cluster ranking model enables rankings for players within guilds or gatherings. You can display the top 1000 rankings.
By associating it with the repeat event of GS2-Schedule, you can reset the ranking according to the number of repetitions.
| Type | Condition | Required | Default | Value Limits | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| clusterRankingModelId | string | * | ~ 1024 chars | Cluster Ranking GRN * Set automatically by the server | ||||||||||
| name | string | ✓ | ~ 128 chars | Cluster Ranking Model name Cluster Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||||||||||
| metadata | string | ~ 1024 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. | |||||||||||
| clusterType | String Enum enum { “Raw”, “Gs2Guild::Guild”, “Gs2Matchmaking::SeasonGathering” } | ✓ | Cluster Type Defines the type of group (cluster) used for ranking segmentation. “Raw” allows arbitrary cluster names without membership verification, “Gs2Guild::Guild” verifies the user belongs to a GS2-Guild guild, and “Gs2Matchmaking::SeasonGathering” verifies membership in a GS2-Matchmaking season gathering.
| |||||||||||
| minimumValue | long | 0 ~ 9223372036854775805 | Minimum Score The minimum allowed score value. Scores below this value will be rejected when submitted. | |||||||||||
| maximumValue | long | 0 ~ 9223372036854775805 | Maximum Score The maximum allowed score value. Scores above this value will be rejected when submitted. | |||||||||||
| sum | bool | false | Sum Scores When enabled, all submitted scores are accumulated and the ranking is determined by the total value. When disabled, only the best score is used for ranking. | |||||||||||
| orderDirection | String Enum enum { “asc”, “desc” } | ✓ | Order Direction The sort direction for ranking scores. Use “asc” for lower-is-better rankings, or “desc” for higher-is-better rankings.
| |||||||||||
| entryPeriodEventId | string | ~ 1024 chars | Entry Period Event GRN GS2-Schedule event GRN that defines the period during which scores can be submitted. When linked to a repeating event, the ranking resets with each repeat cycle, enabling seasonal rankings. | |||||||||||
| rankingRewards | List<RankingReward> | {entryPeriodEventId} != null | [] | 0 ~ 100 items | Ranking Rewards List of rewards granted based on ranking position at the end of each season. Only available when an entry period event is configured. | |||||||||
| accessPeriodEventId | string | ~ 1024 chars | Access Period Event GRN GS2-Schedule event GRN that defines the period during which ranking results can be viewed and rewards can be claimed. | |||||||||||
| rewardCalculationIndex | String Enum enum { “rank”, “index” } | “rank” | Reward Calculation Index Determines how rewards are matched to players. “rank” uses the 1-based ranking position (tied scores share same rank), “index” uses the 0-based unique sorted position (no ties).
|
SubscribeRankingModel
Subscribe Ranking Model
A model that aggregates scores of other players that the user has subscribed to and creates a ranking.
| Type | Condition | Required | Default | Value Limits | Description | |||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| subscribeRankingModelId | string | * | ~ 1024 chars | Subscribe Ranking GRN * Set automatically by the server | ||||||||
| name | string | ✓ | ~ 128 chars | Subscribe Ranking Model name Subscribe Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||||||||
| metadata | string | ~ 1024 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. | |||||||||
| minimumValue | long | 0 ~ 9223372036854775805 | Minimum Score The minimum allowed score value. Scores below this value will be rejected when submitted. | |||||||||
| maximumValue | long | 0 ~ 9223372036854775805 | Maximum Score The maximum allowed score value. Scores above this value will be rejected when submitted. | |||||||||
| sum | bool | false | Sum Scores When enabled, all submitted scores are accumulated and the ranking is determined by the total value. When disabled, only the best score is used for ranking. | |||||||||
| orderDirection | String Enum enum { “asc”, “desc” } | ✓ | Order Direction The sort direction for ranking scores. Use “asc” for lower-is-better rankings, or “desc” for higher-is-better rankings.
| |||||||||
| entryPeriodEventId | string | ~ 1024 chars | Entry Period Event GRN GS2-Schedule event GRN that defines the period during which scores can be submitted. When linked to a repeating event, the ranking resets with each repeat cycle, enabling seasonal rankings. | |||||||||
| accessPeriodEventId | string | ~ 1024 chars | Access Period Event GRN GS2-Schedule event GRN that defines the period during which ranking results can be viewed. |
AcquireAction
Acquire Action