GS2-MegaField
GS2-SDK for Game Engine Reference
SDK for Game Engine
Models
EzAreaModel
Area divides space, and different areas can be treated as different spaces even if they have the same coordinates.
Type | Description | |
---|---|---|
name | string | Area Model Name |
metadata | string | metadata |
layerModels | List<EzLayerModel> | List of layer models |
EzLayerModel
Layers allow for multiple logical hierarchies within a single space.
For example, it solves the problem of an Enemy being invisible in a space with a large number of characters.
Characters are placed on Layer 1. If Enemies are placed on Layer 2, there is no need to worry about them becoming invisible, since each layer can specify the quantity to be acquired within a specified distance.
Type | Description | |
---|---|---|
name | string | Layer Model Name |
metadata | string | metadata |
EzMyPosition
My Location
Type | Description | |
---|---|---|
position | EzPosition | Position |
vector | EzVector | Vector |
r | float | Radius |
EzPosition
Position
Type | Description | |
---|---|---|
x | float | X position |
y | float | Y position |
z | float | Z position |
EzScope
Surroundings to be acquired
Type | Description | |
---|---|---|
r | float | Radius |
limit | int | Maximum number of result |
EzSpatial
Type | Description | |
---|---|---|
userId | string | User Id |
areaModelName | string | Area name |
layerModelName | string | Layer name |
position | EzPosition | Position |
vector | EzVector | Vector |
EzVector
Position
Type | Description | |
---|---|---|
x | float | X position |
y | float | Y position |
z | float | Z position |
Methods
describeAreaModels
describeAreaModels
///////////////////////////////////////////////////////////////
// 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.MegaField.Namespace(
namespaceName: "namespace-0001"
);
var items = await domain.AreaModelsAsync(
).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.MegaField.Namespace(
namespaceName: "namespace-0001"
);
var it = domain.AreaModels(
);
List<EzAreaModel> items = new List<EzAreaModel>();
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<EzDescribeAreaModelsResult> asyncResult = null;
var current = gs2.MegaField.DescribeAreaModels(
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->MegaField->Namespace(
"namespace-0001" // namespaceName
);
const auto It = Domain->AreaModels(
);
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->megaField.describeAreaModels(
[](gs2::ez::account::AsyncEzDescribeAreaModelsResult r)
{
if (r.getError())
{
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, "megaField.describeAreaModels failed.");
}
else
{
Items = r.getResult()->getItems();
}
},
TCHAR_TO_ANSI("namespace-0001") // namespaceName
);
Get list of Area Model
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32 chars | Namespace name |
Result
Type | Description | |
---|---|---|
items | List<EzAreaModel> | List of Area Models |
getAreaModel
getAreaModel
///////////////////////////////////////////////////////////////
// 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.MegaField.Namespace(
namespaceName: "namespace-0001"
).AreaModel(
areaModelName: "area-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.MegaField.Namespace(
namespaceName: "namespace-0001"
).AreaModel(
areaModelName: "area-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<EzGetAreaModelResult> asyncResult = null;
var current = gs2.MegaField.GetAreaModel(
callback: r => { asyncResult = r; },
namespaceName: "namespace-0001",
areaModelName: "area-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->MegaField->Namespace(
"namespace-0001" // namespaceName
)->AreaModel(
"area-0001" // areaModelName
);
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->megaField.getAreaModel(
[](gs2::ez::account::AsyncEzGetAreaModelResult r)
{
if (r.getError())
{
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, "megaField.getAreaModel failed.");
}
else
{
Item = r.getResult()->getItem();
}
},
TCHAR_TO_ANSI("namespace-0001"), // namespaceName
TCHAR_TO_ANSI("area-0001") // areaModelName
);
Get Area Model
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32 chars | Namespace name | |
areaModelName | string | ✓ | ~ 128 chars | Area Model Name |
Result
Type | Description | |
---|---|---|
item | EzAreaModel | Area Model |
describeLayerModels
describeLayerModels
///////////////////////////////////////////////////////////////
// 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.MegaField.Namespace(
namespaceName: "namespace-0001"
).AreaModel(
areaModelName: "area-0001"
);
var items = await domain.LayerModelsAsync(
).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.MegaField.Namespace(
namespaceName: "namespace-0001"
).AreaModel(
areaModelName: "area-0001"
);
var it = domain.LayerModels(
);
List<EzLayerModel> items = new List<EzLayerModel>();
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<EzDescribeLayerModelsResult> asyncResult = null;
var current = gs2.MegaField.DescribeLayerModels(
callback: r => { asyncResult = r; },
namespaceName: "namespace-0001",
areaModelName: "area-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->MegaField->Namespace(
"namespace-0001" // namespaceName
)->AreaModel(
"area-0001" // areaModelName
);
const auto It = Domain->LayerModels(
);
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->megaField.describeLayerModels(
[](gs2::ez::account::AsyncEzDescribeLayerModelsResult r)
{
if (r.getError())
{
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, "megaField.describeLayerModels failed.");
}
else
{
Items = r.getResult()->getItems();
}
},
TCHAR_TO_ANSI("namespace-0001"), // namespaceName
TCHAR_TO_ANSI("area-0001") // areaModelName
);
Get list of Layer Model
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32 chars | Namespace name | |
areaModelName | string | ✓ | ~ 128 chars | Area Model Name |
Result
Type | Description | |
---|---|---|
items | List<EzLayerModel> | List of Layer Model |
getLayerModel
getLayerModel
///////////////////////////////////////////////////////////////
// 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.MegaField.Namespace(
namespaceName: "namespace-0001"
).AreaModel(
areaModelName: "area-0001"
).LayerModel(
layerModelName: "layer-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.MegaField.Namespace(
namespaceName: "namespace-0001"
).AreaModel(
areaModelName: "area-0001"
).LayerModel(
layerModelName: "layer-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<EzGetLayerModelResult> asyncResult = null;
var current = gs2.MegaField.GetLayerModel(
callback: r => { asyncResult = r; },
namespaceName: "namespace-0001",
areaModelName: "area-0001",
layerModelName: "layer-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->MegaField->Namespace(
"namespace-0001" // namespaceName
)->AreaModel(
"area-0001" // areaModelName
)->LayerModel(
"layer-0001" // layerModelName
);
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->megaField.getLayerModel(
[](gs2::ez::account::AsyncEzGetLayerModelResult r)
{
if (r.getError())
{
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, "megaField.getLayerModel failed.");
}
else
{
Item = r.getResult()->getItem();
}
},
TCHAR_TO_ANSI("namespace-0001"), // namespaceName
TCHAR_TO_ANSI("area-0001"), // areaModelName
TCHAR_TO_ANSI("layer-0001") // layerModelName
);
Get Layer Model
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32 chars | Namespace name | |
areaModelName | string | ✓ | ~ 128 chars | Area Model Name | |
layerModelName | string | ✓ | ~ 128 chars | Layer Model Name |
Result
Type | Description | |
---|---|---|
item | EzLayerModel |
update
update
///////////////////////////////////////////////////////////////
// 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.MegaField.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Spatial(
areaModelName: "area-0001",
layerModelName: "layer-0001"
);
var result = await domain.UpdateAsync(
position: ,
scopes: null
);
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.MegaField.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Spatial(
areaModelName: "area-0001",
layerModelName: "layer-0001"
);
var future = domain.Update(
position: ,
scopes: null
);
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<EzUpdateResult> asyncResult = null;
var current = gs2.MegaField.Update(
callback: r => { asyncResult = r; },
session: session,
namespaceName: "namespace-0001",
areaModelName: "area-0001",
layerModelName: "layer-0001",
position: null,
scopes: null
);
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->MegaField->Namespace(
"namespace-0001" // namespaceName
)->Me(
AccessToken
)->Spatial(
"area-0001", // areaModelName
"layer-0001" // layerModelName
);
const auto Future = Domain->Update(
,
nullptr // scopes
);
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->megaField.action(
[](gs2::ez::account::AsyncEzActionResult r)
{
if (r.getError())
{
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, "megaField.action failed.");
}
else
{
Items = r.getResult()->getItems();
}
},
ProfilePtr->getGs2Session(),
TCHAR_TO_ANSI("namespace-0001"), // namespaceName
TCHAR_TO_ANSI("area-0001"), // areaModelName
TCHAR_TO_ANSI("layer-0001"), // layerModelName
null // position,
null // scopes
);
Send position
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32 chars | Namespace name | |
areaModelName | string | ✓ | ~ 128 chars | Area name | |
layerModelName | string | ✓ | ~ 128 chars | Layer name | |
position | EzMyPosition | ✓ | My Location | ||
scopes | List<EzScope> | List of Scope of acquisition by other players | |||
accessToken | string | ✓ | ~ 128 chars | User Id |
Result
Type | Description | |
---|---|---|
items | List<EzSpatial> | List of Spatial |