diff --git a/Assets/_Scripts/GhostSystem/GhostRecorderBatch.cs b/Assets/_Scripts/GhostSystem/GhostRecorderBatch.cs index 7f9b156..869d2a7 100644 --- a/Assets/_Scripts/GhostSystem/GhostRecorderBatch.cs +++ b/Assets/_Scripts/GhostSystem/GhostRecorderBatch.cs @@ -53,7 +53,9 @@ namespace GhostSystem private void Start() { - _offlinePath = Path.Combine(Application.persistentDataPath, "offline_log.jsonl"); + string now = DateTime.Now.ToString("yyyyMMdd_HHmmss"); + string dateiname = now + ".jsonl"; + _offlinePath = Path.Combine(Application.persistentDataPath, dateiname); } private void HandleSupabaseReady() @@ -116,13 +118,15 @@ namespace GhostSystem private async UniTaskVoid FlushBatchAsync() // Die eigentliche Methode zum Hochladen eines Batches/leeren des Buffers. { - if (_frameBuffer.Count == 0 || !supabaseReady) return; + if (_frameBuffer.Count == 0) return; var batch = new List(_frameBuffer); _frameBuffer.Clear(); Debug.Log("Flushing Frame Buffer"); - try + await FallbackToOfflineAsync(batch); + OnUploadFinished?.Invoke(); // Die Action für das Ende des Ladescreens wird trotzdem ausgelöst. + /*try { var response = await SupabaseManager.instance.supabase.From().Insert(batch); // Versucht, den Batch an Superbase hochzuladen if (!response.ResponseMessage.IsSuccessStatusCode) @@ -145,7 +149,7 @@ namespace GhostSystem await FallbackToOfflineAsync(batch); // Bei nicht erfolgtem Upload wird der Batch lokal gescpeichert. OnUploadFinished?.Invoke(); // Die Action für das Ende des Ladescreens wird trotzdem ausgelöst. Debug.Log("Upload Finished"); - } + }*/ } private async UniTask FallbackToOfflineAsync(List batch) // Schreibt den Buffer in eine Datei, falls Upload nicht möglich diff --git a/Assets/_Scripts/GhostSystem/SupabaseManager.cs b/Assets/_Scripts/GhostSystem/SupabaseManager.cs index f6c9ea0..9014e70 100644 --- a/Assets/_Scripts/GhostSystem/SupabaseManager.cs +++ b/Assets/_Scripts/GhostSystem/SupabaseManager.cs @@ -48,9 +48,9 @@ namespace GhostSystem } Debug.Log("🌠Starting Supabase setup..."); - await RunDiagnostics(); + //await RunDiagnostics(); - await InitSupabaseAsync(); + //await InitSupabaseAsync(); OnSuperbaseReady?.Invoke(); } @@ -141,6 +141,7 @@ namespace GhostSystem } else { + //textbox.text += $"\n\rSupabase health check failed: {www.error}"; Debug.LogError($"⌠Supabase health check failed: {www.error}"); } diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index b114f6f..8f7b478 100644 --- a/ProjectSettings/ProjectSettings.asset +++ b/ProjectSettings/ProjectSettings.asset @@ -13,7 +13,7 @@ PlayerSettings: useOnDemandResources: 0 accelerometerFrequency: 60 companyName: TH - productName: RoomAware VR + productName: RoomAware VR Fully Offline defaultCursor: {fileID: 0} cursorHotspot: {x: 0, y: 0} m_SplashScreenBackgroundColor: {r: 0.13725491, g: 0.12156863, b: 0.1254902, a: 1} @@ -167,7 +167,7 @@ PlayerSettings: androidMaxAspectRatio: 2.4 androidMinAspectRatio: 1 applicationIdentifier: - Android: com.TH.RoomAwareVR + Android: com.TH.RoomAwareVRFullyOffline Standalone: com.DefaultCompany.VR-Multiplayer iPhone: com.Unity-Technologies.com.unity.template.urp-blank buildNumber: @@ -184,7 +184,7 @@ PlayerSettings: stripEngineCode: 1 iPhoneStrippingLevel: 0 iPhoneScriptCallOptimization: 0 - ForceInternetPermission: 1 + ForceInternetPermission: 0 ForceSDCardPermission: 0 CreateWallpaper: 0 androidSplitApplicationBinary: 0