Skip to content

Commit e91519e

Browse files
committed
Version 3.0.4: Switch support
1 parent a71d542 commit e91519e

File tree

6 files changed

+29
-11
lines changed

6 files changed

+29
-11
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Backtrace Unity Release Notes
22

3+
## Version 3.0.4
4+
Preliminary Nintendo Switch support has been introduced. The offline database is not currently supported in this version, but will be included in an upcoming release.
5+
36
## Version 3.0.3
47
This release includes significant improvements to performance by way of report filtering as well as improved performance diagnostics. Learn more below.
58

Editor/BacktraceConfigurationEditor.cs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public override void OnInspectorGUI()
2525
EditorGUILayout.PropertyField(
2626
serializedObject.FindProperty("HandleUnhandledExceptions"),
2727
new GUIContent(BacktraceConfigurationLabels.LABEL_HANDLE_UNHANDLED_EXCEPTION));
28-
28+
2929
EditorGUILayout.PropertyField(
3030
serializedObject.FindProperty("ReportPerMin"),
3131
new GUIContent(BacktraceConfigurationLabels.LABEL_REPORT_PER_MIN));
@@ -80,10 +80,14 @@ public override void OnInspectorGUI()
8080
EditorGUILayout.HelpBox("Please insert value greater or equal -1", MessageType.Error);
8181
}
8282
}
83+
#if !UNITY_SWITCH
8384
SerializedProperty enabled = serializedObject.FindProperty("Enabled");
8485
EditorGUILayout.PropertyField(enabled, new GUIContent(BacktraceConfigurationLabels.LABEL_ENABLE_DATABASE));
85-
86-
if (enabled.boolValue)
86+
bool databaseEnabled = enabled.boolValue;
87+
#else
88+
bool databaseEnabled = false;
89+
#endif
90+
if (databaseEnabled)
8791
{
8892

8993
SerializedProperty databasePath = serializedObject.FindProperty("DatabasePath");
@@ -97,7 +101,7 @@ public override void OnInspectorGUI()
97101
GUIStyle databaseFoldout = new GUIStyle(EditorStyles.foldout);
98102
showDatabaseSettings = EditorGUILayout.Foldout(showDatabaseSettings, "Advanced database settings", databaseFoldout);
99103
if (showDatabaseSettings)
100-
{
104+
{
101105
EditorGUILayout.PropertyField(
102106
serializedObject.FindProperty("DeduplicationStrategy"),
103107
new GUIContent(BacktraceConfigurationLabels.LABEL_DEDUPLICATION_RULES));

Runtime/BacktraceDatabase.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ public DeduplicationStrategy DeduplicationStrategy
106106
/// </summary>
107107
public void Reload()
108108
{
109-
110109
// validate configuration
111110
if (Configuration == null)
112111
{
@@ -118,8 +117,11 @@ public void Reload()
118117
return;
119118
}
120119

121-
120+
#if UNITY_SWITCH
121+
Enable = false;
122+
#else
122123
Enable = Configuration.Enabled && InitializeDatabasePaths();
124+
#endif
123125
if (!Enable)
124126
{
125127
if (Configuration.Enabled)
@@ -452,6 +454,10 @@ protected virtual void SetupMultisceneSupport()
452454
/// <returns>Success when directory exists, otherwise false</returns>
453455
protected virtual bool InitializeDatabasePaths()
454456
{
457+
if (!Configuration.Enabled)
458+
{
459+
return false;
460+
}
455461
DatabasePath = DatabasePathHelper.GetFullDatabasePath(Configuration.DatabasePath);
456462
if (string.IsNullOrEmpty(DatabasePath))
457463
{

Runtime/Model/BacktraceData.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public class BacktraceData
4545
/// <summary>
4646
/// Version of the C# library
4747
/// </summary>
48-
public const string AgentVersion = "3.0.3";
48+
public const string AgentVersion = "3.0.4";
4949

5050
/// <summary>
5151
/// Application thread details

Runtime/Model/JsonData/BacktraceAttributes.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,11 @@ private void SetLibraryAttributes(BacktraceReport report)
110110
Attributes["application.sandboxType"] = Application.sandboxType.ToString();
111111
Attributes["application.system.language"] = Application.systemLanguage.ToString();
112112
Attributes["application.unity.version"] = Application.unityVersion;
113-
Attributes["application.temporary_cache"] = Application.temporaryCachePath;
114113
Attributes["application.debug"] = Debug.isDebugBuild.ToString();
114+
#if !UNITY_SWITCH
115+
Attributes["application.temporary_cache"] = Application.temporaryCachePath;
116+
#endif
117+
115118

116119
}
117120

@@ -122,11 +125,13 @@ private void SetLibraryAttributes(BacktraceReport report)
122125
/// <returns>Machine uuid</returns>
123126
private static string GenerateMachineId()
124127
{
128+
#if !UNITY_WEBGL && !UNITY_SWITCH
129+
// DeviceUniqueIdentifier will return "Switch" on Nintendo Switch
130+
// try to generate random guid instead
125131
if (SystemInfo.deviceUniqueIdentifier != SystemInfo.unsupportedIdentifier)
126132
{
127133
return SystemInfo.deviceUniqueIdentifier;
128134
}
129-
#if !UNITY_WEBGL
130135
var networkInterface =
131136
NetworkInterface.GetAllNetworkInterfaces()
132137
.FirstOrDefault(n => n.OperationalStatus == OperationalStatus.Up);
@@ -144,7 +149,7 @@ private static string GenerateMachineId()
144149
var value = Convert.ToInt64(hex, 16);
145150
return GuidExtensions.FromLong(value).ToString();
146151
#else
147-
return Guid.NewGuid().ToString();
152+
return Guid.NewGuid().ToString();
148153
#endif
149154
}
150155

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "io.backtrace.unity",
33
"displayName": "Backtrace",
4-
"version": "3.0.3",
4+
"version": "3.0.4",
55
"unity": "2017.1",
66
"description": "Backtrace's integration with Unity games allows customers to capture and report handled and unhandled Unity exceptions to their Backtrace instance, instantly offering the ability to prioritize and debug software errors.",
77
"keywords": [

0 commit comments

Comments
 (0)