API Reference of GS2-Dictionary SDK for Game Engine
Model
EzEntryModel
The entry model is the entity to be recorded in the index.
This section defines what kind of entities can be recorded in the index.
| Type | Require | Default | Limitation | Description |
---|
name | string | ✓ | | ~ 128 chars | Entry Name |
metadata | string | | | ~ 2048 chars | metadata |
EzEntry
Entries obtained by game players
| Type | Require | Default | Limitation | Description |
---|
entryId | string | ✓ | | ~ 1024 chars | Entry GRN |
userId | string | ✓ | | ~ 128 chars | User Id |
name | string | ✓ | | ~ 128 chars | Entry Name |
acquiredAt | long | ✓ | Now | Date of acquisition | |
EzConfig
| Type | Require | Default | Limitation | Description |
---|
key | string | ✓ | | ~ 64 chars | Name |
value | string | | | ~ 51200 chars | Value |
Methods
getEntryModel
Get entry model information
Request
| Type | Require | Default | Limitation | Description |
---|
namespaceName | string | ✓ | | ~ 32 chars | Namespace name |
entryName | string | ✓ | | ~ 128 chars | Entry Name |
Result
Implementation Example
var domain = gs2.Dictionary.Namespace(
namespaceName: "namespace-0001"
).EntryModel(
entryName: "entry-0001"
);
var item = await domain.ModelAsync();
var domain = gs2.Dictionary.Namespace(
namespaceName: "namespace-0001"
).EntryModel(
entryName: "entry-0001"
);
var future = domain.Model();
yield return future;
var item = future.Result;
const auto Domain = Gs2->Dictionary->Namespace(
"namespace-0001" // namespaceName
)->EntryModel(
"entry-0001" // entryName
);
const auto item = Domain.Model();
listEntryModels
Get list of entry model information
Request
| Type | Require | Default | Limitation | Description |
---|
namespaceName | string | ✓ | | ~ 32 chars | Namespace name |
Result
Implementation Example
var domain = gs2.Dictionary.Namespace(
namespaceName: "namespace-0001"
);
var items = await domain.EntryModelsAsync(
).ToListAsync();
var domain = gs2.Dictionary.Namespace(
namespaceName: "namespace-0001"
);
var it = domain.EntryModels(
);
List<EzEntryModel> items = new List<EzEntryModel>();
while (it.HasNext())
{
yield return it.Next();
if (it.Error != null)
{
onError.Invoke(it.Error, null);
break;
}
if (it.Current != null)
{
items.Add(it.Current);
}
else
{
break;
}
}
const auto Domain = Gs2->Dictionary->Namespace(
"namespace-0001" // namespaceName
);
const auto It = Domain->EntryModels(
);
for (auto Item : *It)
{
}
getEntry
Get an entry
Request
| Type | Require | Default | Limitation | Description |
---|
namespaceName | string | ✓ | | ~ 32 chars | Namespace name |
accessToken | string | ✓ | | ~ 128 chars | User Id |
entryModelName | string | ✓ | | ~ 128 chars | Entry Name |
Result
Implementation Example
var domain = gs2.Dictionary.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Entry(
entryModelName: "entry-0001"
);
var item = await domain.ModelAsync();
var domain = gs2.Dictionary.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Entry(
entryModelName: "entry-0001"
);
var future = domain.Model();
yield return future;
var item = future.Result;
const auto Domain = Gs2->Dictionary->Namespace(
"namespace-0001" // namespaceName
)->Me(
AccessToken
)->Entry(
"entry-0001" // entryModelName
);
const auto item = Domain.Model();
getEntryWithSignature
Get entry with signature
Request
| Type | Require | Default | Limitation | Description |
---|
namespaceName | string | ✓ | | ~ 32 chars | Namespace name |
accessToken | string | ✓ | | ~ 128 chars | User Id |
entryModelName | string | ✓ | | ~ 128 chars | Entry Name |
keyId | string | ✓ | | ~ 1024 chars | encryption key GRN |
Result
| Type | Description |
---|
item | EzEntry | Entry |
body | string | Entry information for signature subject |
signature | string | signature |
Implementation Example
var domain = gs2.Dictionary.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Entry(
entryModelName: "entry-0001"
);
var result = await domain.GetEntryWithSignatureAsync(
keyId: "key-0001"
);
var item = await result.ModelAsync();
var body = result.Body;
var signature = result.Signature;
var domain = gs2.Dictionary.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Entry(
entryModelName: "entry-0001"
);
var future = domain.GetEntryWithSignature(
keyId: "key-0001"
);
yield return future;
if (future.Error != null)
{
onError.Invoke(future.Error, null);
yield break;
}
var future2 = future.Result.Model();
yield return future2;
if (future2.Error != null)
{
onError.Invoke(future2.Error, null);
yield break;
}
var result = future2.Result;
var body = future.Result.Body;
var signature = future.Result.Signature;
const auto Domain = Gs2->Dictionary->Namespace(
"namespace-0001" // namespaceName
)->Me(
AccessToken
)->Entry(
"entry-0001" // entryModelName
);
const auto Future = Domain->GetEntryWithSignature(
"key-0001"
);
Future->StartSynchronousTask();
if (Future->GetTask().IsError())
{
return false;
}
// obtain changed values / result values
const auto Future2 = Future->GetTask().Result()->Model();
Future2->StartSynchronousTask();
if (!TestFalse(WHAT, Future2->GetTask().IsError())) return false;
const auto Result = Future2->GetTask().Result();
const auto Body = Result->Body;
const auto Signature = Result->Signature;
listEntries
Get list of entries
Request
| Type | Require | Default | Limitation | Description |
---|
namespaceName | string | ✓ | | ~ 32 chars | Namespace name |
accessToken | string | ✓ | | ~ 128 chars | User Id |
limit | int | ✓ | 30 | 1 ~ 10000 | Number of data acquired |
pageToken | string | | | ~ 1024 chars | Token specifying the position from which to start acquiring data |
Result
| Type | Description |
---|
items | List<EzEntry> | List of Entries |
nextPageToken | string | Page token to retrieve the rest of the listing |
Implementation Example
var domain = gs2.Dictionary.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
);
var items = await domain.EntriesAsync(
).ToListAsync();
var domain = gs2.Dictionary.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
);
var it = domain.Entries(
);
List<EzEntry> items = new List<EzEntry>();
while (it.HasNext())
{
yield return it.Next();
if (it.Error != null)
{
onError.Invoke(it.Error, null);
break;
}
if (it.Current != null)
{
items.Add(it.Current);
}
else
{
break;
}
}
const auto Domain = Gs2->Dictionary->Namespace(
"namespace-0001" // namespaceName
)->Me(
AccessToken
);
const auto It = Domain->Entries(
);
for (auto Item : *It)
{
}