Skip to content

Stratkit Web API Shop For Gold

Data model for the "shop for gold" offers — the offers that are bought with in-game gold rather than with money/real currency.

It issues the same getOffers web-backend call as the regular shop, with the extra forGoldShop=1 property, and parses the response into its own set of ECS components.

Usage

ShopForGoldModule must be registered in the persistent world, because getOffers is a web-backend (notypo) call.

The usage mimics the one of the existing shop, so its workflow is symmetric. The request is a separate one from the regular shop, independent from it.

For an explicit refresh:

ShopForGoldUtils.IssueGetOffersForGoldRequest(scope);

Read the result:

_goldOffersQuery = new EntityQueryBuilder(Allocator.Temp)
    .WithAll<GoldShopOfferTag, GoldShopOfferIdComponent>()
    .Build(persistentWorld.EntityManager);

A GoldShopOffersUpdatedTag entity is created once a batch finishes parsing. Consumers react to it and destroy it, the same way ShopRefreshOffersTag works for the money shop. Each successful response replaces the previous batch, so requests cannot accumulate duplicates.

Request properties

Same shape as the regular shop call, with forGoldShop instead of forCountry. No offer chain requests.