Skip saving and loading savefile if no save encryption keys are present

This commit is contained in:
2025-09-11 14:02:18 -07:00
parent 6ea64d3be9
commit 01454cce1f

View File

@@ -45,6 +45,7 @@ public class BazookaManager : MonoBehaviour
public void Load() public void Load()
{ {
if (SensitiveInfo.BAZOOKA_MANAGER_KEY.Trim().Length == 0 || SensitiveInfo.BAZOOKA_MANAGER_FILE_KEY.Trim().Length == 0) return;
string path = Path.Join(Application.persistentDataPath, SensitiveInfo.BAZOOKA_MANAGER_FILE_KEY + ".dat"); string path = Path.Join(Application.persistentDataPath, SensitiveInfo.BAZOOKA_MANAGER_FILE_KEY + ".dat");
if (!File.Exists(path)) if (!File.Exists(path))
{ {
@@ -386,6 +387,7 @@ public class BazookaManager : MonoBehaviour
#if UNITY_EDITOR #if UNITY_EDITOR
return; return;
#else #else
if (SensitiveInfo.BAZOOKA_MANAGER_KEY.Trim().Length == 0 || SensitiveInfo.BAZOOKA_MANAGER_FILE_KEY.Trim().Length == 0) return;
string path = Path.Join(Application.persistentDataPath, SensitiveInfo.BAZOOKA_MANAGER_FILE_KEY + ".dat"); string path = Path.Join(Application.persistentDataPath, SensitiveInfo.BAZOOKA_MANAGER_FILE_KEY + ".dat");
var encoded = SensitiveInfo.EncryptRaw(saveFile.ToString(Newtonsoft.Json.Formatting.None), SensitiveInfo.BAZOOKA_MANAGER_KEY); var encoded = SensitiveInfo.EncryptRaw(saveFile.ToString(Newtonsoft.Json.Formatting.None), SensitiveInfo.BAZOOKA_MANAGER_KEY);
if (encoded == null) return; if (encoded == null) return;