예제 #1
0
 public override void Execute()
 {
     base.Execute();
     Service.Get <ServerAPI>().Enabled = true;
     Service.Get <ServerAPI>().Sync(new PlayerFueCompleteCommand(new PlayerIdChecksumRequest()));
     Service.Get <CurrentPlayer>().CampaignProgress.FueInProgress = false;
     KochavaPlugin.FireEvent("tutorialComplete", "1");
     this.parent.ChildComplete(this);
 }
        public override ISerializable FromObject(object obj)
        {
            bool flag = true;
            Dictionary <string, object> dictionary  = obj as Dictionary <string, object>;
            Dictionary <string, object> dictionary2 = dictionary["iap"] as Dictionary <string, object>;
            Dictionary <string, object> dictionary3 = null;
            bool   isPromo      = (bool)dictionary["isPromo"];
            string currencyCode = "USD";
            double price        = 0.0;
            string uid          = "";
            double num          = 1.0;
            string offerUid     = null;

            if (dictionary.ContainsKey("sale"))
            {
                dictionary3 = (dictionary["sale"] as Dictionary <string, object>);
            }
            if (dictionary3 != null && dictionary3.ContainsKey("bonusMultiplier"))
            {
                num = Convert.ToDouble(dictionary3["bonusMultiplier"], CultureInfo.InvariantCulture);
                if (flag)
                {
                    Service.Get <StaRTSLogger>().Debug("MoneyReceiptVerifyResponse: Bonus Multiplier: " + num);
                }
            }
            if (dictionary2.ContainsKey("uid"))
            {
                uid = (dictionary2["uid"] as string);
            }
            if (dictionary2.ContainsKey("price"))
            {
                price = Convert.ToDouble(dictionary2["price"], CultureInfo.InvariantCulture);
            }
            if (dictionary.ContainsKey("targetedOffer"))
            {
                offerUid = (dictionary["targetedOffer"] as string);
            }
            if (dictionary.ContainsKey("crateData"))
            {
                this.crateDataTO = new CrateData();
                this.crateDataTO.FromObject(dictionary["crateData"]);
            }
            KochavaPlugin.FireEvent("paymentAction", "1");
            KochavaPlugin.FireEvent("revenueAmount", price.ToString());
            if (this.Status == 0u)
            {
                Service.Get <InAppPurchaseController>().HandleReceiptVerificationResponse(uid, this.TransactionId, currencyCode, price, num, isPromo, offerUid, this.crateDataTO);
            }
            return(this);
        }
        private void OnLoginComplete(LoginResponse response, object cookie)
        {
            Service.Get <StaRTSLogger>().Debug("Player Logged In Successfully.");
            Service.Get <EventManager>().SendEvent(EventId.PlayerLoginSuccess, null);
            CurrentPlayer currentPlayer = Service.Get <CurrentPlayer>();

            Service.Get <ServerAPI>().StartSession(currentPlayer.LoginTime);
            if (!Service.Get <CurrentPlayer>().CampaignProgress.FueInProgress)
            {
                Service.Get <NotificationController>().TryEnableNotifications();
            }
            if (Service.Get <CurrentPlayer>().SessionCountToday == 1)
            {
                KochavaPlugin.FireEvent("dayPlayed", "1");
            }
            currentPlayer.Prizes.Crates.UpdateBadgingBasedOnAvailableCrates();
            base.Complete();
            Service.Get <IAccountSyncController>().UpdateExternalAccountInfo(new OnUpdateExternalAccountInfoResponseReceived(this.OnUpdateExternalAccountInfoResponseReceived));
        }