Beispiel #1
0
        public override BuyItemResult OnBuyItem(int itemId, string authToken, UberStrikeCurrencyType currencyType, BuyingDurationType durationType, UberStrikeItemType itemType, BuyingLocationType marketLocation, BuyingRecommendationType recommendationType)
        {
            var member = Context.Users.GetMember(authToken);

            if (member == null)
            {
                Log.Error("An unidentified AuthToken was passed.");
                return(BuyItemResult.InvalidData);
            }

            var cmid      = member.PublicProfile.Cmid;
            var inventory = Context.Users.Db.Inventories.Load(member.PublicProfile.Cmid);

            inventory.Add(new ItemInventoryView(itemId, null, -1, cmid));

            Context.Users.Db.Inventories.Save(cmid, inventory);
            return(BuyItemResult.OK);
        }
 public abstract BuyItemResult OnBuyItem(int itemId, string authToken, UberStrikeCurrencyType currencyType, BuyingDurationType durationType, UberStrikeItemType itemType, BuyingLocationType marketLocation, BuyingRecommendationType recommendationType);