Skip to content

Commit

Permalink
Merge pull request #14 from matryx/Matryx_Amendment
Browse files Browse the repository at this point in the history
Matryx Amendment
  • Loading branch information
Astrovicis authored Dec 11, 2018
2 parents 9b93605 + 162e7af commit fc0f34f
Show file tree
Hide file tree
Showing 254 changed files with 54,145 additions and 16,781 deletions.
Binary file not shown.
Binary file added .vs/Calcflow/v15/Server/sqlite3/storage.ide-wal
Binary file not shown.
8 changes: 4 additions & 4 deletions Assets/360VRCameraCaptureRig/LS360VRCamera.cs
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ IEnumerator StartFullCapture ()
{
if(disableOVR)
{
UnityEngine.VR.VRSettings.enabled = false;
UnityEngine.XR.XRSettings.enabled = false;
}

yield return new WaitForSeconds(0.2f);
Expand All @@ -514,7 +514,7 @@ public void StopCaptureEveryFrame()
capturingEveryFrame = false;
if (disableOVR)
{
UnityEngine.VR.VRSettings.enabled = true;
UnityEngine.XR.XRSettings.enabled = true;
}
}

Expand Down Expand Up @@ -560,7 +560,7 @@ public IEnumerator FadeOut(IEnumerable<LSFadeController> fadeControls)
}
if (disableOVR)
{
UnityEngine.VR.VRSettings.enabled = false;
UnityEngine.XR.XRSettings.enabled = false;
}

}
Expand All @@ -569,7 +569,7 @@ public IEnumerator FadeIn(IEnumerable<LSFadeController> fadeControls)
{
if (disableOVR)
{
UnityEngine.VR.VRSettings.enabled = true;
UnityEngine.XR.XRSettings.enabled = true;
}
Log("Fading back in");
float elapsedTime = 0.0f;
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Assets/Libs/Sentry.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

69 changes: 69 additions & 0 deletions Assets/Libs/Sentry/Dsn.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
using System.Text.RegularExpressions;
using System;
using UnityEngine;

namespace Unity3DRavenCS
{
public class DSN
{
private bool m_isValid;
public bool isValid { get { return m_isValid; } }

private string m_dsnUri;
private string m_protocol;
private string m_publicKey;
private string m_host;
private int m_projectID;

public string sentryUri;

public DSN(string dsnUri)
{
m_dsnUri = dsnUri;

m_isValid = Parse();
}

private bool Parse()
{
if (string.IsNullOrEmpty(m_dsnUri))
{
return false;
}

Regex reg = new Regex(@"^(?<protocol>[\w]+)://(?<publicKey>[\w]+)@(?<host>[\w\d.:-_]+)/(?<projectID>[\d]+)[/]?$", RegexOptions.IgnoreCase);
Match match = reg.Match(m_dsnUri);

try
{
m_protocol = match.Groups["protocol"].Value;
m_publicKey = match.Groups["publicKey"].Value;
m_host = match.Groups["host"].Value;
m_projectID = System.Convert.ToInt32(match.Groups["projectID"].Value);
}
catch
{
return false;
}

this.sentryUri = string.Format("{0}://{1}/api/{2}/store/", m_protocol, m_host, m_projectID);

return true;
}

public string XSentryAuthHeader()
{
return string.Format(
"Sentry sentry_version=7, sentry_client={0}, sentry_timestamp={1}, sentry_key={2}",
UserAgent(),
(long)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds,
m_publicKey
);
}

public string UserAgent()
{
return "Unity3DRavenCS/0.0.1";
}
}
}
11 changes: 11 additions & 0 deletions Assets/Libs/Sentry/Dsn.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

145 changes: 145 additions & 0 deletions Assets/Libs/Sentry/MessagePacket.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
using System;
using System.Collections.Generic;
using UnityEngine;
using Newtonsoft.Json;


namespace Unity3DRavenCS
{
public abstract class Packet
{
public struct SDK
{
public string name;
public string version;
}

[JsonProperty(PropertyName = "sdk")]
protected SDK m_sdk = new SDK();

public struct Device
{
public string name;
public string version;
public string build;
}

[JsonProperty(PropertyName = "device")]
protected Device m_device = new Device();

[JsonProperty(PropertyName = "event_id")]
protected string m_eventID;
[JsonProperty(PropertyName = "message")]
protected string m_message;
[JsonProperty(PropertyName = "timestamp")]
protected string m_timestamp;
[JsonProperty(PropertyName = "platform")]
protected string m_platform;
[JsonProperty(PropertyName = "tags")]
protected Dictionary<string, string> m_tags;
[JsonProperty(PropertyName = "release")]
protected readonly string VersionNumber = "Nanome@" + Nanome.Core.Version.Current;

public Packet(string message, Dictionary<string, string> tags)
{
m_eventID = Guid.NewGuid().ToString("N");
m_message = message;
m_platform = "csharp";
m_sdk.name = "Unity3D-Raven-CS";
m_sdk.version = Version.VERSION;
m_timestamp = DateTime.UtcNow.ToString("s");
m_device.name = "n/a";
m_device.version = "0";
m_device.build = "n/a";
m_tags = tags;
}

public virtual string ToJson()
{
return JsonConvert.SerializeObject(this);
}
}

public class MessagePacket : Packet
{
#pragma warning disable 0414
[JsonProperty(PropertyName = "level")]
private string m_level;
[JsonProperty(PropertyName = "logger")]
private string m_logger;
[JsonProperty(PropertyName = "stacktrace")]
private RavenStackTrace m_stacktrace;
#pragma warning restore 0414

public MessagePacket(string message, LogType logType, Dictionary<string, string> tags, string stackTrace) : base(message, tags)
{
m_level = ToLogLevelFromLogType(logType);
if (!string.IsNullOrEmpty(stackTrace))
{
m_stacktrace = new RavenStackTrace(stackTrace);
}
}

public MessagePacket(string message, LogType logType, Dictionary<string, string> tags, System.Diagnostics.StackTrace stackTrace) : base(message, tags)
{
this.m_level = ToLogLevelFromLogType(logType);
if (stackTrace != null)
{
m_stacktrace = new RavenStackTrace(stackTrace);
}
}

private string ToLogLevelFromLogType(LogType logType)
{
string logLevel;
switch (logType)
{
case LogType.Log:
logLevel = "info";
break;
case LogType.Warning:
logLevel = "warning";
break;
case LogType.Error:
case LogType.Assert:
case LogType.Exception:
logLevel = "error";
break;
default:
logLevel = "error";
break;
}
return logLevel;
}
}


public class ExceptionPacket : Packet
{
#pragma warning disable 0414
[JsonProperty(PropertyName = "exception")]
private RavenException m_exception;
#pragma warning restore 0414

public ExceptionPacket(Exception exception, Dictionary<string, string> tags) : base(exception.Message, tags)
{
this.m_exception = new RavenException(exception);
}

public ExceptionPacket(string message, string stackTrace, Dictionary<string, string> tags) : base(message, tags)
{
this.m_exception = new RavenException(message, stackTrace);
}

public ExceptionPacket(string message, System.Diagnostics.StackTrace stackTrace, Dictionary<string, string> tags) : base(message, tags)
{
this.m_exception = new RavenException(message, stackTrace);
}
}


public struct ResponsePacket
{
public string id;
}
}
11 changes: 11 additions & 0 deletions Assets/Libs/Sentry/MessagePacket.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 38 additions & 0 deletions Assets/Libs/Sentry/RavenException.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
using System;
using Newtonsoft.Json;

namespace Unity3DRavenCS
{
public class RavenException
{
#pragma warning disable 0414
[JsonProperty(PropertyName = "stacktrace")]
private RavenStackTrace m_stacktrace;
[JsonProperty(PropertyName = "value")]
private string m_value;
[JsonProperty(PropertyName = "type")]
private string m_type;
#pragma warning restore 0414

public RavenException(Exception exception)
{
m_stacktrace = new RavenStackTrace(exception);
m_value = exception.Message;
m_type = exception.GetType().ToString();
}

public RavenException(string message, string stackTrace)
{
m_stacktrace = new RavenStackTrace(stackTrace);
m_value = message;
m_type = message;
}

public RavenException(string message, System.Diagnostics.StackTrace stackTrace)
{
m_stacktrace = new RavenStackTrace(stackTrace);
m_value = message;
m_type = message;
}
}
}
11 changes: 11 additions & 0 deletions Assets/Libs/Sentry/RavenException.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit fc0f34f

Please sign in to comment.