Esempio n. 1
0
        private bool onStats(CatalogServiceEvents.UserStatsRetrievedEvent evt)
        {
            List <CatalogItemData> currentItems    = evt.Response.currentItems;
            CatalogItemData        mostPopularItem = evt.Response.mostPopularItem;
            long             totalItemsPurchased   = evt.Response.totalItemsPurchased;
            long             totalItemsSold        = evt.Response.totalItemsSold;
            CatalogStats     catalogStats          = new CatalogStats(mostPopularItem, currentItems, totalItemsPurchased, totalItemsSold);
            CatalogCacheData cacheDataById         = cache.GetCacheDataById("catalogStatsCacheId");

            cacheDataById.Data      = catalogStats;
            cacheDataById.CacheTime = 0;
            cache.SetCatalogCacheData("catalogStatsCacheId", cacheDataById);
            Service.Get <EventDispatcher>().DispatchEvent(new CatalogServiceProxyEvents.StatsReponse(catalogStats));
            return(false);
        }
 private void onPlayerCatalogStatsResponse(GetUserStatsOperation operation, HttpResponse response)
 {
     CatalogServiceEvents.UserStatsRetrievedEvent evt = new CatalogServiceEvents.UserStatsRetrievedEvent(operation.Response);
     Service.Get <EventDispatcher>().DispatchEvent(evt);
 }