GS2-Formation
GS2-SDK for Game Engine のリファレンス
ゲームエンジン向けSDK
モデル
EzFormModel
編成モデル
編成状況を表すエンティティです。
編成できる領域として スロット
を定義できます。
武器・防具 であれば 「右手」「左手」「胴」「腕」のような部位をスロットとし、
パーティであれば「前衛」「中衛」「後衛」のようなポジションをスロットとして表現できます。
型 | 説明 | |
---|---|---|
name | string | 編成名 |
metadata | string | メタデータ |
slots | List<EzSlotModel> | スロットモデルリスト |
EzMoldModel
編成の情報を保存する領域
パーティ編成であれば「火属性パーティ」「水属性パーティ」のような形で保存することを想定しています。
保存できる領域の数は制限することができ、個別に拡張することもできます。
型 | 説明 | |
---|---|---|
name | string | 編成モデル名 |
metadata | string | メタデータ |
formModel | EzFormModel | |
initialMaxCapacity | int | フォームを保存できる初期キャパシティ |
maxCapacity | int | フォームを保存できる最大キャパシティ |
EzMold
保存したフォーム
ゲームプレイヤーが編成した情報を保持するエンティティです。
編成情報(Form) は 編成モデル(Mold) ごとに複数保持することができ、いくつ保持できるかのキャパシティをゲームプレイヤー×編成モデル ごとに個別に設定できます。
型 | 説明 | |
---|---|---|
name | string | 編成モデルの名前 |
userId | string | ユーザーID |
capacity | int | 現在のキャパシティ |
EzForm
編成
編成状況を表すエンティティです。
編成できる領域として スロット
を定義できます。
武器・防具 であれば 「右手」「左手」「胴」「腕」のような部位をスロットとし、
パーティであれば「前衛」「中衛」「後衛」のようなポジションをスロットとして表現できます。
型 | 説明 | |
---|---|---|
name | string | 編成の名前 |
index | int | 保存領域のインデックス |
slots | List<EzSlot> | スロットリスト |
EzPropertyForm
プロパティ編成
型 | 説明 | |
---|---|---|
name | string | 編成の名前 |
propertyId | string | プロパティID |
slots | List<EzSlot> | スロットリスト |
EzSlot
型 | 説明 | |
---|---|---|
name | string | スロットモデル名 |
propertyId | string | プロパティID |
metadata | string | メタデータ |
EzSlotModel
型 | 説明 | |
---|---|---|
name | string | スロットモデル名 |
propertyRegex | string | プロパティとして設定可能な値の正規表現 |
metadata | string | メタデータ |
EzSlotWithSignature
型 | 説明 | |
---|---|---|
name | string | スロットモデル名 |
propertyType | enum ['gs2_inventory', 'gs2_dictionary'] | プロパティの種類 |
body | string | ペイロード |
signature | string | プロパティIDのリソースを所有していることを証明する署名 |
metadata | string | メタデータ |
EzAcquireActionConfig
型 | 説明 | |
---|---|---|
name | string | スロット名 |
config | List<EzConfig> | スタンプシートに使用するコンフィグ |
EzConfig
型 | 説明 | |
---|---|---|
key | string | 名前 |
value | string | 値 |
EzAcquireAction
型 | 説明 | |
---|---|---|
action | enum [] | スタンプシートを使用して実行するアクションの種類 |
request | string | リクエストのJSON |
メソッド
getMoldModel
getMoldModel
///////////////////////////////////////////////////////////////
// New Experience (Enabled UniTask)
///////////////////////////////////////////////////////////////
using Gs2.Unity.Util;
#if GS2_ENABLE_UNITASK
using Cysharp.Threading.Tasks;
using Cysharp.Threading.Tasks.Linq;
#endif
var profile = new Profile(
clientId: "your client id",
clientSecret: "your client secret",
reopener: new Gs2BasicReopener()
);
await profile.InitializeAsync();
var gs2 = new Gs2.Unity.Core.Gs2Domain(profile);
// Up to this line is the initialization process.
{
var domain = gs2.Formation.Namespace(
namespaceName: "namespace-0001"
).MoldModel(
moldName: "mold-0001"
);
var item = await domain.ModelAsync();
}
///////////////////////////////////////////////////////////////
// New Experience
///////////////////////////////////////////////////////////////
using Gs2.Unity.Util;
var profile = new Profile(
clientId: "your client id",
clientSecret: "your client secret",
reopener: new Gs2BasicReopener()
);
var future = profile.Initialize();
yield return future;
if (future.Error != null)
{
onError.Invoke(future.Error, null);
yield break;
}
var gs2 = new Gs2.Unity.Core.Gs2Domain(profile);
// Up to this line is the initialization process.
{
var domain = gs2.Formation.Namespace(
namespaceName: "namespace-0001"
).MoldModel(
moldName: "mold-0001"
);
var future = domain.Model();
yield return future;
var item = future.Result;
}
///////////////////////////////////////////////////////////////
// Legacy Experience
///////////////////////////////////////////////////////////////
using Gs2.Core.AsyncResult;
using Gs2.Gs2Account.Unity.Result;
using Gs2.Unity.Util;
var profile = new Profile(
clientId: "your client id",
clientSecret: "your client secret",
reopener: new Gs2BasicReopener()
);
{
AsyncResult<object> asyncResult = null;
var current = profile.Initialize(
r => { asyncResult = r; }
);
yield return current;
if (asyncResult.Error != null)
{
OnError(asyncResult.Error);
yield break;
}
}
var gs2 = new Gs2.Unity.Client(profile);
// Up to this line is the initialization process.
{
AsyncResult<EzGetMoldModelResult> asyncResult = null;
var current = gs2.Formation.GetMoldModel(
callback: r => { asyncResult = r; },
namespaceName: "namespace-0001",
moldName: "mold-0001"
);
yield return current;
if (asyncResult.Error != null)
{
OnError(asyncResult.Error);
yield break;
}
var result = asyncResult.Result;
var item = result.Item;
}
const auto Profile = MakeShared<Gs2::UE5::Util::FProfile>(
"your client id",
"your client secret",
Gs2::Core::Model::ERegion::ApNorthEast1,
MakeShareable<Gs2::UE5::Util::IReOpener>(new Gs2::UE5::Util::FGs2BasicReOpener())
);
Gs2::UE5::Core::Domain::FGs2DomainPtr Gs2;
{
const auto Future = Profile->Initialize();
Future->StartSynchronousTask();
if (!TestFalse(WHAT, Future->GetTask().IsError())) return false;
Gs2 = Future->GetTask().Result();
Future->EnsureCompletion();
}
// Up to this line is the initialization process.
{
const auto Domain = Gs2->Formation->Namespace(
"namespace-0001" // namespaceName
)->MoldModel(
"mold-0001" // moldName
);
const auto item = Domain.Model();
}
ProfilePtr = std::make_shared<gs2::ez::Profile>(
TCHAR_TO_ANSI(*ClientId),
TCHAR_TO_ANSI(*ClientSecret),
gs2::ez::Gs2BasicReopener()
);
ClientPtr = std::make_shared<gs2::ez::Client>(
*ProfilePtr
);
ProfilePtr->initialize(
[this](gs2::ez::Profile::AsyncInitializeResult r)
{
if (r.getError())
{
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, "profile.initialize failed.");
}
else
{
AccountCreate();
}
}
);
// Up to this line is the initialization process.
ClientPtr->formation.getMoldModel(
[](gs2::ez::account::AsyncEzGetMoldModelResult r)
{
if (r.getError())
{
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, "formation.getMoldModel failed.");
}
else
{
Item = r.getResult()->getItem();
}
},
TCHAR_TO_ANSI("namespace-0001"), // namespaceName
TCHAR_TO_ANSI("mold-0001") // moldName
);
フォームモデル情報を取得
Request
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32文字 | ネームスペース名 | |
moldName | string | ✓ | ~ 128文字 | 編成モデル名 |
Result
型 | 説明 | |
---|---|---|
item | EzMoldModel | フォームの保存領域 |
listMoldModels
listMoldModels
///////////////////////////////////////////////////////////////
// New Experience (Enabled UniTask)
///////////////////////////////////////////////////////////////
using Gs2.Unity.Util;
#if GS2_ENABLE_UNITASK
using Cysharp.Threading.Tasks;
using Cysharp.Threading.Tasks.Linq;
#endif
var profile = new Profile(
clientId: "your client id",
clientSecret: "your client secret",
reopener: new Gs2BasicReopener()
);
await profile.InitializeAsync();
var gs2 = new Gs2.Unity.Core.Gs2Domain(profile);
// Up to this line is the initialization process.
{
var domain = gs2.Formation.Namespace(
namespaceName: "namespace-0001"
);
var items = await domain.MoldModelsAsync(
).ToListAsync();
}
///////////////////////////////////////////////////////////////
// New Experience
///////////////////////////////////////////////////////////////
using Gs2.Unity.Util;
var profile = new Profile(
clientId: "your client id",
clientSecret: "your client secret",
reopener: new Gs2BasicReopener()
);
var future = profile.Initialize();
yield return future;
if (future.Error != null)
{
onError.Invoke(future.Error, null);
yield break;
}
var gs2 = new Gs2.Unity.Core.Gs2Domain(profile);
// Up to this line is the initialization process.
{
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;
}
}
}
///////////////////////////////////////////////////////////////
// Legacy Experience
///////////////////////////////////////////////////////////////
using Gs2.Core.AsyncResult;
using Gs2.Gs2Account.Unity.Result;
using Gs2.Unity.Util;
var profile = new Profile(
clientId: "your client id",
clientSecret: "your client secret",
reopener: new Gs2BasicReopener()
);
{
AsyncResult<object> asyncResult = null;
var current = profile.Initialize(
r => { asyncResult = r; }
);
yield return current;
if (asyncResult.Error != null)
{
OnError(asyncResult.Error);
yield break;
}
}
var gs2 = new Gs2.Unity.Client(profile);
// Up to this line is the initialization process.
{
AsyncResult<EzListMoldModelsResult> asyncResult = null;
var current = gs2.Formation.ListMoldModels(
callback: r => { asyncResult = r; },
namespaceName: "namespace-0001"
);
yield return current;
if (asyncResult.Error != null)
{
OnError(asyncResult.Error);
yield break;
}
var result = asyncResult.Result;
var items = result.Items;
}
const auto Profile = MakeShared<Gs2::UE5::Util::FProfile>(
"your client id",
"your client secret",
Gs2::Core::Model::ERegion::ApNorthEast1,
MakeShareable<Gs2::UE5::Util::IReOpener>(new Gs2::UE5::Util::FGs2BasicReOpener())
);
Gs2::UE5::Core::Domain::FGs2DomainPtr Gs2;
{
const auto Future = Profile->Initialize();
Future->StartSynchronousTask();
if (!TestFalse(WHAT, Future->GetTask().IsError())) return false;
Gs2 = Future->GetTask().Result();
Future->EnsureCompletion();
}
// Up to this line is the initialization process.
{
const auto Domain = Gs2->Formation->Namespace(
"namespace-0001" // namespaceName
);
const auto It = Domain->MoldModels(
);
for (auto Item : *It)
{
}
}
ProfilePtr = std::make_shared<gs2::ez::Profile>(
TCHAR_TO_ANSI(*ClientId),
TCHAR_TO_ANSI(*ClientSecret),
gs2::ez::Gs2BasicReopener()
);
ClientPtr = std::make_shared<gs2::ez::Client>(
*ProfilePtr
);
ProfilePtr->initialize(
[this](gs2::ez::Profile::AsyncInitializeResult r)
{
if (r.getError())
{
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, "profile.initialize failed.");
}
else
{
AccountCreate();
}
}
);
// Up to this line is the initialization process.
ClientPtr->formation.describeMoldModels(
[](gs2::ez::account::AsyncEzDescribeMoldModelsResult r)
{
if (r.getError())
{
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, "formation.describeMoldModels failed.");
}
else
{
Items = r.getResult()->getItems();
}
},
TCHAR_TO_ANSI("namespace-0001") // namespaceName
);
フォームモデル情報の一覧を取得
Request
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32文字 | ネームスペース名 |
Result
型 | 説明 | |
---|---|---|
items | List<EzMoldModel> | フォームの保存領域のリスト |
getMold
getMold
///////////////////////////////////////////////////////////////
// New Experience (Enabled UniTask)
///////////////////////////////////////////////////////////////
using Gs2.Unity.Util;
#if GS2_ENABLE_UNITASK
using Cysharp.Threading.Tasks;
using Cysharp.Threading.Tasks.Linq;
#endif
var profile = new Profile(
clientId: "your client id",
clientSecret: "your client secret",
reopener: new Gs2BasicReopener()
);
await profile.InitializeAsync();
var gs2 = new Gs2.Unity.Core.Gs2Domain(profile);
// Up to this line is the initialization process.
{
var domain = gs2.Formation.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Mold(
moldName: "mold-0001"
);
var item = await domain.ModelAsync();
}
///////////////////////////////////////////////////////////////
// New Experience
///////////////////////////////////////////////////////////////
using Gs2.Unity.Util;
var profile = new Profile(
clientId: "your client id",
clientSecret: "your client secret",
reopener: new Gs2BasicReopener()
);
var future = profile.Initialize();
yield return future;
if (future.Error != null)
{
onError.Invoke(future.Error, null);
yield break;
}
var gs2 = new Gs2.Unity.Core.Gs2Domain(profile);
// Up to this line is the initialization process.
{
var domain = gs2.Formation.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Mold(
moldName: "mold-0001"
);
var future = domain.Model();
yield return future;
var item = future.Result;
}
///////////////////////////////////////////////////////////////
// Legacy Experience
///////////////////////////////////////////////////////////////
using Gs2.Core.AsyncResult;
using Gs2.Gs2Account.Unity.Result;
using Gs2.Unity.Util;
var profile = new Profile(
clientId: "your client id",
clientSecret: "your client secret",
reopener: new Gs2BasicReopener()
);
{
AsyncResult<object> asyncResult = null;
var current = profile.Initialize(
r => { asyncResult = r; }
);
yield return current;
if (asyncResult.Error != null)
{
OnError(asyncResult.Error);
yield break;
}
}
var gs2 = new Gs2.Unity.Client(profile);
// Up to this line is the initialization process.
{
AsyncResult<EzGetMoldResult> asyncResult = null;
var current = gs2.Formation.GetMold(
callback: r => { asyncResult = r; },
session: session,
namespaceName: "namespace-0001",
moldName: "mold-0001"
);
yield return current;
if (asyncResult.Error != null)
{
OnError(asyncResult.Error);
yield break;
}
var result = asyncResult.Result;
var item = result.Item;
var moldModel = result.MoldModel;
}
const auto Profile = MakeShared<Gs2::UE5::Util::FProfile>(
"your client id",
"your client secret",
Gs2::Core::Model::ERegion::ApNorthEast1,
MakeShareable<Gs2::UE5::Util::IReOpener>(new Gs2::UE5::Util::FGs2BasicReOpener())
);
Gs2::UE5::Core::Domain::FGs2DomainPtr Gs2;
{
const auto Future = Profile->Initialize();
Future->StartSynchronousTask();
if (!TestFalse(WHAT, Future->GetTask().IsError())) return false;
Gs2 = Future->GetTask().Result();
Future->EnsureCompletion();
}
// Up to this line is the initialization process.
{
const auto Domain = Gs2->Formation->Namespace(
"namespace-0001" // namespaceName
)->Me(
AccessToken
)->Mold(
"mold-0001" // moldName
);
const auto item = Domain.Model();
}
ProfilePtr = std::make_shared<gs2::ez::Profile>(
TCHAR_TO_ANSI(*ClientId),
TCHAR_TO_ANSI(*ClientSecret),
gs2::ez::Gs2BasicReopener()
);
ClientPtr = std::make_shared<gs2::ez::Client>(
*ProfilePtr
);
ProfilePtr->initialize(
[this](gs2::ez::Profile::AsyncInitializeResult r)
{
if (r.getError())
{
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, "profile.initialize failed.");
}
else
{
AccountCreate();
}
}
);
// Up to this line is the initialization process.
ClientPtr->formation.getMold(
[](gs2::ez::account::AsyncEzGetMoldResult r)
{
if (r.getError())
{
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, "formation.getMold failed.");
}
else
{
Item = r.getResult()->getItem();
MoldModel = r.getResult()->getMoldModel();
}
},
ProfilePtr->getGs2Session(),
TCHAR_TO_ANSI("namespace-0001"), // namespaceName
TCHAR_TO_ANSI("mold-0001") // moldName
);
フォームの保存領域
と プロパティID
を指定して保存したフォーム情報を取得
Request
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32文字 | ネームスペース名 | |
moldName | string | ✓ | ~ 128文字 | 編成モデルの名前 | |
accessToken | string | ✓ | ~ 128文字 | ユーザーID |
Result
型 | 説明 | |
---|---|---|
item | EzMold | 保存したフォーム |
moldModel | EzMoldModel | フォームの保存領域 |
listMolds
listMolds
///////////////////////////////////////////////////////////////
// New Experience (Enabled UniTask)
///////////////////////////////////////////////////////////////
using Gs2.Unity.Util;
#if GS2_ENABLE_UNITASK
using Cysharp.Threading.Tasks;
using Cysharp.Threading.Tasks.Linq;
#endif
var profile = new Profile(
clientId: "your client id",
clientSecret: "your client secret",
reopener: new Gs2BasicReopener()
);
await profile.InitializeAsync();
var gs2 = new Gs2.Unity.Core.Gs2Domain(profile);
// Up to this line is the initialization process.
{
var domain = gs2.Formation.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
);
var items = await domain.MoldsAsync(
).ToListAsync();
}
///////////////////////////////////////////////////////////////
// New Experience
///////////////////////////////////////////////////////////////
using Gs2.Unity.Util;
var profile = new Profile(
clientId: "your client id",
clientSecret: "your client secret",
reopener: new Gs2BasicReopener()
);
var future = profile.Initialize();
yield return future;
if (future.Error != null)
{
onError.Invoke(future.Error, null);
yield break;
}
var gs2 = new Gs2.Unity.Core.Gs2Domain(profile);
// Up to this line is the initialization process.
{
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;
}
}
}
///////////////////////////////////////////////////////////////
// Legacy Experience
///////////////////////////////////////////////////////////////
using Gs2.Core.AsyncResult;
using Gs2.Gs2Account.Unity.Result;
using Gs2.Unity.Util;
var profile = new Profile(
clientId: "your client id",
clientSecret: "your client secret",
reopener: new Gs2BasicReopener()
);
{
AsyncResult<object> asyncResult = null;
var current = profile.Initialize(
r => { asyncResult = r; }
);
yield return current;
if (asyncResult.Error != null)
{
OnError(asyncResult.Error);
yield break;
}
}
var gs2 = new Gs2.Unity.Client(profile);
// Up to this line is the initialization process.
{
AsyncResult<EzListMoldsResult> asyncResult = null;
var current = gs2.Formation.ListMolds(
callback: r => { asyncResult = r; },
session: session,
namespaceName: "namespace-0001",
limit: null,
pageToken: null
);
yield return current;
if (asyncResult.Error != null)
{
OnError(asyncResult.Error);
yield break;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
}
const auto Profile = MakeShared<Gs2::UE5::Util::FProfile>(
"your client id",
"your client secret",
Gs2::Core::Model::ERegion::ApNorthEast1,
MakeShareable<Gs2::UE5::Util::IReOpener>(new Gs2::UE5::Util::FGs2BasicReOpener())
);
Gs2::UE5::Core::Domain::FGs2DomainPtr Gs2;
{
const auto Future = Profile->Initialize();
Future->StartSynchronousTask();
if (!TestFalse(WHAT, Future->GetTask().IsError())) return false;
Gs2 = Future->GetTask().Result();
Future->EnsureCompletion();
}
// Up to this line is the initialization process.
{
const auto Domain = Gs2->Formation->Namespace(
"namespace-0001" // namespaceName
)->Me(
AccessToken
);
const auto It = Domain->Molds(
);
for (auto Item : *It)
{
}
}
ProfilePtr = std::make_shared<gs2::ez::Profile>(
TCHAR_TO_ANSI(*ClientId),
TCHAR_TO_ANSI(*ClientSecret),
gs2::ez::Gs2BasicReopener()
);
ClientPtr = std::make_shared<gs2::ez::Client>(
*ProfilePtr
);
ProfilePtr->initialize(
[this](gs2::ez::Profile::AsyncInitializeResult r)
{
if (r.getError())
{
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, "profile.initialize failed.");
}
else
{
AccountCreate();
}
}
);
// Up to this line is the initialization process.
ClientPtr->formation.describeMolds(
[](gs2::ez::account::AsyncEzDescribeMoldsResult r)
{
if (r.getError())
{
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, "formation.describeMolds failed.");
}
else
{
Items = r.getResult()->getItems();
NextPageToken = r.getResult()->getNextPageToken();
}
},
ProfilePtr->getGs2Session(),
TCHAR_TO_ANSI("namespace-0001"), // namespaceName
null // limit,
TCHAR_TO_ANSI(null) // pageToken
);
保存したフォーム情報の一覧を取得
Request
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32文字 | ネームスペース名 | |
accessToken | string | ✓ | ~ 128文字 | ユーザーID | |
pageToken | string | ~ 1024文字 | データの取得を開始する位置を指定するトークン | ||
limit | int | ✓ | 30 | 1 ~ 1000 | データの取得件数 |
Result
型 | 説明 | |
---|---|---|
items | List<EzMold> | 保存したフォームのリスト |
nextPageToken | string | リストの続きを取得するためのページトークン |
getFormModel
getFormModel
///////////////////////////////////////////////////////////////
// New Experience (Enabled UniTask)
///////////////////////////////////////////////////////////////
using Gs2.Unity.Util;
#if GS2_ENABLE_UNITASK
using Cysharp.Threading.Tasks;
using Cysharp.Threading.Tasks.Linq;
#endif
var profile = new Profile(
clientId: "your client id",
clientSecret: "your client secret",
reopener: new Gs2BasicReopener()
);
await profile.InitializeAsync();
var gs2 = new Gs2.Unity.Core.Gs2Domain(profile);
// Up to this line is the initialization process.
{
var domain = gs2.Formation.Namespace(
namespaceName: "namespace-0001"
).FormModel(
formModelName: "form-0001"
);
var item = await domain.ModelAsync();
}
///////////////////////////////////////////////////////////////
// New Experience
///////////////////////////////////////////////////////////////
using Gs2.Unity.Util;
var profile = new Profile(
clientId: "your client id",
clientSecret: "your client secret",
reopener: new Gs2BasicReopener()
);
var future = profile.Initialize();
yield return future;
if (future.Error != null)
{
onError.Invoke(future.Error, null);
yield break;
}
var gs2 = new Gs2.Unity.Core.Gs2Domain(profile);
// Up to this line is the initialization process.
{
var domain = gs2.Formation.Namespace(
namespaceName: "namespace-0001"
).FormModel(
formModelName: "form-0001"
);
var future = domain.Model();
yield return future;
var item = future.Result;
}
///////////////////////////////////////////////////////////////
// Legacy Experience
///////////////////////////////////////////////////////////////
using Gs2.Core.AsyncResult;
using Gs2.Gs2Account.Unity.Result;
using Gs2.Unity.Util;
var profile = new Profile(
clientId: "your client id",
clientSecret: "your client secret",
reopener: new Gs2BasicReopener()
);
{
AsyncResult<object> asyncResult = null;
var current = profile.Initialize(
r => { asyncResult = r; }
);
yield return current;
if (asyncResult.Error != null)
{
OnError(asyncResult.Error);
yield break;
}
}
var gs2 = new Gs2.Unity.Client(profile);
// Up to this line is the initialization process.
{
AsyncResult<EzGetFormModelResult> asyncResult = null;
var current = gs2.Formation.GetFormModel(
callback: r => { asyncResult = r; },
namespaceName: "namespace-0001",
formModelName: "form-0001"
);
yield return current;
if (asyncResult.Error != null)
{
OnError(asyncResult.Error);
yield break;
}
var result = asyncResult.Result;
var item = result.Item;
}
const auto Profile = MakeShared<Gs2::UE5::Util::FProfile>(
"your client id",
"your client secret",
Gs2::Core::Model::ERegion::ApNorthEast1,
MakeShareable<Gs2::UE5::Util::IReOpener>(new Gs2::UE5::Util::FGs2BasicReOpener())
);
Gs2::UE5::Core::Domain::FGs2DomainPtr Gs2;
{
const auto Future = Profile->Initialize();
Future->StartSynchronousTask();
if (!TestFalse(WHAT, Future->GetTask().IsError())) return false;
Gs2 = Future->GetTask().Result();
Future->EnsureCompletion();
}
// Up to this line is the initialization process.
{
const auto Domain = Gs2->Formation->Namespace(
"namespace-0001" // namespaceName
)->FormModel(
"form-0001" // formModelName
);
const auto item = Domain.Model();
}
ProfilePtr = std::make_shared<gs2::ez::Profile>(
TCHAR_TO_ANSI(*ClientId),
TCHAR_TO_ANSI(*ClientSecret),
gs2::ez::Gs2BasicReopener()
);
ClientPtr = std::make_shared<gs2::ez::Client>(
*ProfilePtr
);
ProfilePtr->initialize(
[this](gs2::ez::Profile::AsyncInitializeResult r)
{
if (r.getError())
{
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, "profile.initialize failed.");
}
else
{
AccountCreate();
}
}
);
// Up to this line is the initialization process.
ClientPtr->formation.getFormModel(
[](gs2::ez::account::AsyncEzGetFormModelResult r)
{
if (r.getError())
{
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, "formation.getFormModel failed.");
}
else
{
Item = r.getResult()->getItem();
}
},
TCHAR_TO_ANSI("namespace-0001"), // namespaceName
TCHAR_TO_ANSI("form-0001") // formModelName
);
フォームモデル情報を取得
Request
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32文字 | ネームスペース名 | |
formModelName | string | ✓ | ~ 128文字 | 編成名 |
Result
型 | 説明 | |
---|---|---|
item | EzFormModel | フォーム |
listFormModels
listFormModels
///////////////////////////////////////////////////////////////
// New Experience (Enabled UniTask)
///////////////////////////////////////////////////////////////
using Gs2.Unity.Util;
#if GS2_ENABLE_UNITASK
using Cysharp.Threading.Tasks;
using Cysharp.Threading.Tasks.Linq;
#endif
var profile = new Profile(
clientId: "your client id",
clientSecret: "your client secret",
reopener: new Gs2BasicReopener()
);
await profile.InitializeAsync();
var gs2 = new Gs2.Unity.Core.Gs2Domain(profile);
// Up to this line is the initialization process.
{
var domain = gs2.Formation.Namespace(
namespaceName: "namespace-0001"
);
var items = await domain.FormModelsAsync(
).ToListAsync();
}
///////////////////////////////////////////////////////////////
// New Experience
///////////////////////////////////////////////////////////////
using Gs2.Unity.Util;
var profile = new Profile(
clientId: "your client id",
clientSecret: "your client secret",
reopener: new Gs2BasicReopener()
);
var future = profile.Initialize();
yield return future;
if (future.Error != null)
{
onError.Invoke(future.Error, null);
yield break;
}
var gs2 = new Gs2.Unity.Core.Gs2Domain(profile);
// Up to this line is the initialization process.
{
var domain = gs2.Formation.Namespace(
namespaceName: "namespace-0001"
);
var it = domain.FormModels(
);
List<EzFormModel> items = new List<EzFormModel>();
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;
}
}
}
///////////////////////////////////////////////////////////////
// Legacy Experience
///////////////////////////////////////////////////////////////
using Gs2.Core.AsyncResult;
using Gs2.Gs2Account.Unity.Result;
using Gs2.Unity.Util;
var profile = new Profile(
clientId: "your client id",
clientSecret: "your client secret",
reopener: new Gs2BasicReopener()
);
{
AsyncResult<object> asyncResult = null;
var current = profile.Initialize(
r => { asyncResult = r; }
);
yield return current;
if (asyncResult.Error != null)
{
OnError(asyncResult.Error);
yield break;
}
}
var gs2 = new Gs2.Unity.Client(profile);
// Up to this line is the initialization process.
{
AsyncResult<EzListFormModelsResult> asyncResult = null;
var current = gs2.Formation.ListFormModels(
callback: r => { asyncResult = r; },
namespaceName: "namespace-0001"
);
yield return current;
if (asyncResult.Error != null)
{
OnError(asyncResult.Error);
yield break;
}
var result = asyncResult.Result;
var items = result.Items;
}
const auto Profile = MakeShared<Gs2::UE5::Util::FProfile>(
"your client id",
"your client secret",
Gs2::Core::Model::ERegion::ApNorthEast1,
MakeShareable<Gs2::UE5::Util::IReOpener>(new Gs2::UE5::Util::FGs2BasicReOpener())
);
Gs2::UE5::Core::Domain::FGs2DomainPtr Gs2;
{
const auto Future = Profile->Initialize();
Future->StartSynchronousTask();
if (!TestFalse(WHAT, Future->GetTask().IsError())) return false;
Gs2 = Future->GetTask().Result();
Future->EnsureCompletion();
}
// Up to this line is the initialization process.
{
const auto Domain = Gs2->Formation->Namespace(
"namespace-0001" // namespaceName
);
const auto It = Domain->FormModels(
);
for (auto Item : *It)
{
}
}
ProfilePtr = std::make_shared<gs2::ez::Profile>(
TCHAR_TO_ANSI(*ClientId),
TCHAR_TO_ANSI(*ClientSecret),
gs2::ez::Gs2BasicReopener()
);
ClientPtr = std::make_shared<gs2::ez::Client>(
*ProfilePtr
);
ProfilePtr->initialize(
[this](gs2::ez::Profile::AsyncInitializeResult r)
{
if (r.getError())
{
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, "profile.initialize failed.");
}
else
{
AccountCreate();
}
}
);
// Up to this line is the initialization process.
ClientPtr->formation.describeFormModels(
[](gs2::ez::account::AsyncEzDescribeFormModelsResult r)
{
if (r.getError())
{
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, "formation.describeFormModels failed.");
}
else
{
Items = r.getResult()->getItems();
}
},
TCHAR_TO_ANSI("namespace-0001") // namespaceName
);
フォームモデル情報の一覧を取得
Request
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32文字 | ネームスペース名 |
Result
型 | 説明 | |
---|---|---|
items | List<EzFormModel> | フォームのリスト |
getForm
getForm
///////////////////////////////////////////////////////////////
// New Experience (Enabled UniTask)
///////////////////////////////////////////////////////////////
using Gs2.Unity.Util;
#if GS2_ENABLE_UNITASK
using Cysharp.Threading.Tasks;
using Cysharp.Threading.Tasks.Linq;
#endif
var profile = new Profile(
clientId: "your client id",
clientSecret: "your client secret",
reopener: new Gs2BasicReopener()
);
await profile.InitializeAsync();
var gs2 = new Gs2.Unity.Core.Gs2Domain(profile);
// Up to this line is the initialization process.
{
var domain = gs2.Formation.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Mold(
moldName: "mold-0001"
).Form(
index: 0
);
var item = await domain.ModelAsync();
}
///////////////////////////////////////////////////////////////
// New Experience
///////////////////////////////////////////////////////////////
using Gs2.Unity.Util;
var profile = new Profile(
clientId: "your client id",
clientSecret: "your client secret",
reopener: new Gs2BasicReopener()
);
var future = profile.Initialize();
yield return future;
if (future.Error != null)
{
onError.Invoke(future.Error, null);
yield break;
}
var gs2 = new Gs2.Unity.Core.Gs2Domain(profile);
// Up to this line is the initialization process.
{
var domain = gs2.Formation.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Mold(
moldName: "mold-0001"
).Form(
index: 0
);
var future = domain.Model();
yield return future;
var item = future.Result;
}
///////////////////////////////////////////////////////////////
// Legacy Experience
///////////////////////////////////////////////////////////////
using Gs2.Core.AsyncResult;
using Gs2.Gs2Account.Unity.Result;
using Gs2.Unity.Util;
var profile = new Profile(
clientId: "your client id",
clientSecret: "your client secret",
reopener: new Gs2BasicReopener()
);
{
AsyncResult<object> asyncResult = null;
var current = profile.Initialize(
r => { asyncResult = r; }
);
yield return current;
if (asyncResult.Error != null)
{
OnError(asyncResult.Error);
yield break;
}
}
var gs2 = new Gs2.Unity.Client(profile);
// Up to this line is the initialization process.
{
AsyncResult<EzGetFormResult> asyncResult = null;
var current = gs2.Formation.GetForm(
callback: r => { asyncResult = r; },
session: session,
namespaceName: "namespace-0001",
moldName: "mold-0001",
index: 0
);
yield return current;
if (asyncResult.Error != null)
{
OnError(asyncResult.Error);
yield break;
}
var result = asyncResult.Result;
var item = result.Item;
var mold = result.Mold;
var moldModel = result.MoldModel;
var formModel = result.FormModel;
}
const auto Profile = MakeShared<Gs2::UE5::Util::FProfile>(
"your client id",
"your client secret",
Gs2::Core::Model::ERegion::ApNorthEast1,
MakeShareable<Gs2::UE5::Util::IReOpener>(new Gs2::UE5::Util::FGs2BasicReOpener())
);
Gs2::UE5::Core::Domain::FGs2DomainPtr Gs2;
{
const auto Future = Profile->Initialize();
Future->StartSynchronousTask();
if (!TestFalse(WHAT, Future->GetTask().IsError())) return false;
Gs2 = Future->GetTask().Result();
Future->EnsureCompletion();
}
// Up to this line is the initialization process.
{
const auto Domain = Gs2->Formation->Namespace(
"namespace-0001" // namespaceName
)->Me(
AccessToken
)->Mold(
"mold-0001" // moldName
)->Form(
0 // index
);
const auto item = Domain.Model();
}
ProfilePtr = std::make_shared<gs2::ez::Profile>(
TCHAR_TO_ANSI(*ClientId),
TCHAR_TO_ANSI(*ClientSecret),
gs2::ez::Gs2BasicReopener()
);
ClientPtr = std::make_shared<gs2::ez::Client>(
*ProfilePtr
);
ProfilePtr->initialize(
[this](gs2::ez::Profile::AsyncInitializeResult r)
{
if (r.getError())
{
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, "profile.initialize failed.");
}
else
{
AccountCreate();
}
}
);
// Up to this line is the initialization process.
ClientPtr->formation.getForm(
[](gs2::ez::account::AsyncEzGetFormResult r)
{
if (r.getError())
{
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, "formation.getForm failed.");
}
else
{
Item = r.getResult()->getItem();
Mold = r.getResult()->getMold();
MoldModel = r.getResult()->getMoldModel();
FormModel = r.getResult()->getFormModel();
}
},
ProfilePtr->getGs2Session(),
TCHAR_TO_ANSI("namespace-0001"), // namespaceName
TCHAR_TO_ANSI("mold-0001"), // moldName
0 // index
);
フォームを取得
Request
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32文字 | ネームスペース名 | |
moldName | string | ✓ | ~ 128文字 | フォームの保存領域の名前 | |
accessToken | string | ✓ | ~ 128文字 | ユーザーID | |
index | int | ✓ | ~ 2147483646 | 保存領域のインデックス |
Result
型 | 説明 | |
---|---|---|
item | EzForm | フォーム |
mold | EzMold | 保存したフォーム |
moldModel | EzMoldModel | フォームの保存領域 |
formModel | EzFormModel | フォームモデル |
getFormWithSignature
getFormWithSignature
///////////////////////////////////////////////////////////////
// New Experience (Enabled UniTask)
///////////////////////////////////////////////////////////////
using Gs2.Unity.Util;
#if GS2_ENABLE_UNITASK
using Cysharp.Threading.Tasks;
using Cysharp.Threading.Tasks.Linq;
#endif
var profile = new Profile(
clientId: "your client id",
clientSecret: "your client secret",
reopener: new Gs2BasicReopener()
);
await profile.InitializeAsync();
var gs2 = new Gs2.Unity.Core.Gs2Domain(profile);
// Up to this line is the initialization process.
{
var domain = gs2.Formation.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Mold(
moldName: "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;
}
///////////////////////////////////////////////////////////////
// New Experience
///////////////////////////////////////////////////////////////
using Gs2.Unity.Util;
var profile = new Profile(
clientId: "your client id",
clientSecret: "your client secret",
reopener: new Gs2BasicReopener()
);
var future = profile.Initialize();
yield return future;
if (future.Error != null)
{
onError.Invoke(future.Error, null);
yield break;
}
var gs2 = new Gs2.Unity.Core.Gs2Domain(profile);
// Up to this line is the initialization process.
{
var domain = gs2.Formation.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Mold(
moldName: "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;
}
///////////////////////////////////////////////////////////////
// Legacy Experience
///////////////////////////////////////////////////////////////
using Gs2.Core.AsyncResult;
using Gs2.Gs2Account.Unity.Result;
using Gs2.Unity.Util;
var profile = new Profile(
clientId: "your client id",
clientSecret: "your client secret",
reopener: new Gs2BasicReopener()
);
{
AsyncResult<object> asyncResult = null;
var current = profile.Initialize(
r => { asyncResult = r; }
);
yield return current;
if (asyncResult.Error != null)
{
OnError(asyncResult.Error);
yield break;
}
}
var gs2 = new Gs2.Unity.Client(profile);
// Up to this line is the initialization process.
{
AsyncResult<EzGetFormWithSignatureResult> asyncResult = null;
var current = gs2.Formation.GetFormWithSignature(
callback: r => { asyncResult = r; },
session: session,
namespaceName: "namespace-0001",
moldName: "mold-0001",
index: 0,
keyId: "key-0001"
);
yield return current;
if (asyncResult.Error != null)
{
OnError(asyncResult.Error);
yield break;
}
var result = asyncResult.Result;
var item = result.Item;
var body = result.Body;
var signature = result.Signature;
var mold = result.Mold;
var moldModel = result.MoldModel;
var formModel = result.FormModel;
}
const auto Profile = MakeShared<Gs2::UE5::Util::FProfile>(
"your client id",
"your client secret",
Gs2::Core::Model::ERegion::ApNorthEast1,
MakeShareable<Gs2::UE5::Util::IReOpener>(new Gs2::UE5::Util::FGs2BasicReOpener())
);
Gs2::UE5::Core::Domain::FGs2DomainPtr Gs2;
{
const auto Future = Profile->Initialize();
Future->StartSynchronousTask();
if (!TestFalse(WHAT, Future->GetTask().IsError())) return false;
Gs2 = Future->GetTask().Result();
Future->EnsureCompletion();
}
// Up to this line is the initialization process.
{
const auto Domain = Gs2->Formation->Namespace(
"namespace-0001" // namespaceName
)->Me(
AccessToken
)->Mold(
"mold-0001" // moldName
)->Form(
0 // index
);
const auto Future = Domain->GetFormWithSignature(
"key-0001"
);
Future->StartSynchronousTask();
if (!TestFalse(WHAT, 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;
}
ProfilePtr = std::make_shared<gs2::ez::Profile>(
TCHAR_TO_ANSI(*ClientId),
TCHAR_TO_ANSI(*ClientSecret),
gs2::ez::Gs2BasicReopener()
);
ClientPtr = std::make_shared<gs2::ez::Client>(
*ProfilePtr
);
ProfilePtr->initialize(
[this](gs2::ez::Profile::AsyncInitializeResult r)
{
if (r.getError())
{
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, "profile.initialize failed.");
}
else
{
AccountCreate();
}
}
);
// Up to this line is the initialization process.
ClientPtr->formation.getFormWithSignature(
[](gs2::ez::account::AsyncEzGetFormWithSignatureResult r)
{
if (r.getError())
{
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, "formation.getFormWithSignature failed.");
}
else
{
Item = r.getResult()->getItem();
Body = r.getResult()->getBody();
Signature = r.getResult()->getSignature();
Mold = r.getResult()->getMold();
MoldModel = r.getResult()->getMoldModel();
FormModel = r.getResult()->getFormModel();
}
},
ProfilePtr->getGs2Session(),
TCHAR_TO_ANSI("namespace-0001"), // namespaceName
TCHAR_TO_ANSI("mold-0001"), // moldName
0, // index
TCHAR_TO_ANSI("key-0001") // keyId
);
署名と共にフォームを取得
Request
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32文字 | ネームスペース名 | |
moldName | 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 | フォームモデル |
listForms
listForms
///////////////////////////////////////////////////////////////
// New Experience (Enabled UniTask)
///////////////////////////////////////////////////////////////
using Gs2.Unity.Util;
#if GS2_ENABLE_UNITASK
using Cysharp.Threading.Tasks;
using Cysharp.Threading.Tasks.Linq;
#endif
var profile = new Profile(
clientId: "your client id",
clientSecret: "your client secret",
reopener: new Gs2BasicReopener()
);
await profile.InitializeAsync();
var gs2 = new Gs2.Unity.Core.Gs2Domain(profile);
// Up to this line is the initialization process.
{
var domain = gs2.Formation.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Mold(
moldName: "mold-0001"
);
var items = await domain.FormsAsync(
).ToListAsync();
}
///////////////////////////////////////////////////////////////
// New Experience
///////////////////////////////////////////////////////////////
using Gs2.Unity.Util;
var profile = new Profile(
clientId: "your client id",
clientSecret: "your client secret",
reopener: new Gs2BasicReopener()
);
var future = profile.Initialize();
yield return future;
if (future.Error != null)
{
onError.Invoke(future.Error, null);
yield break;
}
var gs2 = new Gs2.Unity.Core.Gs2Domain(profile);
// Up to this line is the initialization process.
{
var domain = gs2.Formation.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Mold(
moldName: "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;
}
}
}
///////////////////////////////////////////////////////////////
// Legacy Experience
///////////////////////////////////////////////////////////////
using Gs2.Core.AsyncResult;
using Gs2.Gs2Account.Unity.Result;
using Gs2.Unity.Util;
var profile = new Profile(
clientId: "your client id",
clientSecret: "your client secret",
reopener: new Gs2BasicReopener()
);
{
AsyncResult<object> asyncResult = null;
var current = profile.Initialize(
r => { asyncResult = r; }
);
yield return current;
if (asyncResult.Error != null)
{
OnError(asyncResult.Error);
yield break;
}
}
var gs2 = new Gs2.Unity.Client(profile);
// Up to this line is the initialization process.
{
AsyncResult<EzListFormsResult> asyncResult = null;
var current = gs2.Formation.ListForms(
callback: r => { asyncResult = r; },
session: session,
namespaceName: "namespace-0001",
moldName: "mold-0001",
limit: null,
pageToken: null
);
yield return current;
if (asyncResult.Error != null)
{
OnError(asyncResult.Error);
yield break;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
}
const auto Profile = MakeShared<Gs2::UE5::Util::FProfile>(
"your client id",
"your client secret",
Gs2::Core::Model::ERegion::ApNorthEast1,
MakeShareable<Gs2::UE5::Util::IReOpener>(new Gs2::UE5::Util::FGs2BasicReOpener())
);
Gs2::UE5::Core::Domain::FGs2DomainPtr Gs2;
{
const auto Future = Profile->Initialize();
Future->StartSynchronousTask();
if (!TestFalse(WHAT, Future->GetTask().IsError())) return false;
Gs2 = Future->GetTask().Result();
Future->EnsureCompletion();
}
// Up to this line is the initialization process.
{
const auto Domain = Gs2->Formation->Namespace(
"namespace-0001" // namespaceName
)->Me(
AccessToken
)->Mold(
"mold-0001" // moldName
);
const auto It = Domain->Forms(
);
for (auto Item : *It)
{
}
}
ProfilePtr = std::make_shared<gs2::ez::Profile>(
TCHAR_TO_ANSI(*ClientId),
TCHAR_TO_ANSI(*ClientSecret),
gs2::ez::Gs2BasicReopener()
);
ClientPtr = std::make_shared<gs2::ez::Client>(
*ProfilePtr
);
ProfilePtr->initialize(
[this](gs2::ez::Profile::AsyncInitializeResult r)
{
if (r.getError())
{
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, "profile.initialize failed.");
}
else
{
AccountCreate();
}
}
);
// Up to this line is the initialization process.
ClientPtr->formation.describeForms(
[](gs2::ez::account::AsyncEzDescribeFormsResult r)
{
if (r.getError())
{
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, "formation.describeForms failed.");
}
else
{
Items = r.getResult()->getItems();
NextPageToken = r.getResult()->getNextPageToken();
}
},
ProfilePtr->getGs2Session(),
TCHAR_TO_ANSI("namespace-0001"), // namespaceName
TCHAR_TO_ANSI("mold-0001"), // moldName
null // limit,
TCHAR_TO_ANSI(null) // pageToken
);
フォームの一覧を取得
Request
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32文字 | ネームスペース名 | |
moldName | string | ✓ | ~ 128文字 | フォームの保存領域の名前 | |
accessToken | string | ✓ | ~ 128文字 | ユーザーID | |
pageToken | string | ~ 1024文字 | データの取得を開始する位置を指定するトークン | ||
limit | int | ✓ | 30 | 1 ~ 1000 | データの取得件数 |
Result
型 | 説明 | |
---|---|---|
items | List<EzForm> | フォームのリスト |
nextPageToken | string | リストの続きを取得するためのページトークン |
setForm
setForm
///////////////////////////////////////////////////////////////
// New Experience (Enabled UniTask)
///////////////////////////////////////////////////////////////
using Gs2.Unity.Util;
#if GS2_ENABLE_UNITASK
using Cysharp.Threading.Tasks;
using Cysharp.Threading.Tasks.Linq;
#endif
var profile = new Profile(
clientId: "your client id",
clientSecret: "your client secret",
reopener: new Gs2BasicReopener()
);
await profile.InitializeAsync();
var gs2 = new Gs2.Unity.Core.Gs2Domain(profile);
// Up to this line is the initialization process.
{
var domain = gs2.Formation.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Mold(
moldName: "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();
}
///////////////////////////////////////////////////////////////
// New Experience
///////////////////////////////////////////////////////////////
using Gs2.Unity.Util;
var profile = new Profile(
clientId: "your client id",
clientSecret: "your client secret",
reopener: new Gs2BasicReopener()
);
var future = profile.Initialize();
yield return future;
if (future.Error != null)
{
onError.Invoke(future.Error, null);
yield break;
}
var gs2 = new Gs2.Unity.Core.Gs2Domain(profile);
// Up to this line is the initialization process.
{
var domain = gs2.Formation.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Mold(
moldName: "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;
}
///////////////////////////////////////////////////////////////
// Legacy Experience
///////////////////////////////////////////////////////////////
using Gs2.Core.AsyncResult;
using Gs2.Gs2Account.Unity.Result;
using Gs2.Unity.Util;
var profile = new Profile(
clientId: "your client id",
clientSecret: "your client secret",
reopener: new Gs2BasicReopener()
);
{
AsyncResult<object> asyncResult = null;
var current = profile.Initialize(
r => { asyncResult = r; }
);
yield return current;
if (asyncResult.Error != null)
{
OnError(asyncResult.Error);
yield break;
}
}
var gs2 = new Gs2.Unity.Client(profile);
// Up to this line is the initialization process.
{
AsyncResult<EzSetFormResult> asyncResult = null;
var current = gs2.Formation.SetForm(
callback: r => { asyncResult = r; },
session: session,
namespaceName: "namespace-0001",
moldName: "mold-0001",
index: 0,
slots: new List<Gs2.Unity.Gs2Formation.Model.EzSlotWithSignature> {
{'name': 'slot-0001', 'propertyType': 'gs2_dictionary', 'body': 'body', 'signature': 'signature'}
},
keyId: "key-0001"
);
yield return current;
if (asyncResult.Error != null)
{
OnError(asyncResult.Error);
yield break;
}
var result = asyncResult.Result;
var item = result.Item;
var mold = result.Mold;
var moldModel = result.MoldModel;
var formModel = result.FormModel;
}
const auto Profile = MakeShared<Gs2::UE5::Util::FProfile>(
"your client id",
"your client secret",
Gs2::Core::Model::ERegion::ApNorthEast1,
MakeShareable<Gs2::UE5::Util::IReOpener>(new Gs2::UE5::Util::FGs2BasicReOpener())
);
Gs2::UE5::Core::Domain::FGs2DomainPtr Gs2;
{
const auto Future = Profile->Initialize();
Future->StartSynchronousTask();
if (!TestFalse(WHAT, Future->GetTask().IsError())) return false;
Gs2 = Future->GetTask().Result();
Future->EnsureCompletion();
}
// Up to this line is the initialization process.
{
const auto Domain = Gs2->Formation->Namespace(
"namespace-0001" // namespaceName
)->Me(
AccessToken
)->Mold(
"mold-0001" // moldName
)->Form(
0 // index
);
const auto Future = Domain->SetForm(
new Gs2.Unity.Gs2Formation.Model.EzSlotWithSignature[] {
new Gs2.Unity.Gs2Formation.Model.EzSlotWithSignature
{
Name = "slot-0001",
PropertyType = "gs2_dictionary",
Body = "body",
Signature = "signature",
},
},
"key-0001"
);
Future->StartSynchronousTask();
if (!TestFalse(WHAT, 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();
}
ProfilePtr = std::make_shared<gs2::ez::Profile>(
TCHAR_TO_ANSI(*ClientId),
TCHAR_TO_ANSI(*ClientSecret),
gs2::ez::Gs2BasicReopener()
);
ClientPtr = std::make_shared<gs2::ez::Client>(
*ProfilePtr
);
ProfilePtr->initialize(
[this](gs2::ez::Profile::AsyncInitializeResult r)
{
if (r.getError())
{
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, "profile.initialize failed.");
}
else
{
AccountCreate();
}
}
);
// Up to this line is the initialization process.
ClientPtr->formation.setFormWithSignature(
[](gs2::ez::account::AsyncEzSetFormWithSignatureResult r)
{
if (r.getError())
{
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, "formation.setFormWithSignature failed.");
}
else
{
Item = r.getResult()->getItem();
Mold = r.getResult()->getMold();
MoldModel = r.getResult()->getMoldModel();
FormModel = r.getResult()->getFormModel();
}
},
ProfilePtr->getGs2Session(),
TCHAR_TO_ANSI("namespace-0001"), // namespaceName
TCHAR_TO_ANSI("mold-0001"), // moldName
0, // index
new Gs2.Gs2Formation.Model.SlotWithSignature[] {
{'name': 'slot-0001', 'propertyType': 'gs2_dictionary', 'body': 'body', 'signature': 'signature'}
}, // slots
TCHAR_TO_ANSI("key-0001") // keyId
);
フォームを更新
Request
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32文字 | ネームスペース名 | |
moldName | 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 | フォームモデル |
getPropertyForm
getPropertyForm
///////////////////////////////////////////////////////////////
// New Experience (Enabled UniTask)
///////////////////////////////////////////////////////////////
using Gs2.Unity.Util;
#if GS2_ENABLE_UNITASK
using Cysharp.Threading.Tasks;
using Cysharp.Threading.Tasks.Linq;
#endif
var profile = new Profile(
clientId: "your client id",
clientSecret: "your client secret",
reopener: new Gs2BasicReopener()
);
await profile.InitializeAsync();
var gs2 = new Gs2.Unity.Core.Gs2Domain(profile);
// Up to this line is the initialization process.
{
var domain = gs2.Formation.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).PropertyForm(
formModelName: "form-0001",
propertyId: "property-0001"
);
var item = await domain.ModelAsync();
}
///////////////////////////////////////////////////////////////
// New Experience
///////////////////////////////////////////////////////////////
using Gs2.Unity.Util;
var profile = new Profile(
clientId: "your client id",
clientSecret: "your client secret",
reopener: new Gs2BasicReopener()
);
var future = profile.Initialize();
yield return future;
if (future.Error != null)
{
onError.Invoke(future.Error, null);
yield break;
}
var gs2 = new Gs2.Unity.Core.Gs2Domain(profile);
// Up to this line is the initialization process.
{
var domain = gs2.Formation.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).PropertyForm(
formModelName: "form-0001",
propertyId: "property-0001"
);
var future = domain.Model();
yield return future;
var item = future.Result;
}
///////////////////////////////////////////////////////////////
// Legacy Experience
///////////////////////////////////////////////////////////////
using Gs2.Core.AsyncResult;
using Gs2.Gs2Account.Unity.Result;
using Gs2.Unity.Util;
var profile = new Profile(
clientId: "your client id",
clientSecret: "your client secret",
reopener: new Gs2BasicReopener()
);
{
AsyncResult<object> asyncResult = null;
var current = profile.Initialize(
r => { asyncResult = r; }
);
yield return current;
if (asyncResult.Error != null)
{
OnError(asyncResult.Error);
yield break;
}
}
var gs2 = new Gs2.Unity.Client(profile);
// Up to this line is the initialization process.
{
AsyncResult<EzGetPropertyFormResult> asyncResult = null;
var current = gs2.Formation.GetPropertyForm(
callback: r => { asyncResult = r; },
session: session,
namespaceName: "namespace-0001",
formModelName: "form-0001",
propertyId: "property-0001"
);
yield return current;
if (asyncResult.Error != null)
{
OnError(asyncResult.Error);
yield break;
}
var result = asyncResult.Result;
var item = result.Item;
var formModel = result.FormModel;
}
const auto Profile = MakeShared<Gs2::UE5::Util::FProfile>(
"your client id",
"your client secret",
Gs2::Core::Model::ERegion::ApNorthEast1,
MakeShareable<Gs2::UE5::Util::IReOpener>(new Gs2::UE5::Util::FGs2BasicReOpener())
);
Gs2::UE5::Core::Domain::FGs2DomainPtr Gs2;
{
const auto Future = Profile->Initialize();
Future->StartSynchronousTask();
if (!TestFalse(WHAT, Future->GetTask().IsError())) return false;
Gs2 = Future->GetTask().Result();
Future->EnsureCompletion();
}
// Up to this line is the initialization process.
{
const auto Domain = Gs2->Formation->Namespace(
"namespace-0001" // namespaceName
)->Me(
AccessToken
)->PropertyForm(
"form-0001", // formModelName
"property-0001" // propertyId
);
const auto item = Domain.Model();
}
ProfilePtr = std::make_shared<gs2::ez::Profile>(
TCHAR_TO_ANSI(*ClientId),
TCHAR_TO_ANSI(*ClientSecret),
gs2::ez::Gs2BasicReopener()
);
ClientPtr = std::make_shared<gs2::ez::Client>(
*ProfilePtr
);
ProfilePtr->initialize(
[this](gs2::ez::Profile::AsyncInitializeResult r)
{
if (r.getError())
{
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, "profile.initialize failed.");
}
else
{
AccountCreate();
}
}
);
// Up to this line is the initialization process.
ClientPtr->formation.getPropertyForm(
[](gs2::ez::account::AsyncEzGetPropertyFormResult r)
{
if (r.getError())
{
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, "formation.getPropertyForm failed.");
}
else
{
Item = r.getResult()->getItem();
FormModel = r.getResult()->getFormModel();
}
},
ProfilePtr->getGs2Session(),
TCHAR_TO_ANSI("namespace-0001"), // namespaceName
TCHAR_TO_ANSI("form-0001"), // formModelName
TCHAR_TO_ANSI("property-0001") // propertyId
);
フォームを取得
Request
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32文字 | ネームスペース名 | |
formModelName | string | ✓ | ~ 128文字 | フォームの保存領域の名前 | |
accessToken | string | ✓ | ~ 128文字 | ユーザーID | |
propertyId | string | ✓ | ~ 1024文字 | プロパティID |
Result
型 | 説明 | |
---|---|---|
item | EzPropertyForm | フォーム |
formModel | EzFormModel | フォームモデル |
getPropertyFormWithSignature
getPropertyFormWithSignature
///////////////////////////////////////////////////////////////
// New Experience (Enabled UniTask)
///////////////////////////////////////////////////////////////
using Gs2.Unity.Util;
#if GS2_ENABLE_UNITASK
using Cysharp.Threading.Tasks;
using Cysharp.Threading.Tasks.Linq;
#endif
var profile = new Profile(
clientId: "your client id",
clientSecret: "your client secret",
reopener: new Gs2BasicReopener()
);
await profile.InitializeAsync();
var gs2 = new Gs2.Unity.Core.Gs2Domain(profile);
// Up to this line is the initialization process.
{
var domain = gs2.Formation.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).PropertyForm(
formModelName: "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;
}
///////////////////////////////////////////////////////////////
// New Experience
///////////////////////////////////////////////////////////////
using Gs2.Unity.Util;
var profile = new Profile(
clientId: "your client id",
clientSecret: "your client secret",
reopener: new Gs2BasicReopener()
);
var future = profile.Initialize();
yield return future;
if (future.Error != null)
{
onError.Invoke(future.Error, null);
yield break;
}
var gs2 = new Gs2.Unity.Core.Gs2Domain(profile);
// Up to this line is the initialization process.
{
var domain = gs2.Formation.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).PropertyForm(
formModelName: "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;
}
///////////////////////////////////////////////////////////////
// Legacy Experience
///////////////////////////////////////////////////////////////
using Gs2.Core.AsyncResult;
using Gs2.Gs2Account.Unity.Result;
using Gs2.Unity.Util;
var profile = new Profile(
clientId: "your client id",
clientSecret: "your client secret",
reopener: new Gs2BasicReopener()
);
{
AsyncResult<object> asyncResult = null;
var current = profile.Initialize(
r => { asyncResult = r; }
);
yield return current;
if (asyncResult.Error != null)
{
OnError(asyncResult.Error);
yield break;
}
}
var gs2 = new Gs2.Unity.Client(profile);
// Up to this line is the initialization process.
{
AsyncResult<EzGetPropertyFormWithSignatureResult> asyncResult = null;
var current = gs2.Formation.GetPropertyFormWithSignature(
callback: r => { asyncResult = r; },
session: session,
namespaceName: "namespace-0001",
formModelName: "form-0001",
propertyId: "property-0001",
keyId: "key-0001"
);
yield return current;
if (asyncResult.Error != null)
{
OnError(asyncResult.Error);
yield break;
}
var result = asyncResult.Result;
var item = result.Item;
var body = result.Body;
var signature = result.Signature;
var formModel = result.FormModel;
}
const auto Profile = MakeShared<Gs2::UE5::Util::FProfile>(
"your client id",
"your client secret",
Gs2::Core::Model::ERegion::ApNorthEast1,
MakeShareable<Gs2::UE5::Util::IReOpener>(new Gs2::UE5::Util::FGs2BasicReOpener())
);
Gs2::UE5::Core::Domain::FGs2DomainPtr Gs2;
{
const auto Future = Profile->Initialize();
Future->StartSynchronousTask();
if (!TestFalse(WHAT, Future->GetTask().IsError())) return false;
Gs2 = Future->GetTask().Result();
Future->EnsureCompletion();
}
// Up to this line is the initialization process.
{
const auto Domain = Gs2->Formation->Namespace(
"namespace-0001" // namespaceName
)->Me(
AccessToken
)->PropertyForm(
"form-0001", // formModelName
"property-0001" // propertyId
);
const auto Future = Domain->GetPropertyFormWithSignature(
"key-0001"
);
Future->StartSynchronousTask();
if (!TestFalse(WHAT, 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;
}
ProfilePtr = std::make_shared<gs2::ez::Profile>(
TCHAR_TO_ANSI(*ClientId),
TCHAR_TO_ANSI(*ClientSecret),
gs2::ez::Gs2BasicReopener()
);
ClientPtr = std::make_shared<gs2::ez::Client>(
*ProfilePtr
);
ProfilePtr->initialize(
[this](gs2::ez::Profile::AsyncInitializeResult r)
{
if (r.getError())
{
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, "profile.initialize failed.");
}
else
{
AccountCreate();
}
}
);
// Up to this line is the initialization process.
ClientPtr->formation.getPropertyFormWithSignature(
[](gs2::ez::account::AsyncEzGetPropertyFormWithSignatureResult r)
{
if (r.getError())
{
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, "formation.getPropertyFormWithSignature failed.");
}
else
{
Item = r.getResult()->getItem();
Body = r.getResult()->getBody();
Signature = r.getResult()->getSignature();
FormModel = r.getResult()->getFormModel();
}
},
ProfilePtr->getGs2Session(),
TCHAR_TO_ANSI("namespace-0001"), // namespaceName
TCHAR_TO_ANSI("form-0001"), // formModelName
TCHAR_TO_ANSI("property-0001"), // propertyId
TCHAR_TO_ANSI("key-0001") // keyId
);
署名と共にフォームを取得
Request
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32文字 | ネームスペース名 | |
formModelName | string | ✓ | ~ 128文字 | フォームの保存領域の名前 | |
accessToken | string | ✓ | ~ 128文字 | ユーザーID | |
propertyId | string | ✓ | ~ 1024文字 | プロパティID | |
keyId | string | ✓ | ~ 1024文字 | 暗号鍵GRN |
Result
型 | 説明 | |
---|---|---|
item | EzPropertyForm | フォーム |
body | string | 署名対象の値 |
signature | string | 署名 |
formModel | EzFormModel | フォームモデル |
listPropertyForms
listPropertyForms
///////////////////////////////////////////////////////////////
// New Experience (Enabled UniTask)
///////////////////////////////////////////////////////////////
using Gs2.Unity.Util;
#if GS2_ENABLE_UNITASK
using Cysharp.Threading.Tasks;
using Cysharp.Threading.Tasks.Linq;
#endif
var profile = new Profile(
clientId: "your client id",
clientSecret: "your client secret",
reopener: new Gs2BasicReopener()
);
await profile.InitializeAsync();
var gs2 = new Gs2.Unity.Core.Gs2Domain(profile);
// Up to this line is the initialization process.
{
var domain = gs2.Formation.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
);
var items = await domain.PropertyFormsAsync(
).ToListAsync();
}
///////////////////////////////////////////////////////////////
// New Experience
///////////////////////////////////////////////////////////////
using Gs2.Unity.Util;
var profile = new Profile(
clientId: "your client id",
clientSecret: "your client secret",
reopener: new Gs2BasicReopener()
);
var future = profile.Initialize();
yield return future;
if (future.Error != null)
{
onError.Invoke(future.Error, null);
yield break;
}
var gs2 = new Gs2.Unity.Core.Gs2Domain(profile);
// Up to this line is the initialization process.
{
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;
}
}
}
///////////////////////////////////////////////////////////////
// Legacy Experience
///////////////////////////////////////////////////////////////
using Gs2.Core.AsyncResult;
using Gs2.Gs2Account.Unity.Result;
using Gs2.Unity.Util;
var profile = new Profile(
clientId: "your client id",
clientSecret: "your client secret",
reopener: new Gs2BasicReopener()
);
{
AsyncResult<object> asyncResult = null;
var current = profile.Initialize(
r => { asyncResult = r; }
);
yield return current;
if (asyncResult.Error != null)
{
OnError(asyncResult.Error);
yield break;
}
}
var gs2 = new Gs2.Unity.Client(profile);
// Up to this line is the initialization process.
{
AsyncResult<EzListPropertyFormsResult> asyncResult = null;
var current = gs2.Formation.ListPropertyForms(
callback: r => { asyncResult = r; },
session: session,
namespaceName: "namespace-0001",
formModelName: "form-0001",
limit: null,
pageToken: null
);
yield return current;
if (asyncResult.Error != null)
{
OnError(asyncResult.Error);
yield break;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
}
const auto Profile = MakeShared<Gs2::UE5::Util::FProfile>(
"your client id",
"your client secret",
Gs2::Core::Model::ERegion::ApNorthEast1,
MakeShareable<Gs2::UE5::Util::IReOpener>(new Gs2::UE5::Util::FGs2BasicReOpener())
);
Gs2::UE5::Core::Domain::FGs2DomainPtr Gs2;
{
const auto Future = Profile->Initialize();
Future->StartSynchronousTask();
if (!TestFalse(WHAT, Future->GetTask().IsError())) return false;
Gs2 = Future->GetTask().Result();
Future->EnsureCompletion();
}
// Up to this line is the initialization process.
{
const auto Domain = Gs2->Formation->Namespace(
"namespace-0001" // namespaceName
)->Me(
AccessToken
);
const auto It = Domain->PropertyForms( // formModelName
);
for (auto Item : *It)
{
}
}
ProfilePtr = std::make_shared<gs2::ez::Profile>(
TCHAR_TO_ANSI(*ClientId),
TCHAR_TO_ANSI(*ClientSecret),
gs2::ez::Gs2BasicReopener()
);
ClientPtr = std::make_shared<gs2::ez::Client>(
*ProfilePtr
);
ProfilePtr->initialize(
[this](gs2::ez::Profile::AsyncInitializeResult r)
{
if (r.getError())
{
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, "profile.initialize failed.");
}
else
{
AccountCreate();
}
}
);
// Up to this line is the initialization process.
ClientPtr->formation.describePropertyForms(
[](gs2::ez::account::AsyncEzDescribePropertyFormsResult r)
{
if (r.getError())
{
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, "formation.describePropertyForms failed.");
}
else
{
Items = r.getResult()->getItems();
NextPageToken = r.getResult()->getNextPageToken();
}
},
ProfilePtr->getGs2Session(),
TCHAR_TO_ANSI("namespace-0001"), // namespaceName
TCHAR_TO_ANSI("form-0001"), // formModelName
null // limit,
TCHAR_TO_ANSI(null) // pageToken
);
フォームの一覧を取得
Request
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32文字 | ネームスペース名 | |
formModelName | string | ✓ | ~ 128文字 | フォームの保存領域の名前 | |
accessToken | string | ✓ | ~ 128文字 | ユーザーID | |
pageToken | string | ~ 1024文字 | データの取得を開始する位置を指定するトークン | ||
limit | int | ✓ | 30 | 1 ~ 1000 | データの取得件数 |
Result
型 | 説明 | |
---|---|---|
items | List<EzPropertyForm> | フォームのリスト |
nextPageToken | string | リストの続きを取得するためのページトークン |
setPropertyForm
setPropertyForm
///////////////////////////////////////////////////////////////
// New Experience (Enabled UniTask)
///////////////////////////////////////////////////////////////
using Gs2.Unity.Util;
#if GS2_ENABLE_UNITASK
using Cysharp.Threading.Tasks;
using Cysharp.Threading.Tasks.Linq;
#endif
var profile = new Profile(
clientId: "your client id",
clientSecret: "your client secret",
reopener: new Gs2BasicReopener()
);
await profile.InitializeAsync();
var gs2 = new Gs2.Unity.Core.Gs2Domain(profile);
// Up to this line is the initialization process.
{
var domain = gs2.Formation.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).PropertyForm(
formModelName: "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();
}
///////////////////////////////////////////////////////////////
// New Experience
///////////////////////////////////////////////////////////////
using Gs2.Unity.Util;
var profile = new Profile(
clientId: "your client id",
clientSecret: "your client secret",
reopener: new Gs2BasicReopener()
);
var future = profile.Initialize();
yield return future;
if (future.Error != null)
{
onError.Invoke(future.Error, null);
yield break;
}
var gs2 = new Gs2.Unity.Core.Gs2Domain(profile);
// Up to this line is the initialization process.
{
var domain = gs2.Formation.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).PropertyForm(
formModelName: "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;
}
///////////////////////////////////////////////////////////////
// Legacy Experience
///////////////////////////////////////////////////////////////
using Gs2.Core.AsyncResult;
using Gs2.Gs2Account.Unity.Result;
using Gs2.Unity.Util;
var profile = new Profile(
clientId: "your client id",
clientSecret: "your client secret",
reopener: new Gs2BasicReopener()
);
{
AsyncResult<object> asyncResult = null;
var current = profile.Initialize(
r => { asyncResult = r; }
);
yield return current;
if (asyncResult.Error != null)
{
OnError(asyncResult.Error);
yield break;
}
}
var gs2 = new Gs2.Unity.Client(profile);
// Up to this line is the initialization process.
{
AsyncResult<EzSetPropertyFormResult> asyncResult = null;
var current = gs2.Formation.SetPropertyForm(
callback: r => { asyncResult = r; },
session: session,
namespaceName: "namespace-0001",
formModelName: "form-0001",
propertyId: "property-0001",
slots: new List<Gs2.Unity.Gs2Formation.Model.EzSlotWithSignature> {
{'name': 'slot-0001', 'propertyType': 'gs2_dictionary', 'body': 'body', 'signature': 'signature'}
},
keyId: "key-0001"
);
yield return current;
if (asyncResult.Error != null)
{
OnError(asyncResult.Error);
yield break;
}
var result = asyncResult.Result;
var item = result.Item;
var formModel = result.FormModel;
}
const auto Profile = MakeShared<Gs2::UE5::Util::FProfile>(
"your client id",
"your client secret",
Gs2::Core::Model::ERegion::ApNorthEast1,
MakeShareable<Gs2::UE5::Util::IReOpener>(new Gs2::UE5::Util::FGs2BasicReOpener())
);
Gs2::UE5::Core::Domain::FGs2DomainPtr Gs2;
{
const auto Future = Profile->Initialize();
Future->StartSynchronousTask();
if (!TestFalse(WHAT, Future->GetTask().IsError())) return false;
Gs2 = Future->GetTask().Result();
Future->EnsureCompletion();
}
// Up to this line is the initialization process.
{
const auto Domain = Gs2->Formation->Namespace(
"namespace-0001" // namespaceName
)->Me(
AccessToken
)->PropertyForm(
"form-0001", // formModelName
"property-0001" // propertyId
);
const auto Future = Domain->SetPropertyForm(
new Gs2.Unity.Gs2Formation.Model.EzSlotWithSignature[] {
new Gs2.Unity.Gs2Formation.Model.EzSlotWithSignature
{
Name = "slot-0001",
PropertyType = "gs2_dictionary",
Body = "body",
Signature = "signature",
},
},
"key-0001"
);
Future->StartSynchronousTask();
if (!TestFalse(WHAT, 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();
}
ProfilePtr = std::make_shared<gs2::ez::Profile>(
TCHAR_TO_ANSI(*ClientId),
TCHAR_TO_ANSI(*ClientSecret),
gs2::ez::Gs2BasicReopener()
);
ClientPtr = std::make_shared<gs2::ez::Client>(
*ProfilePtr
);
ProfilePtr->initialize(
[this](gs2::ez::Profile::AsyncInitializeResult r)
{
if (r.getError())
{
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, "profile.initialize failed.");
}
else
{
AccountCreate();
}
}
);
// Up to this line is the initialization process.
ClientPtr->formation.setPropertyFormWithSignature(
[](gs2::ez::account::AsyncEzSetPropertyFormWithSignatureResult r)
{
if (r.getError())
{
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, "formation.setPropertyFormWithSignature failed.");
}
else
{
Item = r.getResult()->getItem();
FormModel = r.getResult()->getFormModel();
}
},
ProfilePtr->getGs2Session(),
TCHAR_TO_ANSI("namespace-0001"), // namespaceName
TCHAR_TO_ANSI("form-0001"), // formModelName
TCHAR_TO_ANSI("property-0001"), // propertyId
new Gs2.Gs2Formation.Model.SlotWithSignature[] {
{'name': 'slot-0001', 'propertyType': 'gs2_dictionary', 'body': 'body', 'signature': 'signature'}
}, // slots
TCHAR_TO_ANSI("key-0001") // keyId
);
フォームを更新
Request
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32文字 | ネームスペース名 | |
formModelName | string | ✓ | ~ 128文字 | フォームの保存領域の名前 | |
accessToken | string | ✓ | ~ 128文字 | ユーザーID | |
propertyId | string | ✓ | ~ 1024文字 | プロパティID | |
slots | List<EzSlotWithSignature> | ✓ | スロットリスト | ||
keyId | string | ✓ | ~ 1024文字 | 暗号鍵GRN |
Result
型 | 説明 | |
---|---|---|
item | EzPropertyForm | フォーム |
formModel | EzFormModel | フォームモデル |