private void onShopEntryPurchased(Player player, ShopEntryInstance shopEntryInstance, ShopEntry shopEntry, ResourceType spentResource, double totalPrice, int purchaseCount) { string shopEntryId; string itemCategory = "vendor"; int repeatPurchase = 0; if (shopEntryInstance != null) { shopEntryId = shopEntryInstance.ShopEntryId; repeatPurchase = shopEntryInstance.NumTimesPurchased; if (shopEntryInstance.ShopEntry.Type == ShopEntryType.ReviveBundle) { this.sendCrmEvent(player, "crm_purchase_item_revive"); } } else { shopEntryId = shopEntry.Id; if (shopEntry.Type == ShopEntryType.ReviveBundle) { this.sendCrmEvent(player, "crm_purchase_item_revive"); } else if (shopEntry.Type == ShopEntryType.MegaBoxBundle) { itemCategory = "megabox"; purchaseCount = (int)ConfigShops.CalculateMegaBoxBundleSize(shopEntryId); } } this.sendPurchaseItemEvent(player, shopEntryId, itemCategory, spentResource, totalPrice, purchaseCount, repeatPurchase); this.sendCrmEvent(player, "crm_purchase_item_vendor"); }
private ShopPurchaseController createShopPurchaseController(ShopEntry shopEntry, ShopEntryInstance shopEntryInstance) { if (this.m_params.HasValue) { return(new ShopPurchaseController(shopEntry, shopEntryInstance, this.m_params.Value.PathToShop, this.m_params.Value.CloseCallback, this.m_params.Value.PurchaseCallback)); } return(new ShopPurchaseController(shopEntry, shopEntryInstance, PathToShopType.Vendor, new System.Action(this.onShopClosed), new Action <ShopEntry, PurchaseResult>(this.onShopPurchaseCompleted))); }