diff --git a/package-dev/Plugins/Xbox/Sentry/sentry.dll.meta b/package-dev/Plugins/Xbox/Sentry/sentry.dll.meta new file mode 100644 index 000000000..4eacd85a8 --- /dev/null +++ b/package-dev/Plugins/Xbox/Sentry/sentry.dll.meta @@ -0,0 +1,63 @@ +fileFormatVersion: 2 +guid: 9af1ed7e934f9bb4dbb6fa3e43c62340 +PluginImporter: + externalObjects: {} + serializedVersion: 3 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 1 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + Any: + enabled: 0 + settings: + Exclude Editor: 1 + Exclude GameCoreScarlett: 0 + Exclude GameCoreXboxOne: 1 + Exclude Linux64: 1 + Exclude OSXUniversal: 1 + Exclude Win: 1 + Exclude Win64: 1 + Exclude iOS: 1 + Editor: + enabled: 0 + settings: + CPU: x86_64 + DefaultValueInitialized: true + OS: Windows + GameCoreScarlett: + enabled: 1 + settings: {} + Linux64: + enabled: 0 + settings: + CPU: None + OSXUniversal: + enabled: 0 + settings: + CPU: None + Win: + enabled: 0 + settings: + CPU: None + Win64: + enabled: 0 + settings: + CPU: x86_64 + WindowsStoreApps: + enabled: 0 + settings: + CPU: x64 + iOS: + enabled: 0 + settings: + AddToEmbeddedBinaries: false + CPU: AnyCPU + CompileFlags: + FrameworkDependencies: + userData: + assetBundleName: + assetBundleVariant: diff --git a/package-dev/Runtime/Sentry.Unity.Native.dll.meta b/package-dev/Runtime/Sentry.Unity.Native.dll.meta index 7d1ed0db6..6fb222303 100644 --- a/package-dev/Runtime/Sentry.Unity.Native.dll.meta +++ b/package-dev/Runtime/Sentry.Unity.Native.dll.meta @@ -2,7 +2,7 @@ fileFormatVersion: 2 guid: bb324dd170e76fb4bbe06f959c323cbd PluginImporter: externalObjects: {} - serializedVersion: 2 + serializedVersion: 3 iconMap: {} executionOrder: {} defineConstraints: [] @@ -11,13 +11,17 @@ PluginImporter: isExplicitlyReferenced: 0 validateReferences: 1 platformData: - - first: - : Any - second: + Android: + enabled: 0 + settings: + CPU: ARMv7 + Any: enabled: 0 settings: Exclude Android: 1 Exclude Editor: 0 + Exclude GameCoreScarlett: 0 + Exclude GameCoreXboxOne: 0 Exclude Linux64: 0 Exclude OSXUniversal: 1 Exclude WebGL: 1 @@ -25,67 +29,46 @@ PluginImporter: Exclude Win64: 0 Exclude iOS: 1 Exclude tvOS: 1 - - first: - Android: Android - second: - enabled: 0 - settings: - CPU: ARMv7 - - first: - Any: - second: - enabled: 0 - settings: {} - - first: - Editor: Editor - second: + Editor: enabled: 1 settings: CPU: AnyCPU DefaultValueInitialized: true OS: AnyOS - - first: - Standalone: Linux64 - second: + GameCoreScarlett: + enabled: 1 + settings: {} + GameCoreXboxOne: + enabled: 1 + settings: {} + Linux64: enabled: 1 settings: CPU: x86_64 - - first: - Standalone: OSXUniversal - second: + OSXUniversal: enabled: 0 settings: CPU: None - - first: - Standalone: Win - second: + Win: enabled: 1 settings: CPU: x86 - - first: - Standalone: Win64 - second: + Win64: enabled: 1 settings: CPU: x86_64 - - first: - Windows Store Apps: WindowsStoreApps - second: + WindowsStoreApps: enabled: 0 settings: CPU: AnyCPU - - first: - iPhone: iOS - second: + iOS: enabled: 0 settings: AddToEmbeddedBinaries: false CPU: AnyCPU CompileFlags: FrameworkDependencies: - - first: - tvOS: tvOS - second: + tvOS: enabled: 0 settings: CPU: AnyCPU diff --git a/package-dev/Runtime/SentryInitialization.cs b/package-dev/Runtime/SentryInitialization.cs index 918cc2165..2c4ec2534 100644 --- a/package-dev/Runtime/SentryInitialization.cs +++ b/package-dev/Runtime/SentryInitialization.cs @@ -5,6 +5,8 @@ #define SENTRY_NATIVE_ANDROID #elif UNITY_64 && (UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX) #define SENTRY_NATIVE +#elif UNITY_GAMECORE +#define SENTRY_NATIVE #elif UNITY_WEBGL #define SENTRY_WEBGL #endif @@ -55,6 +57,10 @@ public static class SentryInitialization #endif public static void Init() { +#if IL2CPP_LINENUMBER_SUPPORT + Debug.Log("should work now"); +#endif + var unityInfo = new SentryUnityInfo(); // Loading the options invokes the ScriptableOption`Configure` callback. Users can disable the SDK via code. var options = ScriptableSentryUnityOptions.LoadSentryUnityOptions(unityInfo); @@ -90,6 +96,7 @@ private static void SetupNativeSdk(SentryUnityOptions options, SentryUnityInfo u #elif SENTRY_NATIVE_ANDROID SentryNativeAndroid.Configure(options, unityInfo); #elif SENTRY_NATIVE + options.DiagnosticLogger?.LogDebug("Considering this a native thing!"); SentryNative.Configure(options, unityInfo); #elif SENTRY_WEBGL SentryWebGL.Configure(options); @@ -290,7 +297,8 @@ public bool IsKnownPlatform() platform == RuntimePlatform.OSXPlayer || platform == RuntimePlatform.LinuxEditor || platform == RuntimePlatform.LinuxPlayer || - platform == RuntimePlatform.WebGLPlayer + platform == RuntimePlatform.WebGLPlayer || + platform == RuntimePlatform.GameCoreXboxSeries #if UNITY_2021_3_OR_NEWER || platform == RuntimePlatform.WindowsServer || @@ -325,6 +333,8 @@ public bool IsNativeSupportEnabled(SentryUnityOptions options, RuntimePlatform p return options.MacosNativeSupportEnabled; case RuntimePlatform.LinuxPlayer: return options.LinuxNativeSupportEnabled; + case RuntimePlatform.GameCoreXboxSeries: + return true; #if UNITY_2021_3_OR_NEWER case RuntimePlatform.WindowsServer: return options.WindowsNativeSupportEnabled; @@ -344,6 +354,7 @@ public bool IsSupportedBySentryNative(RuntimePlatform platform) return platform == RuntimePlatform.Android || platform == RuntimePlatform.LinuxPlayer || platform == RuntimePlatform.WindowsPlayer + || platform == RuntimePlatform.GameCoreXboxSeries #if UNITY_2021_3_OR_NEWER || platform == RuntimePlatform.WindowsServer || platform == RuntimePlatform.OSXServer @@ -366,6 +377,8 @@ public string GetDebugImageType(RuntimePlatform platform) return "elf"; case RuntimePlatform.WindowsPlayer: return "pe"; + case RuntimePlatform.GameCoreXboxSeries: + return "pe"; #if UNITY_2021_3_OR_NEWER case RuntimePlatform.WindowsServer: return "pe"; diff --git a/src/Sentry.Unity.Editor/Native/BuildPostProcess.cs b/src/Sentry.Unity.Editor/Native/BuildPostProcess.cs index 751e4491f..dd66a9c52 100644 --- a/src/Sentry.Unity.Editor/Native/BuildPostProcess.cs +++ b/src/Sentry.Unity.Editor/Native/BuildPostProcess.cs @@ -18,10 +18,11 @@ public static class BuildPostProcess public static void OnPostProcessBuild(BuildTarget target, string executablePath) { var targetGroup = BuildPipeline.GetBuildTargetGroup(target); - if (targetGroup is not BuildTargetGroup.Standalone) - { - return; - } + // TODO: Is Xbox standalone? + // if (targetGroup is not BuildTargetGroup.Standalone) + // { + // return; + // } var (options, cliOptions) = SentryScriptableObject.ConfiguredBuildTimeOptions(); var logger = options?.DiagnosticLogger ?? new UnityLogger(options ?? new SentryUnityOptions()); @@ -77,6 +78,7 @@ public static void OnPostProcessBuild(BuildTarget target, string executablePath) BuildTarget.StandaloneWindows64 => options.WindowsNativeSupportEnabled, BuildTarget.StandaloneOSX => options.MacosNativeSupportEnabled, BuildTarget.StandaloneLinux64 => options.LinuxNativeSupportEnabled, + (BuildTarget)42 => true, _ => false, }; @@ -94,6 +96,9 @@ private static void AddCrashHandler(IDiagnosticLogger logger, BuildTarget target case BuildTarget.StandaloneOSX: // No standalone crash handler for Linux/macOS - uses built-in handlers. return; + case (BuildTarget)42: + logger.LogDebug("I know it's Xbox but I don't know what do to with it (yet)."); + break; default: throw new ArgumentException($"Unsupported build target: {target}"); } @@ -219,6 +224,9 @@ private static void UploadDebugSymbols(IDiagnosticLogger logger, BuildTarget tar addPath(Path.GetFileNameWithoutExtension(executableName) + "_BackUpThisFolder_ButDontShipItWithYourGame"); } break; + case (BuildTarget)42: + logger.LogDebug("This is where I would attempt to upload stuff for Xbox to Sentry as well."); + break; default: logger.LogError($"Symbol upload for '{target}' is currently not supported."); break; diff --git a/src/Sentry.Unity.Native/SentryNative.cs b/src/Sentry.Unity.Native/SentryNative.cs index 6f15a65f8..cacfbc71b 100644 --- a/src/Sentry.Unity.Native/SentryNative.cs +++ b/src/Sentry.Unity.Native/SentryNative.cs @@ -58,11 +58,11 @@ public static void Configure(SentryUnityOptions options, ISentryUnityInfo sentry options.NativeContextWriter = new NativeContextWriter(); // Use AnalyticsSessionInfo.userId as the default UserID in native & dotnet - options.DefaultUserId = AnalyticsSessionInfo.userId; - if (options.DefaultUserId is not null) - { - options.ScopeObserver.SetUser(new SentryUser { Id = options.DefaultUserId }); - } + // options.DefaultUserId = AnalyticsSessionInfo.userId; + // if (options.DefaultUserId is not null) + // { + // options.ScopeObserver.SetUser(new SentryUser { Id = options.DefaultUserId }); + // } // Note: we must actually call the function now and on every other call use the value we get here. // Additionally, we cannot call this multiple times for the same directory, because the result changes diff --git a/src/Sentry.Unity/Integrations/UnityScopeIntegration.cs b/src/Sentry.Unity/Integrations/UnityScopeIntegration.cs index 02cd0c465..aa2999588 100644 --- a/src/Sentry.Unity/Integrations/UnityScopeIntegration.cs +++ b/src/Sentry.Unity/Integrations/UnityScopeIntegration.cs @@ -73,7 +73,8 @@ private void PopulateApp(App app) private void PopulateOperatingSystem(OperatingSystem operatingSystem) { - operatingSystem.RawDescription = MainThreadData.OperatingSystem; + // operatingSystem.RawDescription = MainThreadData.OperatingSystem; + operatingSystem.RawDescription = "Xbox 10.0.26100"; } private void PopulateDevice(Device device)