Exemplo n.º 1
0
 protected override void OnDestroy()
 {
     ContentHolder.Deinit();
     SaveDataHandler.ResetCache();
     MainActivity.Game = null;
     base.OnDestroy();
 }
Exemplo n.º 2
0
 private static void OnSignInCompleted(object sender, SignInCompletedEventArgs e)
 {
     SaveDataHandler.ResetCache();
     StatTracker.LoadAsync();
     if (!(Engine.Room is RoomMain) && !(Engine.Room is RoomInit))
     {
         Engine.ChangeRoom <RoomMain>();
     }
 }
Exemplo n.º 3
0
 private static void OnSignOutCompleted(object sender, SignOutCompletedEventArgs e)
 {
     XboxLiveObject.CurrentUser    = null;
     XboxLiveObject.CurrentContext = null;
     SaveDataHandler.ResetCache();
     StatTracker.Reset();
     if (!(Engine.Room is RoomMain) && !(Engine.Room is RoomInit))
     {
         Engine.ChangeRoom <RoomMain>();
     }
     XboxLiveObject.SignOutCompleted?.Invoke(sender, e);
 }
Exemplo n.º 4
0
        protected int LoadSavedAdTime()
        {
            string loaded_ad_time = SaveDataHandler.LoadData(Ads.AdTimeSavePath);

            if (loaded_ad_time != null)
            {
                Debug.WriteLine("Ads::LoadSavedAdTime() - loaded_ad_time = " + loaded_ad_time);
                return(int.Parse(loaded_ad_time));
            }

            this.SaveCurrentAdTime(0);
            return(0);
        }
Exemplo n.º 5
0
        private string GetAdvertiserID()
        {
            string id = null;
            var    cr = Application.Context.ContentResolver;

            // If do not track is on return empty advertiser id
            if (this.GetDoNotTrack() == 1)
            {
                return("00000000-0000-0000-0000-000000000000");
            }

            // First try to get the advertising_id (from on FireTV) if available
            try {
                id = Android.Provider.Settings.Secure.GetString(cr, "advertising_id");
            } catch {}

            // Next use android_id if available
            if (string.IsNullOrWhiteSpace(id))
            {
                try {
                    id = Android.Provider.Settings.Secure.GetString(cr, Android.Provider.Settings.Secure.AndroidId);
                } catch {}
            }

            // Next use Serial if available (exists on API Level 9)
            if (string.IsNullOrWhiteSpace(id))
            {
                id = Build.Serial;
            }

            // Finally if we still don't have an ad id generate a uuid and save it to file.
            if (string.IsNullOrWhiteSpace(id))
            {
                id = SaveDataHandler.LoadData(AndroidAds.CustomGUIDSavePath);
                if (string.IsNullOrWhiteSpace(id))
                {
                    id = Guid.NewGuid().ToString();
                    SaveDataHandler.SaveData(id, AndroidAds.CustomGUIDSavePath);
                }
            }

            return(id);
        }
Exemplo n.º 6
0
 protected void SaveCurrentAdTime(int time)
 {
     SaveDataHandler.SaveData(time.ToString(), Ads.AdTimeSavePath);
 }