diff --git a/SVSimLoader/IdentityWipe.cs b/SVSimLoader/IdentityWipe.cs index 82a3752..92d8baf 100644 --- a/SVSimLoader/IdentityWipe.cs +++ b/SVSimLoader/IdentityWipe.cs @@ -1,14 +1,45 @@ extern alias game; +using ObscuredPrefs = CodeStage.AntiCheat.ObscuredTypes.ObscuredPrefs; using PlayerPrefs = game::UnityEngine.PlayerPrefs; namespace SVSimLoader; +/// +/// Narrow identity reset for the local-server test loop. Deletes ONLY the three +/// account-keyed entries in Toolbox.SavedataManager: +/// +/// UDID — client-generated GUID identifying this install +/// VIEWER_ID — server-assigned viewer id +/// SHORT_UDID — server-assigned short id +/// +/// +/// Calling PlayerPrefs.DeleteAll() would also wipe RES_VER (the asset manifest +/// version that drives the Akamai CDN path), language/sound prefs, and — most importantly +/// for the local-server loop — whatever cache-index metadata the asset layer stores in +/// PlayerPrefs. That made every nuked launch trigger the 15.8 MB tutorial-asset download +/// prompt followed by the 497 MB background-download prompt, even when the on-disk asset +/// bundles were already there. Narrowing to the three identity keys keeps the asset cache +/// in sync with what prod last served, so a wiped client behaves like a fresh signup +/// against the same RES_VER prod is currently on. +/// +/// +/// ObscuredPrefs.DeleteKey deletes both the obscured-key entry +/// (PlayerPrefs[EncryptKey("UDID")]) and the plain-key entry +/// (PlayerPrefs["UDID"]) for each key, matching how +/// Cute/Certification.InitializeFileds would clear them in the game itself. +/// +/// public static class IdentityWipe { + private static readonly string[] IdentityKeys = { "UDID", "VIEWER_ID", "SHORT_UDID" }; + public static void Execute() { - PlayerPrefs.DeleteAll(); + foreach (var key in IdentityKeys) + { + ObscuredPrefs.DeleteKey(key); + } PlayerPrefs.Save(); } }