Completely wipe savefile on logout

This commit is contained in:
2025-08-23 14:58:47 -07:00
parent ddd582addb
commit 888d30d6b3
3 changed files with 8 additions and 27 deletions

View File

@@ -1,8 +1,6 @@
using System.IO;
using System.Numerics;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Unity.VisualScripting;
using UnityEngine;
public class BazookaManager : MonoBehaviour
@@ -69,7 +67,7 @@ public class BazookaManager : MonoBehaviour
return;
#else
string path = Path.Join(Application.persistentDataPath, SensitiveInfo.BAZOOKA_MANAGER_FILE_KEY + ".dat");
var encoded = SensitiveInfo.EncryptRaw(saveFile.ToString(Formatting.None), SensitiveInfo.BAZOOKA_MANAGER_KEY);
var encoded = SensitiveInfo.EncryptRaw(saveFile.ToString(Newtonsoft.Json.Formatting.None), SensitiveInfo.BAZOOKA_MANAGER_KEY);
if (encoded == null) return;
using var fileStream = new FileStream(path, FileMode.Create, FileAccess.Write, FileShare.None);
fileStream.Write(encoded, 0, encoded.Length);
@@ -77,6 +75,12 @@ public class BazookaManager : MonoBehaviour
#endif
}
public void ResetSave()
{
saveFile = new JObject();
Save();
}
//Bird stuff
public void SetBirdIcon(int value)