-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from matryx/Matryx_Amendment
Matryx Amendment
- Loading branch information
Showing
254 changed files
with
54,145 additions
and
16,781 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 2 additions & 3 deletions
5
...s/Resources/Prefabs/MathBox/Textures.meta → Assets/Libs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"; | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.