GS2-Deploy/CDK Reference of GS2-Enchant
Entities
Namespace
Namespace
Namespace is a mechanism that allows multiple uses of the same service for different purposes within a single project. Basically, GS2 services have a layer called namespace, and different namespaces are treated as completely different data spaces, even for the same service.
Therefore, it is necessary to create a namespace before starting to use each service.
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
name | string | ✓ | ~ 32 chars | Namespace name | |
description | string | ~ 1024 chars | description of Namespace | ||
transactionSetting | TransactionSetting | ✓ | Transaction settings | ||
logSetting | LogSetting | Log output settings |
GetAttr
Type | Description | |
---|---|---|
Item | Namespace | Namespace created |
Implementation Example
Type: GS2::Enchant::Namespace
Properties:
Name: namespace1
Description: null
TransactionSetting:
EnableAutoRun: false
QueueNamespaceId: grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001
KeyId: grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0001
LogSetting:
LoggingNamespaceId: grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1
from gs2_cdk import Stack, core, enchant
class SampleStack(Stack):
def __init__(self):
super().__init__()
enchant.Namespace(
stack=self,
name="namespace-0001",
transaction_setting=core.TransactionSetting(
enable_auto_run=False,
options=core.TransactionSettingOptions(
distributor_namespace_id=,
key_id='grn:gs2:ap-northeast-1:YourOwnerId:key:namespace-0001:key:key-0001',
queue_namespace_id='grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001',
)
),
options=enchant.NamespaceOptions(
log_setting=core.LogSetting(
logging_namespace_id='grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001',
),
),
)
print(SampleStack().yaml()) # Generate Template
class SampleStack extends \Gs2Cdk\Core\Model\Stack
{
function __construct() {
parent::__construct();
new \Gs2Cdk\Enchant\Model\Namespace_(
stack: $this,
name: "namespace-0001",
transactionSetting: new \Gs2Cdk\Core\Model\TransactionSetting(
enableAutoRun: False,
options: new \Gs2Cdk\Core\Model\Options\TransactionSettingOptions(
distributorNamespaceId: ,
keyId: "grn:gs2:ap-northeast-1:YourOwnerId:key:namespace-0001:key:key-0001",
queueNamespaceId: "grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001",
)
),
options: new \Gs2Cdk\Enchant\Model\Options\NamespaceOptions(
logSetting: new \Gs2Cdk\Core\Model\LogSetting(
loggingNamespaceId: "grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001",
),
),
);
}
}
print((new SampleStack())->yaml()); // Generate Template
class SampleStack extends io.gs2.cdk.core.model.Stack
{
public SampleStack() {
super();
new io.gs2.cdk.enchant.model.Namespace(
this,
"namespace-0001",
new io.gs2.cdk.core.model.TransactionSetting(
false,
new io.gs2.cdk.core.model.options.TransactionSettingOptions(
,
"grn:gs2:ap-northeast-1:YourOwnerId:key:namespace-0001:key:key-0001",
"grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001"
)
),
new io.gs2.cdk.enchant.model.options.NamespaceOptions() {
{
logSetting = new io.gs2.cdk.core.model.LogSetting(
"grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"
);
}
}
);
}
}
System.out.println(new SampleStack().yaml()); // Generate Template
import core from "@/gs2cdk/core";
import enchant from "@/gs2cdk/enchant";
class SampleStack extends core.Stack
{
public constructor() {
super();
new enchant.model.Namespace(
this,
"namespace-0001",
new core.TransactionSetting(
false,
{
,
"grn:gs2:ap-northeast-1:YourOwnerId:key:namespace-0001:key:key-0001",
"grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001"
}
),
{
logSetting: new core.LogSetting(
"grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"
)
}
);
}
}
console.log(new SampleStack().yaml()); // Generate Template
public class SampleStack : Gs2Cdk.Core.Model.Stack
{
public SampleStack() {
new Gs2Cdk.Gs2Enchant.Model.Namespace(
this,
"namespace-0001",
new Gs2Cdk.Core.Model.TransactionSetting(
false,
new Gs2Cdk.Core.Model.Options.TransactionSettingOptions(
DistributorNamespaceId = ,
KeyId = "grn:gs2:ap-northeast-1:YourOwnerId:key:namespace-0001:key:key-0001",
QueueNamespaceId = "grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001"
}
),
new Gs2Cdk.Gs2Enchant.Model.Options.NamespaceOptions {
logSetting = new Gs2Cdk.Core.Model.LogSetting(
"grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"
),
}
);
}
}
Debug.Log(new SampleStack().Yaml()); // Generate Template
CurrentParameterMaster
Currently available enchantd rate masters
GS2 uses JSON format files for master data management. By uploading the file, the settings can actually be reflected on the server.
We provide a Master Data Editor on the Management Console as a way to create JSON files, but you can also create your own JSON files using the The service can also be used by creating a tool more appropriate for game management and exporting a JSON file in the appropriate format.
Please refer to the documentation for the format of the JSON file.
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32 chars | Namespace name | |
settings | string | ✓ | ~ 5242880 chars | Master data |
GetAttr
Type | Description | |
---|---|---|
Item | CurrentParameterMaster | Updated and currently available parameter settings |
Implementation Example
Type: GS2::Enchant::CurrentParameterMaster
Properties:
NamespaceName: namespace1
Settings: {"version": "2023-07-18", "balanceParameterModels": [{"name": "balance-0001", "metadata": "BALANCE_0001", "totalValue": 100, "initialValueStrategy": "average", "parameters": [{"name": "parameter-0001", "metadata": "PARAMETER_0001"}, {"name": "parameter-0002", "metadata": "PARAMETER_0002"}, {"name": "parameter-0003", "metadata": "PARAMETER_0003"}]}, {"name": "balance-0002", "metadata": "BALANCE_0002", "totalValue": 200, "initialValueStrategy": "lottery", "parameters": [{"name": "parameter-0001", "metadata": "PARAMETER_0001"}, {"name": "parameter-0002", "metadata": "PARAMETER_0002"}, {"name": "parameter-0003", "metadata": "PARAMETER_0003"}, {"name": "parameter-0004", "metadata": "PARAMETER_0004"}]}, {"name": "balance-0003", "metadata": "BALANCE_0003", "totalValue": 500, "initialValueStrategy": "average", "parameters": [{"name": "parameter-0001", "metadata": "PARAMETER_0001"}, {"name": "parameter-0002", "metadata": "PARAMETER_0002"}]}], "rarityParameterModels": [{"name": "rarity-0001", "metadata": "RARITY_0001", "maximumParameterCount": 5, "parameterCounts": [{"count": 0, "weight": 1}, {"count": 1, "weight": 2}, {"count": 2, "weight": 3}], "parameters": [{"name": "parameter-0001", "metadata": "PARAMETER_0001", "resourceName": "resource-0001", "resourceValue": 10, "weight": 1}, {"name": "parameter-0002", "metadata": "PARAMETER_0002", "resourceName": "resource-0002", "resourceValue": 20, "weight": 2}, {"name": "parameter-0003", "metadata": "PARAMETER_0003", "resourceName": "resource-0003", "resourceValue": 30, "weight": 3}]}, {"name": "rarity-0002", "metadata": "RARITY_0002", "maximumParameterCount": 10, "parameterCounts": [{"count": 1, "weight": 10}, {"count": 2, "weight": 20}, {"count": 3, "weight": 30}], "parameters": [{"name": "parameter-1001", "metadata": "PARAMETER_1001", "resourceName": "resource-1001", "resourceValue": 100, "weight": 10}, {"name": "parameter-1002", "metadata": "PARAMETER_1002", "resourceName": "resource-1002", "resourceValue": 200, "weight": 20}, {"name": "parameter-1003", "metadata": "PARAMETER_1003", "resourceName": "resource-1003", "resourceValue": 300, "weight": 30}]}, {"name": "rarity-0003", "metadata": "RARITY_0003", "maximumParameterCount": 3, "parameterCounts": [{"count": 2, "weight": 5}, {"count": 3, "weight": 10}, {"count": 4, "weight": 15}], "parameters": [{"name": "parameter-2001", "metadata": "PARAMETER_2001", "resourceName": "resource-2001", "resourceValue": 1000, "weight": 2}, {"name": "parameter-2002", "metadata": "PARAMETER_2002", "resourceName": "resource-2002", "resourceValue": 2000, "weight": 4}, {"name": "parameter-2003", "metadata": "PARAMETER_2003", "resourceName": "resource-2003", "resourceValue": 3000, "weight": 6}, {"name": "parameter-0004", "metadata": "PARAMETER_0004", "resourceName": "resource-2004", "resourceValue": 4000, "weight": 8}]}]}
from gs2_cdk import Stack, core, enchant
class SampleStack(Stack):
def __init__(self):
super().__init__()
enchant.Namespace(
stack=self,
# omission
).master_data(
[
enchant.BalanceParameterModel(
name='balance-0001',
total_value=100,
initial_value_strategy='average',
parameters=[ {'name': 'parameter-0001', 'metadata': 'PARAMETER_0001'},
{'name': 'parameter-0002', 'metadata': 'PARAMETER_0002'},
{'name': 'parameter-0003', 'metadata': 'PARAMETER_0003'},
],
options=enchant.BalanceParameterModelOptions(
metadata='BALANCE_0001',
),
),
enchant.BalanceParameterModel(
name='balance-0002',
total_value=200,
initial_value_strategy='lottery',
parameters=[ {'name': 'parameter-0001', 'metadata': 'PARAMETER_0001'},
{'name': 'parameter-0002', 'metadata': 'PARAMETER_0002'},
{'name': 'parameter-0003', 'metadata': 'PARAMETER_0003'},
{'name': 'parameter-0004', 'metadata': 'PARAMETER_0004'},
],
options=enchant.BalanceParameterModelOptions(
metadata='BALANCE_0002',
),
),
enchant.BalanceParameterModel(
name='balance-0003',
total_value=500,
initial_value_strategy='average',
parameters=[ {'name': 'parameter-0001', 'metadata': 'PARAMETER_0001'},
{'name': 'parameter-0002', 'metadata': 'PARAMETER_0002'},
],
options=enchant.BalanceParameterModelOptions(
metadata='BALANCE_0003',
),
),
],
[
enchant.RarityParameterModel(
name='rarity-0001',
maximum_parameter_count=5,
parameter_counts=[ {'count': 0, 'weight': 1},
{'count': 1, 'weight': 2},
{'count': 2, 'weight': 3},
],
parameters=[ {'name': 'parameter-0001', 'metadata': 'PARAMETER_0001', 'resourceName': 'resource-0001', 'resourceValue': 10, 'weight': 1},
{'name': 'parameter-0002', 'metadata': 'PARAMETER_0002', 'resourceName': 'resource-0002', 'resourceValue': 20, 'weight': 2},
{'name': 'parameter-0003', 'metadata': 'PARAMETER_0003', 'resourceName': 'resource-0003', 'resourceValue': 30, 'weight': 3},
],
options=enchant.RarityParameterModelOptions(
metadata='RARITY_0001',
),
),
enchant.RarityParameterModel(
name='rarity-0002',
maximum_parameter_count=10,
parameter_counts=[ {'count': 1, 'weight': 10},
{'count': 2, 'weight': 20},
{'count': 3, 'weight': 30},
],
parameters=[ {'name': 'parameter-1001', 'metadata': 'PARAMETER_1001', 'resourceName': 'resource-1001', 'resourceValue': 100, 'weight': 10},
{'name': 'parameter-1002', 'metadata': 'PARAMETER_1002', 'resourceName': 'resource-1002', 'resourceValue': 200, 'weight': 20},
{'name': 'parameter-1003', 'metadata': 'PARAMETER_1003', 'resourceName': 'resource-1003', 'resourceValue': 300, 'weight': 30},
],
options=enchant.RarityParameterModelOptions(
metadata='RARITY_0002',
),
),
enchant.RarityParameterModel(
name='rarity-0003',
maximum_parameter_count=3,
parameter_counts=[ {'count': 2, 'weight': 5},
{'count': 3, 'weight': 10},
{'count': 4, 'weight': 15},
],
parameters=[ {'name': 'parameter-2001', 'metadata': 'PARAMETER_2001', 'resourceName': 'resource-2001', 'resourceValue': 1000, 'weight': 2},
{'name': 'parameter-2002', 'metadata': 'PARAMETER_2002', 'resourceName': 'resource-2002', 'resourceValue': 2000, 'weight': 4},
{'name': 'parameter-2003', 'metadata': 'PARAMETER_2003', 'resourceName': 'resource-2003', 'resourceValue': 3000, 'weight': 6},
{'name': 'parameter-0004', 'metadata': 'PARAMETER_0004', 'resourceName': 'resource-2004', 'resourceValue': 4000, 'weight': 8},
],
options=enchant.RarityParameterModelOptions(
metadata='RARITY_0003',
),
),
],
)
print(SampleStack().yaml()) # Generate Template
class SampleStack extends \Gs2Cdk\Core\Model\Stack
{
function __construct() {
parent::__construct();
(new \Gs2Cdk\Enchant\Model\Namespace_(
stack: $this,
// omission
))->masterData(
[
new \Gs2Cdk\Enchant\Model\BalanceParameterModel(
name:"balance-0001",
totalValue:100,
initialValueStrategy: \Gs2Cdk\Enchant\Model\Enums\CurrentParameterMasterInitialValueStrategy::AVERAGE
parameters:[ {'name': 'parameter-0001', 'metadata': 'PARAMETER_0001'},
{'name': 'parameter-0002', 'metadata': 'PARAMETER_0002'},
{'name': 'parameter-0003', 'metadata': 'PARAMETER_0003'},
],
options: new \Gs2Cdk\Enchant\Model\Options\BalanceParameterModelOptions(
metadata:"BALANCE_0001",
),
),
new \Gs2Cdk\Enchant\Model\BalanceParameterModel(
name:"balance-0002",
totalValue:200,
initialValueStrategy: \Gs2Cdk\Enchant\Model\Enums\CurrentParameterMasterInitialValueStrategy::LOTTERY
parameters:[ {'name': 'parameter-0001', 'metadata': 'PARAMETER_0001'},
{'name': 'parameter-0002', 'metadata': 'PARAMETER_0002'},
{'name': 'parameter-0003', 'metadata': 'PARAMETER_0003'},
{'name': 'parameter-0004', 'metadata': 'PARAMETER_0004'},
],
options: new \Gs2Cdk\Enchant\Model\Options\BalanceParameterModelOptions(
metadata:"BALANCE_0002",
),
),
new \Gs2Cdk\Enchant\Model\BalanceParameterModel(
name:"balance-0003",
totalValue:500,
initialValueStrategy: \Gs2Cdk\Enchant\Model\Enums\CurrentParameterMasterInitialValueStrategy::AVERAGE
parameters:[ {'name': 'parameter-0001', 'metadata': 'PARAMETER_0001'},
{'name': 'parameter-0002', 'metadata': 'PARAMETER_0002'},
],
options: new \Gs2Cdk\Enchant\Model\Options\BalanceParameterModelOptions(
metadata:"BALANCE_0003",
),
),
],
[
new \Gs2Cdk\Enchant\Model\RarityParameterModel(
name:"rarity-0001",
maximumParameterCount:5,
parameterCounts:[ {'count': 0, 'weight': 1},
{'count': 1, 'weight': 2},
{'count': 2, 'weight': 3},
],
parameters:[ {'name': 'parameter-0001', 'metadata': 'PARAMETER_0001', 'resourceName': 'resource-0001', 'resourceValue': 10, 'weight': 1},
{'name': 'parameter-0002', 'metadata': 'PARAMETER_0002', 'resourceName': 'resource-0002', 'resourceValue': 20, 'weight': 2},
{'name': 'parameter-0003', 'metadata': 'PARAMETER_0003', 'resourceName': 'resource-0003', 'resourceValue': 30, 'weight': 3},
],
options: new \Gs2Cdk\Enchant\Model\Options\RarityParameterModelOptions(
metadata:"RARITY_0001",
),
),
new \Gs2Cdk\Enchant\Model\RarityParameterModel(
name:"rarity-0002",
maximumParameterCount:10,
parameterCounts:[ {'count': 1, 'weight': 10},
{'count': 2, 'weight': 20},
{'count': 3, 'weight': 30},
],
parameters:[ {'name': 'parameter-1001', 'metadata': 'PARAMETER_1001', 'resourceName': 'resource-1001', 'resourceValue': 100, 'weight': 10},
{'name': 'parameter-1002', 'metadata': 'PARAMETER_1002', 'resourceName': 'resource-1002', 'resourceValue': 200, 'weight': 20},
{'name': 'parameter-1003', 'metadata': 'PARAMETER_1003', 'resourceName': 'resource-1003', 'resourceValue': 300, 'weight': 30},
],
options: new \Gs2Cdk\Enchant\Model\Options\RarityParameterModelOptions(
metadata:"RARITY_0002",
),
),
new \Gs2Cdk\Enchant\Model\RarityParameterModel(
name:"rarity-0003",
maximumParameterCount:3,
parameterCounts:[ {'count': 2, 'weight': 5},
{'count': 3, 'weight': 10},
{'count': 4, 'weight': 15},
],
parameters:[ {'name': 'parameter-2001', 'metadata': 'PARAMETER_2001', 'resourceName': 'resource-2001', 'resourceValue': 1000, 'weight': 2},
{'name': 'parameter-2002', 'metadata': 'PARAMETER_2002', 'resourceName': 'resource-2002', 'resourceValue': 2000, 'weight': 4},
{'name': 'parameter-2003', 'metadata': 'PARAMETER_2003', 'resourceName': 'resource-2003', 'resourceValue': 3000, 'weight': 6},
{'name': 'parameter-0004', 'metadata': 'PARAMETER_0004', 'resourceName': 'resource-2004', 'resourceValue': 4000, 'weight': 8},
],
options: new \Gs2Cdk\Enchant\Model\Options\RarityParameterModelOptions(
metadata:"RARITY_0003",
),
),
],
);
}
}
print((new SampleStack())->yaml()); // Generate Template
class SampleStack extends io.gs2.cdk.core.model.Stack
{
public SampleStack() {
super();
new io.gs2.cdk.enchant.model.Namespace(
this,
// omission
).masterData(
Arrays.asList(
new io.gs2.cdk.enchant.model.BalanceParameterModel(
"balance-0001",
100L,
Average,
Arrays.asList(
{'name': 'parameter-0001', 'metadata': 'PARAMETER_0001'},
{'name': 'parameter-0002', 'metadata': 'PARAMETER_0002'},
{'name': 'parameter-0003', 'metadata': 'PARAMETER_0003'}
),
new io.gs2.cdk.enchant.model.options.BalanceParameterModelOptions() {
{
metadata: "BALANCE_0001";
}
}
),
new io.gs2.cdk.enchant.model.BalanceParameterModel(
"balance-0002",
200L,
Lottery,
Arrays.asList(
{'name': 'parameter-0001', 'metadata': 'PARAMETER_0001'},
{'name': 'parameter-0002', 'metadata': 'PARAMETER_0002'},
{'name': 'parameter-0003', 'metadata': 'PARAMETER_0003'},
{'name': 'parameter-0004', 'metadata': 'PARAMETER_0004'}
),
new io.gs2.cdk.enchant.model.options.BalanceParameterModelOptions() {
{
metadata: "BALANCE_0002";
}
}
),
new io.gs2.cdk.enchant.model.BalanceParameterModel(
"balance-0003",
500L,
Average,
Arrays.asList(
{'name': 'parameter-0001', 'metadata': 'PARAMETER_0001'},
{'name': 'parameter-0002', 'metadata': 'PARAMETER_0002'}
),
new io.gs2.cdk.enchant.model.options.BalanceParameterModelOptions() {
{
metadata: "BALANCE_0003";
}
}
)
),
Arrays.asList(
new io.gs2.cdk.enchant.model.RarityParameterModel(
"rarity-0001",
5,
Arrays.asList(
{'count': 0, 'weight': 1},
{'count': 1, 'weight': 2},
{'count': 2, 'weight': 3}
),
Arrays.asList(
{'name': 'parameter-0001', 'metadata': 'PARAMETER_0001', 'resourceName': 'resource-0001', 'resourceValue': 10, 'weight': 1},
{'name': 'parameter-0002', 'metadata': 'PARAMETER_0002', 'resourceName': 'resource-0002', 'resourceValue': 20, 'weight': 2},
{'name': 'parameter-0003', 'metadata': 'PARAMETER_0003', 'resourceName': 'resource-0003', 'resourceValue': 30, 'weight': 3}
),
new io.gs2.cdk.enchant.model.options.RarityParameterModelOptions() {
{
metadata: "RARITY_0001";
}
}
),
new io.gs2.cdk.enchant.model.RarityParameterModel(
"rarity-0002",
10,
Arrays.asList(
{'count': 1, 'weight': 10},
{'count': 2, 'weight': 20},
{'count': 3, 'weight': 30}
),
Arrays.asList(
{'name': 'parameter-1001', 'metadata': 'PARAMETER_1001', 'resourceName': 'resource-1001', 'resourceValue': 100, 'weight': 10},
{'name': 'parameter-1002', 'metadata': 'PARAMETER_1002', 'resourceName': 'resource-1002', 'resourceValue': 200, 'weight': 20},
{'name': 'parameter-1003', 'metadata': 'PARAMETER_1003', 'resourceName': 'resource-1003', 'resourceValue': 300, 'weight': 30}
),
new io.gs2.cdk.enchant.model.options.RarityParameterModelOptions() {
{
metadata: "RARITY_0002";
}
}
),
new io.gs2.cdk.enchant.model.RarityParameterModel(
"rarity-0003",
3,
Arrays.asList(
{'count': 2, 'weight': 5},
{'count': 3, 'weight': 10},
{'count': 4, 'weight': 15}
),
Arrays.asList(
{'name': 'parameter-2001', 'metadata': 'PARAMETER_2001', 'resourceName': 'resource-2001', 'resourceValue': 1000, 'weight': 2},
{'name': 'parameter-2002', 'metadata': 'PARAMETER_2002', 'resourceName': 'resource-2002', 'resourceValue': 2000, 'weight': 4},
{'name': 'parameter-2003', 'metadata': 'PARAMETER_2003', 'resourceName': 'resource-2003', 'resourceValue': 3000, 'weight': 6},
{'name': 'parameter-0004', 'metadata': 'PARAMETER_0004', 'resourceName': 'resource-2004', 'resourceValue': 4000, 'weight': 8}
),
new io.gs2.cdk.enchant.model.options.RarityParameterModelOptions() {
{
metadata: "RARITY_0003";
}
}
)
)
);
}
}
System.out.println(new SampleStack().yaml()); // Generate Template
import core from "@/gs2cdk/core";
import enchant from "@/gs2cdk/enchant";
class SampleStack extends core.Stack
{
public constructor() {
super();
new enchant.model.Namespace(
this,
// omission
).masterData(
[
new enchant.model.BalanceParameterModel(
"balance-0001",
100,
enchant.model.CurrentParameterMasterInitialValueStrategy.AVERAGE,
[
{'name': 'parameter-0001', 'metadata': 'PARAMETER_0001'},
{'name': 'parameter-0002', 'metadata': 'PARAMETER_0002'},
{'name': 'parameter-0003', 'metadata': 'PARAMETER_0003'}
],
{
metadata: "BALANCE_0001"
}
),
new enchant.model.BalanceParameterModel(
"balance-0002",
200,
enchant.model.CurrentParameterMasterInitialValueStrategy.LOTTERY,
[
{'name': 'parameter-0001', 'metadata': 'PARAMETER_0001'},
{'name': 'parameter-0002', 'metadata': 'PARAMETER_0002'},
{'name': 'parameter-0003', 'metadata': 'PARAMETER_0003'},
{'name': 'parameter-0004', 'metadata': 'PARAMETER_0004'}
],
{
metadata: "BALANCE_0002"
}
),
new enchant.model.BalanceParameterModel(
"balance-0003",
500,
enchant.model.CurrentParameterMasterInitialValueStrategy.AVERAGE,
[
{'name': 'parameter-0001', 'metadata': 'PARAMETER_0001'},
{'name': 'parameter-0002', 'metadata': 'PARAMETER_0002'}
],
{
metadata: "BALANCE_0003"
}
)
],
[
new enchant.model.RarityParameterModel(
"rarity-0001",
5,
[
{'count': 0, 'weight': 1},
{'count': 1, 'weight': 2},
{'count': 2, 'weight': 3}
],
[
{'name': 'parameter-0001', 'metadata': 'PARAMETER_0001', 'resourceName': 'resource-0001', 'resourceValue': 10, 'weight': 1},
{'name': 'parameter-0002', 'metadata': 'PARAMETER_0002', 'resourceName': 'resource-0002', 'resourceValue': 20, 'weight': 2},
{'name': 'parameter-0003', 'metadata': 'PARAMETER_0003', 'resourceName': 'resource-0003', 'resourceValue': 30, 'weight': 3}
],
{
metadata: "RARITY_0001"
}
),
new enchant.model.RarityParameterModel(
"rarity-0002",
10,
[
{'count': 1, 'weight': 10},
{'count': 2, 'weight': 20},
{'count': 3, 'weight': 30}
],
[
{'name': 'parameter-1001', 'metadata': 'PARAMETER_1001', 'resourceName': 'resource-1001', 'resourceValue': 100, 'weight': 10},
{'name': 'parameter-1002', 'metadata': 'PARAMETER_1002', 'resourceName': 'resource-1002', 'resourceValue': 200, 'weight': 20},
{'name': 'parameter-1003', 'metadata': 'PARAMETER_1003', 'resourceName': 'resource-1003', 'resourceValue': 300, 'weight': 30}
],
{
metadata: "RARITY_0002"
}
),
new enchant.model.RarityParameterModel(
"rarity-0003",
3,
[
{'count': 2, 'weight': 5},
{'count': 3, 'weight': 10},
{'count': 4, 'weight': 15}
],
[
{'name': 'parameter-2001', 'metadata': 'PARAMETER_2001', 'resourceName': 'resource-2001', 'resourceValue': 1000, 'weight': 2},
{'name': 'parameter-2002', 'metadata': 'PARAMETER_2002', 'resourceName': 'resource-2002', 'resourceValue': 2000, 'weight': 4},
{'name': 'parameter-2003', 'metadata': 'PARAMETER_2003', 'resourceName': 'resource-2003', 'resourceValue': 3000, 'weight': 6},
{'name': 'parameter-0004', 'metadata': 'PARAMETER_0004', 'resourceName': 'resource-2004', 'resourceValue': 4000, 'weight': 8}
],
{
metadata: "RARITY_0003"
}
)
]
);
}
}
console.log(new SampleStack().yaml()); // Generate Template
public class SampleStack : Gs2Cdk.Core.Model.Stack
{
public SampleStack() {
new Gs2Cdk.Gs2Enchant.Model.Namespace(
this,
// omission
).MasterData(
new [] {
new Gs2Cdk.Gs2Enchant.Model.BalanceParameterModel(
"balance-0001",
100L,
Gs2Cdk.Gs2Enchant.Model.Enums.CurrentParameterMasterInitialValueStrategy.Average,
new Gs2Cdk.Gs2Enchant.Model.BalanceParameterValueModel[] {
{'name': 'parameter-0001', 'metadata': 'PARAMETER_0001'},
{'name': 'parameter-0002', 'metadata': 'PARAMETER_0002'},
{'name': 'parameter-0003', 'metadata': 'PARAMETER_0003'}
},
new Gs2Cdk.Gs2Enchant.Model.Options.BalanceParameterModelOptions {
metadata = "BALANCE_0001",
}
),
new Gs2Cdk.Gs2Enchant.Model.BalanceParameterModel(
"balance-0002",
200L,
Gs2Cdk.Gs2Enchant.Model.Enums.CurrentParameterMasterInitialValueStrategy.Lottery,
new Gs2Cdk.Gs2Enchant.Model.BalanceParameterValueModel[] {
{'name': 'parameter-0001', 'metadata': 'PARAMETER_0001'},
{'name': 'parameter-0002', 'metadata': 'PARAMETER_0002'},
{'name': 'parameter-0003', 'metadata': 'PARAMETER_0003'},
{'name': 'parameter-0004', 'metadata': 'PARAMETER_0004'}
},
new Gs2Cdk.Gs2Enchant.Model.Options.BalanceParameterModelOptions {
metadata = "BALANCE_0002",
}
),
new Gs2Cdk.Gs2Enchant.Model.BalanceParameterModel(
"balance-0003",
500L,
Gs2Cdk.Gs2Enchant.Model.Enums.CurrentParameterMasterInitialValueStrategy.Average,
new Gs2Cdk.Gs2Enchant.Model.BalanceParameterValueModel[] {
{'name': 'parameter-0001', 'metadata': 'PARAMETER_0001'},
{'name': 'parameter-0002', 'metadata': 'PARAMETER_0002'}
},
new Gs2Cdk.Gs2Enchant.Model.Options.BalanceParameterModelOptions {
metadata = "BALANCE_0003",
}
)
},
new [] {
new Gs2Cdk.Gs2Enchant.Model.RarityParameterModel(
"rarity-0001",
5,
new Gs2Cdk.Gs2Enchant.Model.RarityParameterCountModel[] {
{'count': 0, 'weight': 1},
{'count': 1, 'weight': 2},
{'count': 2, 'weight': 3}
},
new Gs2Cdk.Gs2Enchant.Model.RarityParameterValueModel[] {
{'name': 'parameter-0001', 'metadata': 'PARAMETER_0001', 'resourceName': 'resource-0001', 'resourceValue': 10, 'weight': 1},
{'name': 'parameter-0002', 'metadata': 'PARAMETER_0002', 'resourceName': 'resource-0002', 'resourceValue': 20, 'weight': 2},
{'name': 'parameter-0003', 'metadata': 'PARAMETER_0003', 'resourceName': 'resource-0003', 'resourceValue': 30, 'weight': 3}
},
new Gs2Cdk.Gs2Enchant.Model.Options.RarityParameterModelOptions {
metadata = "RARITY_0001",
}
),
new Gs2Cdk.Gs2Enchant.Model.RarityParameterModel(
"rarity-0002",
10,
new Gs2Cdk.Gs2Enchant.Model.RarityParameterCountModel[] {
{'count': 1, 'weight': 10},
{'count': 2, 'weight': 20},
{'count': 3, 'weight': 30}
},
new Gs2Cdk.Gs2Enchant.Model.RarityParameterValueModel[] {
{'name': 'parameter-1001', 'metadata': 'PARAMETER_1001', 'resourceName': 'resource-1001', 'resourceValue': 100, 'weight': 10},
{'name': 'parameter-1002', 'metadata': 'PARAMETER_1002', 'resourceName': 'resource-1002', 'resourceValue': 200, 'weight': 20},
{'name': 'parameter-1003', 'metadata': 'PARAMETER_1003', 'resourceName': 'resource-1003', 'resourceValue': 300, 'weight': 30}
},
new Gs2Cdk.Gs2Enchant.Model.Options.RarityParameterModelOptions {
metadata = "RARITY_0002",
}
),
new Gs2Cdk.Gs2Enchant.Model.RarityParameterModel(
"rarity-0003",
3,
new Gs2Cdk.Gs2Enchant.Model.RarityParameterCountModel[] {
{'count': 2, 'weight': 5},
{'count': 3, 'weight': 10},
{'count': 4, 'weight': 15}
},
new Gs2Cdk.Gs2Enchant.Model.RarityParameterValueModel[] {
{'name': 'parameter-2001', 'metadata': 'PARAMETER_2001', 'resourceName': 'resource-2001', 'resourceValue': 1000, 'weight': 2},
{'name': 'parameter-2002', 'metadata': 'PARAMETER_2002', 'resourceName': 'resource-2002', 'resourceValue': 2000, 'weight': 4},
{'name': 'parameter-2003', 'metadata': 'PARAMETER_2003', 'resourceName': 'resource-2003', 'resourceValue': 3000, 'weight': 6},
{'name': 'parameter-0004', 'metadata': 'PARAMETER_0004', 'resourceName': 'resource-2004', 'resourceValue': 4000, 'weight': 8}
},
new Gs2Cdk.Gs2Enchant.Model.Options.RarityParameterModelOptions {
metadata = "RARITY_0003",
}
)
}
);
}
}
Debug.Log(new SampleStack().Yaml()); // Generate Template
BalanceParameterValueModel
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
name | string | ✓ | ~ 64 chars | Name | |
metadata | string | ~ 512 chars | metadata |
RarityParameterCountModel
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
count | int | ✓ | ~ 10 | Value | |
weight | int | ✓ | 1 ~ 2147483646 | Weight |
RarityParameterValueModel
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
name | string | ✓ | ~ 64 chars | Name | |
metadata | string | ~ 512 chars | metadata | ||
resourceName | string | ✓ | ~ 64 chars | Parameter Resource Name for Game(Not used for GS2) | |
resourceValue | long | ✓ | ~ 9223372036854775805 | Parameter Resource Value for Game(Not used for GS2) | |
weight | int | ✓ | 1 ~ 2147483646 | Weight |
BalanceParameterValue
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
name | string | ✓ | ~ 64 chars | Name | |
value | long | ✓ | ~ 9223372036854775805 | Value |
RarityParameterValue
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
name | string | ✓ | ~ 64 chars | Name | |
resourceName | string | ✓ | ~ 64 chars | Resource Name | |
resourceValue | long | ✓ | ~ 9223372036854775805 | Resource Value |
Config
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
key | string | ✓ | ~ 64 chars | Name | |
value | string | ~ 51200 chars | Value |
GitHubCheckoutSetting
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
apiKeyId | string | ✓ | ~ 1024 chars | GitHub API key GRN | |
repositoryName | string | ✓ | ~ 1024 chars | Repository Name | |
sourcePath | string | ✓ | ~ 1024 chars | Source code file path | |
referenceType | enum [‘commit_hash’, ‘branch’, ’tag’] | ✓ | ~ 128 chars | Source of code | |
commitHash | string | {referenceType} == “commit_hash” | ~ 1024 chars | Commit hash | |
branchName | string | {referenceType} == “branch” | ~ 1024 chars | Branch Name | |
tagName | string | {referenceType} == “tag” | ~ 1024 chars | Tag Name |
ScriptSetting
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
triggerScriptId | string | ~ 1024 chars | Script GRN | ||
doneTriggerTargetType | enum [’none’, ‘gs2_script’, ‘aws’] | ✓ | “none” | ~ 128 chars | Notification of Completion |
doneTriggerScriptId | string | {doneTriggerTargetType} == “gs2_script” | ~ 1024 chars | Script GRN | |
doneTriggerQueueNamespaceId | string | {doneTriggerTargetType} == “gs2_script” | ~ 1024 chars | Namespace GRN |
LogSetting
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
loggingNamespaceId | string | ✓ | ~ 1024 chars | Namespace GRN |
TransactionSetting
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
enableAutoRun | bool | ✓ | false | Automatically run issued stamp sheets on the server side, or | |
distributorNamespaceId | string | {enableAutoRun} | ~ 1024 chars | GS2-Distributor namespace used for stamp sheet execution | |
keyId | string | !{enableAutoRun} | ~ 1024 chars | GS2-Key encryption key used to sign the stamp sheet | |
queueNamespaceId | string | ~ 1024 chars | Namespace in GS2-JobQueue used to run the stamp sheet |