public void OnMintBuyShopSlot(object response) { logger.Debug($"OnMintBuyShopSlot UserID={UID}"); var shopSlot = processShopSlot; if (shopSlot == null) { logger.Error($"OnMintBuyShopSlot shopSlot is null UserID={UID}"); return; } shopSlot.OnBuy(response, this); stateType = UserStateType.None; processShopSlot = null; }
public override ConsumeState Consume(Resource.PriceType priceType, Int64 priceValue, string walletaddr, UserStateType userStateType, ShopSlot shopSlot) { if (!CheckConsume(priceType, priceValue)) { return(ConsumeState.ConsumeState_Falied); } if (priceValue == 0) { return(ConsumeState.ConsumeState_Done); } SetPrice("", -priceValue); return(ConsumeState.ConsumeState_Done); }
public abstract ConsumeState Consume(Resource.PriceType priceType, Int64 priceValue, string walletaddr, UserStateType userStateType, ShopSlot shopSlot);
public override ConsumeState Consume(Resource.PriceType priceType, Int64 priceValue, string walletaddr, UserStateType userStateType, ShopSlot shopSlot) { if (!CheckConsume(priceType, priceValue)) { return(ConsumeState.ConsumeState_Falied); } if (priceValue == 0) { return(ConsumeState.ConsumeState_Done); } user.stateType = userStateType; user.processShopSlot = shopSlot; if (fungibleType == Resource.FungibleType.Fungible) { user.WithdrawFungible(TokenType(), (int)priceValue); } else if (fungibleType == Resource.FungibleType.ServiceToken) { user.WithdrawServiceToken((int)priceValue); } return(ConsumeState.ConsumeState_Request_Burn); }