API Reference of GS2-Showcase SDK for Game Engine

Model

EzSalesItem

Showcase

Set the price required to purchase the product and the reward earned for the purchase of the product.

TypeRequireDefaultLimitationDescription
namestring~ 128 charsProduct Name
metadatastring~ 2048 charsmetadata
consumeActionsList<EzConsumeAction>~ 10 itemsList of Consumption Action
acquireActionsList<EzAcquireAction>1 ~ 100 itemsList of Acquire Action

EzSalesItemGroup

Product Group

A product group is an entity for display on a showcase. The first product that is determined to be available for purchase is actually displayed on the shelves. This can be used for products that are discounted only for the first time, or for a system in which the contents of products change depending on the number of times they are purchased, such as a step-up gacha.

TypeRequireDefaultLimitationDescription
namestring~ 128 charsProduct Group Name
metadatastring~ 2048 charsmetadata
salesItemsList<EzSalesItem>2 ~ 10 itemsProducts to be included in the product group

EzShowcase

Showcase

The sales period can be set for the display shelf.

TypeRequireDefaultLimitationDescription
namestring~ 128 charsShowcase Name
metadatastring~ 2048 charsmetadata
displayItemsList<EzDisplayItem>1 ~ 1000 itemsList of Products on display

EzDisplayItem

Displayed Item

TypeRequireDefaultLimitationDescription
displayItemIdstringUUID~ 128 charsDisplayed Item ID
typeenum [‘salesItem’, ‘salesItemGroup’]~ 128 charsType
salesItemEzSalesItem{type} == “salesItem”Products to be displayed
salesItemGroupEzSalesItemGroup{type} == “salesItemGroup”Product group to be displayed

EzRandomDisplayItem

Random displayable items on the Random Showcase

TypeRequireDefaultLimitationDescription
namestringUUID~ 128 charsRandom Displayed Item ID
metadatastring~ 2048 charsmetadata
consumeActionsList<EzConsumeAction>~ 10 itemsList of Consumption Action
acquireActionsList<EzAcquireAction>1 ~ 100 itemsList of Acquire Action
currentPurchaseCountint1 ~ 2147483646Current purchase count
maximumPurchaseCountint1 ~ 2147483646Maximum purchase count

EzConfig

TypeRequireDefaultLimitationDescription
keystring~ 64 charsName
valuestring~ 51200 charsValue

EzConsumeAction

TypeRequireDefaultLimitationDescription
actionenum []~ 128 charsTypes of actions to be performed in the stamp task
requeststring~ 1048576 charsJSON of the obtain request

EzAcquireAction

TypeRequireDefaultLimitationDescription
actionenum []~ 128 charsTypes of actions to be performed in the stamp sheet
requeststring~ 1048576 charsJSON of request

Methods

buy

Buy Product

Request

TypeRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
showcaseNamestring~ 128 charsShowcase Name
accessTokenstring~ 128 charsUser Id
displayItemIdstringUUID~ 128 charsDisplayed Item ID
quantityint11 ~ 1000Purchase Quantity
configList<EzConfig>[]~ 32 itemsSet values to be applied to stamp sheet variables

Result

TypeDescription
itemEzSalesItemProduct
transactionIdstringTransaction ID of the stamp sheet issued
stampSheetstringStamp sheets used to execute the purchase process
stampSheetEncryptionKeyIdstringCryptographic key GRN used for stamp sheet signature calculations
autoRunStampSheetboolIs stamp sheet auto-execution enabled?

Implementation Example

    var domain = gs2.Showcase.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).Showcase(
        showcaseName: "showcase-0001"
    ).DisplayItem(
        displayItemId: "display-item-0001"
    );
    var result = await domain.BuyAsync(
        quantity: null,
        config: null
    );
    // New Experience ではスタンプシートはSDKレベルで自動的に実行されます。
    // エラーが発生すると TransactionException がスローされます。
    // TransactionException::Retry() でリトライが可能です。
    // In New Experience, stamp sheets are automatically executed at the SDK level.
    // If an error occurs, a TransactionException is thrown.
    // you can retry with TransactionException::Retry().
    var domain = gs2.Showcase.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).Showcase(
        showcaseName: "showcase-0001"
    ).DisplayItem(
        displayItemId: "display-item-0001"
    );
    var future = domain.BuyFuture(
        quantity: null,
        config: null
    );
    yield return future;
    if (future.Error != null)
    {
        onError.Invoke(future.Error, null);
        yield break;
    }
    // New Experience ではスタンプシートはSDKレベルで自動的に実行されます。
    // エラーが発生すると TransactionException がスローされます。
    // TransactionException::Retry() でリトライが可能です。
    // In New Experience, stamp sheets are automatically executed at the SDK level.
    // If an error occurs, a TransactionException is thrown.
    // you can retry with TransactionException::Retry().
    const auto Domain = Gs2->Showcase->Namespace(
        "namespace-0001" // namespaceName
    )->Me(
        AccessToken
    )->Showcase(
        "showcase-0001" // showcaseName
    )->DisplayItem(
        "display-item-0001" // displayItemId
    );
    const auto Future = Domain->Buy(
        nullptr, // quantity
        nullptr // config
    );
    Future->StartSynchronousTask();
    if (Future->GetTask().IsError())
    {
        return false;
    }

getShowcase

Retrieve showcase

Request

TypeRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
accessTokenstring~ 128 charsUser Id
showcaseNamestring~ 128 charsShowcase Name

Result

TypeDescription
itemEzShowcaseShowcase

Implementation Example

    var domain = gs2.Showcase.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).Showcase(
        showcaseName: "showcase-0001"
    );
    var item = await domain.ModelAsync();
    var domain = gs2.Showcase.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).Showcase(
        showcaseName: "showcase-0001"
    );
    var future = domain.Model();
    yield return future;
    var item = future.Result;
    const auto Domain = Gs2->Showcase->Namespace(
        "namespace-0001" // namespaceName
    )->Me(
        AccessToken
    )->Showcase(
        "showcase-0001" // showcaseName
    );
    const auto Future = Domain.Model();
    Future->StartSynchronousTask();
    if (Future->GetTask().IsError())
    {
        return false;
    }
Value change event handling
    var domain = gs2.Showcase.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).Showcase(
        showcaseName: "showcase-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.Showcase.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).Showcase(
        showcaseName: "showcase-0001"
    );
    var future = domain.Model();
    yield return future;
    var item = future.Result;
    const auto Domain = Gs2->Showcase->Namespace(
        "namespace-0001" // namespaceName
    )->Me(
        AccessToken
    )->Showcase(
        "showcase-0001" // showcaseName
    );
    
    // Start event handling
    const auto CallbackId = Domain->Subscribe(
        [](TSharedPtr<Gs2::Showcase::Model::FShowcase> value) {
            // Called when the value changes
            // The "value" is passed the value after the change.
        }
    );

    // Stop event handling
    Domain->Unsubscribe(CallbackId);

getRandomShowcaseDisplayItem

Get random showcase display item

Request

TypeRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
accessTokenstring~ 128 charsUser Id
showcaseNamestring~ 128 charsRandom Showcase Name
displayItemNamestringUUID~ 128 charsRandom Displayed Item ID

Result

TypeDescription
itemEzRandomDisplayItemDisplayed item

Implementation Example

    var domain = gs2.Showcase.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).RandomShowcase(
        showcaseName: "showcase-0001"
    ).RandomDisplayItem(
        displayItemName: "display-item-0001"
    );
    var item = await domain.ModelAsync();
    var domain = gs2.Showcase.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).RandomShowcase(
        showcaseName: "showcase-0001"
    ).RandomDisplayItem(
        displayItemName: "display-item-0001"
    );
    var future = domain.Model();
    yield return future;
    var item = future.Result;
    const auto Domain = Gs2->Showcase->Namespace(
        "namespace-0001" // namespaceName
    )->Me(
        AccessToken
    )->RandomShowcase(
        "showcase-0001" // showcaseName
    )->RandomDisplayItem(
        "display-item-0001" // displayItemName
    );
    const auto Future = Domain.Model();
    Future->StartSynchronousTask();
    if (Future->GetTask().IsError())
    {
        return false;
    }
Value change event handling
    var domain = gs2.Showcase.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).RandomShowcase(
        showcaseName: "showcase-0001"
    ).RandomDisplayItem(
        displayItemName: "display-item-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.Showcase.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).RandomShowcase(
        showcaseName: "showcase-0001"
    ).RandomDisplayItem(
        displayItemName: "display-item-0001"
    );
    var future = domain.Model();
    yield return future;
    var item = future.Result;
    const auto Domain = Gs2->Showcase->Namespace(
        "namespace-0001" // namespaceName
    )->Me(
        AccessToken
    )->RandomShowcase(
        "showcase-0001" // showcaseName
    )->RandomDisplayItem(
        "display-item-0001" // displayItemName
    );
    
    // Start event handling
    const auto CallbackId = Domain->Subscribe(
        [](TSharedPtr<Gs2::Showcase::Model::FRandomDisplayItem> value) {
            // Called when the value changes
            // The "value" is passed the value after the change.
        }
    );

    // Stop event handling
    Domain->Unsubscribe(CallbackId);

listRandomShowcaseDisplayItems

Retrieve random showcase display items

Request

TypeRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
accessTokenstring~ 128 charsUser Id
showcaseNamestring~ 128 charsRandom Showcase Name

Result

TypeDescription
itemsList<EzRandomDisplayItem>Displayed items

Implementation Example

    var domain = gs2.Showcase.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).RandomShowcase(
        showcaseName: "showcase-0001"
    );
    var items = await domain.RandomDisplayItemsAsync(
    ).ToListAsync();
    var domain = gs2.Showcase.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).RandomShowcase(
        showcaseName: "showcase-0001"
    );
    var it = domain.RandomDisplayItems(
    );
    List<EzRandomDisplayItem> items = new List<EzRandomDisplayItem>();
    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->Showcase->Namespace(
        "namespace-0001" // namespaceName
    )->Me(
        AccessToken
    )->RandomShowcase(
        "showcase-0001" // showcaseName
    );
    const auto It = Domain->RandomDisplayItems(
    );
    for (auto Item : *It)
    {

    }
Value change event handling
    var domain = gs2.Showcase.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).RandomShowcase(
        showcaseName: "showcase-0001"
    );
    
    // Start event handling
    var callbackId = domain.SubscribeRandomDisplayItems(
        () => {
            // Called when an element of the list changes.
        }
    );

    // Stop event handling
    domain.UnsubscribeRandomDisplayItems(callbackId);
    var domain = gs2.Showcase.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).RandomShowcase(
        showcaseName: "showcase-0001"
    );
    var it = domain.RandomDisplayItems(
    );
    List<EzRandomDisplayItem> items = new List<EzRandomDisplayItem>();
    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->Showcase->Namespace(
        "namespace-0001" // namespaceName
    )->Me(
        AccessToken
    )->RandomShowcase(
        "showcase-0001" // showcaseName
    );
    
    // Start event handling
    const auto CallbackId = Domain->SubscribeRandomDisplayItems(
        []() {
            // Called when an element of the list changes.
        }
    );

    // Stop event handling
    Domain->UnsubscribeRandomDisplayItems(CallbackId);

randomShowcaseBuy

Buy Product from random showcase

Request

TypeRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
showcaseNamestring~ 128 charsRandom Showcase Name
accessTokenstring~ 128 charsUser Id
displayItemNamestringUUID~ 128 charsRandom Displayed Item ID
quantityint11 ~ 1000Purchase Quantity
configList<EzConfig>[]~ 32 itemsSet values to be applied to stamp sheet variables

Result

TypeDescription
itemEzRandomDisplayItemDisplayed item
transactionIdstringTransaction ID of the stamp sheet issued
stampSheetstringStamp sheets used to execute the purchase process
stampSheetEncryptionKeyIdstringCryptographic key GRN used for stamp sheet signature calculations
autoRunStampSheetboolIs stamp sheet auto-execution enabled?

Implementation Example

    var domain = gs2.Showcase.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).RandomShowcase(
        showcaseName: "showcase-0001"
    ).RandomDisplayItem(
        displayItemName: "display-item-0001"
    );
    var result = await domain.RandomShowcaseBuyAsync(
        quantity: 1,
        config: null
    );
    // New Experience ではスタンプシートはSDKレベルで自動的に実行されます。
    // エラーが発生すると TransactionException がスローされます。
    // TransactionException::Retry() でリトライが可能です。
    // In New Experience, stamp sheets are automatically executed at the SDK level.
    // If an error occurs, a TransactionException is thrown.
    // you can retry with TransactionException::Retry().
    var domain = gs2.Showcase.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).RandomShowcase(
        showcaseName: "showcase-0001"
    ).RandomDisplayItem(
        displayItemName: "display-item-0001"
    );
    var future = domain.RandomShowcaseBuyFuture(
        quantity: 1,
        config: null
    );
    yield return future;
    if (future.Error != null)
    {
        onError.Invoke(future.Error, null);
        yield break;
    }
    // New Experience ではスタンプシートはSDKレベルで自動的に実行されます。
    // エラーが発生すると TransactionException がスローされます。
    // TransactionException::Retry() でリトライが可能です。
    // In New Experience, stamp sheets are automatically executed at the SDK level.
    // If an error occurs, a TransactionException is thrown.
    // you can retry with TransactionException::Retry().
    const auto Domain = Gs2->Showcase->Namespace(
        "namespace-0001" // namespaceName
    )->Me(
        AccessToken
    )->RandomShowcase(
        "showcase-0001" // showcaseName
    )->RandomDisplayItem(
        "display-item-0001" // displayItemName
    );
    const auto Future = Domain->RandomShowcaseBuy(
        1, // quantity
        nullptr // config
    );
    Future->StartSynchronousTask();
    if (Future->GetTask().IsError())
    {
        return false;
    }