GS2-Dictionary SDK for Game Engine API Reference
Model
EzEntry
Entry acquired by game player
Represents a single dictionary entry that a game player has collected. Each entry corresponds to an EntryModel and records the acquisition timestamp. The possession state is binary—either the entry exists (collected) or it does not—with no concept of quantity.
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| entryId | string | * | ~ 1024 chars | Entry GRN * Set automatically by the server | ||
| userId | string | ~ 128 chars | User ID | |||
| name | string | ✓ | ~ 128 chars | Entry Model name Entry Model-specific name. Specified using alphanumeric characters, hyphen (-), underscore (_), and period (.). | ||
| acquiredAt | long | * | Now | Date of acquisition The timestamp when this entry was first collected by the game player. Automatically set to the current time at the moment of registration and cannot be modified afterwards. |
EzLike
Entry registered as a favorite
Represents a dictionary entry that a game player has marked as a favorite (liked). Allows players to bookmark specific entries in the dictionary for quick access. Each like references an EntryModel by name and is unique per user—the same entry cannot be liked twice.
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| likeId | string | * | ~ 1024 chars | Like Entry GRN * Set automatically by the server | ||
| userId | string | ~ 128 chars | User ID | |||
| name | string | ✓ | ~ 128 chars | Entry Model name Entry Model-specific name. Specified using alphanumeric characters, hyphen (-), underscore (_), and period (.). |
EzEntryModel
Entry Model
An Entry Model is master data that defines what can be recorded in the Dictionary within GS2-Dictionary. Each Entry Model represents a type of entity recorded in the Dictionary, such as monsters, items, or avatar parts.
The possession state of an entry is managed as a binary state—recorded or not recorded—and there is no concept of quantity or stacking for a single Entry Model.
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| name | string | ✓ | ~ 128 chars | Entry Model name | ||
| metadata | string | ~ 2048 chars | Metadata Arbitrary values can be set in the metadata. Since they do not affect GS2’s behavior, they can be used to store information used in the game. |
EzConfig
Configuration
A key-value pair applied to transaction variables during distributed transaction execution. Allows dynamic substitution of placeholder values in transaction parameters at runtime.
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| key | string | ✓ | ~ 64 chars | Name The variable name used as the placeholder key in transaction parameters. Must match the placeholder defined in the transaction template. | ||
| value | string | ~ 51200 chars | Value The value to substitute for the placeholder key at transaction execution time. This value replaces the corresponding placeholder in the transaction parameters. |
Methods
getEntryModel
Get a collectible item definition by name
Retrieves a single entry model by specifying its name. Use this to display the details of a specific collectible item, such as its description or metadata, when the player taps on an entry in the collection screen.
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| entryName | string | ✓ | ~ 128 chars | Entry Model name |
Result
| Type | Description | |
|---|---|---|
| item | EzEntryModel | Entry Model |
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.ModelFuture();
yield return future;
var item = future.Result; const auto Domain = Gs2->Dictionary->Namespace(
"namespace-0001" // namespaceName
)->EntryModel(
"entry-0001" // entryName
);
const auto Future = Domain->Model();
Future->StartSynchronousTask();
if (Future->GetTask().IsError())
{
return false;
}Value change event handling
var domain = gs2.Dictionary.Namespace(
namespaceName: "namespace-0001"
).EntryModel(
entryName: "entry-0001"
);
// Start event handling
var callbackId = domain.Subscribe(
value => {
// Called when the value changes
// The "value" is passed the value after the change.
}
);
// Stop event handling
domain.Unsubscribe(callbackId); var domain = gs2.Dictionary.Namespace(
namespaceName: "namespace-0001"
).EntryModel(
entryName: "entry-0001"
);
// Start event handling
var callbackId = domain.Subscribe(
value => {
// Called when the value changes
// The "value" is passed the value after the change.
}
);
// Stop event handling
domain.Unsubscribe(callbackId); const auto Domain = Gs2->Dictionary->Namespace(
"namespace-0001" // namespaceName
)->EntryModel(
"entry-0001" // entryName
);
// Start event handling
const auto CallbackId = Domain->Subscribe(
[](TSharedPtr<Gs2::Dictionary::Model::FEntryModel> value) {
// Called when the value changes
// The "value" is passed the value after the change.
}
);
// Stop event handling
Domain->Unsubscribe(CallbackId);Warning
This event is triggered when the value stored in the SDK’s local cache changes.
The local cache is updated only when executing the SDK’s API, or by executing stamp sheets via GS2-Distributor with GS2-Gateway notification enabled, or by executing a GS2-JobQueue with GS2-Gateway notification enabled.
Therefore, callbacks will not be invoked if the value is changed in any other way.
listEntryModels
Get a list of collectible item definitions
Retrieves all entry models (collectible item types) registered in this namespace. Entry models define the items that can appear in the player’s collection — for example, monsters in a bestiary, characters in an album, or achievements. Use this to display the full list of collectible items on a collection/encyclopedia screen.
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
Result
| Type | Description | |
|---|---|---|
| items | List<EzEntryModel> | List of Entry Models |
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(
);
TArray<Gs2::UE5::Dictionary::Model::FEzEntryModelPtr> Result;
for (auto Item : *It)
{
if (Item.IsError())
{
return false;
}
Result.Add(Item.Current());
}Value change event handling
var domain = gs2.Dictionary.Namespace(
namespaceName: "namespace-0001"
);
// Start event handling
var callbackId = domain.SubscribeEntryModels(
() => {
// Called when an element of the list changes.
}
);
// Stop event handling
domain.UnsubscribeEntryModels(callbackId); var domain = gs2.Dictionary.Namespace(
namespaceName: "namespace-0001"
);
// Start event handling
var callbackId = domain.SubscribeEntryModels(
() => {
// Called when an element of the list changes.
}
);
// Stop event handling
domain.UnsubscribeEntryModels(callbackId); const auto Domain = Gs2->Dictionary->Namespace(
"namespace-0001" // namespaceName
);
// Start event handling
const auto CallbackId = Domain->SubscribeEntryModels(
[]() {
// Called when an element of the list changes.
}
);
// Stop event handling
Domain->UnsubscribeEntryModels(CallbackId);Warning
This event is triggered when the value stored in the SDK’s local cache changes.
The local cache is updated only when executing the SDK’s API, or by executing stamp sheets via GS2-Distributor with GS2-Gateway notification enabled, or by executing a GS2-JobQueue with GS2-Gateway notification enabled.
Therefore, callbacks will not be invoked if the value is changed in any other way.
getEntry
Check if the player has collected a specific entry
Checks whether the player has obtained a specific collectible item by specifying the entry model name. Use this to show a “collected” or “not yet collected” status on the detail screen of a collection item.
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| gameSession | GameSession | ✓ | GameSession | |||
| entryModelName | string | ✓ | ~ 128 chars | Entry Model name Entry Model-specific name. Specified using alphanumeric characters, hyphen (-), underscore (_), and period (.). |
Result
| Type | Description | |
|---|---|---|
| item | EzEntry | Entry |
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.ModelFuture();
yield return future;
var item = future.Result; const auto Domain = Gs2->Dictionary->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
)->Entry(
"entry-0001" // entryModelName
);
const auto Future = Domain->Model();
Future->StartSynchronousTask();
if (Future->GetTask().IsError())
{
return false;
}Value change event handling
var domain = gs2.Dictionary.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Entry(
entryModelName: "entry-0001"
);
// Start event handling
var callbackId = domain.Subscribe(
value => {
// Called when the value changes
// The "value" is passed the value after the change.
}
);
// Stop event handling
domain.Unsubscribe(callbackId); var domain = gs2.Dictionary.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Entry(
entryModelName: "entry-0001"
);
// Start event handling
var callbackId = domain.Subscribe(
value => {
// Called when the value changes
// The "value" is passed the value after the change.
}
);
// Stop event handling
domain.Unsubscribe(callbackId); const auto Domain = Gs2->Dictionary->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
)->Entry(
"entry-0001" // entryModelName
);
// Start event handling
const auto CallbackId = Domain->Subscribe(
[](TSharedPtr<Gs2::Dictionary::Model::FEntry> value) {
// Called when the value changes
// The "value" is passed the value after the change.
}
);
// Stop event handling
Domain->Unsubscribe(CallbackId);Warning
This event is triggered when the value stored in the SDK’s local cache changes.
The local cache is updated only when executing the SDK’s API, or by executing stamp sheets via GS2-Distributor with GS2-Gateway notification enabled, or by executing a GS2-JobQueue with GS2-Gateway notification enabled.
Therefore, callbacks will not be invoked if the value is changed in any other way.
getEntryWithSignature
Get an entry with a tamper-proof signature
Retrieves an entry along with a cryptographic signature that proves the data has not been tampered with. This is useful when you need to verify on an external server that the player really owns a specific collection entry — for example, to grant rewards based on collection progress through a custom server.
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| gameSession | GameSession | ✓ | GameSession | |||
| entryModelName | string | ✓ | ~ 128 chars | Entry Model name Entry Model-specific name. Specified using alphanumeric characters, hyphen (-), underscore (_), and period (.). | ||
| keyId | string | “grn:gs2:{region}:{ownerId}:key:default:key:default” | ~ 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.GetEntryWithSignatureFuture(
keyId: "key-0001"
);
yield return future;
if (future.Error != null)
{
onError.Invoke(future.Error, null);
yield break;
}
var future2 = future.Result.ModelFuture();
yield return future2;
if (future2.Error != null)
{
onError.Invoke(future2.Error, null);
yield break;
}
var result = future2.Result;
var body = future.Result.Body;
var signature = future.Result.Signature; const auto Domain = Gs2->Dictionary->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
)->Entry(
"entry-0001" // entryModelName
);
const auto Future = Domain->GetEntryWithSignature(
"key-0001" // keyId
);
Future->StartSynchronousTask();
if (Future->GetTask().IsError())
{
return false;
}
// obtain changed values / result values
const auto Future2 = Future->GetTask().Result()->Model();
Future2->StartSynchronousTask();
if (Future2->GetTask().IsError())
{
return Future2->GetTask().Error();
}
const auto Result = Future2->GetTask().Result();
const auto Body = Result->Body;
const auto Signature = Result->Signature;listEntries
Get a list of the player’s collected entries
Retrieves the list of entries (collectible items) that the player has obtained so far. Use this to build a collection/encyclopedia screen showing which items the player has unlocked. By comparing this list with the full entry model list, you can show collected vs. uncollected items.
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| gameSession | GameSession | ✓ | GameSession | |||
| limit | int | 30 | 1 ~ 10000 | Number of data items to retrieve | ||
| 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(
GameSession
);
const auto It = Domain->Entries(
);
TArray<Gs2::UE5::Dictionary::Model::FEzEntryPtr> Result;
for (auto Item : *It)
{
if (Item.IsError())
{
return false;
}
Result.Add(Item.Current());
}Value change event handling
var domain = gs2.Dictionary.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
);
// Start event handling
var callbackId = domain.SubscribeEntries(
() => {
// Called when an element of the list changes.
}
);
// Stop event handling
domain.UnsubscribeEntries(callbackId); var domain = gs2.Dictionary.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
);
// Start event handling
var callbackId = domain.SubscribeEntries(
() => {
// Called when an element of the list changes.
}
);
// Stop event handling
domain.UnsubscribeEntries(callbackId); const auto Domain = Gs2->Dictionary->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
);
// Start event handling
const auto CallbackId = Domain->SubscribeEntries(
[]() {
// Called when an element of the list changes.
}
);
// Stop event handling
Domain->UnsubscribeEntries(CallbackId);Warning
This event is triggered when the value stored in the SDK’s local cache changes.
The local cache is updated only when executing the SDK’s API, or by executing stamp sheets via GS2-Distributor with GS2-Gateway notification enabled, or by executing a GS2-JobQueue with GS2-Gateway notification enabled.
Therefore, callbacks will not be invoked if the value is changed in any other way.
addLikes
Add entries to favorites
Marks one or more entries as favorites for the player. You can specify multiple entry names at once to batch-add favorites. If an entry is already in the favorites list, it is simply skipped (no error). Use this when the player taps a “favorite” button on the collection screen.
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| gameSession | GameSession | ✓ | GameSession | |||
| entryModelNames | List<string> | [] | 0 ~ 100 items | List of Entry Model names |
Result
| Type | Description | |
|---|---|---|
| items | List<EzLike> | List of Added Likes |
Implementation Example
var domain = gs2.Dictionary.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
);
var result = await domain.AddLikesAsync(
entryModelNames: new List<string> {
"entry-0001",
"entry-0002",
"entry-0003",
}
);
var item = await result.ModelAsync(); var domain = gs2.Dictionary.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
);
var future = domain.AddLikesFuture(
entryModelNames: new List<string> {
"entry-0001",
"entry-0002",
"entry-0003",
}
);
yield return future;
if (future.Error != null)
{
onError.Invoke(future.Error, null);
yield break;
}
var future2 = future.Result.ModelFuture();
yield return future2;
if (future2.Error != null)
{
onError.Invoke(future2.Error, null);
yield break;
}
var result = future2.Result; const auto Domain = Gs2->Dictionary->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
);
const auto Future = Domain->AddLikes(
[]
{
auto v = TOptional<TArray<FString>>();
v->Add("entry-0001");
v->Add("entry-0002");
v->Add("entry-0003");
return v;
}() // entryModelNames
);
Future->StartSynchronousTask();
if (Future->GetTask().IsError())
{
return false;
}
// obtain changed values / result values
const auto Future2 = Future->GetTask().Result()->Model();
Future2->StartSynchronousTask();
if (Future2->GetTask().IsError())
{
return Future2->GetTask().Error();
}
const auto Result = Future2->GetTask().Result();deleteLikes
Remove entries from favorites
Removes one or more entries from the player’s favorites list. You can specify multiple entry names at once to batch-remove favorites. Use this when the player taps a “remove from favorites” button on the collection screen. The collection status of the entries is not affected — they remain collected.
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| gameSession | GameSession | ✓ | GameSession | |||
| entryModelNames | List<string> | [] | 0 ~ 100 items | List of Entry Model names |
Result
| Type | Description | |
|---|---|---|
| items | List<EzLike> | List of Deleted Likes |
Implementation Example
var domain = gs2.Dictionary.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
);
var result = await domain.DeleteLikesAsync(
entryModelNames: new List<string> {
"entry-0001",
"entry-0002",
"entry-0003",
}
); var domain = gs2.Dictionary.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
);
var future = domain.DeleteLikesFuture(
entryModelNames: new List<string> {
"entry-0001",
"entry-0002",
"entry-0003",
}
);
yield return future;
if (future.Error != null)
{
onError.Invoke(future.Error, null);
yield break;
} const auto Domain = Gs2->Dictionary->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
);
const auto Future = Domain->DeleteLikes(
[]
{
auto v = TOptional<TArray<FString>>();
v->Add("entry-0001");
v->Add("entry-0002");
v->Add("entry-0003");
return v;
}() // entryModelNames
);
Future->StartSynchronousTask();
if (Future->GetTask().IsError())
{
return false;
}
const auto Result = Future->GetTask().Result();getLike
Check if a specific entry is favorited
Checks whether the player has marked a specific entry as a favorite. Use this to show a “favorited” icon or highlight on the detail screen of a collection item.
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| gameSession | GameSession | ✓ | GameSession | |||
| entryModelName | string | ✓ | ~ 128 chars | Entry Model name Entry Model-specific name. Specified using alphanumeric characters, hyphen (-), underscore (_), and period (.). |
Result
| Type | Description | |
|---|---|---|
| item | EzLike | Like Entry |
Implementation Example
var domain = gs2.Dictionary.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Like(
entryModelName: "entry-0001"
);
var item = await domain.ModelAsync(); var domain = gs2.Dictionary.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Like(
entryModelName: "entry-0001"
);
var future = domain.ModelFuture();
yield return future;
var item = future.Result; const auto Domain = Gs2->Dictionary->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
)->Like(
"entry-0001" // entryModelName
);
const auto Future = Domain->Model();
Future->StartSynchronousTask();
if (Future->GetTask().IsError())
{
return false;
}Value change event handling
var domain = gs2.Dictionary.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Like(
entryModelName: "entry-0001"
);
// Start event handling
var callbackId = domain.Subscribe(
value => {
// Called when the value changes
// The "value" is passed the value after the change.
}
);
// Stop event handling
domain.Unsubscribe(callbackId); var domain = gs2.Dictionary.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Like(
entryModelName: "entry-0001"
);
// Start event handling
var callbackId = domain.Subscribe(
value => {
// Called when the value changes
// The "value" is passed the value after the change.
}
);
// Stop event handling
domain.Unsubscribe(callbackId); const auto Domain = Gs2->Dictionary->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
)->Like(
"entry-0001" // entryModelName
);
// Start event handling
const auto CallbackId = Domain->Subscribe(
[](TSharedPtr<Gs2::Dictionary::Model::FLike> value) {
// Called when the value changes
// The "value" is passed the value after the change.
}
);
// Stop event handling
Domain->Unsubscribe(CallbackId);Warning
This event is triggered when the value stored in the SDK’s local cache changes.
The local cache is updated only when executing the SDK’s API, or by executing stamp sheets via GS2-Distributor with GS2-Gateway notification enabled, or by executing a GS2-JobQueue with GS2-Gateway notification enabled.
Therefore, callbacks will not be invoked if the value is changed in any other way.
listLikes
Get a list of the player’s favorite entries
Retrieves the list of entries that the player has marked as favorites. Favorites are managed separately from collection — even if an entry is collected, it is not automatically favorited. Use this to display a “favorites” tab in the collection screen, letting the player quickly access the items they care about.
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| gameSession | GameSession | ✓ | GameSession | |||
| limit | int | 30 | 1 ~ 1000 | Number of data items to retrieve | ||
| pageToken | string | ~ 1024 chars | Token specifying the position from which to start acquiring data |
Result
| Type | Description | |
|---|---|---|
| items | List<EzLike> | List of Likes |
| 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.LikesAsync(
).ToListAsync(); var domain = gs2.Dictionary.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
);
var it = domain.Likes(
);
List<EzLike> items = new List<EzLike>();
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(
GameSession
);
const auto It = Domain->Likes(
);
TArray<Gs2::UE5::Dictionary::Model::FEzLikePtr> Result;
for (auto Item : *It)
{
if (Item.IsError())
{
return false;
}
Result.Add(Item.Current());
}Value change event handling
var domain = gs2.Dictionary.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
);
// Start event handling
var callbackId = domain.SubscribeLikes(
() => {
// Called when an element of the list changes.
}
);
// Stop event handling
domain.UnsubscribeLikes(callbackId); var domain = gs2.Dictionary.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
);
// Start event handling
var callbackId = domain.SubscribeLikes(
() => {
// Called when an element of the list changes.
}
);
// Stop event handling
domain.UnsubscribeLikes(callbackId); const auto Domain = Gs2->Dictionary->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
);
// Start event handling
const auto CallbackId = Domain->SubscribeLikes(
[]() {
// Called when an element of the list changes.
}
);
// Stop event handling
Domain->UnsubscribeLikes(CallbackId);Warning
This event is triggered when the value stored in the SDK’s local cache changes.
The local cache is updated only when executing the SDK’s API, or by executing stamp sheets via GS2-Distributor with GS2-Gateway notification enabled, or by executing a GS2-JobQueue with GS2-Gateway notification enabled.
Therefore, callbacks will not be invoked if the value is changed in any other way.