From 8e711ca0676d5c288c602b536111c6f76682ca93 Mon Sep 17 00:00:00 2001 From: Thorbjoern Date: Fri, 11 Jul 2025 01:59:51 +0200 Subject: [PATCH] Optimized GhostRecorder and Supabase Manager --- Assets/_Scripts/GhostSystem/GhostRecorderBatch.cs | 2 ++ Assets/_Scripts/GhostSystem/SupabaseManager.cs | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Assets/_Scripts/GhostSystem/GhostRecorderBatch.cs b/Assets/_Scripts/GhostSystem/GhostRecorderBatch.cs index 1689a68..b13cacd 100644 --- a/Assets/_Scripts/GhostSystem/GhostRecorderBatch.cs +++ b/Assets/_Scripts/GhostSystem/GhostRecorderBatch.cs @@ -129,6 +129,8 @@ namespace GhostSystem { Debug.LogWarning($"Batch insert failed: {response.ResponseMessage.StatusCode}, fallback to offline."); await FallbackToOfflineAsync(batch); + OnUploadFinished?.Invoke(); // Die Action für das Ende des Ladescreens wird trotzdem ausgelöst. + Debug.Log("Upload Finished"); } if (response.ResponseMessage.IsSuccessStatusCode && sceneIdReady) // Löst Action aus, wenn der Upload geklappt hat und die neue Szene geladen ist. { diff --git a/Assets/_Scripts/GhostSystem/SupabaseManager.cs b/Assets/_Scripts/GhostSystem/SupabaseManager.cs index 9f8ffbf..f6c9ea0 100644 --- a/Assets/_Scripts/GhostSystem/SupabaseManager.cs +++ b/Assets/_Scripts/GhostSystem/SupabaseManager.cs @@ -70,10 +70,10 @@ namespace GhostSystem else { email = string.IsNullOrEmpty(SystemInfo.deviceUniqueIdentifier) - ? $"{Guid.NewGuid()}@device.local" + ? $"{Guid.NewGuid()}@device.local" // Fallback, generiert theoretisch bei jeder Neuinstallation der App einen anderen User. : $"{SystemInfo.deviceUniqueIdentifier}@device.local"; - password = Convert.ToBase64String(Guid.NewGuid().ToByteArray()); + password = email; // selbe GUID, damit das Passwort sich nicht pro App-Version verändern kann. await UniTask.Run(() => File.WriteAllLines(path, new[] { email, password })); }