ChrisNZL / Tallowmere2

Changelog, issue tracker, and development knowledge for Tallowmere 2.
https://tallowmere2.com
13 stars 0 forks source link

Flushed up to token index xxxxxx, cache file is xxxxxxxxxxxxxx #1146

Closed jovegoh closed 1 year ago

jovegoh commented 1 year ago

Flushed up to token index xxxxxx, cache file is xxxxxxxxxxxxxx causing screen freeze for 1s every 1min

I tried clear cache, data, uninstall, restart phone, reinstall still same issue short sample of freeze in attached video

Device: Nubia Redmagic5g OS: Android 11 Game version: 0.3.7g Downloaded from playstore

Screenshot_2022-12-03-04-03-26-299

https://user-images.githubusercontent.com/36652777/205377591-d773a669-c329-471c-abd4-ddc268d17810.mp4

ChrisNZL commented 1 year ago

Thanks for the report.

The message Flushed up to token index does not exist in my game's scripts, so it's coming from a plugin I am using somewhere...

Searching Google for Flushed up to token index, came across these Unity threads:

Sounds like it's an unwanted feature of Unity Analytics / Unity Gaming Services. I require using Unity Gaming Services to make the In-App Purchase system work, but I do not need the Unity Analytics stuff. (both plugins/packages are kind of intertwined unfortunately)

One call a Unity employee is suggesting to use is:

AnalyticsService.Instance.SetAnalyticsEnabled(false);

So I will likely try adding this to my startup code.

I will have to profile and debug and make sure this does not break the IAP system, but I believe this is the culprit and solution. I will try to get this fixed soon.

jovegoh commented 1 year ago

Hi, I kinda found out the reason for this flush thing. I have been using dns.adsguard.com for my phone DNS

after off the DNS, the flushing stops. I enable again, the flush index reset from low number which doesnt seems to hang the game.

jovegoh commented 1 year ago

Hi, new findings: the flush is probably caused by lost connection to whatever server Reason: due to flush appearing when playing without internet connection (wifi and mobile data off)

ChrisNZL commented 1 year ago

Thanks for the further info.

The stuttering and logging should be resolved in upcoming 0.3.7h.

Added the following to the game's UnityGamingServices class:

// ➡️ Disable Unity Analytics:
// https://forum.unity.com/threads/unity-analytics-making-my-app-sluggish.1361308/
AnalyticsService.Instance.SetAnalyticsEnabled(false); 

// ➡️ Further disabling:
// https://docs.unity3d.com/ScriptReference/Analytics.Analytics-enabled.html
Analytics.enabled = false;
Analytics.deviceStatsEnabled = false;
PerformanceReporting.enabled = false;

IAP functionality seems to remain intact.