Ejemplo n.º 1
0
        public override int Execute(LogicLevel level)
        {
            LogicOffer offer = level.GetOfferManager().GetOfferById(this.m_offerId);

            if (offer != null)
            {
                offer.SetState(this.m_offerState);
                return(0);
            }

            Debugger.Warning(string.Format("Offer not found when updating offer state for id: {0} to state: {1}", this.m_offerId, this.m_offerState));
            return(-2);
        }
        public override int Execute(LogicLevel level)
        {
            if (level.GetState() == 1)
            {
                LogicOffer offer = level.GetOfferManager().GetOfferById(this.m_offerId);

                if (offer.GetState() == 1)
                {
                    offer.SetState(2);
                    return(0);
                }

                return(-2);
            }

            return(-1);
        }
        public override int Execute(LogicLevel level)
        {
            if (level.GetGameMode().GetState() == 1)
            {
                LogicAvatar avatar = level.GetHomeOwnerAvatar();

                if (avatar != null)
                {
                    if (this.m_deliverableBundle != null)
                    {
                        if (this.m_billingPackageData != null)
                        {
                            LogicDeliveryHelper.Deliver(level, this.m_deliverableBundle);
                            LogicOffer offer = level.GetOfferManager().GetOfferById(this.m_offerId);

                            if (offer != null)
                            {
                                offer.SetState(4);
                                offer.AddPayCount(1);
                            }

                            /*else
                             * {
                             *  Debugger.Warning(string.Format("Delivering offerUid:{0}. Offer was no longer found.", this.m_offerId));
                             * }*/

                            return(0);
                        }

                        return(-4);
                    }

                    return(-3);
                }

                return(-2);
            }

            return(-1);
        }