GS2-Formation SDK for Game Engine API リファレンス
モデル
EzFormModel
編成モデル
編成状況を表すエンティティです。
編成できる領域として スロット
を定義できます。
武器・防具 であれば 「右手」「左手」「胴」「腕」のような部位をスロットとし、 パーティであれば「前衛」「中衛」「後衛」のようなポジションをスロットとして表現できます。
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
name | string | ✓ | ~ 128文字 | 編成名 | |
metadata | string | ~ 2048文字 | メタデータ | ||
slots | List<EzSlotModel> | ✓ | スロットモデルリスト |
EzMoldModel
編成の情報を保存する領域
パーティ編成であれば「火属性パーティ」「水属性パーティ」のような形で保存することを想定しています。 保存できる領域の数は制限することができ、個別に拡張することもできます。
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
name | string | ✓ | ~ 128文字 | 編成モデル名 | |
metadata | string | ~ 2048文字 | メタデータ | ||
formModel | EzFormModel | ✓ | |||
initialMaxCapacity | int | ✓ | 1 ~ 2147483646 | フォームを保存できる初期キャパシティ | |
maxCapacity | int | ✓ | 1 ~ 2147483646 | フォームを保存できる最大キャパシティ |
EzPropertyFormModel
編成モデル
編成状況を表すエンティティです。
編成できる領域として スロット
を定義できます。
武器・防具 であれば 「右手」「左手」「胴」「腕」のような部位をスロットとし、 パーティであれば「前衛」「中衛」「後衛」のようなポジションをスロットとして表現できます。
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
name | string | ✓ | ~ 128文字 | 編成名 | |
metadata | string | ~ 2048文字 | メタデータ | ||
slots | List<EzSlotModel> | ✓ | スロットモデルリスト |
EzMold
保存したフォーム
ゲームプレイヤーが編成した情報を保持するエンティティです。 編成情報(Form) は 編成モデル(Mold) ごとに複数保持することができ、いくつ保持できるかのキャパシティをゲームプレイヤー×編成モデル ごとに個別に設定できます。
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
name | string | ✓ | ~ 128文字 | 編成モデルの名前 | |
userId | string | ✓ | ~ 128文字 | ユーザーID | |
capacity | int | ✓ | ~ 2147483646 | 現在のキャパシティ |
EzForm
編成
編成状況を表すエンティティです。
編成できる領域として スロット
を定義できます。
武器・防具 であれば 「右手」「左手」「胴」「腕」のような部位をスロットとし、 パーティであれば「前衛」「中衛」「後衛」のようなポジションをスロットとして表現できます。
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
name | string | ✓ | ~ 128文字 | 編成の名前 | |
index | int | ✓ | ~ 2147483646 | 保存領域のインデックス | |
slots | List<EzSlot> | スロットリスト |
EzPropertyForm
プロパティ編成
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
name | string | ✓ | ~ 128文字 | 編成の名前 | |
propertyId | string | ✓ | ~ 1024文字 | プロパティID | |
slots | List<EzSlot> | スロットリスト |
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文字 | メタデータ |
EzAcquireActionConfig
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
name | enum [] | ✓ | ~ 128文字 | スタンプシートを使用して実行するアクションの種類 | |
config | List<EzConfig> | [] | スタンプシートに使用するコンフィグ |
EzConfig
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
key | string | ✓ | ~ 64文字 | 名前 | |
value | string | ~ 51200文字 | 値 |
EzAcquireAction
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
action | enum [] | ✓ | ~ 128文字 | スタンプシートを使用して実行するアクションの種類 | |
request | string | ✓ | ~ 1048576文字 | リクエストのJSON |
メソッド
getMoldModel
フォームモデル情報を取得
Request
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32文字 | ネームスペース名 | |
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.Model();
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.Model();
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 | ✓ | ~ 32文字 | ネームスペース名 |
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(
);
for (auto Item : *It)
{
}
値の変更イベントハンドリング
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 | ✓ | ~ 32文字 | ネームスペース名 | |
moldModelName | string | ✓ | ~ 128文字 | 編成モデルの名前 | |
accessToken | string | ✓ | ~ 128文字 | ユーザーID |
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.Model();
yield return future;
var item = future.Result;
const auto Domain = Gs2->Formation->Namespace(
"namespace-0001" // namespaceName
)->Me(
AccessToken
)->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.Model();
yield return future;
var item = future.Result;
const auto Domain = Gs2->Formation->Namespace(
"namespace-0001" // namespaceName
)->Me(
AccessToken
)->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 | ✓ | ~ 32文字 | ネームスペース名 | |
accessToken | string | ✓ | ~ 128文字 | ユーザーID | |
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(
AccessToken
);
const auto It = Domain->Molds(
);
for (auto Item : *It)
{
}
値の変更イベントハンドリング
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(
AccessToken
);
// イベントハンドリングを開始
const auto CallbackId = Domain->SubscribeMolds(
[]() {
// リストの要素が変化した時に呼び出される
}
);
// イベントハンドリングを停止
Domain->UnsubscribeMolds(CallbackId);
Warning
このイベントはSDKがもつローカルキャッシュの値が変更された時に呼び出されます。
ローカルキャッシュは SDK が持つ API の実行、または GS2-Gateway の通知を有効にした GS2-Distributor 経由でのスタンプシートの実行、または GS2-Gateway の通知を有効にした GS2-JobQueue の実行によって変化したもののみが対象となります。
そのため、これらの方法以外で値が変更されてもコールバックは呼び出されません。
getFormModel
フォームモデル情報を取得
Request
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32文字 | ネームスペース名 | |
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.Model();
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.Model();
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 の実行によって変化したもののみが対象となります。
そのため、これらの方法以外で値が変更されてもコールバックは呼び出されません。
getForm
フォームを取得
Request
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32文字 | ネームスペース名 | |
moldModelName | string | ✓ | ~ 128文字 | フォームの保存領域の名前 | |
accessToken | string | ✓ | ~ 128文字 | ユーザーID | |
index | int | ✓ | ~ 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.Model();
yield return future;
var item = future.Result;
const auto Domain = Gs2->Formation->Namespace(
"namespace-0001" // namespaceName
)->Me(
AccessToken
)->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.Model();
yield return future;
var item = future.Result;
const auto Domain = Gs2->Formation->Namespace(
"namespace-0001" // namespaceName
)->Me(
AccessToken
)->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 | ✓ | ~ 32文字 | ネームスペース名 | |
moldModelName | string | ✓ | ~ 128文字 | フォームの保存領域の名前 | |
accessToken | string | ✓ | ~ 128文字 | ユーザーID | |
index | int | ✓ | ~ 2147483646 | 保存領域のインデックス | |
keyId | string | ✓ | ~ 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.GetFormWithSignature(
keyId: "key-0001"
);
yield return future;
if (future.Error != null)
{
onError.Invoke(future.Error, null);
yield break;
}
var future2 = future.Result.Model();
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(
AccessToken
)->Mold(
"mold-0001" // moldModelName
)->Form(
0 // index
);
const auto Future = Domain->GetFormWithSignature(
"key-0001"
);
Future->StartSynchronousTask();
if (Future->GetTask().IsError())
{
return false;
}
// obtain changed values / result values
const auto Future2 = Future->GetTask().Result()->Model();
Future2->StartSynchronousTask();
if (!TestFalse(WHAT, Future2->GetTask().IsError())) return false;
const auto Result = Future2->GetTask().Result();
const auto Body = Result->Body;
const auto Signature = Result->Signature;
listForms
フォームの一覧を取得
Request
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32文字 | ネームスペース名 | |
moldModelName | string | ✓ | ~ 128文字 | フォームの保存領域の名前 | |
accessToken | string | ✓ | ~ 128文字 | ユーザーID | |
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(
AccessToken
)->Mold(
"mold-0001" // moldModelName
);
const auto It = Domain->Forms(
);
for (auto Item : *It)
{
}
値の変更イベントハンドリング
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(
AccessToken
)->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 | ✓ | ~ 32文字 | ネームスペース名 | |
moldModelName | string | ✓ | ~ 128文字 | フォームの保存領域の名前 | |
accessToken | string | ✓ | ~ 128文字 | ユーザーID | |
index | int | ✓ | ~ 2147483646 | 保存領域のインデックス | |
slots | List<EzSlotWithSignature> | ✓ | スロットリスト | ||
keyId | string | ✓ | ~ 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 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.SetForm(
slots: new 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.Model();
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(
AccessToken
)->Mold(
"mold-0001" // moldModelName
)->Form(
0 // index
);
const auto Future = Domain->SetForm(
[]
{
const auto v = MakeShared<TArray<TSharedPtr<Gs2::Formation::Model::FSlotWithSignature>>>();
v->Add({'name': 'slot-0001', 'propertyType': 'gs2_dictionary', 'body': 'body', 'signature': 'signature'});
return v;
}(),
"key-0001"
);
Future->StartSynchronousTask();
if (Future->GetTask().IsError())
{
return false;
}
// obtain changed values / result values
const auto Future2 = Future->GetTask().Result()->Model();
Future2->StartSynchronousTask();
if (!TestFalse(WHAT, Future2->GetTask().IsError())) return false;
const auto Result = Future2->GetTask().Result();
getPropertyFormModel
フォームモデル情報を取得
Request
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32文字 | ネームスペース名 | |
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.Model();
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.Model();
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 | ✓ | ~ 32文字 | ネームスペース名 |
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(
);
for (auto Item : *It)
{
}
値の変更イベントハンドリング
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 の実行によって変化したもののみが対象となります。
そのため、これらの方法以外で値が変更されてもコールバックは呼び出されません。
getPropertyForm
フォームを取得
Request
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32文字 | ネームスペース名 | |
propertyFormModelName | string | ✓ | ~ 128文字 | フォームの保存領域の名前 | |
accessToken | string | ✓ | ~ 128文字 | ユーザーID | |
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.Model();
yield return future;
var item = future.Result;
const auto Domain = Gs2->Formation->Namespace(
"namespace-0001" // namespaceName
)->Me(
AccessToken
)->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.Model();
yield return future;
var item = future.Result;
const auto Domain = Gs2->Formation->Namespace(
"namespace-0001" // namespaceName
)->Me(
AccessToken
)->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 | ✓ | ~ 32文字 | ネームスペース名 | |
propertyFormModelName | string | ✓ | ~ 128文字 | フォームの保存領域の名前 | |
accessToken | string | ✓ | ~ 128文字 | ユーザーID | |
propertyId | string | ✓ | ~ 1024文字 | プロパティID | |
keyId | string | ✓ | ~ 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.GetPropertyFormWithSignature(
keyId: "key-0001"
);
yield return future;
if (future.Error != null)
{
onError.Invoke(future.Error, null);
yield break;
}
var future2 = future.Result.Model();
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(
AccessToken
)->PropertyForm(
"form-0001", // propertyFormModelName
"property-0001" // propertyId
);
const auto Future = Domain->GetPropertyFormWithSignature(
"key-0001"
);
Future->StartSynchronousTask();
if (Future->GetTask().IsError())
{
return false;
}
// obtain changed values / result values
const auto Future2 = Future->GetTask().Result()->Model();
Future2->StartSynchronousTask();
if (!TestFalse(WHAT, Future2->GetTask().IsError())) return false;
const auto Result = Future2->GetTask().Result();
const auto Body = Result->Body;
const auto Signature = Result->Signature;
listPropertyForms
フォームの一覧を取得
Request
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32文字 | ネームスペース名 | |
propertyFormModelName | string | ✓ | ~ 128文字 | フォームの保存領域の名前 | |
accessToken | string | ✓ | ~ 128文字 | ユーザーID | |
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(
).ToListAsync();
var domain = gs2.Formation.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
);
var it = domain.PropertyForms(
);
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(
AccessToken
);
const auto It = Domain->PropertyForms( // propertyFormModelName
);
for (auto Item : *It)
{
}
値の変更イベントハンドリング
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(
);
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(
AccessToken
);
// イベントハンドリングを開始
const auto CallbackId = Domain->SubscribePropertyForms(
[]() {
// リストの要素が変化した時に呼び出される
}
);
// イベントハンドリングを停止
Domain->UnsubscribePropertyForms(CallbackId);
Warning
このイベントはSDKがもつローカルキャッシュの値が変更された時に呼び出されます。
ローカルキャッシュは SDK が持つ API の実行、または GS2-Gateway の通知を有効にした GS2-Distributor 経由でのスタンプシートの実行、または GS2-Gateway の通知を有効にした GS2-JobQueue の実行によって変化したもののみが対象となります。
そのため、これらの方法以外で値が変更されてもコールバックは呼び出されません。
setPropertyForm
フォームを更新
Request
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32文字 | ネームスペース名 | |
propertyFormModelName | string | ✓ | ~ 128文字 | フォームの保存領域の名前 | |
accessToken | string | ✓ | ~ 128文字 | ユーザーID | |
propertyId | string | ✓ | ~ 1024文字 | プロパティID | |
slots | List<EzSlotWithSignature> | ✓ | スロットリスト | ||
keyId | string | ✓ | ~ 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 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.SetPropertyForm(
slots: new 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.Model();
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(
AccessToken
)->PropertyForm(
"form-0001", // propertyFormModelName
"property-0001" // propertyId
);
const auto Future = Domain->SetPropertyForm(
[]
{
const auto v = MakeShared<TArray<TSharedPtr<Gs2::Formation::Model::FSlotWithSignature>>>();
v->Add({'name': 'slot-0001', 'propertyType': 'gs2_dictionary', 'body': 'body', 'signature': 'signature'});
return v;
}(),
"key-0001"
);
Future->StartSynchronousTask();
if (Future->GetTask().IsError())
{
return false;
}
// obtain changed values / result values
const auto Future2 = Future->GetTask().Result()->Model();
Future2->StartSynchronousTask();
if (!TestFalse(WHAT, Future2->GetTask().IsError())) return false;
const auto Result = Future2->GetTask().Result();