GS2-Formation SDK for Game Engine API リファレンス
モデル
EzFormModel
フォームモデル
編成状況を表すエンティティです。
編成できる領域として スロット を定義できます。
武器・防具 であれば 「右手」「左手」「胴」「腕」のような部位をスロットとし、
パーティであれば「前衛」「中衛」「後衛」のようなポジションをスロットとして表現できます。
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| name | string | ✓ | ~ 128文字 | フォームモデル名 | ||
| metadata | string | ~ 2048文字 | メタデータ | |||
| slots | List<EzSlotModel> | ✓ | 1 ~ 10 items | スロットモデルリスト | 
関連するメソッド
getFormModel deleteForm getForm getFormWithSignature setForm
関連するモデル
EzMoldModel
フォームの保存領域モデル
パーティ編成であれば「火属性パーティ」「水属性パーティ」のような形で保存することを想定しています。
保存できる領域の数は制限することができ、個別に拡張することもできます。
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| name | string | ✓ | ~ 128文字 | フォームの保存領域モデル名 | ||
| metadata | string | ~ 2048文字 | メタデータ | |||
| formModel | EzFormModel | ✓ | ||||
| initialMaxCapacity | int | ✓ | 1 ~ 2147483646 | フォームを保存できる初期キャパシティ | ||
| maxCapacity | int | ✓ | 1 ~ 2147483646 | フォームを保存できる最大キャパシティ | 
関連するメソッド
getMoldModel listMoldModels getMold deleteForm getForm getFormWithSignature setForm
EzPropertyFormModel
プロパティフォームモデル
編成状況を表すエンティティです。
Mold / Form との違いは、スロット数を定義して、各スロットに編成を記録するのが Mold / Form で、
所有している装備に対してスキルを設定するような、数を事前に決めるのが難しい編成を表現するのに利用するのがプロパティフォームモデルです。
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| name | string | ✓ | ~ 128文字 | プロパティフォームモデル名 | ||
| metadata | string | ~ 2048文字 | メタデータ | |||
| slots | List<EzSlotModel> | ✓ | 1 ~ 10 items | スロットモデルリスト | 
関連するメソッド
getPropertyFormModel listPropertyFormModels deletePropertyForm getPropertyForm getPropertyFormWithSignature setPropertyForm
EzMold
フォームの保存領域
ゲームプレイヤーが編成した情報を保持するエンティティです。
編成情報(Form) は フォームの保存領域モデル(Mold) ごとに複数保持することができ、いくつ保持できるかのキャパシティをゲームプレイヤー×フォームモデル ごとに個別に設定できます。
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| name | string | ✓ | ~ 128文字 | フォームの保存領域モデルの名前 | ||
| userId | string | ✓ | ~ 128文字 | ユーザーID | ||
| capacity | int | ✓ | 0 ~ 2147483646 | 現在のキャパシティ | 
関連するメソッド
getMold listMolds deleteForm getForm getFormWithSignature setForm
EzForm
フォーム
編成状況を表すエンティティです。
編成できる領域として スロット を定義できます。
武器・防具 であれば 「右手」「左手」「胴」「腕」のような部位をスロットとし、
パーティであれば「前衛」「中衛」「後衛」のようなポジションをスロットとして表現できます。
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| name | string | ✓ | ~ 128文字 | フォームの保存領域モデルの名前 | ||
| index | int | ✓ | 0 ~ 2147483646 | フォームの保存領域のインデックス | ||
| slots | List<EzSlot> | 0 ~ 10 items | スロットリスト | 
関連するメソッド
EzPropertyForm
プロパティフォーム
編成状況を表すエンティティです。
Mold / Form との違いは、スロット数を定義して、各スロットに編成を記録するのが Mold / Form で、
所有している装備に対してスキルを設定するような、数を事前に決めるのが難しい編成を表現するのに利用するのがプロパティフォームです。
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| name | string | ✓ | ~ 128文字 | プロパティフォームの名前 | ||
| propertyId | string | ✓ | ~ 1024文字 | プロパティID | ||
| slots | List<EzSlot> | 0 ~ 10 items | スロットリスト | 
関連するメソッド
deletePropertyForm getPropertyForm getPropertyFormWithSignature listPropertyForms setPropertyForm
EzSlot
スロット
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| name | string | ✓ | ~ 128文字 | スロットモデル名 | ||
| propertyId | string | ~ 1024文字 | プロパティID | |||
| metadata | string | ~ 1024文字 | メタデータ | 
関連するモデル
EzSlotModel
スロットモデル
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| name | string | ✓ | ~ 128文字 | スロットモデル名 | ||
| propertyRegex | string | ✓ | “.*” | ~ 512文字 | プロパティとして設定可能な値の正規表現 | |
| metadata | string | ~ 512文字 | メタデータ | 
関連するモデル
EzSlotWithSignature
署名付きスロット
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| name | string | ✓ | ~ 128文字 | スロットモデル名 | ||||||||||
| propertyType | 文字列列挙型 enum { “gs2_inventory”, “gs2_simple_inventory”, “gs2_dictionary” } | ✓ | ~ 128文字 | プロパティの種類 
 | ||||||||||
| body | string | ~ 1048576文字 | ペイロード | |||||||||||
| signature | string | ~ 1024文字 | プロパティIDのリソースを所有していることを証明する署名 | |||||||||||
| metadata | string | ~ 1024文字 | メタデータ | 
関連するメソッド
EzConfig
コンフィグ設定
トランザクションの変数に適用する設定値
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| key | string | ✓ | ~ 64文字 | 名前 | ||
| value | string | ~ 51200文字 | 値 | 
EzAcquireAction
入手アクション
EzVerifyActionResult
検証アクションの実行結果
関連するモデル
EzConsumeActionResult
消費アクションの実行結果
関連するモデル
EzAcquireActionResult
入手アクションの実行結果
関連するモデル
EzTransactionResult
トランザクション実行結果
サーバーサイドでのトランザクションの自動実行機能を利用して実行されたトランザクションの実行結果
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| transactionId | string | ✓ | 36 ~ 36文字 | トランザクションID | ||
| verifyResults | List<EzVerifyActionResult> | 0 ~ 10 items | 検証アクションの実行結果リスト | |||
| consumeResults | List<EzConsumeActionResult> | [] | 0 ~ 10 items | 消費アクションの実行結果リスト | ||
| acquireResults | List<EzAcquireActionResult> | [] | 0 ~ 100 items | 入手アクションの実行結果リスト | 
メソッド
getMoldModel
フォームの保存領域情報を取得
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
| moldModelName | string | ✓ | ~ 128文字 | フォームの保存領域モデル名 | 
Result
| 型 | 説明 | |
|---|---|---|
| item | EzMoldModel | フォームの保存領域 | 
実装例
    var domain = gs2.Formation.Namespace(
        namespaceName: "namespace-0001"
    ).MoldModel(
        moldModelName: "mold-0001"
    );
    var item = await domain.ModelAsync();    var domain = gs2.Formation.Namespace(
        namespaceName: "namespace-0001"
    ).MoldModel(
        moldModelName: "mold-0001"
    );
    var future = domain.ModelFuture();
    yield return future;
    var item = future.Result;    const auto Domain = Gs2->Formation->Namespace(
        "namespace-0001" // namespaceName
    )->MoldModel(
        "mold-0001" // moldModelName
    );
    const auto Future = Domain->Model();
    Future->StartSynchronousTask();
    if (Future->GetTask().IsError())
    {
        return false;
    }値の変更イベントハンドリング
    var domain = gs2.Formation.Namespace(
        namespaceName: "namespace-0001"
    ).MoldModel(
        moldModelName: "mold-0001"
    );
    
    // イベントハンドリングを開始
    var callbackId = domain.Subscribe(
        value => {
            // 値が変化した時に呼び出される
            // value には変更後の値が渡ってくる
        }
    );
    // イベントハンドリングを停止
    domain.Unsubscribe(callbackId);    var domain = gs2.Formation.Namespace(
        namespaceName: "namespace-0001"
    ).MoldModel(
        moldModelName: "mold-0001"
    );
    var future = domain.ModelFuture();
    yield return future;
    var item = future.Result;    const auto Domain = Gs2->Formation->Namespace(
        "namespace-0001" // namespaceName
    )->MoldModel(
        "mold-0001" // moldModelName
    );
    
    // イベントハンドリングを開始
    const auto CallbackId = Domain->Subscribe(
        [](TSharedPtr<Gs2::Formation::Model::FMoldModel> value) {
            // 値が変化した時に呼び出される
            // value には変更後の値が渡ってくる
        }
    );
    // イベントハンドリングを停止
    Domain->Unsubscribe(CallbackId);Warning
このイベントはSDKがもつローカルキャッシュの値が変更された時に呼び出されます。
ローカルキャッシュは SDK が持つ API の実行、または GS2-Gateway の通知を有効にした GS2-Distributor 経由でのスタンプシートの実行、または GS2-Gateway の通知を有効にした GS2-JobQueue の実行によって変化したもののみが対象となります。
そのため、これらの方法以外で値が変更されてもコールバックは呼び出されません。
listMoldModels
フォームの保存領域情報の一覧を取得
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | 
Result
| 型 | 説明 | |
|---|---|---|
| items | List<EzMoldModel> | フォームの保存領域のリスト | 
実装例
    var domain = gs2.Formation.Namespace(
        namespaceName: "namespace-0001"
    );
    var items = await domain.MoldModelsAsync(
    ).ToListAsync();    var domain = gs2.Formation.Namespace(
        namespaceName: "namespace-0001"
    );
    var it = domain.MoldModels(
    );
    List<EzMoldModel> items = new List<EzMoldModel>();
    while (it.HasNext())
    {
        yield return it.Next();
        if (it.Error != null)
        {
            onError.Invoke(it.Error, null);
            break;
        }
        if (it.Current != null)
        {
            items.Add(it.Current);
        }
        else
        {
            break;
        }
    }    const auto Domain = Gs2->Formation->Namespace(
        "namespace-0001" // namespaceName
    );
    const auto It = Domain->MoldModels(
    );
    TArray<Gs2::UE5::Formation::Model::FEzMoldModelPtr> Result;
    for (auto Item : *It)
    {
        if (Item.IsError())
        {
            return false;
        }
        Result.Add(Item.Current());
    }値の変更イベントハンドリング
    var domain = gs2.Formation.Namespace(
        namespaceName: "namespace-0001"
    );
    
    // イベントハンドリングを開始
    var callbackId = domain.SubscribeMoldModels(
        () => {
            // リストの要素が変化した時に呼び出される
        }
    );
    // イベントハンドリングを停止
    domain.UnsubscribeMoldModels(callbackId);    var domain = gs2.Formation.Namespace(
        namespaceName: "namespace-0001"
    );
    var it = domain.MoldModels(
    );
    List<EzMoldModel> items = new List<EzMoldModel>();
    while (it.HasNext())
    {
        yield return it.Next();
        if (it.Error != null)
        {
            onError.Invoke(it.Error, null);
            break;
        }
        if (it.Current != null)
        {
            items.Add(it.Current);
        }
        else
        {
            break;
        }
    }    const auto Domain = Gs2->Formation->Namespace(
        "namespace-0001" // namespaceName
    );
    
    // イベントハンドリングを開始
    const auto CallbackId = Domain->SubscribeMoldModels(
        []() {
            // リストの要素が変化した時に呼び出される
        }
    );
    // イベントハンドリングを停止
    Domain->UnsubscribeMoldModels(CallbackId);Warning
このイベントはSDKがもつローカルキャッシュの値が変更された時に呼び出されます。
ローカルキャッシュは SDK が持つ API の実行、または GS2-Gateway の通知を有効にした GS2-Distributor 経由でのスタンプシートの実行、または GS2-Gateway の通知を有効にした GS2-JobQueue の実行によって変化したもののみが対象となります。
そのため、これらの方法以外で値が変更されてもコールバックは呼び出されません。
getMold
フォームの保存領域 と プロパティID を指定してフォームの保存領域情報を取得
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
| moldModelName | string | ✓ | ~ 128文字 | フォームの保存領域モデルの名前 | ||
| accessToken | string | ✓ | ~ 128文字 | アクセストークン | 
Result
| 型 | 説明 | |
|---|---|---|
| item | EzMold | フォームの保存領域 | 
| moldModel | EzMoldModel | フォームの保存領域 | 
実装例
    var domain = gs2.Formation.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).Mold(
        moldModelName: "mold-0001"
    );
    var item = await domain.ModelAsync();    var domain = gs2.Formation.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).Mold(
        moldModelName: "mold-0001"
    );
    var future = domain.ModelFuture();
    yield return future;
    var item = future.Result;    const auto Domain = Gs2->Formation->Namespace(
        "namespace-0001" // namespaceName
    )->Me(
        GameSession
    )->Mold(
        "mold-0001" // moldModelName
    );
    const auto Future = Domain->Model();
    Future->StartSynchronousTask();
    if (Future->GetTask().IsError())
    {
        return false;
    }値の変更イベントハンドリング
    var domain = gs2.Formation.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).Mold(
        moldModelName: "mold-0001"
    );
    
    // イベントハンドリングを開始
    var callbackId = domain.Subscribe(
        value => {
            // 値が変化した時に呼び出される
            // value には変更後の値が渡ってくる
        }
    );
    // イベントハンドリングを停止
    domain.Unsubscribe(callbackId);    var domain = gs2.Formation.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).Mold(
        moldModelName: "mold-0001"
    );
    var future = domain.ModelFuture();
    yield return future;
    var item = future.Result;    const auto Domain = Gs2->Formation->Namespace(
        "namespace-0001" // namespaceName
    )->Me(
        GameSession
    )->Mold(
        "mold-0001" // moldModelName
    );
    
    // イベントハンドリングを開始
    const auto CallbackId = Domain->Subscribe(
        [](TSharedPtr<Gs2::Formation::Model::FMold> value) {
            // 値が変化した時に呼び出される
            // value には変更後の値が渡ってくる
        }
    );
    // イベントハンドリングを停止
    Domain->Unsubscribe(CallbackId);Warning
このイベントはSDKがもつローカルキャッシュの値が変更された時に呼び出されます。
ローカルキャッシュは SDK が持つ API の実行、または GS2-Gateway の通知を有効にした GS2-Distributor 経由でのスタンプシートの実行、または GS2-Gateway の通知を有効にした GS2-JobQueue の実行によって変化したもののみが対象となります。
そのため、これらの方法以外で値が変更されてもコールバックは呼び出されません。
listMolds
フォームの保存領域情報の一覧を取得
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
| accessToken | string | ✓ | ~ 128文字 | アクセストークン | ||
| pageToken | string | ~ 1024文字 | データの取得を開始する位置を指定するトークン | |||
| limit | int | ✓ | 30 | 1 ~ 1000 | データの取得件数 | 
Result
| 型 | 説明 | |
|---|---|---|
| items | List<EzMold> | フォームの保存領域のリスト | 
| nextPageToken | string | リストの続きを取得するためのページトークン | 
実装例
    var domain = gs2.Formation.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    );
    var items = await domain.MoldsAsync(
    ).ToListAsync();    var domain = gs2.Formation.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    );
    var it = domain.Molds(
    );
    List<EzMold> items = new List<EzMold>();
    while (it.HasNext())
    {
        yield return it.Next();
        if (it.Error != null)
        {
            onError.Invoke(it.Error, null);
            break;
        }
        if (it.Current != null)
        {
            items.Add(it.Current);
        }
        else
        {
            break;
        }
    }    const auto Domain = Gs2->Formation->Namespace(
        "namespace-0001" // namespaceName
    )->Me(
        GameSession
    );
    const auto It = Domain->Molds(
    );
    TArray<Gs2::UE5::Formation::Model::FEzMoldPtr> Result;
    for (auto Item : *It)
    {
        if (Item.IsError())
        {
            return false;
        }
        Result.Add(Item.Current());
    }値の変更イベントハンドリング
    var domain = gs2.Formation.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    );
    
    // イベントハンドリングを開始
    var callbackId = domain.SubscribeMolds(
        () => {
            // リストの要素が変化した時に呼び出される
        }
    );
    // イベントハンドリングを停止
    domain.UnsubscribeMolds(callbackId);    var domain = gs2.Formation.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    );
    var it = domain.Molds(
    );
    List<EzMold> items = new List<EzMold>();
    while (it.HasNext())
    {
        yield return it.Next();
        if (it.Error != null)
        {
            onError.Invoke(it.Error, null);
            break;
        }
        if (it.Current != null)
        {
            items.Add(it.Current);
        }
        else
        {
            break;
        }
    }    const auto Domain = Gs2->Formation->Namespace(
        "namespace-0001" // namespaceName
    )->Me(
        GameSession
    );
    
    // イベントハンドリングを開始
    const auto CallbackId = Domain->SubscribeMolds(
        []() {
            // リストの要素が変化した時に呼び出される
        }
    );
    // イベントハンドリングを停止
    Domain->UnsubscribeMolds(CallbackId);Warning
このイベントはSDKがもつローカルキャッシュの値が変更された時に呼び出されます。
ローカルキャッシュは SDK が持つ API の実行、または GS2-Gateway の通知を有効にした GS2-Distributor 経由でのスタンプシートの実行、または GS2-Gateway の通知を有効にした GS2-JobQueue の実行によって変化したもののみが対象となります。
そのため、これらの方法以外で値が変更されてもコールバックは呼び出されません。
getFormModel
フォームモデル情報を取得
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
| moldModelName | string | ✓ | ~ 128文字 | フォームの保存領域モデル名 | 
Result
| 型 | 説明 | |
|---|---|---|
| item | EzFormModel | フォーム | 
実装例
    var domain = gs2.Formation.Namespace(
        namespaceName: "namespace-0001"
    ).MoldModel(
        moldModelName: "mold-0001"
    ).FormModel(
    );
    var item = await domain.ModelAsync();    var domain = gs2.Formation.Namespace(
        namespaceName: "namespace-0001"
    ).MoldModel(
        moldModelName: "mold-0001"
    ).FormModel(
    );
    var future = domain.ModelFuture();
    yield return future;
    var item = future.Result;    const auto Domain = Gs2->Formation->Namespace(
        "namespace-0001" // namespaceName
    )->MoldModel(
        "mold-0001" // moldModelName
    )->FormModel(
    );
    const auto Future = Domain->Model();
    Future->StartSynchronousTask();
    if (Future->GetTask().IsError())
    {
        return false;
    }値の変更イベントハンドリング
    var domain = gs2.Formation.Namespace(
        namespaceName: "namespace-0001"
    ).MoldModel(
        moldModelName: "mold-0001"
    ).FormModel(
    );
    
    // イベントハンドリングを開始
    var callbackId = domain.Subscribe(
        value => {
            // 値が変化した時に呼び出される
            // value には変更後の値が渡ってくる
        }
    );
    // イベントハンドリングを停止
    domain.Unsubscribe(callbackId);    var domain = gs2.Formation.Namespace(
        namespaceName: "namespace-0001"
    ).MoldModel(
        moldModelName: "mold-0001"
    ).FormModel(
    );
    var future = domain.ModelFuture();
    yield return future;
    var item = future.Result;    const auto Domain = Gs2->Formation->Namespace(
        "namespace-0001" // namespaceName
    )->MoldModel(
        "mold-0001" // moldModelName
    )->FormModel(
    );
    
    // イベントハンドリングを開始
    const auto CallbackId = Domain->Subscribe(
        [](TSharedPtr<Gs2::Formation::Model::FFormModel> value) {
            // 値が変化した時に呼び出される
            // value には変更後の値が渡ってくる
        }
    );
    // イベントハンドリングを停止
    Domain->Unsubscribe(CallbackId);Warning
このイベントはSDKがもつローカルキャッシュの値が変更された時に呼び出されます。
ローカルキャッシュは SDK が持つ API の実行、または GS2-Gateway の通知を有効にした GS2-Distributor 経由でのスタンプシートの実行、または GS2-Gateway の通知を有効にした GS2-JobQueue の実行によって変化したもののみが対象となります。
そのため、これらの方法以外で値が変更されてもコールバックは呼び出されません。
deleteForm
フォームを削除
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
| moldModelName | string | ✓ | ~ 128文字 | フォームの保存領域モデルの名前 | ||
| accessToken | string | ✓ | ~ 128文字 | アクセストークン | ||
| index | int | ✓ | 0 ~ 2147483646 | フォームの保存領域のインデックス | 
Result
| 型 | 説明 | |
|---|---|---|
| item | EzForm | フォーム | 
| mold | EzMold | フォームの保存領域 | 
| moldModel | EzMoldModel | フォームの保存領域モデル | 
| formModel | EzFormModel | フォームモデル | 
実装例
    var domain = gs2.Formation.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).Mold(
        moldModelName: "mold-0001"
    ).Form(
        index: 0
    );
    var result = await domain.DeleteFormAsync(
    );    var domain = gs2.Formation.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).Mold(
        moldModelName: "mold-0001"
    ).Form(
        index: 0
    );
    var future = domain.DeleteFormFuture(
    );
    yield return future;
    if (future.Error != null)
    {
        onError.Invoke(future.Error, null);
        yield break;
    }    const auto Domain = Gs2->Formation->Namespace(
        "namespace-0001" // namespaceName
    )->Me(
        GameSession
    )->Mold(
        "mold-0001" // moldModelName
    )->Form(
        0 // index
    );
    const auto Future = Domain->DeleteForm(
    );
    Future->StartSynchronousTask();
    if (Future->GetTask().IsError())
    {
        return false;
    }
    const auto Result = Future->GetTask().Result();getForm
フォームを取得
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
| moldModelName | string | ✓ | ~ 128文字 | フォームの保存領域モデルの名前 | ||
| accessToken | string | ✓ | ~ 128文字 | アクセストークン | ||
| index | int | ✓ | 0 ~ 2147483646 | フォームの保存領域のインデックス | 
Result
| 型 | 説明 | |
|---|---|---|
| item | EzForm | フォーム | 
| mold | EzMold | フォームの保存領域 | 
| moldModel | EzMoldModel | フォームの保存領域モデル | 
| formModel | EzFormModel | フォームモデル | 
実装例
    var domain = gs2.Formation.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).Mold(
        moldModelName: "mold-0001"
    ).Form(
        index: 0
    );
    var item = await domain.ModelAsync();    var domain = gs2.Formation.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).Mold(
        moldModelName: "mold-0001"
    ).Form(
        index: 0
    );
    var future = domain.ModelFuture();
    yield return future;
    var item = future.Result;    const auto Domain = Gs2->Formation->Namespace(
        "namespace-0001" // namespaceName
    )->Me(
        GameSession
    )->Mold(
        "mold-0001" // moldModelName
    )->Form(
        0 // index
    );
    const auto Future = Domain->Model();
    Future->StartSynchronousTask();
    if (Future->GetTask().IsError())
    {
        return false;
    }値の変更イベントハンドリング
    var domain = gs2.Formation.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).Mold(
        moldModelName: "mold-0001"
    ).Form(
        index: 0
    );
    
    // イベントハンドリングを開始
    var callbackId = domain.Subscribe(
        value => {
            // 値が変化した時に呼び出される
            // value には変更後の値が渡ってくる
        }
    );
    // イベントハンドリングを停止
    domain.Unsubscribe(callbackId);    var domain = gs2.Formation.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).Mold(
        moldModelName: "mold-0001"
    ).Form(
        index: 0
    );
    var future = domain.ModelFuture();
    yield return future;
    var item = future.Result;    const auto Domain = Gs2->Formation->Namespace(
        "namespace-0001" // namespaceName
    )->Me(
        GameSession
    )->Mold(
        "mold-0001" // moldModelName
    )->Form(
        0 // index
    );
    
    // イベントハンドリングを開始
    const auto CallbackId = Domain->Subscribe(
        [](TSharedPtr<Gs2::Formation::Model::FForm> value) {
            // 値が変化した時に呼び出される
            // value には変更後の値が渡ってくる
        }
    );
    // イベントハンドリングを停止
    Domain->Unsubscribe(CallbackId);Warning
このイベントはSDKがもつローカルキャッシュの値が変更された時に呼び出されます。
ローカルキャッシュは SDK が持つ API の実行、または GS2-Gateway の通知を有効にした GS2-Distributor 経由でのスタンプシートの実行、または GS2-Gateway の通知を有効にした GS2-JobQueue の実行によって変化したもののみが対象となります。
そのため、これらの方法以外で値が変更されてもコールバックは呼び出されません。
getFormWithSignature
署名と共にフォームを取得
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
| moldModelName | string | ✓ | ~ 128文字 | フォームの保存領域モデルの名前 | ||
| accessToken | string | ✓ | ~ 128文字 | アクセストークン | ||
| index | int | ✓ | 0 ~ 2147483646 | フォームの保存領域のインデックス | ||
| keyId | string | ✓ | “grn:gs2:{region}:{ownerId}:key:default:key:default” | ~ 1024文字 | 暗号鍵GRN | 
Result
| 型 | 説明 | |
|---|---|---|
| item | EzForm | フォーム | 
| body | string | 署名対象の値 | 
| signature | string | 署名 | 
| mold | EzMold | フォームの保存領域 | 
| moldModel | EzMoldModel | フォームの保存領域モデル | 
| formModel | EzFormModel | フォームモデル | 
実装例
    var domain = gs2.Formation.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).Mold(
        moldModelName: "mold-0001"
    ).Form(
        index: 0
    );
    var result = await domain.GetFormWithSignatureAsync(
        keyId: "key-0001"
    );
    var item = await result.ModelAsync();
    var body = result.Body;
    var signature = result.Signature;    var domain = gs2.Formation.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).Mold(
        moldModelName: "mold-0001"
    ).Form(
        index: 0
    );
    var future = domain.GetFormWithSignatureFuture(
        keyId: "key-0001"
    );
    yield return future;
    if (future.Error != null)
    {
        onError.Invoke(future.Error, null);
        yield break;
    }
    var future2 = future.Result.ModelFuture();
    yield return future2;
    if (future2.Error != null)
    {
        onError.Invoke(future2.Error, null);
        yield break;
    }
    var result = future2.Result;
    var body = future.Result.Body;
    var signature = future.Result.Signature;    const auto Domain = Gs2->Formation->Namespace(
        "namespace-0001" // namespaceName
    )->Me(
        GameSession
    )->Mold(
        "mold-0001" // moldModelName
    )->Form(
        0 // index
    );
    const auto Future = Domain->GetFormWithSignature(
        "key-0001" // keyId
    );
    Future->StartSynchronousTask();
    if (Future->GetTask().IsError())
    {
        return false;
    }
    // obtain changed values / result values
    const auto Future2 = Future->GetTask().Result()->Model();
    Future2->StartSynchronousTask();
    if (Future2->GetTask().IsError())
    {
        return Future2->GetTask().Error();
    }
    const auto Result = Future2->GetTask().Result();
    const auto Body = Result->Body;
    const auto Signature = Result->Signature;listForms
フォームの一覧を取得
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
| moldModelName | string | ✓ | ~ 128文字 | フォームの保存領域モデルの名前 | ||
| accessToken | string | ✓ | ~ 128文字 | アクセストークン | ||
| pageToken | string | ~ 1024文字 | データの取得を開始する位置を指定するトークン | |||
| limit | int | ✓ | 30 | 1 ~ 1000 | データの取得件数 | 
Result
| 型 | 説明 | |
|---|---|---|
| items | List<EzForm> | フォームのリスト | 
| nextPageToken | string | リストの続きを取得するためのページトークン | 
実装例
    var domain = gs2.Formation.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).Mold(
        moldModelName: "mold-0001"
    );
    var items = await domain.FormsAsync(
    ).ToListAsync();    var domain = gs2.Formation.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).Mold(
        moldModelName: "mold-0001"
    );
    var it = domain.Forms(
    );
    List<EzForm> items = new List<EzForm>();
    while (it.HasNext())
    {
        yield return it.Next();
        if (it.Error != null)
        {
            onError.Invoke(it.Error, null);
            break;
        }
        if (it.Current != null)
        {
            items.Add(it.Current);
        }
        else
        {
            break;
        }
    }    const auto Domain = Gs2->Formation->Namespace(
        "namespace-0001" // namespaceName
    )->Me(
        GameSession
    )->Mold(
        "mold-0001" // moldModelName
    );
    const auto It = Domain->Forms(
    );
    TArray<Gs2::UE5::Formation::Model::FEzFormPtr> Result;
    for (auto Item : *It)
    {
        if (Item.IsError())
        {
            return false;
        }
        Result.Add(Item.Current());
    }値の変更イベントハンドリング
    var domain = gs2.Formation.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).Mold(
        moldModelName: "mold-0001"
    );
    
    // イベントハンドリングを開始
    var callbackId = domain.SubscribeForms(
        () => {
            // リストの要素が変化した時に呼び出される
        }
    );
    // イベントハンドリングを停止
    domain.UnsubscribeForms(callbackId);    var domain = gs2.Formation.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).Mold(
        moldModelName: "mold-0001"
    );
    var it = domain.Forms(
    );
    List<EzForm> items = new List<EzForm>();
    while (it.HasNext())
    {
        yield return it.Next();
        if (it.Error != null)
        {
            onError.Invoke(it.Error, null);
            break;
        }
        if (it.Current != null)
        {
            items.Add(it.Current);
        }
        else
        {
            break;
        }
    }    const auto Domain = Gs2->Formation->Namespace(
        "namespace-0001" // namespaceName
    )->Me(
        GameSession
    )->Mold(
        "mold-0001" // moldModelName
    );
    
    // イベントハンドリングを開始
    const auto CallbackId = Domain->SubscribeForms(
        []() {
            // リストの要素が変化した時に呼び出される
        }
    );
    // イベントハンドリングを停止
    Domain->UnsubscribeForms(CallbackId);Warning
このイベントはSDKがもつローカルキャッシュの値が変更された時に呼び出されます。
ローカルキャッシュは SDK が持つ API の実行、または GS2-Gateway の通知を有効にした GS2-Distributor 経由でのスタンプシートの実行、または GS2-Gateway の通知を有効にした GS2-JobQueue の実行によって変化したもののみが対象となります。
そのため、これらの方法以外で値が変更されてもコールバックは呼び出されません。
setForm
フォームを更新
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
| moldModelName | string | ✓ | ~ 128文字 | フォームの保存領域モデルの名前 | ||
| accessToken | string | ✓ | ~ 128文字 | アクセストークン | ||
| index | int | ✓ | 0 ~ 2147483646 | フォームの保存領域のインデックス | ||
| slots | List<EzSlotWithSignature> | ✓ | 1 ~ 10 items | スロットリスト | ||
| keyId | string | ✓ | “grn:gs2:{region}:{ownerId}:key:default:key:default” | ~ 1024文字 | 暗号鍵GRN | 
Result
| 型 | 説明 | |
|---|---|---|
| item | EzForm | フォーム | 
| mold | EzMold | フォームの保存領域 | 
| moldModel | EzMoldModel | フォームの保存領域モデル | 
| formModel | EzFormModel | フォームモデル | 
実装例
    var domain = gs2.Formation.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).Mold(
        moldModelName: "mold-0001"
    ).Form(
        index: 0
    );
    var result = await domain.SetFormAsync(
        slots: new List<Gs2.Unity.Gs2Formation.Model.EzSlotWithSignature> {
            new Gs2.Unity.Gs2Formation.Model.EzSlotWithSignature() {
                Name = "slot-0001",
                PropertyType = "gs2_dictionary",
                Body = "body",
                Signature = "signature",
            },
        },
        keyId: "key-0001"
    );
    var item = await result.ModelAsync();    var domain = gs2.Formation.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).Mold(
        moldModelName: "mold-0001"
    ).Form(
        index: 0
    );
    var future = domain.SetFormFuture(
        slots: new List<Gs2.Unity.Gs2Formation.Model.EzSlotWithSignature> {
            new Gs2.Unity.Gs2Formation.Model.EzSlotWithSignature() {
                Name = "slot-0001",
                PropertyType = "gs2_dictionary",
                Body = "body",
                Signature = "signature",
            },
        },
        keyId: "key-0001"
    );
    yield return future;
    if (future.Error != null)
    {
        onError.Invoke(future.Error, null);
        yield break;
    }
    var future2 = future.Result.ModelFuture();
    yield return future2;
    if (future2.Error != null)
    {
        onError.Invoke(future2.Error, null);
        yield break;
    }
    var result = future2.Result;    const auto Domain = Gs2->Formation->Namespace(
        "namespace-0001" // namespaceName
    )->Me(
        GameSession
    )->Mold(
        "mold-0001" // moldModelName
    )->Form(
        0 // index
    );
    const auto Future = Domain->SetForm(
        []
        {
            auto v = MakeShared<TArray<TSharedPtr<Gs2::UE5::Formation::Model::FEzSlotWithSignature>>>();
            v->Add(
                MakeShared<Gs2::UE5::Formation::Model::FEzSlotWithSignature>()
                ->WithName(TOptional<FString>("slot-0001"))
                ->WithPropertyType(TOptional<FString>("gs2_dictionary"))
                ->WithBody(TOptional<FString>("body"))
                ->WithSignature(TOptional<FString>("signature"))
            );
            return v;
        }(), // slots
        "key-0001" // keyId
    );
    Future->StartSynchronousTask();
    if (Future->GetTask().IsError())
    {
        return false;
    }
    // obtain changed values / result values
    const auto Future2 = Future->GetTask().Result()->Model();
    Future2->StartSynchronousTask();
    if (Future2->GetTask().IsError())
    {
        return Future2->GetTask().Error();
    }
    const auto Result = Future2->GetTask().Result();getPropertyFormModel
プロパティフォームモデル情報を取得
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
| propertyFormModelName | string | ✓ | ~ 128文字 | プロパティフォームモデル名 | 
Result
| 型 | 説明 | |
|---|---|---|
| item | EzPropertyFormModel | プロパティフォーム | 
実装例
    var domain = gs2.Formation.Namespace(
        namespaceName: "namespace-0001"
    ).PropertyFormModel(
        propertyFormModelName: "form-0001"
    );
    var item = await domain.ModelAsync();    var domain = gs2.Formation.Namespace(
        namespaceName: "namespace-0001"
    ).PropertyFormModel(
        propertyFormModelName: "form-0001"
    );
    var future = domain.ModelFuture();
    yield return future;
    var item = future.Result;    const auto Domain = Gs2->Formation->Namespace(
        "namespace-0001" // namespaceName
    )->PropertyFormModel(
        "form-0001" // propertyFormModelName
    );
    const auto Future = Domain->Model();
    Future->StartSynchronousTask();
    if (Future->GetTask().IsError())
    {
        return false;
    }値の変更イベントハンドリング
    var domain = gs2.Formation.Namespace(
        namespaceName: "namespace-0001"
    ).PropertyFormModel(
        propertyFormModelName: "form-0001"
    );
    
    // イベントハンドリングを開始
    var callbackId = domain.Subscribe(
        value => {
            // 値が変化した時に呼び出される
            // value には変更後の値が渡ってくる
        }
    );
    // イベントハンドリングを停止
    domain.Unsubscribe(callbackId);    var domain = gs2.Formation.Namespace(
        namespaceName: "namespace-0001"
    ).PropertyFormModel(
        propertyFormModelName: "form-0001"
    );
    var future = domain.ModelFuture();
    yield return future;
    var item = future.Result;    const auto Domain = Gs2->Formation->Namespace(
        "namespace-0001" // namespaceName
    )->PropertyFormModel(
        "form-0001" // propertyFormModelName
    );
    
    // イベントハンドリングを開始
    const auto CallbackId = Domain->Subscribe(
        [](TSharedPtr<Gs2::Formation::Model::FPropertyFormModel> value) {
            // 値が変化した時に呼び出される
            // value には変更後の値が渡ってくる
        }
    );
    // イベントハンドリングを停止
    Domain->Unsubscribe(CallbackId);Warning
このイベントはSDKがもつローカルキャッシュの値が変更された時に呼び出されます。
ローカルキャッシュは SDK が持つ API の実行、または GS2-Gateway の通知を有効にした GS2-Distributor 経由でのスタンプシートの実行、または GS2-Gateway の通知を有効にした GS2-JobQueue の実行によって変化したもののみが対象となります。
そのため、これらの方法以外で値が変更されてもコールバックは呼び出されません。
listPropertyFormModels
プロパティフォームモデル情報の一覧を取得
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | 
Result
| 型 | 説明 | |
|---|---|---|
| items | List<EzPropertyFormModel> | プロパティフォームのリスト | 
実装例
    var domain = gs2.Formation.Namespace(
        namespaceName: "namespace-0001"
    );
    var items = await domain.PropertyFormModelsAsync(
    ).ToListAsync();    var domain = gs2.Formation.Namespace(
        namespaceName: "namespace-0001"
    );
    var it = domain.PropertyFormModels(
    );
    List<EzPropertyFormModel> items = new List<EzPropertyFormModel>();
    while (it.HasNext())
    {
        yield return it.Next();
        if (it.Error != null)
        {
            onError.Invoke(it.Error, null);
            break;
        }
        if (it.Current != null)
        {
            items.Add(it.Current);
        }
        else
        {
            break;
        }
    }    const auto Domain = Gs2->Formation->Namespace(
        "namespace-0001" // namespaceName
    );
    const auto It = Domain->PropertyFormModels(
    );
    TArray<Gs2::UE5::Formation::Model::FEzPropertyFormModelPtr> Result;
    for (auto Item : *It)
    {
        if (Item.IsError())
        {
            return false;
        }
        Result.Add(Item.Current());
    }値の変更イベントハンドリング
    var domain = gs2.Formation.Namespace(
        namespaceName: "namespace-0001"
    );
    
    // イベントハンドリングを開始
    var callbackId = domain.SubscribePropertyFormModels(
        () => {
            // リストの要素が変化した時に呼び出される
        }
    );
    // イベントハンドリングを停止
    domain.UnsubscribePropertyFormModels(callbackId);    var domain = gs2.Formation.Namespace(
        namespaceName: "namespace-0001"
    );
    var it = domain.PropertyFormModels(
    );
    List<EzPropertyFormModel> items = new List<EzPropertyFormModel>();
    while (it.HasNext())
    {
        yield return it.Next();
        if (it.Error != null)
        {
            onError.Invoke(it.Error, null);
            break;
        }
        if (it.Current != null)
        {
            items.Add(it.Current);
        }
        else
        {
            break;
        }
    }    const auto Domain = Gs2->Formation->Namespace(
        "namespace-0001" // namespaceName
    );
    
    // イベントハンドリングを開始
    const auto CallbackId = Domain->SubscribePropertyFormModels(
        []() {
            // リストの要素が変化した時に呼び出される
        }
    );
    // イベントハンドリングを停止
    Domain->UnsubscribePropertyFormModels(CallbackId);Warning
このイベントはSDKがもつローカルキャッシュの値が変更された時に呼び出されます。
ローカルキャッシュは SDK が持つ API の実行、または GS2-Gateway の通知を有効にした GS2-Distributor 経由でのスタンプシートの実行、または GS2-Gateway の通知を有効にした GS2-JobQueue の実行によって変化したもののみが対象となります。
そのため、これらの方法以外で値が変更されてもコールバックは呼び出されません。
deletePropertyForm
プロパティフォームを削除
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
| accessToken | string | ✓ | ~ 128文字 | アクセストークン | ||
| propertyId | string | ✓ | ~ 1024文字 | プロパティID | 
Result
| 型 | 説明 | |
|---|---|---|
| item | EzPropertyForm | プロパティフォーム | 
| propertyFormModel | EzPropertyFormModel | プロパティフォームモデル | 
実装例
    var domain = gs2.Formation.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).PropertyForm(
        propertyFormModelName: "form-0001",
        propertyId: "property-0001"
    );
    var result = await domain.DeletePropertyFormAsync(
    );    var domain = gs2.Formation.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).PropertyForm(
        propertyFormModelName: "form-0001",
        propertyId: "property-0001"
    );
    var future = domain.DeletePropertyFormFuture(
    );
    yield return future;
    if (future.Error != null)
    {
        onError.Invoke(future.Error, null);
        yield break;
    }    const auto Domain = Gs2->Formation->Namespace(
        "namespace-0001" // namespaceName
    )->Me(
        GameSession
    )->PropertyForm(
        "form-0001", // propertyFormModelName
        "property-0001" // propertyId
    );
    const auto Future = Domain->DeletePropertyForm(
    );
    Future->StartSynchronousTask();
    if (Future->GetTask().IsError())
    {
        return false;
    }
    const auto Result = Future->GetTask().Result();getPropertyForm
プロパティフォームを取得
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
| propertyFormModelName | string | ✓ | ~ 128文字 | プロパティフォームモデルの名前 | ||
| accessToken | string | ✓ | ~ 128文字 | アクセストークン | ||
| propertyId | string | ✓ | ~ 1024文字 | プロパティID | 
Result
| 型 | 説明 | |
|---|---|---|
| item | EzPropertyForm | フォーム | 
| propertyFormModel | EzPropertyFormModel | フォームモデル | 
実装例
    var domain = gs2.Formation.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).PropertyForm(
        propertyFormModelName: "form-0001",
        propertyId: "property-0001"
    );
    var item = await domain.ModelAsync();    var domain = gs2.Formation.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).PropertyForm(
        propertyFormModelName: "form-0001",
        propertyId: "property-0001"
    );
    var future = domain.ModelFuture();
    yield return future;
    var item = future.Result;    const auto Domain = Gs2->Formation->Namespace(
        "namespace-0001" // namespaceName
    )->Me(
        GameSession
    )->PropertyForm(
        "form-0001", // propertyFormModelName
        "property-0001" // propertyId
    );
    const auto Future = Domain->Model();
    Future->StartSynchronousTask();
    if (Future->GetTask().IsError())
    {
        return false;
    }値の変更イベントハンドリング
    var domain = gs2.Formation.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).PropertyForm(
        propertyFormModelName: "form-0001",
        propertyId: "property-0001"
    );
    
    // イベントハンドリングを開始
    var callbackId = domain.Subscribe(
        value => {
            // 値が変化した時に呼び出される
            // value には変更後の値が渡ってくる
        }
    );
    // イベントハンドリングを停止
    domain.Unsubscribe(callbackId);    var domain = gs2.Formation.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).PropertyForm(
        propertyFormModelName: "form-0001",
        propertyId: "property-0001"
    );
    var future = domain.ModelFuture();
    yield return future;
    var item = future.Result;    const auto Domain = Gs2->Formation->Namespace(
        "namespace-0001" // namespaceName
    )->Me(
        GameSession
    )->PropertyForm(
        "form-0001", // propertyFormModelName
        "property-0001" // propertyId
    );
    
    // イベントハンドリングを開始
    const auto CallbackId = Domain->Subscribe(
        [](TSharedPtr<Gs2::Formation::Model::FPropertyForm> value) {
            // 値が変化した時に呼び出される
            // value には変更後の値が渡ってくる
        }
    );
    // イベントハンドリングを停止
    Domain->Unsubscribe(CallbackId);Warning
このイベントはSDKがもつローカルキャッシュの値が変更された時に呼び出されます。
ローカルキャッシュは SDK が持つ API の実行、または GS2-Gateway の通知を有効にした GS2-Distributor 経由でのスタンプシートの実行、または GS2-Gateway の通知を有効にした GS2-JobQueue の実行によって変化したもののみが対象となります。
そのため、これらの方法以外で値が変更されてもコールバックは呼び出されません。
getPropertyFormWithSignature
署名と共にプロパティフォームを取得
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
| propertyFormModelName | string | ✓ | ~ 128文字 | プロパティフォームモデルの名前 | ||
| accessToken | string | ✓ | ~ 128文字 | アクセストークン | ||
| propertyId | string | ✓ | ~ 1024文字 | プロパティID | ||
| keyId | string | ✓ | “grn:gs2:{region}:{ownerId}:key:default:key:default” | ~ 1024文字 | 暗号鍵GRN | 
Result
| 型 | 説明 | |
|---|---|---|
| item | EzPropertyForm | プロパティフォーム | 
| body | string | 署名対象の値 | 
| signature | string | 署名 | 
| propertyFormModel | EzPropertyFormModel | プロパティフォームモデル | 
実装例
    var domain = gs2.Formation.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).PropertyForm(
        propertyFormModelName: "form-0001",
        propertyId: "property-0001"
    );
    var result = await domain.GetPropertyFormWithSignatureAsync(
        keyId: "key-0001"
    );
    var item = await result.ModelAsync();
    var body = result.Body;
    var signature = result.Signature;    var domain = gs2.Formation.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).PropertyForm(
        propertyFormModelName: "form-0001",
        propertyId: "property-0001"
    );
    var future = domain.GetPropertyFormWithSignatureFuture(
        keyId: "key-0001"
    );
    yield return future;
    if (future.Error != null)
    {
        onError.Invoke(future.Error, null);
        yield break;
    }
    var future2 = future.Result.ModelFuture();
    yield return future2;
    if (future2.Error != null)
    {
        onError.Invoke(future2.Error, null);
        yield break;
    }
    var result = future2.Result;
    var body = future.Result.Body;
    var signature = future.Result.Signature;    const auto Domain = Gs2->Formation->Namespace(
        "namespace-0001" // namespaceName
    )->Me(
        GameSession
    )->PropertyForm(
        "form-0001", // propertyFormModelName
        "property-0001" // propertyId
    );
    const auto Future = Domain->GetPropertyFormWithSignature(
        "key-0001" // keyId
    );
    Future->StartSynchronousTask();
    if (Future->GetTask().IsError())
    {
        return false;
    }
    // obtain changed values / result values
    const auto Future2 = Future->GetTask().Result()->Model();
    Future2->StartSynchronousTask();
    if (Future2->GetTask().IsError())
    {
        return Future2->GetTask().Error();
    }
    const auto Result = Future2->GetTask().Result();
    const auto Body = Result->Body;
    const auto Signature = Result->Signature;listPropertyForms
プロパティフォームの一覧を取得
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
| propertyFormModelName | string | ✓ | ~ 128文字 | プロパティフォームモデルの名前 | ||
| accessToken | string | ✓ | ~ 128文字 | アクセストークン | ||
| pageToken | string | ~ 1024文字 | データの取得を開始する位置を指定するトークン | |||
| limit | int | ✓ | 30 | 1 ~ 1000 | データの取得件数 | 
Result
| 型 | 説明 | |
|---|---|---|
| items | List<EzPropertyForm> | フォームのリスト | 
| nextPageToken | string | リストの続きを取得するためのページトークン | 
実装例
    var domain = gs2.Formation.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    );
    var items = await domain.PropertyFormsAsync(
        propertyFormModelName: "form-0001"
    ).ToListAsync();    var domain = gs2.Formation.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    );
    var it = domain.PropertyForms(
        propertyFormModelName: "form-0001"
    );
    List<EzPropertyForm> items = new List<EzPropertyForm>();
    while (it.HasNext())
    {
        yield return it.Next();
        if (it.Error != null)
        {
            onError.Invoke(it.Error, null);
            break;
        }
        if (it.Current != null)
        {
            items.Add(it.Current);
        }
        else
        {
            break;
        }
    }    const auto Domain = Gs2->Formation->Namespace(
        "namespace-0001" // namespaceName
    )->Me(
        GameSession
    );
    const auto It = Domain->PropertyForms(
        "form-0001" // propertyFormModelName
    );
    TArray<Gs2::UE5::Formation::Model::FEzPropertyFormPtr> Result;
    for (auto Item : *It)
    {
        if (Item.IsError())
        {
            return false;
        }
        Result.Add(Item.Current());
    }値の変更イベントハンドリング
    var domain = gs2.Formation.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    );
    
    // イベントハンドリングを開始
    var callbackId = domain.SubscribePropertyForms(
        () => {
            // リストの要素が変化した時に呼び出される
        }
    );
    // イベントハンドリングを停止
    domain.UnsubscribePropertyForms(callbackId);    var domain = gs2.Formation.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    );
    var it = domain.PropertyForms(
        propertyFormModelName: "form-0001"
    );
    List<EzPropertyForm> items = new List<EzPropertyForm>();
    while (it.HasNext())
    {
        yield return it.Next();
        if (it.Error != null)
        {
            onError.Invoke(it.Error, null);
            break;
        }
        if (it.Current != null)
        {
            items.Add(it.Current);
        }
        else
        {
            break;
        }
    }    const auto Domain = Gs2->Formation->Namespace(
        "namespace-0001" // namespaceName
    )->Me(
        GameSession
    );
    
    // イベントハンドリングを開始
    const auto CallbackId = Domain->SubscribePropertyForms(
        []() {
            // リストの要素が変化した時に呼び出される
        }
    );
    // イベントハンドリングを停止
    Domain->UnsubscribePropertyForms(CallbackId);Warning
このイベントはSDKがもつローカルキャッシュの値が変更された時に呼び出されます。
ローカルキャッシュは SDK が持つ API の実行、または GS2-Gateway の通知を有効にした GS2-Distributor 経由でのスタンプシートの実行、または GS2-Gateway の通知を有効にした GS2-JobQueue の実行によって変化したもののみが対象となります。
そのため、これらの方法以外で値が変更されてもコールバックは呼び出されません。
setPropertyForm
プロパティフォームを更新
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
| propertyFormModelName | string | ✓ | ~ 128文字 | プロパティフォームモデルの名前 | ||
| accessToken | string | ✓ | ~ 128文字 | アクセストークン | ||
| propertyId | string | ✓ | ~ 1024文字 | プロパティID | ||
| slots | List<EzSlotWithSignature> | ✓ | 1 ~ 10 items | スロットリスト | ||
| keyId | string | ✓ | “grn:gs2:{region}:{ownerId}:key:default:key:default” | ~ 1024文字 | 暗号鍵GRN | 
Result
| 型 | 説明 | |
|---|---|---|
| item | EzPropertyForm | プロパティフォーム | 
| proeprtyFormModel | EzPropertyFormModel | プロパティフォームモデル | 
実装例
    var domain = gs2.Formation.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).PropertyForm(
        propertyFormModelName: "form-0001",
        propertyId: "property-0001"
    );
    var result = await domain.SetPropertyFormAsync(
        slots: new List<Gs2.Unity.Gs2Formation.Model.EzSlotWithSignature> {
            new Gs2.Unity.Gs2Formation.Model.EzSlotWithSignature() {
                Name = "slot-0001",
                PropertyType = "gs2_dictionary",
                Body = "body",
                Signature = "signature",
            },
        },
        keyId: "key-0001"
    );
    var item = await result.ModelAsync();    var domain = gs2.Formation.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).PropertyForm(
        propertyFormModelName: "form-0001",
        propertyId: "property-0001"
    );
    var future = domain.SetPropertyFormFuture(
        slots: new List<Gs2.Unity.Gs2Formation.Model.EzSlotWithSignature> {
            new Gs2.Unity.Gs2Formation.Model.EzSlotWithSignature() {
                Name = "slot-0001",
                PropertyType = "gs2_dictionary",
                Body = "body",
                Signature = "signature",
            },
        },
        keyId: "key-0001"
    );
    yield return future;
    if (future.Error != null)
    {
        onError.Invoke(future.Error, null);
        yield break;
    }
    var future2 = future.Result.ModelFuture();
    yield return future2;
    if (future2.Error != null)
    {
        onError.Invoke(future2.Error, null);
        yield break;
    }
    var result = future2.Result;    const auto Domain = Gs2->Formation->Namespace(
        "namespace-0001" // namespaceName
    )->Me(
        GameSession
    )->PropertyForm(
        "form-0001", // propertyFormModelName
        "property-0001" // propertyId
    );
    const auto Future = Domain->SetPropertyForm(
        []
        {
            auto v = MakeShared<TArray<TSharedPtr<Gs2::UE5::Formation::Model::FEzSlotWithSignature>>>();
            v->Add(
                MakeShared<Gs2::UE5::Formation::Model::FEzSlotWithSignature>()
                ->WithName(TOptional<FString>("slot-0001"))
                ->WithPropertyType(TOptional<FString>("gs2_dictionary"))
                ->WithBody(TOptional<FString>("body"))
                ->WithSignature(TOptional<FString>("signature"))
            );
            return v;
        }(), // slots
        "key-0001" // keyId
    );
    Future->StartSynchronousTask();
    if (Future->GetTask().IsError())
    {
        return false;
    }
    // obtain changed values / result values
    const auto Future2 = Future->GetTask().Result()->Model();
    Future2->StartSynchronousTask();
    if (Future2->GetTask().IsError())
    {
        return Future2->GetTask().Error();
    }
    const auto Result = Future2->GetTask().Result();