Exemple #1
0
    private void Update()
    {
        switch (this.state)
        {
        case FairyController.State.Timer:
            this.currentTime -= Time.deltaTime;
            if (this.currentTime <= 0f)
            {
                bool flag;
                try
                {
                    flag = AdsManager.Instance.HasRewardedVideo();
                }
                catch (Exception)
                {
                    FMLogger.vCore("hasRewarded ex.");
                    flag = false;
                }
                if (flag)
                {
                    if (GeneralSettings.AdsDisabled)
                    {
                        this.state = FairyController.State.Entry;
                    }
                    else
                    {
                        this.state = FairyController.State.Ready;
                        AppState.TimingBonusReady = true;
                    }
                }
                else
                {
                    if (!this.rewardedRequested)
                    {
                        AdsManager.Instance.SingleRewardedRequest();
                        this.rewardedRequested = true;
                    }
                    this.state       = FairyController.State.WaitingForRewarded;
                    this.currentTime = 5f;
                }
            }
            break;

        case FairyController.State.WaitingForRewarded:
            this.currentTime -= Time.deltaTime;
            if (this.currentTime <= 0f)
            {
                bool flag2;
                try
                {
                    flag2 = AdsManager.Instance.HasRewardedVideo();
                }
                catch (Exception)
                {
                    FMLogger.vCore("hasRewarded ex.");
                    flag2 = false;
                }
                if (flag2)
                {
                    if (GeneralSettings.AdsDisabled)
                    {
                        this.state = FairyController.State.Entry;
                    }
                    else
                    {
                        this.state = FairyController.State.Ready;
                        AppState.TimingBonusReady = true;
                    }
                }
                else
                {
                    this.currentTime = 5f;
                }
            }
            break;

        case FairyController.State.Ready:
            if (!AppState.TimingBonusReady)
            {
                this.rewardedRequested = false;
                this.currentTime       = this.interval;
                this.state             = FairyController.State.Timer;
            }
            break;
        }
    }
Exemple #2
0
 public bool IsValid()
 {
     if (!this.IsValidPaths(this.paths))
     {
         return(false);
     }
     if (this.content == null)
     {
         return(false);
     }
     for (int i = this.content.Count - 1; i >= 0; i--)
     {
         if (!this.content[i].IsValid())
         {
             this.content.RemoveAt(i);
         }
     }
     if (this.content.Count < 1)
     {
         return(false);
     }
     if (this.categories != null)
     {
         for (int j = this.categories.Count - 1; j >= 0; j--)
         {
             if (string.IsNullOrEmpty(this.categories[j].name))
             {
                 FMLogger.vCore("filter cat.");
                 this.categories.RemoveAt(j);
             }
         }
     }
     if (this.featured != null)
     {
         if (this.featured.daily_items != null)
         {
             for (int k = this.featured.daily_items.Count - 1; k >= 0; k--)
             {
                 if (this.featured.daily_items[k].pic == null || !this.featured.daily_items[k].pic.IsValid())
                 {
                     FMLogger.vCore("filter daily.");
                     this.featured.daily_items.RemoveAt(k);
                 }
             }
         }
         if (this.featured.editor_choice != null)
         {
             for (int l = this.featured.editor_choice.Count - 1; l >= 0; l--)
             {
                 if (this.featured.editor_choice[l].pic == null || !this.featured.editor_choice[l].pic.IsValid())
                 {
                     FMLogger.vCore("filter promo pic.");
                     this.featured.editor_choice.RemoveAt(l);
                 }
             }
         }
         if (this.featured.external_links != null)
         {
             for (int m = this.featured.external_links.Count - 1; m >= 0; m--)
             {
                 bool flag = false;
                 FeaturedExternalLink featuredExternalLink = this.featured.external_links[m];
                 if (string.IsNullOrEmpty(featuredExternalLink.target_url))
                 {
                     flag = true;
                 }
                 if (!this.IsValidPaths(featuredExternalLink.paths))
                 {
                     flag = true;
                 }
                 if (string.IsNullOrEmpty(featuredExternalLink.img_url))
                 {
                     flag = true;
                 }
                 if (flag)
                 {
                     this.featured.external_links.RemoveAt(m);
                 }
             }
         }
     }
     if (this.update_dialog != null && (string.IsNullOrEmpty(this.update_dialog.body) || string.IsNullOrEmpty(this.update_dialog.title) || string.IsNullOrEmpty(this.update_dialog.yes) || string.IsNullOrEmpty(this.update_dialog.no)))
     {
         this.update_dialog = null;
     }
     return(true);
 }
 public static void Init()
 {
     SafeLayout.ScreenSize = SafeLayout.GetScreenSize();
     SafeLayout.IsTablet   = SafeLayout.IsTabletDevice(SafeLayout.ScreenSize);
     FMLogger.vCore("tablet:" + SafeLayout.IsTablet);
 }
    public void HandleLowMemory()
    {
        int num = ImageManager.Instance.UnloadUnusedTextures();

        FMLogger.vCore("LowMemory Warning " + num);
    }
 private void RescheduleConfirmReport()
 {
     FMLogger.vCore("app confirm report error. reschedule");
     base.StartCoroutine(this.DelayAction(15f, new Action(this.SendConfirmData)));
 }
 public static void GenerateInstallGUID()
 {
     AppInstallReportService.InstallGUID = Guid.NewGuid().ToString();
     FMLogger.vCore("generated guid: " + AppInstallReportService.InstallGUID);
 }
Exemple #7
0
 public static void Init()
 {
     if (AdjustHelper.inited)
     {
         return;
     }
     try
     {
         AdjustEnvironment environment  = (!AdjustHelper.IsSandboxMode()) ? AdjustEnvironment.Production : AdjustEnvironment.Sandbox;
         AdjustLogLevel    logLevel     = (!BuildConfig.LOG_ENABLED) ? AdjustLogLevel.Error : AdjustLogLevel.Verbose;
         AdjustConfig      adjustConfig = new AdjustConfig("6652dk67rxj4", environment);
         adjustConfig.setLogLevel(logLevel);
         AdjustConfig adjustConfig2 = adjustConfig;
         if (AdjustHelper.__f__mg_cache0 == null)
         {
             AdjustHelper.__f__mg_cache0 = new Action <string>(FMLogger.vCore);
         }
         adjustConfig2.setLogDelegate(AdjustHelper.__f__mg_cache0);
         adjustConfig.setEventBufferingEnabled(true);
         adjustConfig.setLaunchDeferredDeeplink(true);
         AdjustConfig adjustConfig3 = adjustConfig;
         if (AdjustHelper.__f__mg_cache1 == null)
         {
             AdjustHelper.__f__mg_cache1 = new Action <AdjustEventSuccess>(AdjustHelper.EventSuccessCallback);
         }
         adjustConfig3.setEventSuccessDelegate(AdjustHelper.__f__mg_cache1, "Adjust");
         AdjustConfig adjustConfig4 = adjustConfig;
         if (AdjustHelper.__f__mg_cache2 == null)
         {
             AdjustHelper.__f__mg_cache2 = new Action <AdjustEventFailure>(AdjustHelper.EventFailureCallback);
         }
         adjustConfig4.setEventFailureDelegate(AdjustHelper.__f__mg_cache2, "Adjust");
         AdjustConfig adjustConfig5 = adjustConfig;
         if (AdjustHelper.__f__mg_cache3 == null)
         {
             AdjustHelper.__f__mg_cache3 = new Action <AdjustSessionSuccess>(AdjustHelper.SessionSuccessCallback);
         }
         adjustConfig5.setSessionSuccessDelegate(AdjustHelper.__f__mg_cache3, "Adjust");
         AdjustConfig adjustConfig6 = adjustConfig;
         if (AdjustHelper.__f__mg_cache4 == null)
         {
             AdjustHelper.__f__mg_cache4 = new Action <AdjustSessionFailure>(AdjustHelper.SessionFailureCallback);
         }
         adjustConfig6.setSessionFailureDelegate(AdjustHelper.__f__mg_cache4, "Adjust");
         AdjustConfig adjustConfig7 = adjustConfig;
         if (AdjustHelper.__f__mg_cache5 == null)
         {
             AdjustHelper.__f__mg_cache5 = new Action <string>(AdjustHelper.DeferredDeeplinkCallback);
         }
         adjustConfig7.setDeferredDeeplinkDelegate(AdjustHelper.__f__mg_cache5, "Adjust");
         AdjustConfig adjustConfig8 = adjustConfig;
         if (AdjustHelper.__f__mg_cache6 == null)
         {
             AdjustHelper.__f__mg_cache6 = new Action <AdjustAttribution>(AdjustHelper.AttributionChangedCallback);
         }
         adjustConfig8.setAttributionChangedDelegate(AdjustHelper.__f__mg_cache6, "Adjust");
         Adjust.start(adjustConfig);
         AdjustHelper.inited = true;
     }
     catch (Exception ex)
     {
         AdjustHelper.inited = false;
         FMLogger.vCore("Adjust init error. " + ex.Message);
     }
 }
 private void RescheduleInstallReport()
 {
     FMLogger.vCore("app install report error. reschedule");
     base.StartCoroutine(this.DelayAction(1.5f, new Action(this.SendInstallData)));
 }
Exemple #9
0
 private void OnExtraSlowPictureDataDownload()
 {
     FMLogger.vCore("OnExtraSlowPictureDataDownload. Can cancel");
     this.sceneLoader.ShowCloseButton(new Action(this.OnCancelPictureDownload));
 }
Exemple #10
0
 private void FMDeepLinkCallback(string data)
 {
     FMLogger.vCore("FMDeepLinkCallback");
     this.HandleLaunchData(data);
 }
Exemple #11
0
 private void OnSlowPictureDataDownload()
 {
     FMLogger.vCore("OnSlowPictureDataDownload");
     this.sceneLoader.ShowSlowConnectionLabel();
 }
Exemple #12
0
 private void OnTGFResult(bool showDialog)
 {
     this.tgfResultReceived = true;
     this.tgfRequireConsent = showDialog;
     FMLogger.vCore("On server consent result. should show: " + showDialog);
 }
Exemple #13
0
 private void OnMopubResult(bool showDialog)
 {
     this.mopubResultReceived = true;
     this.mopubRequireConsent = showDialog;
     FMLogger.vCore("On mopub consent result. should show: " + showDialog);
 }
Exemple #14
0
 public void OnPrivacyClick()
 {
     FMLogger.vCore("consent OnPrivacyClick");
     SystemUtils.OpenBrowser("https://x-flow.app/privacy-policy.html");
 }
Exemple #15
0
 public void OnTermsClick()
 {
     FMLogger.vCore("consent OnTermsClick");
     SystemUtils.OpenBrowser("https://x-flow.app/terms-of-use.html");
 }