GS2-Account GS2-Deploy/CDK リファレンス
エンティティ
Namespace
ネームスペース
ネームスペースは一つのプロジェクトで同じサービスを異なる用途で複数利用できるようにするための仕組みです。
GS2 の各サービスはネームスペース単位で管理されます。ネームスペースが異なれば、同じサービスでも完全に独立したデータ空間として扱われます。
そのため、各サービスの利用を開始するにあたってネームスペースを作成する必要があります。
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| name | string | ✓ | ~ 128文字 | ネームスペース名 この名前はネームスペースを識別するために使用され、英数字で指定されます。 | ||
| description | string | ~ 1024文字 | 説明文 | |||
| transactionSetting | TransactionSetting | トランザクション設定 | ||||
| changePasswordIfTakeOver | bool | ✓ | false | アカウント引き継ぎ時にパスワードを変更するか アカウント引き継ぎ時にパスワードを変更するかどうかを指定します。 この設定により、アカウント引き継ぎを実行した後に引き継ぎ前のデバイスからのログインを制限することができます。 | ||
| differentUserIdForLoginAndDataRetention | bool | ✓ | false | ログインに使用するユーザーIDとデータの保持に使用するユーザーIDを異なるものにする ログイン用ユーザーIDとデータ保持用ユーザーIDを分けるかどうかを指定します。 この設定により、プラットフォーマーが規定する個人情報保護の要件を少ない工数で満たせる可能性があります。 ※このパラメータは、ネームスペースの作成時にのみ設定が可能です。 | ||
| createAccountScript | ScriptSetting | アカウント新規作成したときに実行するスクリプト アカウント作成のカスタムロジックを実装するのに使用されます。 | ||||
| authenticationScript | ScriptSetting | 認証したときに実行するスクリプト 認証プロセスのカスタマイズに役立ちます。 | ||||
| createTakeOverScript | ScriptSetting | 引き継ぎ情報登録したときに実行するスクリプト 引き継ぎ情報を初めて登録した時に報酬を与えるために、GS2-Mission のカウンターを上昇するなどのカスタムロジックを追加するのに使用されます。 | ||||
| doTakeOverScript | ScriptSetting | 引き継ぎ実行したときに実行するスクリプト 引き継ぎ処理の追加ロジックを実装するのに役立ちます。 | ||||
| banScript | ScriptSetting | アカウントBAN情報を追加したときに実行するスクリプト | ||||
| unBanScript | ScriptSetting | アカウントBAN情報を解除したときに実行するスクリプト | ||||
| logSetting | LogSetting | ログの出力設定 ログデータの書き出し設定を管理します。この型は、ログデータを書き出すために使用される GS2-Log のネームスペース情報を保持します。 |
GetAttr
!GetAttrタグで取得可能なリソースの生成結果
| 型 | 説明 | |
|---|---|---|
| Item | Namespace | 作成したネームスペース |
実装例
Type: GS2::Account::Namespace
Properties:
Name: namespace-0001
Description: null
TransactionSetting: null
ChangePasswordIfTakeOver: false
DifferentUserIdForLoginAndDataRetention: null
CreateAccountScript: null
AuthenticationScript: null
CreateTakeOverScript: null
DoTakeOverScript: null
BanScript: null
UnBanScript: 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/account"
"github.com/openlyinc/pointy"
)
SampleStack := core.NewStack()
account.NewNamespace(
&SampleStack,
"namespace-0001",
account.NamespaceOptions{
ChangePasswordIfTakeOver: false,
LogSetting: &core.LogSetting{
LoggingNamespaceId: "grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001",
},
},
)
println(SampleStack.Yaml()) // Generate Template
class SampleStack extends \Gs2Cdk\Core\Model\Stack
{
function __construct() {
parent::__construct();
new \Gs2Cdk\Account\Model\Namespace_(
stack: $this,
name: "namespace-0001",
options: new \Gs2Cdk\Account\Model\Options\NamespaceOptions(
changePasswordIfTakeOver: False,
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.account.model.Namespace(
this,
"namespace-0001",
new io.gs2.cdk.account.model.options.NamespaceOptions()
.withChangePasswordIfTakeOver(false)
.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.Gs2Account.Model.Namespace(
stack: this,
name: "namespace-0001",
options: new Gs2Cdk.Gs2Account.Model.Options.NamespaceOptions
{
changePasswordIfTakeOver = false,
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 account from "@/gs2cdk/account";
class SampleStack extends core.Stack
{
public constructor() {
super();
new account.model.Namespace(
this,
"namespace-0001",
{
changePasswordIfTakeOver: false,
logSetting: new core.LogSetting(
"grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"
)
}
);
}
}
console.log(new SampleStack().yaml()); // Generate Template
from gs2_cdk import Stack, core, account
class SampleStack(Stack):
def __init__(self):
super().__init__()
account.Namespace(
stack=self,
name='namespace-0001',
options=account.NamespaceOptions(
change_password_if_take_over=False,
log_setting=core.LogSetting(
logging_namespace_id='grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001',
),
),
)
print(SampleStack().yaml()) # Generate TemplateCurrentModelMaster
現在有効なマスターデータ
GS2ではマスターデータの管理にJSON形式のファイルを使用します。
ファイルをアップロードすることで、実際にサーバーに設定を反映することができます。
JSONファイルを作成する方法として、マネージメントコンソール内にマスターデータエディタを提供しています。
また、よりゲームの運営に相応しいツールを作成し、適切なフォーマットのJSONファイルを書き出すことでもサービスを利用可能です。
Note
JSONファイルの形式については GS2-Account マスターデータリファレンス をご参照ください。| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 この名前はネームスペースを識別するために使用され、英数字で指定されます。 | ||||||||
| mode | 文字列列挙型 enum { “direct”, “preUpload” } | ✓ | “direct” | ~ 128文字 | 更新モード
| |||||||
| settings | string | {mode} == “direct” | ✓* | ~ 5242880文字 | マスターデータ ※ mode が “direct” であれば 必須 | |||||||
| uploadToken | string | {mode} == “preUpload” | ✓* | ~ 1024文字 | プレアップロードで取得したトークン ※ mode が “preUpload” であれば 必須 |
GetAttr
!GetAttrタグで取得可能なリソースの生成結果
| 型 | 説明 | |
|---|---|---|
| Item | CurrentModelMaster | 更新した現在有効なマスターデータ |
実装例
Type: GS2::Account::CurrentModelMaster
Properties:
NamespaceName: namespace-0001
Mode: null
Settings: {
"version": "2024-07-30",
"takeOverTypeModels": [
{
"type": 0,
"openIdConnectSetting":
{
"configurationPath": "https://accounts.google.com/.well-known/openid-configuration",
"clientId": "695893071400-qelt0dsu8tkotl13psnq5d1ko7kki4sl.apps.googleusercontent.com",
"clientSecret": "secret"
},
"metadata": "Google"
},
{
"type": 1,
"openIdConnectSetting":
{
"configurationPath": "https://appleid.apple.com/.well-known/openid-configuration",
"clientId": "io.gs2.sample.auth",
"appleTeamId": "9LX9LA85H8",
"appleKeyId": "P937MLY6Z7",
"applePrivateKeyPem": "-----BEGIN PRIVATE KEY-----\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n-----END PRIVATE KEY-----"
},
"metadata": "Apple"
}
]
}
UploadToken: nullimport (
"github.com/gs2io/gs2-golang-cdk/core"
"github.com/gs2io/gs2-golang-cdk/account"
"github.com/openlyinc/pointy"
)
SampleStack := core.NewStack()
account.NewNamespace(
&SampleStack,
"namespace-0001",
account.NamespaceOptions{},
).MasterData(
[]account.TakeOverTypeModel{
account.NewTakeOverTypeModel(
0,
account.NewOpenIdConnectSetting(
"https://accounts.google.com/.well-known/openid-configuration",
"695893071400-qelt0dsu8tkotl13psnq5d1ko7kki4sl.apps.googleusercontent.com",
account.OpenIdConnectSettingOptions{
ClientSecret: pointy.String("secret"),
},
),
account.TakeOverTypeModelOptions{
Metadata: pointy.String("Google"),
},
),
account.NewTakeOverTypeModel(
1,
account.NewOpenIdConnectSetting(
"https://appleid.apple.com/.well-known/openid-configuration",
"io.gs2.sample.auth",
account.OpenIdConnectSettingOptions{
AppleTeamId: pointy.String("9LX9LA85H8"),
AppleKeyId: pointy.String("P937MLY6Z7"),
ApplePrivateKeyPem: pointy.String("-----BEGIN PRIVATE KEY-----\\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\\n-----END PRIVATE KEY-----"),
},
),
account.TakeOverTypeModelOptions{
Metadata: pointy.String("Apple"),
},
),
},
)
println(SampleStack.Yaml()) // Generate Template
class SampleStack extends \Gs2Cdk\Core\Model\Stack
{
function __construct() {
parent::__construct();
(new \Gs2Cdk\Account\Model\Namespace_(
stack: $this,
name: "namespace-0001"
))->masterData(
[
new \Gs2Cdk\Account\Model\TakeOverTypeModel(
type:0,
openIdConnectSetting:new \Gs2Cdk\Account\Model\OpenIdConnectSetting(
configurationPath: "https://accounts.google.com/.well-known/openid-configuration",
clientId: "695893071400-qelt0dsu8tkotl13psnq5d1ko7kki4sl.apps.googleusercontent.com",
options: new \Gs2Cdk\Account\Model\Options\OpenIdConnectSettingOptions(
clientSecret: "secret",
)
),
options: new \Gs2Cdk\Account\Model\Options\TakeOverTypeModelOptions(
metadata:"Google"
)
),
new \Gs2Cdk\Account\Model\TakeOverTypeModel(
type:1,
openIdConnectSetting:new \Gs2Cdk\Account\Model\OpenIdConnectSetting(
configurationPath: "https://appleid.apple.com/.well-known/openid-configuration",
clientId: "io.gs2.sample.auth",
options: new \Gs2Cdk\Account\Model\Options\OpenIdConnectSettingOptions(
appleTeamId: "9LX9LA85H8",
appleKeyId: "P937MLY6Z7",
applePrivateKeyPem: "-----BEGIN PRIVATE KEY-----\\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\\n-----END PRIVATE KEY-----",
)
),
options: new \Gs2Cdk\Account\Model\Options\TakeOverTypeModelOptions(
metadata:"Apple"
)
)
]
);
}
}
print((new SampleStack())->yaml()); // Generate Template
class SampleStack extends io.gs2.cdk.core.model.Stack
{
public SampleStack() {
super();
new io.gs2.cdk.account.model.Namespace(
this,
"namespace-0001"
).masterData(
Arrays.asList(
new io.gs2.cdk.account.model.TakeOverTypeModel(
0,
new io.gs2.cdk.account.model.OpenIdConnectSetting(
"https://accounts.google.com/.well-known/openid-configuration",
"695893071400-qelt0dsu8tkotl13psnq5d1ko7kki4sl.apps.googleusercontent.com",
new io.gs2.cdk.account.model.options.OpenIdConnectSettingOptions()
.withClientSecret("secret")
),
new io.gs2.cdk.account.model.options.TakeOverTypeModelOptions()
.withMetadata("Google")
),
new io.gs2.cdk.account.model.TakeOverTypeModel(
1,
new io.gs2.cdk.account.model.OpenIdConnectSetting(
"https://appleid.apple.com/.well-known/openid-configuration",
"io.gs2.sample.auth",
new io.gs2.cdk.account.model.options.OpenIdConnectSettingOptions()
.withAppleTeamId("9LX9LA85H8")
.withAppleKeyId("P937MLY6Z7")
.withApplePrivateKeyPem("-----BEGIN PRIVATE KEY-----\\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\\n-----END PRIVATE KEY-----")
),
new io.gs2.cdk.account.model.options.TakeOverTypeModelOptions()
.withMetadata("Apple")
)
)
);
}
}
System.out.println(new SampleStack().yaml()); // Generate Templatepublic class SampleStack : Gs2Cdk.Core.Model.Stack
{
public SampleStack() {
new Gs2Cdk.Gs2Account.Model.Namespace(
stack: this,
name: "namespace-0001"
).MasterData(
new Gs2Cdk.Gs2Account.Model.TakeOverTypeModel[] {
new Gs2Cdk.Gs2Account.Model.TakeOverTypeModel(
type: 0,
openIdConnectSetting: new Gs2Cdk.Gs2Account.Model.OpenIdConnectSetting(
configurationPath: "https://accounts.google.com/.well-known/openid-configuration",
clientId: "695893071400-qelt0dsu8tkotl13psnq5d1ko7kki4sl.apps.googleusercontent.com",
options: new Gs2Cdk.Gs2Account.Model.Options.OpenIdConnectSettingOptions
{
clientSecret = "secret"
}
),
options: new Gs2Cdk.Gs2Account.Model.Options.TakeOverTypeModelOptions
{
metadata = "Google"
}
),
new Gs2Cdk.Gs2Account.Model.TakeOverTypeModel(
type: 1,
openIdConnectSetting: new Gs2Cdk.Gs2Account.Model.OpenIdConnectSetting(
configurationPath: "https://appleid.apple.com/.well-known/openid-configuration",
clientId: "io.gs2.sample.auth",
options: new Gs2Cdk.Gs2Account.Model.Options.OpenIdConnectSettingOptions
{
appleTeamId = "9LX9LA85H8",
appleKeyId = "P937MLY6Z7",
applePrivateKeyPem = "-----BEGIN PRIVATE KEY-----\\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\\n-----END PRIVATE KEY-----"
}
),
options: new Gs2Cdk.Gs2Account.Model.Options.TakeOverTypeModelOptions
{
metadata = "Apple"
}
)
}
);
}
}
Debug.Log(new SampleStack().Yaml()); // Generate Templateimport core from "@/gs2cdk/core";
import account from "@/gs2cdk/account";
class SampleStack extends core.Stack
{
public constructor() {
super();
new account.model.Namespace(
this,
"namespace-0001",
).masterData(
[
new account.model.TakeOverTypeModel(
0,
new account.model.OpenIdConnectSetting(
"https://accounts.google.com/.well-known/openid-configuration",
"695893071400-qelt0dsu8tkotl13psnq5d1ko7kki4sl.apps.googleusercontent.com",
{
clientSecret: "secret"
}
),
{
metadata: "Google"
}
),
new account.model.TakeOverTypeModel(
1,
new account.model.OpenIdConnectSetting(
"https://appleid.apple.com/.well-known/openid-configuration",
"io.gs2.sample.auth",
{
appleTeamId: "9LX9LA85H8",
appleKeyId: "P937MLY6Z7",
applePrivateKeyPem: "-----BEGIN PRIVATE KEY-----\\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\\n-----END PRIVATE KEY-----"
}
),
{
metadata: "Apple"
}
)
]
);
}
}
console.log(new SampleStack().yaml()); // Generate Template
from gs2_cdk import Stack, core, account
class SampleStack(Stack):
def __init__(self):
super().__init__()
account.Namespace(
stack=self,
name="namespace-0001",
).master_data(
take_over_type_models=[
account.TakeOverTypeModel(
type=0,
open_id_connect_setting=account.OpenIdConnectSetting(
configuration_path='https://accounts.google.com/.well-known/openid-configuration',
client_id='695893071400-qelt0dsu8tkotl13psnq5d1ko7kki4sl.apps.googleusercontent.com',
options=account.OpenIdConnectSettingOptions(
client_secret='secret',
),
),
options=account.TakeOverTypeModelOptions(
metadata = 'Google'
),
),
account.TakeOverTypeModel(
type=1,
open_id_connect_setting=account.OpenIdConnectSetting(
configuration_path='https://appleid.apple.com/.well-known/openid-configuration',
client_id='io.gs2.sample.auth',
options=account.OpenIdConnectSettingOptions(
apple_team_id='9LX9LA85H8',
apple_key_id='P937MLY6Z7',
apple_private_key_pem='-----BEGIN PRIVATE KEY-----\\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\\n-----END PRIVATE KEY-----',
),
),
options=account.TakeOverTypeModelOptions(
metadata = 'Apple'
),
),
],
)
print(SampleStack().yaml()) # Generate TemplateOpenIdConnectSetting
OpenID Connect の設定
OpenID Connect 準拠の IdP の設定を登録することで、アカウントの引き継ぎ情報として IdP 連携を利用できるようになります。
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| configurationPath | string | ✓ | ~ 1024文字 | OpenID Connect 設定 URL | ||
| clientId | string | ✓ | ~ 1024文字 | クライアントID | ||
| clientSecret | string | {configurationPath} != “https://appleid.apple.com/.well-known/openid-configuration” | ✓* | ~ 1024文字 | クライアントシークレット ※ configurationPath が “https://appleid.apple.com/.well-known/openid-configuration”以外、その他の IdP 連携であれば 必須 | |
| appleTeamId | string | {configurationPath} == “https://appleid.apple.com/.well-known/openid-configuration” | ✓* | ~ 1024文字 | Apple Developer チームID ※ configurationPath が “https://appleid.apple.com/.well-known/openid-configuration” であれば必須 | |
| appleKeyId | string | {configurationPath} == “https://appleid.apple.com/.well-known/openid-configuration” | ✓* | ~ 1024文字 | Apple に登録済みのキーID ※ configurationPath が “https://appleid.apple.com/.well-known/openid-configuration” であれば必須 | |
| applePrivateKeyPem | string | {configurationPath} == “https://appleid.apple.com/.well-known/openid-configuration” | ✓* | ~ 10240文字 | Apple から受け取った秘密鍵 ※ configurationPath が “https://appleid.apple.com/.well-known/openid-configuration” であれば必須 | |
| doneEndpointUrl | string | ~ 1024文字 | 認証完了時に遷移するURL 未指定の場合 /authorization/done に遷移します。 Query String に id_token が付与されます。 | |||
| additionalScopeValues | List<ScopeValue> | [] | 0 ~ 10 items | OpenId Connect で取得する追加のスコープ | ||
| additionalReturnValues | List<string> | [] | 0 ~ 10 items | OpenId Connect で取得する追加の返却値 |
ScopeValue
スコープ値
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| key | string | ✓ | ~ 64文字 | 名前 | ||
| value | string | ~ 51200文字 | 値 |
PlatformUser
各種プラットフォームにおけるユーザー情報
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| type | int | ✓ | 0 ~ 1024 | スロット番号 0から1024までの範囲で指定され、プラットフォームの種類を識別するために使用します。 | ||
| userIdentifier | string | ✓ | ~ 1024文字 | 各種プラットフォームにおけるユーザーID | ||
| userId | string | ✓ | ~ 128文字 | ユーザーID |
ScriptSetting
スクリプト設定
GS2 ではマイクロサービスのイベントに関連づけて、カスタムスクリプトを実行することができます。
このモデルは、スクリプトの実行をトリガーするための設定を保持します。
スクリプトの実行方式は大きく2種類あり、それは「同期実行」と「非同期実行」です。
同期実行は、スクリプトの実行が完了するまで処理がブロックされます。
代わりに、スクリプトの実行結果を使ってAPIの実行を止めたり、APIの結果を改ざんすることができます。
一方、非同期実行ではスクリプトの完了を待つために処理がブロックされることはありません。
ただし、スクリプトの実行結果を利用して API の実行を停止したり、API の応答内容を変更することはできません。
非同期実行は API の応答フローに影響を与えないため、原則として非同期実行を推奨します。
非同期実行には実行方式が2種類あり、GS2-Script と Amazon EventBridge があります。
Amazon EventBridge を使用することで、Lua 以外の言語で処理を記述することができます。
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| triggerScriptId | string | ~ 1024文字 | 同期実行スクリプトの GS2-Script のスクリプトGRN 「grn:gs2:」ではじまる GRN 形式のIDで指定する必要があります。 | |||||||||||
| doneTriggerTargetType | 文字列列挙型 enum { “none”, “gs2_script”, “aws” } | ✓ | “none” | ~ 128文字 | 非同期スクリプトの実行方法 非同期実行で使用するスクリプトの種類を指定します。 「非同期実行のスクリプトを使用しない(none)」「GS2-Scriptを使用する(gs2_script)」「Amazon EventBridgeを使用する(aws)」が選択できます。
| |||||||||
| doneTriggerScriptId | string | {doneTriggerTargetType} == “gs2_script” | ~ 1024文字 | 非同期実行スクリプトの GS2-Script のスクリプトGRN 「grn:gs2:」ではじまる GRN 形式のIDで指定する必要があります。 ※ doneTriggerTargetType が “gs2_script” であれば有効 | ||||||||||
| doneTriggerQueueNamespaceId | string | {doneTriggerTargetType} == “gs2_script” | ~ 1024文字 | 非同期実行スクリプトを実行する GS2-JobQueue ネームスペース 非同期実行スクリプトを直接実行するのではなく、GS2-JobQueue を経由する場合は GS2-JobQueue のネームスペースGRN を指定します。 GS2-JobQueue を利用する理由は多くはありませんので、特に理由がなければ指定する必要はありません。 ※ doneTriggerTargetType が “gs2_script” であれば有効 |
LogSetting
ログの書き出し設定
ログデータの書き出し設定を管理します。この型は、ログデータを書き出すために使用される GS2-Log 名前空間の識別子(Namespace ID)を保持します。
ログ名前空間ID(loggingNamespaceId)には、ログデータを収集し保存する GS2-Log の名前空間を、GRNの形式で指定します。
この設定をすることで、設定された名前空間内で発生したAPIリクエスト・レスポンスのログデータが、対象の GS2-Log 名前空間側へ出力されるようになります。
GS2-Log ではリアルタイムでログが提供され、システムの監視や分析、デバッグなどに利用できます。
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| loggingNamespaceId | string | ✓ | ~ 1024文字 | ログを出力する GS2-Log のネームスペースGRN |
TransactionSetting
トランザクション設定
トランザクション設定は、トランザクションの実行方法・整合性・非同期処理・競合回避の仕組みを制御する設定です。
自動実行(AutoRun)、アトミック実行(AtomicCommit)、非同期実行(Distributor)、スクリプト結果の一括適用、JobQueue による入手アクションの非同期化などを組み合わせ、ゲームロジックに応じた堅牢なトランザクション管理を可能にします。
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| enableAutoRun | bool | ✓ | false | 発行したトランザクションをサーバーサイドで自動的に実行するか | ||
| enableAtomicCommit | bool | {enableAutoRun} == true | ✓* | false | トランザクションの実行をアトミックにコミットするか ※ enableAutoRun が true であれば必須 | |
| transactionUseDistributor | bool | {enableAtomicCommit} == true | ✓* | false | トランザクションを非同期処理で実行する ※ enableAtomicCommit が true であれば必須 | |
| commitScriptResultInUseDistributor | bool | {transactionUseDistributor} == true | ✓* | false | スクリプトの結果コミット処理を非同期処理で実行するか ※ transactionUseDistributor が true であれば必須 | |
| acquireActionUseJobQueue | bool | {enableAtomicCommit} == true | ✓* | false | 入手アクションを実行する際に GS2-JobQueue を使用するか ※ enableAtomicCommit が true であれば必須 | |
| distributorNamespaceId | string | ✓ | “grn:gs2:{region}:{ownerId}:distributor:default” | ~ 1024文字 | トランザクションの実行に使用する GS2-Distributor ネームスペース | |
| queueNamespaceId | string | ✓ | “grn:gs2:{region}:{ownerId}:queue:default” | ~ 1024文字 | トランザクションの実行に使用する GS2-JobQueue のネームスペース |
GitHubCheckoutSetting
GitHubからマスターデータをチェックアウトする設定
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| apiKeyId | string | ✓ | ~ 1024文字 | GitHub APIキーのGRN | ||||||||||
| repositoryName | string | ✓ | ~ 1024文字 | リポジトリ名 | ||||||||||
| sourcePath | string | ✓ | ~ 1024文字 | マスターデータ(JSON)ファイルのパス | ||||||||||
| referenceType | 文字列列挙型 enum { “commit_hash”, “branch”, “tag” } | ✓ | ~ 128文字 | コードの取得元
| ||||||||||
| commitHash | string | {referenceType} == “commit_hash” | ✓* | ~ 1024文字 | コミットハッシュ ※ referenceType が “commit_hash” であれば必須 | |||||||||
| branchName | string | {referenceType} == “branch” | ✓* | ~ 1024文字 | ブランチ名 ※ referenceType が “branch” であれば必須 | |||||||||
| tagName | string | {referenceType} == “tag” | ✓* | ~ 1024文字 | タグ名 ※ referenceType が “tag” であれば必須 |