2 Commits

Author SHA1 Message Date
Thorbjoern b4cdb3a57b Made the Logs uploadable 2025-07-23 00:15:13 +02:00
Thorbjoern 1e8853d8c3 Offline Patch 2025-07-22 21:58:54 +02:00
4 changed files with 28 additions and 22 deletions
+13 -12
View File
@@ -795,6 +795,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 8983945cca89adc46aab1638d1823d76, type: 3} m_Script: {fileID: 11500000, guid: 8983945cca89adc46aab1638d1823d76, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
userId: 09321725-0150-4df0-92a7-029005cc75eb
textbox: {fileID: 1864973021} textbox: {fileID: 1864973021}
--- !u!4 &80522956 --- !u!4 &80522956
Transform: Transform:
@@ -9322,10 +9323,10 @@ RectTransform:
m_Children: [] m_Children: []
m_Father: {fileID: 2045408655} m_Father: {fileID: 2045408655}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1} m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 186, y: -150.7} m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 372, y: 30} m_SizeDelta: {x: 0, y: 30}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1566043034 --- !u!114 &1566043034
MonoBehaviour: MonoBehaviour:
@@ -10511,10 +10512,10 @@ RectTransform:
m_Children: [] m_Children: []
m_Father: {fileID: 2045408655} m_Father: {fileID: 2045408655}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1} m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 186, y: -103.7} m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 372, y: 50} m_SizeDelta: {x: 0, y: 50}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1797910565 --- !u!114 &1797910565
MonoBehaviour: MonoBehaviour:
@@ -11078,10 +11079,10 @@ RectTransform:
m_Children: [] m_Children: []
m_Father: {fileID: 2045408655} m_Father: {fileID: 2045408655}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1} m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 186, y: -35.85} m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 372, y: 71.7} m_SizeDelta: {x: 0, y: 71.7}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1864973021 --- !u!114 &1864973021
MonoBehaviour: MonoBehaviour:
@@ -53,7 +53,9 @@ namespace GhostSystem
private void Start() 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() private void HandleSupabaseReady()
@@ -116,13 +118,15 @@ namespace GhostSystem
private async UniTaskVoid FlushBatchAsync() // Die eigentliche Methode zum Hochladen eines Batches/leeren des Buffers. 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<FrameModel>(_frameBuffer); var batch = new List<FrameModel>(_frameBuffer);
_frameBuffer.Clear(); _frameBuffer.Clear();
Debug.Log("Flushing Frame Buffer"); 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<FrameModel>().Insert(batch); // Versucht, den Batch an Superbase hochzuladen var response = await SupabaseManager.instance.supabase.From<FrameModel>().Insert(batch); // Versucht, den Batch an Superbase hochzuladen
if (!response.ResponseMessage.IsSuccessStatusCode) if (!response.ResponseMessage.IsSuccessStatusCode)
@@ -145,7 +149,7 @@ namespace GhostSystem
await FallbackToOfflineAsync(batch); // Bei nicht erfolgtem Upload wird der Batch lokal gescpeichert. 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. OnUploadFinished?.Invoke(); // Die Action für das Ende des Ladescreens wird trotzdem ausgelöst.
Debug.Log("Upload Finished"); Debug.Log("Upload Finished");
} }*/
} }
private async UniTask FallbackToOfflineAsync(List<FrameModel> batch) // Schreibt den Buffer in eine Datei, falls Upload nicht möglich private async UniTask FallbackToOfflineAsync(List<FrameModel> batch) // Schreibt den Buffer in eine Datei, falls Upload nicht möglich
@@ -18,7 +18,7 @@ namespace GhostSystem
public const string supabaseAnonKey = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImNlemdoeHp0dnlnZ3dndW55aG1xIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NDcyMTk5MzcsImV4cCI6MjA2Mjc5NTkzN30.vr6-3X3Ux_DjcCiw_CqG-VKP8BiBXtmCzAXjYTiA_vY"; public const string supabaseAnonKey = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImNlemdoeHp0dnlnZ3dndW55aG1xIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NDcyMTk5MzcsImV4cCI6MjA2Mjc5NTkzN30.vr6-3X3Ux_DjcCiw_CqG-VKP8BiBXtmCzAXjYTiA_vY";
public Client supabase { get; private set; } public Client supabase { get; private set; }
public string userId => supabase?.Auth?.CurrentUser?.Id; public string userId = "09321725-0150-4df0-92a7-029005cc75eb";
private string email; private string email;
private string password; private string password;
@@ -48,9 +48,9 @@ namespace GhostSystem
} }
Debug.Log("🌐 Starting Supabase setup..."); Debug.Log("🌐 Starting Supabase setup...");
await RunDiagnostics(); //await RunDiagnostics();
await InitSupabaseAsync(); //await InitSupabaseAsync();
OnSuperbaseReady?.Invoke(); OnSuperbaseReady?.Invoke();
} }
@@ -141,6 +141,7 @@ namespace GhostSystem
} }
else else
{ {
//textbox.text += $"\n\rSupabase health check failed: {www.error}"; //textbox.text += $"\n\rSupabase health check failed: {www.error}";
Debug.LogError($"❌ Supabase health check failed: {www.error}"); Debug.LogError($"❌ Supabase health check failed: {www.error}");
} }
+3 -3
View File
@@ -13,7 +13,7 @@ PlayerSettings:
useOnDemandResources: 0 useOnDemandResources: 0
accelerometerFrequency: 60 accelerometerFrequency: 60
companyName: TH companyName: TH
productName: RoomAware VR productName: RoomAware VR Fully Offline
defaultCursor: {fileID: 0} defaultCursor: {fileID: 0}
cursorHotspot: {x: 0, y: 0} cursorHotspot: {x: 0, y: 0}
m_SplashScreenBackgroundColor: {r: 0.13725491, g: 0.12156863, b: 0.1254902, a: 1} m_SplashScreenBackgroundColor: {r: 0.13725491, g: 0.12156863, b: 0.1254902, a: 1}
@@ -167,7 +167,7 @@ PlayerSettings:
androidMaxAspectRatio: 2.4 androidMaxAspectRatio: 2.4
androidMinAspectRatio: 1 androidMinAspectRatio: 1
applicationIdentifier: applicationIdentifier:
Android: com.TH.RoomAwareVR Android: com.TH.RoomAwareVRFullyOffline
Standalone: com.DefaultCompany.VR-Multiplayer Standalone: com.DefaultCompany.VR-Multiplayer
iPhone: com.Unity-Technologies.com.unity.template.urp-blank iPhone: com.Unity-Technologies.com.unity.template.urp-blank
buildNumber: buildNumber:
@@ -184,7 +184,7 @@ PlayerSettings:
stripEngineCode: 1 stripEngineCode: 1
iPhoneStrippingLevel: 0 iPhoneStrippingLevel: 0
iPhoneScriptCallOptimization: 0 iPhoneScriptCallOptimization: 0
ForceInternetPermission: 1 ForceInternetPermission: 0
ForceSDCardPermission: 0 ForceSDCardPermission: 0
CreateWallpaper: 0 CreateWallpaper: 0
androidSplitApplicationBinary: 0 androidSplitApplicationBinary: 0