diff --git a/.API/.vs/CloudX.Shared/v15/.suo b/.API/.vs/CloudX.Shared/v15/.suo deleted file mode 100644 index 78f90fb..0000000 Binary files a/.API/.vs/CloudX.Shared/v15/.suo and /dev/null differ diff --git a/.API/.vs/CloudX.Shared/v15/Server/sqlite3/storage.ide b/.API/.vs/CloudX.Shared/v15/Server/sqlite3/storage.ide deleted file mode 100644 index 56758a8..0000000 Binary files a/.API/.vs/CloudX.Shared/v15/Server/sqlite3/storage.ide and /dev/null differ diff --git a/.API/.vs/CloudX.Shared/v15/Server/sqlite3/storage.ide-shm b/.API/.vs/CloudX.Shared/v15/Server/sqlite3/storage.ide-shm deleted file mode 100644 index d23e350..0000000 Binary files a/.API/.vs/CloudX.Shared/v15/Server/sqlite3/storage.ide-shm and /dev/null differ diff --git a/.API/.vs/CloudX.Shared/v15/Server/sqlite3/storage.ide-wal b/.API/.vs/CloudX.Shared/v15/Server/sqlite3/storage.ide-wal deleted file mode 100644 index 1466191..0000000 Binary files a/.API/.vs/CloudX.Shared/v15/Server/sqlite3/storage.ide-wal and /dev/null differ diff --git a/.API/AccountType.cs b/.API/AccountType.cs deleted file mode 100644 index e438a7f..0000000 --- a/.API/AccountType.cs +++ /dev/null @@ -1,23 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: CloudX.Shared.AccountType -// Assembly: CloudX.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -// MVID: 6223B97A-06A5-46CB-9E10-78604961D6EE -// Assembly location: J:\D\SteamLibrary\steamapps\common\NeosVR\HeadlessClient\CloudX.Shared.dll - -namespace CloudX.Shared -{ - public enum AccountType - { - Normal, - AgentSmith, - BladeRunner, - Gunter, - Neuromancer, - Architect, - Curator, - Level144, - Level250, - Anorak, - END, - } -} diff --git a/.API/AssemblyInfo.cs b/.API/AssemblyInfo.cs deleted file mode 100644 index 25f6449..0000000 --- a/.API/AssemblyInfo.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -[assembly: Extension] -[assembly: AssemblyTitle("CloudX.Shared")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("CloudX.Shared")] -[assembly: AssemblyCopyright("Copyright © 2017")] -[assembly: AssemblyTrademark("")] -[assembly: ComVisible(false)] -[assembly: Guid("b58780a7-fb37-46f1-8c56-ef44a1270475")] -[assembly: AssemblyFileVersion("1.0.0.0")] -[assembly: AssemblyVersion("1.0.0.0")] diff --git a/.API/AssetMetadataRequest.cs b/.API/AssetMetadataRequest.cs deleted file mode 100644 index 5a8ce02..0000000 --- a/.API/AssetMetadataRequest.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: CloudX.Shared.AssetMetadataRequest -// Assembly: CloudX.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -// MVID: 6223B97A-06A5-46CB-9E10-78604961D6EE -// Assembly location: J:\D\SteamLibrary\steamapps\common\NeosVR\HeadlessClient\CloudX.Shared.dll - -namespace CloudX.Shared -{ - public class AssetMetadataRequest - { - public const int MAX_BATCH_SIZE = 32; - } -} diff --git a/.API/AssetUtil.cs b/.API/AssetUtil.cs deleted file mode 100644 index 7a56456..0000000 --- a/.API/AssetUtil.cs +++ /dev/null @@ -1,80 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: CloudX.Shared.AssetUtil -// Assembly: CloudX.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -// MVID: 6223B97A-06A5-46CB-9E10-78604961D6EE -// Assembly location: J:\D\SteamLibrary\steamapps\common\NeosVR\HeadlessClient\CloudX.Shared.dll - -using System; -using System.IO; -using System.Security.Cryptography; - -namespace CloudX.Shared -{ - public static class AssetUtil - { - public static int COMPUTE_VERSION - { - get - { - return 4; - } - } - - public static string GenerateHashSignature(string file) - { - using (FileStream fileStream = File.OpenRead(file)) - return AssetUtil.GenerateHashSignature((Stream) fileStream); - } - - public static string GenerateHashSignature(Stream fileStream) - { - using (SHA256 shA256 = SHA256.Create()) - return BitConverter.ToString(shA256.ComputeHash(fileStream)).Replace("-", "").ToLower(); - } - - public static Uri GenerateURL(string signature, string extension) - { - if (!string.IsNullOrEmpty(extension) && extension[0] != '.') - extension = "." + extension; - return new Uri("neosdb:///" + signature + extension); - } - - public static string ExtractSignature(Uri uri) - { - string extension; - return AssetUtil.ExtractSignature(uri, out extension); - } - - public static string ExtractSignature(Uri uri, out string extension) - { - if (uri.Scheme != "neosdb") - throw new ArgumentException("Not a NeosDB URI"); - string segment = uri.Segments[1]; - extension = Path.GetExtension(segment); - return Path.GetFileNameWithoutExtension(segment); - } - - public static string ComposeIdentifier(string signature, string variant) - { - if (string.IsNullOrWhiteSpace(variant)) - return signature; - return signature + "&" + variant; - } - - public static void SplitIdentifier(string identifier, out string signature, out string variant) - { - int length = identifier.IndexOf('&'); - if (length >= 0) - { - variant = identifier.Substring(length + 1); - signature = identifier.Substring(0, length); - } - else - { - variant = (string) null; - signature = identifier; - } - signature = signature.ToLower(); - } - } -} diff --git a/.API/AssetVariantEntityType.cs b/.API/AssetVariantEntityType.cs deleted file mode 100644 index 1114c7e..0000000 --- a/.API/AssetVariantEntityType.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: CloudX.Shared.AssetVariantEntityType -// Assembly: CloudX.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -// MVID: 6223B97A-06A5-46CB-9E10-78604961D6EE -// Assembly location: J:\D\SteamLibrary\steamapps\common\NeosVR\HeadlessClient\CloudX.Shared.dll - -namespace CloudX.Shared -{ - public enum AssetVariantEntityType - { - BitmapMetadata, - BitmapVariant, - } -} diff --git a/.API/Cloud/AssetEntry.cs b/.API/Cloud/AssetEntry.cs deleted file mode 100644 index 0eccf9e..0000000 --- a/.API/Cloud/AssetEntry.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: CloudX.Shared.AssetEntry`1 -// Assembly: CloudX.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -// MVID: 6223B97A-06A5-46CB-9E10-78604961D6EE -// Assembly location: J:\D\SteamLibrary\steamapps\common\NeosVR\HeadlessClient\CloudX.Shared.dll - -using Newtonsoft.Json; -using System; -using System.Text.Json.Serialization; - -namespace CloudX.Shared -{ - [JsonObject(MemberSerialization = MemberSerialization.OptIn)] - public class AssetEntry where E : class, new() - { - [JsonProperty(PropertyName = "id")] - [JsonPropertyName("id")] - public string Id { get; set; } - - [JsonProperty(PropertyName = "ownerId")] - [JsonPropertyName("ownerId")] - public string OwnerId { get; set; } - - [JsonIgnore] - [JsonIgnore] - public string AssetHash - { - get - { - if (this.OwnerId == null || !this.OwnerId.StartsWith("A-")) - throw new Exception("OwnerId is invalid, cannot extract asset hash from it"); - return this.OwnerId.Substring("A-".Length); - } - set - { - this.OwnerId = "A-" + value; - } - } - - [JsonProperty(PropertyName = "entry")] - [JsonPropertyName("entry")] - public E Entry { get; set; } - - [JsonProperty(PropertyName = "computeLock")] - [JsonPropertyName("computeLock")] - public ComputationLock ComputeLock { get; set; } - } -} diff --git a/.API/Cloud/AssetInfo.cs b/.API/Cloud/AssetInfo.cs deleted file mode 100644 index 08f9d22..0000000 --- a/.API/Cloud/AssetInfo.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: CloudX.Shared.AssetInfo -// Assembly: CloudX.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -// MVID: 6223B97A-06A5-46CB-9E10-78604961D6EE -// Assembly location: J:\D\SteamLibrary\steamapps\common\NeosVR\HeadlessClient\CloudX.Shared.dll - -using Newtonsoft.Json; -using System.Text.Json.Serialization; - -namespace CloudX.Shared -{ - [JsonObject(MemberSerialization = MemberSerialization.OptIn)] - public class AssetInfo - { - [JsonProperty(PropertyName = "ownerId")] - [JsonPropertyName("ownerId")] - public string OwnerId { get; set; } - - [JsonProperty(PropertyName = "assetHash")] - [JsonPropertyName("assetHash")] - public string AssetHash { get; set; } - - [JsonProperty(PropertyName = "bytes")] - [JsonPropertyName("bytes")] - public long Bytes { get; set; } - - [JsonProperty(PropertyName = "free")] - [JsonPropertyName("free")] - public bool Free { get; set; } - - [JsonProperty(PropertyName = "isUploaded")] - [JsonPropertyName("isUploaded")] - public bool IsUploaded { get; set; } - - [JsonProperty(NullValueHandling = NullValueHandling.Ignore, PropertyName = "uploaderUserId")] - [JsonPropertyName("uploaderUserId")] - public string UploaderUserId { get; set; } - - [JsonProperty(NullValueHandling = NullValueHandling.Ignore, PropertyName = "countsAgainstMemberQuota")] - [JsonPropertyName("countsAgainstMemberQuota")] - public bool? CountsAgainstMemberQuota { get; set; } - } -} diff --git a/.API/Cloud/CloudMessage.cs b/.API/Cloud/CloudMessage.cs deleted file mode 100644 index 5565c08..0000000 --- a/.API/Cloud/CloudMessage.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: CloudX.Shared.CloudMessage -// Assembly: CloudX.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -// MVID: 6223B97A-06A5-46CB-9E10-78604961D6EE -// Assembly location: J:\D\SteamLibrary\steamapps\common\NeosVR\HeadlessClient\CloudX.Shared.dll - -using Newtonsoft.Json; -using System.Text.Json.Serialization; - -namespace CloudX.Shared -{ - public class CloudMessage - { - [JsonProperty(PropertyName = "Message")] - [JsonPropertyName("Message")] - public string Message { get; set; } - - public static string ExtractMessage(string content) - { - try - { - return JsonConvert.DeserializeObject(content)?.Message ?? content; - } - catch - { - return content; - } - } - } -} diff --git a/.API/Cloud/CloudVariable.cs b/.API/Cloud/CloudVariable.cs deleted file mode 100644 index b84d4b4..0000000 --- a/.API/Cloud/CloudVariable.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: CloudX.Shared.CloudVariable -// Assembly: CloudX.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -// MVID: 6223B97A-06A5-46CB-9E10-78604961D6EE -// Assembly location: J:\D\SteamLibrary\steamapps\common\NeosVR\HeadlessClient\CloudX.Shared.dll - -using Newtonsoft.Json; -using System.Text.Json.Serialization; - -namespace CloudX.Shared -{ - public class CloudVariable - { - [JsonProperty("ownerId")] - [JsonPropertyName("ownerId")] - public string VariableOwnerId { get; set; } - - [JsonProperty("path")] - [JsonPropertyName("path")] - public string Path { get; set; } - - [JsonProperty("value")] - [JsonPropertyName("value")] - public string Value { get; set; } - - public void GetDefinitionPath(out string ownerId, out string subpath) - { - CloudVariable.GetDefinitionPath(this.Path, out ownerId, out subpath); - } - - public static void GetDefinitionPath(string path, out string ownerId, out string subpath) - { - int length = path.IndexOf('.'); - ownerId = path.Substring(0, length); - subpath = path.Substring(length + 1); - } - } -} diff --git a/.API/Cloud/CloudVariableDefinition.cs b/.API/Cloud/CloudVariableDefinition.cs deleted file mode 100644 index 263c6af..0000000 --- a/.API/Cloud/CloudVariableDefinition.cs +++ /dev/null @@ -1,56 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: CloudX.Shared.CloudVariableDefinition -// Assembly: CloudX.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -// MVID: 6223B97A-06A5-46CB-9E10-78604961D6EE -// Assembly location: J:\D\SteamLibrary\steamapps\common\NeosVR\HeadlessClient\CloudX.Shared.dll - -using Newtonsoft.Json; -using System.Text.Json.Serialization; - -namespace CloudX.Shared -{ - public class CloudVariableDefinition - { - [JsonProperty("definitionOwnerId")] - [JsonPropertyName("definitionOwnerId")] - public string DefinitionOwnerId { get; set; } - - [JsonProperty("subpath")] - [JsonPropertyName("subpath")] - public string Subpath { get; set; } - - [JsonProperty(PropertyName = "typeHint")] - [JsonPropertyName("typeHint")] - public string TypeHint { get; set; } - - [JsonProperty(PropertyName = "defaultValue")] - [JsonPropertyName("defaultValue")] - public string DefaultValue { get; set; } - - [JsonProperty(PropertyName = "variableOwnerCanRead")] - [JsonPropertyName("variableOwnerCanRead")] - public bool VariableOwnerCanRead { get; set; } - - [JsonProperty(PropertyName = "variableOwnerCanWrite")] - [JsonPropertyName("variableOwnerCanWrite")] - public bool VariableOwnerCanWrite { get; set; } - - [JsonProperty(PropertyName = "anyoneCanRead")] - [JsonPropertyName("anyoneCanRead")] - public bool AnyoneCanRead { get; set; } - - [JsonProperty(PropertyName = "anyoneCanWrite")] - [JsonPropertyName("anyoneCanWrite")] - public bool AnyoneCanWrite { get; set; } - - public bool CanRead(string variableOwnerId, string readerId) - { - return this.AnyoneCanRead || this.VariableOwnerCanRead && variableOwnerId == readerId || readerId == this.DefinitionOwnerId; - } - - public bool CanWrite(string variableOwnerId, string writerId) - { - return this.AnyoneCanWrite || this.VariableOwnerCanWrite && variableOwnerId == writerId || writerId == this.DefinitionOwnerId; - } - } -} diff --git a/.API/Cloud/Friend.cs b/.API/Cloud/Friend.cs deleted file mode 100644 index 265fd4d..0000000 --- a/.API/Cloud/Friend.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: CloudX.Shared.Friend -// Assembly: CloudX.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -// MVID: 6223B97A-06A5-46CB-9E10-78604961D6EE -// Assembly location: J:\D\SteamLibrary\steamapps\common\NeosVR\HeadlessClient\CloudX.Shared.dll - -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using System; -using System.Text.Json.Serialization; - -namespace CloudX.Shared -{ - [JsonObject(MemberSerialization = MemberSerialization.OptIn)] - public class Friend - { - [JsonProperty(PropertyName = "id")] - [JsonPropertyName("id")] - public string FriendUserId { get; set; } - - [JsonProperty(PropertyName = "ownerId")] - [JsonPropertyName("ownerId")] - public string OwnerId { get; set; } - - [JsonProperty(PropertyName = "friendUsername")] - [JsonPropertyName("friendUsername")] - public string FriendUsername { get; set; } - - [JsonProperty(PropertyName = "friendStatus")] - [JsonPropertyName("friendStatus")] - [Newtonsoft.Json.JsonConverter(typeof (StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof (JsonStringEnumConverter))] - public FriendStatus FriendStatus { get; set; } - - [JsonProperty(PropertyName = "isAccepted")] - [JsonPropertyName("isAccepted")] - public bool IsAccepted { get; set; } - - [JsonProperty(PropertyName = "userStatus")] - [JsonPropertyName("userStatus")] - public UserStatus UserStatus { get; set; } - - [JsonProperty(PropertyName = "latestMessageTime")] - [JsonPropertyName("latestMessageTime")] - public DateTime LatestMessageTime { get; set; } - - [JsonProperty(PropertyName = "profile")] - [JsonPropertyName("profile")] - public UserProfile Profile { get; set; } - } -} diff --git a/.API/Cloud/Group.cs b/.API/Cloud/Group.cs deleted file mode 100644 index fba43f9..0000000 --- a/.API/Cloud/Group.cs +++ /dev/null @@ -1,34 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: CloudX.Shared.Group -// Assembly: CloudX.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -// MVID: 6223B97A-06A5-46CB-9E10-78604961D6EE -// Assembly location: J:\D\SteamLibrary\steamapps\common\NeosVR\HeadlessClient\CloudX.Shared.dll - -using Newtonsoft.Json; -using System.Text.Json.Serialization; - -namespace CloudX.Shared -{ - public class Group - { - [JsonProperty(PropertyName = "id")] - [JsonPropertyName("id")] - public string GroupId { get; set; } - - [JsonProperty(PropertyName = "adminUserId")] - [JsonPropertyName("adminUserId")] - public string AdminUserId { get; set; } - - [JsonProperty(PropertyName = "name")] - [JsonPropertyName("name")] - public string Name { get; set; } - - [JsonProperty(PropertyName = "quotaBytes")] - [JsonPropertyName("quotaBytes")] - public long QuotaBytes { get; set; } - - [JsonProperty(PropertyName = "usedBytes")] - [JsonPropertyName("usedBytes")] - public long UsedBytes { get; set; } - } -} diff --git a/.API/Cloud/IRecord.cs b/.API/Cloud/IRecord.cs deleted file mode 100644 index 0bf730b..0000000 --- a/.API/Cloud/IRecord.cs +++ /dev/null @@ -1,76 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: CloudX.Shared.RecordHelper -// Assembly: CloudX.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -// MVID: 6223B97A-06A5-46CB-9E10-78604961D6EE -// Assembly location: J:\D\SteamLibrary\steamapps\common\NeosVR\HeadlessClient\CloudX.Shared.dll - -using System; - -namespace CloudX.Shared -{ - public static class RecordHelper - { - public static bool IsSameVersion(this IRecord record, IRecord other) - { - if (record.LastModifyingMachineId == other.LastModifyingMachineId && record.LastModifyingUserId == other.LastModifyingUserId) - return record.LocalVersion == other.LocalVersion; - if (record.LocalVersion == other.LocalVersion && record.GlobalVersion == other.GlobalVersion && record.LastModifyingMachineId == other.LastModifyingMachineId) - return record.LastModifyingUserId == other.LastModifyingUserId; - return false; - } - - public static bool IsSameRecord(this IRecord record, IRecord other) - { - if (record.OwnerId == other.OwnerId) - return record.RecordId == other.RecordId; - return false; - } - - public static void InheritPermissions(this IRecord record, IRecord source) - { - record.IsPublic = source.IsPublic; - record.IsForPatrons = source.IsForPatrons; - } - - public static bool CanOverwrite(this IRecord record, IRecord oldRecord) - { - if (oldRecord == null) - return true; - if (record.LastModifyingMachineId == oldRecord.LastModifyingMachineId && record.LastModifyingUserId == oldRecord.LastModifyingUserId) - return record.LocalVersion > oldRecord.LocalVersion; - return record.GlobalVersion == oldRecord.GlobalVersion; - } - - public static void TakeIdentityFrom(this IRecord record, IRecord source) - { - record.RecordId = source.RecordId; - record.OwnerId = source.OwnerId; - record.LocalVersion = source.LocalVersion; - record.GlobalVersion = source.GlobalVersion; - record.LastModifyingMachineId = source.LastModifyingMachineId; - record.LastModifyingUserId = source.LastModifyingUserId; - record.IsPublic = source.IsPublic; - record.IsForPatrons = source.IsForPatrons; - record.IsListed = source.IsListed; - record.FirstPublishTime = source.FirstPublishTime; - record.CreationTime = source.CreationTime; - record.Visits = source.Visits; - record.Rating = source.Rating; - } - - public static Uri GetUrl(IRecord record) - { - return RecordUtil.GenerateUri(record.OwnerId, record.RecordId); - } - - public static void SetUrl(IRecord record, Uri url) - { - string ownerId; - string recordId; - if (!RecordUtil.ExtractRecordID(url, out ownerId, out recordId)) - throw new Exception("Invalid Record URL"); - record.OwnerId = ownerId; - record.RecordId = recordId; - } - } -} diff --git a/.API/Cloud/Member.cs b/.API/Cloud/Member.cs deleted file mode 100644 index 814423b..0000000 --- a/.API/Cloud/Member.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: CloudX.Shared.Member -// Assembly: CloudX.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -// MVID: 6223B97A-06A5-46CB-9E10-78604961D6EE -// Assembly location: J:\D\SteamLibrary\steamapps\common\NeosVR\HeadlessClient\CloudX.Shared.dll - -using Newtonsoft.Json; -using System.Text.Json.Serialization; - -namespace CloudX.Shared -{ - public class Member - { - [JsonProperty(PropertyName = "id")] - [JsonPropertyName("id")] - public string UserId { get; set; } - - [JsonProperty(PropertyName = "ownerId")] - [JsonPropertyName("ownerId")] - public string GroupId { get; set; } - - [JsonProperty(PropertyName = "quotaBytes")] - [JsonPropertyName("quotaBytes")] - public long QuotaBytes { get; set; } - - [JsonProperty(PropertyName = "usedBytes")] - [JsonPropertyName("usedBytes")] - public long UsedBytes { get; set; } - } -} diff --git a/.API/Cloud/Membership.cs b/.API/Cloud/Membership.cs deleted file mode 100644 index e7e55d3..0000000 --- a/.API/Cloud/Membership.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: CloudX.Shared.Membership -// Assembly: CloudX.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -// MVID: 6223B97A-06A5-46CB-9E10-78604961D6EE -// Assembly location: J:\D\SteamLibrary\steamapps\common\NeosVR\HeadlessClient\CloudX.Shared.dll - -using Newtonsoft.Json; -using System.Text.Json.Serialization; - -namespace CloudX.Shared -{ - public class Membership - { - [JsonProperty(PropertyName = "ownerId")] - [JsonPropertyName("ownerId")] - public string UserId { get; set; } - - [JsonProperty(PropertyName = "id")] - [JsonPropertyName("id")] - public string GroupId { get; set; } - - [JsonProperty(PropertyName = "groupName")] - [JsonPropertyName("groupName")] - public string GroupName { get; set; } - } -} diff --git a/.API/Cloud/Message.cs b/.API/Cloud/Message.cs deleted file mode 100644 index c8e36c2..0000000 --- a/.API/Cloud/Message.cs +++ /dev/null @@ -1,97 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: CloudX.Shared.Message -// Assembly: CloudX.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -// MVID: 6223B97A-06A5-46CB-9E10-78604961D6EE -// Assembly location: J:\D\SteamLibrary\steamapps\common\NeosVR\HeadlessClient\CloudX.Shared.dll - -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using System; -using System.Text.Json.Serialization; - -namespace CloudX.Shared -{ - [JsonObject(MemberSerialization = MemberSerialization.OptIn)] - public class Message - { - public static string GenerateId() - { - return "MSG-" + Guid.NewGuid().ToString(); - } - - [JsonProperty(PropertyName = "id")] - [JsonPropertyName("id")] - public string Id { get; set; } - - [JsonProperty(PropertyName = "ownerId")] - [JsonPropertyName("ownerId")] - public string OwnerId { get; set; } - - [JsonProperty(PropertyName = "recipientId")] - [JsonPropertyName("recipientId")] - public string RecipientId { get; set; } - - [JsonProperty(PropertyName = "senderId")] - [JsonPropertyName("senderId")] - public string SenderId { get; set; } - - [JsonProperty(PropertyName = "messageType")] - [JsonPropertyName("messageType")] - [Newtonsoft.Json.JsonConverter(typeof (StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof (JsonStringEnumConverter))] - public MessageType MessageType { get; set; } - - [JsonProperty(PropertyName = "content")] - [JsonPropertyName("content")] - public string Content { get; set; } - - public T ExtractContent() - { - return JsonConvert.DeserializeObject(this.Content); - } - - public void SetContent(T obj) - { - this.Content = JsonConvert.SerializeObject((object) obj); - } - - [JsonProperty(PropertyName = "sendTime")] - [JsonPropertyName("sendTime")] - public DateTime SendTime { get; set; } - - [JsonProperty(PropertyName = "lastUpdateTime")] - [JsonPropertyName("lastUpdateTime")] - public DateTime LastUpdateTime { get; set; } - - [JsonProperty(PropertyName = "readTime")] - [JsonPropertyName("readTime")] - public DateTime? ReadTime { get; set; } - - [JsonIgnore] - public bool IsSent - { - get - { - return this.SenderId == this.OwnerId; - } - } - - [JsonIgnore] - public bool IsReceived - { - get - { - return this.RecipientId == this.OwnerId; - } - } - - [JsonIgnore] - public bool IsRead - { - get - { - return this.ReadTime.HasValue; - } - } - } -} diff --git a/.API/Cloud/NeosSession.cs b/.API/Cloud/NeosSession.cs deleted file mode 100644 index 6f56560..0000000 --- a/.API/Cloud/NeosSession.cs +++ /dev/null @@ -1,91 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: CloudX.Shared.NeosSession -// Assembly: CloudX.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -// MVID: 6223B97A-06A5-46CB-9E10-78604961D6EE -// Assembly location: J:\D\SteamLibrary\steamapps\common\NeosVR\HeadlessClient\CloudX.Shared.dll - -using Newtonsoft.Json; -using System; -using System.Text.Json.Serialization; - -namespace CloudX.Shared -{ - public class NeosSession - { - [JsonProperty(PropertyName = "reverseTimestamp")] - [JsonPropertyName("reverseTimestamp")] - public string ReverseTimestamp { get; set; } - - [JsonProperty(PropertyName = "sessionId")] - [JsonPropertyName("sessionId")] - public string SessionId { get; set; } - - [JsonProperty(PropertyName = "neosVersion")] - [JsonPropertyName("neosVersion")] - public string NeosVersion { get; set; } - - [JsonProperty(PropertyName = "userId")] - [JsonPropertyName("userId")] - public string UserId { get; set; } - - [JsonProperty(PropertyName = "machineId")] - [JsonPropertyName("machineId")] - public string MachineId { get; set; } - - [JsonProperty(PropertyName = "countryCode")] - [JsonPropertyName("countryCode")] - public string CountryCode { get; set; } - - [JsonProperty(PropertyName = "systemLocale")] - [JsonPropertyName("systemLocale")] - public string SystemLocale { get; set; } - - [JsonProperty(PropertyName = "clientIp")] - [JsonPropertyName("clientIp")] - public string ClientIp { get; set; } - - [JsonProperty(PropertyName = "sessionStart")] - [JsonPropertyName("sessionStart")] - public DateTime SessionStart { get; set; } - - [JsonProperty(PropertyName = "sessionEnd")] - [JsonPropertyName("sessionEnd")] - public DateTime SessionEnd { get; set; } - - [JsonProperty(PropertyName = "visitedWorlds")] - [JsonPropertyName("visitedWorlds")] - public int VisitedWorlds { get; set; } - - [JsonProperty(PropertyName = "createdWorlds")] - [JsonPropertyName("createdWorlds")] - public int CreatedWorlds { get; set; } - - [JsonProperty(PropertyName = "operatingSystem")] - [JsonPropertyName("operatingSystem")] - public string OperatingSystem { get; set; } - - [JsonProperty(PropertyName = "headDevice")] - [JsonPropertyName("headDevice")] - public string HeadDevice { get; set; } - - [JsonProperty(PropertyName = "headDeviceModel")] - [JsonPropertyName("headDeviceModel")] - public string HeadDeviceModel { get; set; } - - [JsonProperty(PropertyName = "cpu")] - [JsonPropertyName("cpu")] - public string CPU { get; set; } - - [JsonProperty(PropertyName = "gpu")] - [JsonPropertyName("gpu")] - public string GPU { get; set; } - - [JsonProperty(PropertyName = "memoryBytes")] - [JsonPropertyName("memoryBytes")] - public long MemoryBytes { get; set; } - - [JsonProperty(PropertyName = "peripherals")] - [JsonPropertyName("peripherals")] - public string Peripherals { get; set; } - } -} diff --git a/.API/Cloud/Record.cs b/.API/Cloud/Record.cs deleted file mode 100644 index af38772..0000000 --- a/.API/Cloud/Record.cs +++ /dev/null @@ -1,161 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: CloudX.Shared.Record -// Assembly: CloudX.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -// MVID: 6223B97A-06A5-46CB-9E10-78604961D6EE -// Assembly location: J:\D\SteamLibrary\steamapps\common\NeosVR\HeadlessClient\CloudX.Shared.dll - -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Text.Json.Serialization; - -namespace CloudX.Shared -{ - [JsonObject(MemberSerialization = MemberSerialization.OptIn)] - [Serializable] - public class Record : IRecord - { - [JsonProperty(PropertyName = "id")] - [JsonPropertyName("id")] - public string RecordId { get; set; } - - [JsonProperty(PropertyName = "ownerId")] - [JsonPropertyName("ownerId")] - public string OwnerId { get; set; } - - [JsonProperty(PropertyName = "assetUri")] - [JsonPropertyName("assetUri")] - public string AssetURI { get; set; } - - [JsonIgnore] - public Uri URL - { - get - { - return RecordHelper.GetUrl((IRecord) this); - } - set - { - RecordHelper.SetUrl((IRecord) this, value); - } - } - - [JsonProperty(PropertyName = "globalVersion")] - [JsonPropertyName("globalVersion")] - public int GlobalVersion { get; set; } - - [JsonProperty(PropertyName = "localVersion")] - [JsonPropertyName("localVersion")] - public int LocalVersion { get; set; } - - [JsonProperty(PropertyName = "lastModifyingUserId")] - [JsonPropertyName("lastModifyingUserId")] - public string LastModifyingUserId { get; set; } - - [JsonProperty(PropertyName = "lastModifyingMachineId")] - [JsonPropertyName("lastModifyingMachineId")] - public string LastModifyingMachineId { get; set; } - - [JsonProperty(PropertyName = "name")] - [JsonPropertyName("name")] - public string Name { get; set; } - - [JsonProperty(NullValueHandling = NullValueHandling.Ignore, PropertyName = "description")] - [JsonPropertyName("description")] - public string Description { get; set; } - - [JsonProperty(PropertyName = "recordType")] - [JsonPropertyName("recordType")] - public string RecordType { get; set; } - - [JsonProperty(PropertyName = "ownerName")] - [JsonPropertyName("ownerName")] - public string OwnerName { get; set; } - - [JsonProperty(NullValueHandling = NullValueHandling.Ignore, PropertyName = "tags")] - [JsonPropertyName("tags")] - public HashSet Tags { get; set; } - - [JsonProperty(PropertyName = "path")] - [JsonPropertyName("path")] - public string Path { get; set; } - - [JsonProperty(NullValueHandling = NullValueHandling.Ignore, PropertyName = "thumbnailUri")] - [JsonPropertyName("thumbnailUri")] - public string ThumbnailURI { get; set; } - - [JsonProperty(PropertyName = "lastModificationTime")] - [JsonPropertyName("lastModificationTime")] - public DateTime LastModificationTime { get; set; } - - [JsonProperty(PropertyName = "creationTime")] - [JsonPropertyName("creationTime")] - public DateTime? CreationTime { get; set; } - - [JsonProperty(PropertyName = "firstPublishTime")] - [JsonPropertyName("firstPublishTime")] - public DateTime? FirstPublishTime { get; set; } - - [JsonProperty(PropertyName = "isPublic")] - [JsonPropertyName("isPublic")] - public bool IsPublic { get; set; } - - [JsonProperty(PropertyName = "isForPatrons")] - [JsonPropertyName("isForPatrons")] - public bool IsForPatrons { get; set; } - - [JsonProperty(PropertyName = "isListed")] - [JsonPropertyName("isListed")] - public bool IsListed { get; set; } - - [JsonProperty(PropertyName = "visits")] - [JsonPropertyName("visits")] - public int Visits { get; set; } - - [JsonProperty(PropertyName = "rating")] - [JsonPropertyName("rating")] - public double Rating { get; set; } - - [JsonProperty(PropertyName = "submissions")] - [JsonPropertyName("submissions")] - public List Submissions { get; set; } - - [JsonIgnore] - public List Manifest { get; set; } - - [JsonProperty(NullValueHandling = NullValueHandling.Ignore, PropertyName = "neosDBmanifest")] - [JsonPropertyName("neosDBmanifest")] - public List NeosDBManifest { get; set; } - - public static bool IsValidId(string recordId) - { - return recordId.StartsWith("R-"); - } - - [JsonIgnore] - public bool IsValidOwnerId - { - get - { - return IdUtil.GetOwnerType(this.OwnerId) != OwnerType.INVALID; - } - } - - [JsonIgnore] - public bool IsValidRecordId - { - get - { - return RecordUtil.IsValidRecordID(this.RecordId); - } - } - - public void ResetVersioning() - { - this.LocalVersion = 0; - this.GlobalVersion = 0; - this.LastModifyingMachineId = (string) null; - this.LastModifyingUserId = (string) null; - } - } -} diff --git a/.API/Cloud/RecordList.cs b/.API/Cloud/RecordList.cs deleted file mode 100644 index 4d9f39b..0000000 --- a/.API/Cloud/RecordList.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: CloudX.Shared.RecordList -// Assembly: CloudX.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -// MVID: 6223B97A-06A5-46CB-9E10-78604961D6EE -// Assembly location: J:\D\SteamLibrary\steamapps\common\NeosVR\HeadlessClient\CloudX.Shared.dll - -using Newtonsoft.Json; -using System.Collections.Generic; -using System.Text.Json.Serialization; - -namespace CloudX.Shared -{ - public class RecordList - { - [JsonProperty(PropertyName = "id")] - [JsonPropertyName("id")] - public string Id - { - get - { - return this.Name + "-" + this.Page.ToString(); - } - } - - [JsonProperty(PropertyName = "ownerId")] - [JsonPropertyName("ownerId")] - public string OwnerId { get; set; } - - [JsonProperty(PropertyName = "name")] - [JsonPropertyName("name")] - public string Name { get; set; } - - [JsonProperty(PropertyName = "page")] - [JsonPropertyName("page")] - public int Page { get; set; } - - [JsonProperty(PropertyName = "records")] - [JsonPropertyName("records")] - public List Records { get; set; } - } -} diff --git a/.API/Cloud/SessionUser.cs b/.API/Cloud/SessionUser.cs deleted file mode 100644 index 70d8df3..0000000 --- a/.API/Cloud/SessionUser.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: CloudX.Shared.SessionUser -// Assembly: CloudX.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -// MVID: 6223B97A-06A5-46CB-9E10-78604961D6EE -// Assembly location: J:\D\SteamLibrary\steamapps\common\NeosVR\HeadlessClient\CloudX.Shared.dll - -using Newtonsoft.Json; -using System; -using System.Text.Json.Serialization; - -namespace CloudX.Shared -{ - [JsonObject(MemberSerialization = MemberSerialization.OptIn)] - public class SessionUser : IEquatable - { - [JsonProperty(PropertyName = "username")] - [JsonPropertyName("username")] - public string Username { get; set; } - - [JsonProperty(PropertyName = "userID")] - [JsonPropertyName("userID")] - public string UserID { get; set; } - - [JsonProperty(PropertyName = "isPresent")] - [JsonPropertyName("isPresent")] - public bool IsPresent { get; set; } - - public bool Equals(SessionUser other) - { - if (this.Username == other.Username && this.UserID == other.UserID) - return this.IsPresent == other.IsPresent; - return false; - } - } -} diff --git a/.API/Cloud/Submission.cs b/.API/Cloud/Submission.cs deleted file mode 100644 index 61fd9a2..0000000 --- a/.API/Cloud/Submission.cs +++ /dev/null @@ -1,52 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: CloudX.Shared.Submission -// Assembly: CloudX.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -// MVID: 6223B97A-06A5-46CB-9E10-78604961D6EE -// Assembly location: J:\D\SteamLibrary\steamapps\common\NeosVR\HeadlessClient\CloudX.Shared.dll - -using Newtonsoft.Json; -using System; -using System.Text.Json.Serialization; - -namespace CloudX.Shared -{ - [Serializable] - public class Submission - { - [JsonProperty(PropertyName = "id")] - [JsonPropertyName("id")] - public string Id { get; set; } - - [JsonProperty(PropertyName = "ownerId")] - [JsonPropertyName("ownerId")] - public string GroupId { get; set; } - - [JsonProperty(PropertyName = "targetRecordId")] - [JsonPropertyName("targetRecordId")] - public RecordId TargetRecordId { get; set; } = new RecordId(); - - [JsonProperty(PropertyName = "submissionTime")] - [JsonPropertyName("submissionTime")] - public DateTime SubmissionTime { get; set; } - - [JsonProperty(PropertyName = "submittedById")] - [JsonPropertyName("submittedById")] - public string SubmittedById { get; set; } - - [JsonProperty(PropertyName = "submittedByName")] - [JsonPropertyName("submittedByName")] - public string SubmittedByName { get; set; } - - [JsonProperty(PropertyName = "featured")] - [JsonPropertyName("featured")] - public bool Featured { get; set; } - - [JsonProperty(PropertyName = "featuredByUserId")] - [JsonPropertyName("featuredByUserId")] - public string FeaturedByUserId { get; set; } - - [JsonProperty(PropertyName = "featuredTimestamp")] - [JsonPropertyName("featuredTimestamp")] - public DateTime? FeaturedTimestamp { get; set; } - } -} diff --git a/.API/Cloud/User.cs b/.API/Cloud/User.cs deleted file mode 100644 index 77e3d56..0000000 --- a/.API/Cloud/User.cs +++ /dev/null @@ -1,175 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: CloudX.Shared.User -// Assembly: CloudX.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -// MVID: 6223B97A-06A5-46CB-9E10-78604961D6EE -// Assembly location: J:\D\SteamLibrary\steamapps\common\NeosVR\HeadlessClient\CloudX.Shared.dll - -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text.Json.Serialization; - -namespace CloudX.Shared -{ - [JsonObject(MemberSerialization = MemberSerialization.OptIn)] - public class User - { - [JsonProperty(PropertyName = "id")] - [JsonPropertyName("id")] - public string Id { get; set; } - - [JsonProperty(PropertyName = "username")] - [JsonPropertyName("username")] - public string Username { get; set; } - - [JsonProperty(NullValueHandling = NullValueHandling.Ignore, PropertyName = "email")] - [JsonPropertyName("email")] - public string Email { get; set; } - - [JsonProperty(PropertyName = "registrationDate")] - [JsonPropertyName("registrationDate")] - public DateTime RegistrationDate { get; set; } - - [JsonProperty(PropertyName = "quotaBytes")] - [JsonPropertyName("quotaBytes")] - public long QuotaBytes { get; set; } = -1; - - [JsonProperty(PropertyName = "usedBytes")] - [JsonPropertyName("usedBytes")] - public long UsedBytes { get; set; } = -1; - - [JsonProperty(PropertyName = "isVerified")] - [JsonPropertyName("isVerified")] - public bool IsVerified { get; set; } - - [JsonProperty(PropertyName = "accountBanExpiration")] - [JsonPropertyName("accountBanExpiration")] - public DateTime AccountBanExpiration { get; set; } - - [JsonProperty(PropertyName = "publicBanExpiration")] - [JsonPropertyName("publicBanExpiration")] - public DateTime PublicBanExpiration { get; set; } - - [JsonProperty(PropertyName = "spectatorBanExpiration")] - [JsonPropertyName("spectatorBanExpiration")] - public DateTime SpectatorBanExpiration { get; set; } - - [JsonProperty(PropertyName = "muteBanExpiration")] - [JsonPropertyName("muteBanExpiration")] - public DateTime MuteBanExpiration { get; set; } - - [JsonIgnore] - public bool IsAccountBanned - { - get - { - return DateTime.UtcNow < this.AccountBanExpiration; - } - } - - [JsonIgnore] - public bool IsPublicBanned - { - get - { - return DateTime.UtcNow < this.PublicBanExpiration; - } - } - - [JsonIgnore] - public bool IsSpectatorBanned - { - get - { - return DateTime.UtcNow < this.SpectatorBanExpiration; - } - } - - [JsonIgnore] - public bool IsMuteBanned - { - get - { - return DateTime.UtcNow < this.MuteBanExpiration; - } - } - - [JsonProperty(NullValueHandling = NullValueHandling.Ignore, PropertyName = "password")] - [JsonPropertyName("password")] - public string Password { get; set; } - - [JsonProperty(NullValueHandling = NullValueHandling.Ignore, PropertyName = "recoverCode")] - [JsonPropertyName("recoverCode")] - public string RecoverCode { get; set; } - - [JsonProperty(PropertyName = "tags")] - [JsonPropertyName("tags")] - public List Tags { get; set; } - - [JsonProperty(PropertyName = "patreonData")] - [JsonPropertyName("patreonData")] - public UserPatreonData PatreonData { get; set; } - - [JsonProperty(PropertyName = "credits")] - [JsonPropertyName("credits")] - public Dictionary Credits { get; set; } - - [JsonProperty(PropertyName = "NCRdepositAddress")] - [JsonPropertyName("NCRdepositAddress")] - public string NCRDepositAddress { get; set; } - - [JsonProperty(PropertyName = "referralId")] - [JsonPropertyName("referralId")] - public string ReferralId { get; set; } - - [JsonProperty(PropertyName = "referrerUserId")] - [JsonPropertyName("referrerUserId")] - public string ReferrerUserId { get; set; } - - [JsonIgnore] - public AccountType CurrentAccountType - { - get - { - UserPatreonData patreonData = this.PatreonData; - if (patreonData == null) - return AccountType.Normal; - return patreonData.CurrentAccountType; - } - } - - [JsonIgnore] - public string AccountName - { - get - { - return this.PatreonData?.AccountName ?? NeosAccount.AccountName(AccountType.Normal); - } - } - - [JsonProperty(PropertyName = "profile")] - [JsonPropertyName("profile")] - public UserProfile Profile { get; set; } - - [JsonIgnore] - public bool IsPasswordValid - { - get - { - return this.Password != null && this.Password.Length >= 8 && this.Password.Count((Func) (c => char.IsDigit(c))) != 0 && (this.Password.Count((Func) (c => char.IsLetter(c))) != 0 && this.Password.Count((Func) (c => char.IsLower(c))) != 0) && this.Password.Count((Func) (c => char.IsUpper(c))) != 0; - } - } - - [JsonIgnore] - public bool IsUsernameValid - { - get - { - if (this.Username != null) - return this.Username.Length > 0; - return false; - } - } - } -} diff --git a/.API/Cloud/UserSession.cs b/.API/Cloud/UserSession.cs deleted file mode 100644 index 412d713..0000000 --- a/.API/Cloud/UserSession.cs +++ /dev/null @@ -1,50 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: CloudX.Shared.UserSession -// Assembly: CloudX.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -// MVID: 6223B97A-06A5-46CB-9E10-78604961D6EE -// Assembly location: J:\D\SteamLibrary\steamapps\common\NeosVR\HeadlessClient\CloudX.Shared.dll - -using Newtonsoft.Json; -using System; -using System.Text.Json.Serialization; - -namespace CloudX.Shared -{ - [JsonObject(MemberSerialization = MemberSerialization.OptIn)] - public class UserSession - { - [JsonProperty(PropertyName = "userId")] - [JsonPropertyName("userId")] - public string UserId { get; set; } - - [JsonProperty(PropertyName = "token")] - [JsonPropertyName("token")] - public string SessionToken { get; set; } - - [JsonProperty(PropertyName = "created")] - [JsonPropertyName("created")] - public DateTime SessionCreated { get; set; } - - [JsonProperty(PropertyName = "expire")] - [JsonPropertyName("expire")] - public DateTime SessionExpire { get; set; } - - [NullOnExternal] - [JsonProperty(PropertyName = "secretMachineId")] - [JsonPropertyName("secretMachineId")] - public string SecretMachineId { get; set; } - - [JsonProperty(PropertyName = "rememberMe")] - [JsonPropertyName("rememberMe")] - public bool RememberMe { get; set; } - - [JsonIgnore] - public bool IsExpired - { - get - { - return DateTime.UtcNow > this.SessionExpire.ToUniversalTime(); - } - } - } -} diff --git a/.API/Cloud/Visit.cs b/.API/Cloud/Visit.cs deleted file mode 100644 index 1ca3ed0..0000000 --- a/.API/Cloud/Visit.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: CloudX.Shared.Visit -// Assembly: CloudX.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -// MVID: 6223B97A-06A5-46CB-9E10-78604961D6EE -// Assembly location: J:\D\SteamLibrary\steamapps\common\NeosVR\HeadlessClient\CloudX.Shared.dll - -using Newtonsoft.Json; -using System; -using System.Text.Json.Serialization; - -namespace CloudX.Shared -{ - [JsonObject(MemberSerialization = MemberSerialization.OptIn)] - public class Visit - { - [JsonProperty(PropertyName = "url")] - [JsonPropertyName("url")] - public string URL { get; set; } - - [JsonProperty(PropertyName = "userId")] - [JsonPropertyName("userId")] - public string UserId { get; set; } - - [JsonProperty(PropertyName = "neosSessionID")] - [JsonPropertyName("neosSessionID")] - public string NeosSessionID { get; set; } - - [JsonProperty(PropertyName = "recordVersion")] - [JsonPropertyName("recordVersion")] - public int RecordVersion { get; set; } - - [JsonProperty(PropertyName = "duration")] - [JsonPropertyName("duration")] - public long Duration { get; set; } - - [JsonProperty(PropertyName = "start")] - [JsonPropertyName("start")] - public DateTime Start { get; set; } - - [JsonProperty(PropertyName = "end")] - [JsonPropertyName("end")] - public DateTime End { get; set; } - - [JsonProperty(PropertyName = "referal")] - [JsonPropertyName("referal")] - public string Referal { get; set; } - - [JsonIgnore] - public bool IsValid - { - get - { - return this.Start.Year >= 2016 && !(this.Start >= this.End) && ((this.End - this.Start).TotalSeconds >= (double) this.Duration && !string.IsNullOrWhiteSpace(this.URL)); - } - } - } -} diff --git a/.API/CloudResult.cs b/.API/CloudResult.cs deleted file mode 100644 index 072059e..0000000 --- a/.API/CloudResult.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: CloudX.Shared.CloudResult -// Assembly: CloudX.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -// MVID: 6223B97A-06A5-46CB-9E10-78604961D6EE -// Assembly location: J:\D\SteamLibrary\steamapps\common\NeosVR\HeadlessClient\CloudX.Shared.dll - -using Newtonsoft.Json; -using System.Net; - -namespace CloudX.Shared -{ - public class CloudResult - { - public HttpStatusCode State { get; private set; } - - public string Content { get; protected set; } - - public CloudResult(HttpStatusCode state, string content) - { - this.State = state; - this.Content = content; - if (!this.IsError) - return; - if (content == null) - return; - try - { - this.Content = JsonConvert.DeserializeObject(content)?.Message; - } - catch - { - this.Content = content; - } - } - - public bool IsOK - { - get - { - if (this.State != HttpStatusCode.OK) - return this.State == HttpStatusCode.NoContent; - return true; - } - } - - public bool IsError - { - get - { - return !this.IsOK; - } - } - - public override string ToString() - { - return string.Format("CloudResult - State: {0}, Content: {1}", (object) this.State, (object) this.Content); - } - } -} diff --git a/.API/CloudResult`1.cs b/.API/CloudResult`1.cs deleted file mode 100644 index a7862c5..0000000 --- a/.API/CloudResult`1.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: CloudX.Shared.CloudResult`1 -// Assembly: CloudX.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -// MVID: 6223B97A-06A5-46CB-9E10-78604961D6EE -// Assembly location: J:\D\SteamLibrary\steamapps\common\NeosVR\HeadlessClient\CloudX.Shared.dll - -using System.Net; - -namespace CloudX.Shared -{ - public class CloudResult : CloudResult - { - public T Entity { get; private set; } - - public CloudResult(T result, HttpStatusCode state, string content = null) - : base(state, content) - { - this.Entity = result; - } - - public CloudResult AsResult() where E : class - { - return new CloudResult((object) this.Entity as E, this.State, this.Content); - } - - public override string ToString() - { - return string.Format("CloudResult<{0}> - State: {1}, Content: {2}", (object) typeof (T), (object) this.State, (object) this.Content); - } - } -} diff --git a/.API/CloudX.Shared.csproj b/.API/CloudX.Shared.csproj deleted file mode 100644 index 06fdfa9..0000000 --- a/.API/CloudX.Shared.csproj +++ /dev/null @@ -1,134 +0,0 @@ - - - - - Debug - AnyCPU - {5B47FE9F-AB28-4231-AA06-43D87E0C4E18} - Library - CloudX.Shared - v4.7.1 - 1.0.0.0 - 512 - CloudX.Shared - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - lib\BaseX.dll - - - lib\System.Text.Json.dll - - - lib\Newtonsoft.Json.dll - - - lib\CodeX.dll - - - lib\System.Threading.Tasks.Extensions.dll - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.API/CloudX.Shared.pdb b/.API/CloudX.Shared.pdb deleted file mode 100644 index 1bdbc35..0000000 Binary files a/.API/CloudX.Shared.pdb and /dev/null differ diff --git a/.API/CloudX.Shared.sln b/.API/CloudX.Shared.sln deleted file mode 100644 index 0ef3f23..0000000 --- a/.API/CloudX.Shared.sln +++ /dev/null @@ -1,20 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CloudX.Shared", "CloudX.Shared.csproj", "{5B47FE9F-AB28-4231-AA06-43D87E0C4E18}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {5B47FE9F-AB28-4231-AA06-43D87E0C4E18}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5B47FE9F-AB28-4231-AA06-43D87E0C4E18}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5B47FE9F-AB28-4231-AA06-43D87E0C4E18}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5B47FE9F-AB28-4231-AA06-43D87E0C4E18}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/.API/CloudXInterface.cs b/.API/CloudXInterface.cs deleted file mode 100644 index 2773d21..0000000 --- a/.API/CloudXInterface.cs +++ /dev/null @@ -1,1882 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: CloudX.Shared.CloudXInterface -// Assembly: CloudX.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -// MVID: 6223B97A-06A5-46CB-9E10-78604961D6EE -// Assembly location: J:\D\SteamLibrary\steamapps\common\NeosVR\HeadlessClient\CloudX.Shared.dll - -using BaseX; -using CodeX; -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.IO; -using System.Linq; -using System.Net; -using System.Net.Http; -using System.Net.Http.Headers; -using System.Runtime.CompilerServices; -using System.Security.Cryptography; -using System.Text; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; - -namespace CloudX.Shared -{ - public class CloudXInterface - { - public static int DEFAULT_RETRIES = 5; - public static int UPLOAD_DEGREE_OF_PARALLELISM = 16; - public static bool DEBUG_UPLOAD = false; - private static readonly HttpMethod PATCH_METHOD = new HttpMethod("PATCH"); - public static float[] storageUpdateDelays = new float[4] - { - 1f, - 5f, - 15f, - 30f - }; - private static readonly MediaTypeHeaderValue JSON_MEDIA_TYPE = new MediaTypeHeaderValue("application/json") - { - CharSet = "utf-8" - }; - protected object lockobj = new object(); - private List _groupMemberships = new List(); - private Dictionary _groupMemberInfos = new Dictionary(); - private Dictionary _groups = new Dictionary(); - public Dictionary> cachedRecords = new Dictionary>(); - public const int SESSION_EXTEND_INTERVAL = 3600; - public static Action ProfilerBeginSampleCallback; - public static Action ProfilerEndSampleCallback; - public static Func MemoryStreamAllocator; - public static bool USE_CDN; - private const string CLOUDX_PRODUCTION_NEOS_API = "https://cloudx.azurewebsites.net"; - private const string CLOUDX_STAGING_NEOS_API = "https://cloudx-staging.azurewebsites.net"; - private const string CLOUDX_NEOS_BLOB = "https://cloudxstorage.blob.core.windows.net/"; - private const string CLOUDX_NEOS_CDN = "https://cloudx.azureedge.net/"; - private const string LOCAL_NEOS_API = "http://localhost:60612"; - private const string LOCAL_NEOS_BLOB = "http://127.0.0.1:10000/devstoreaccount1/"; - private UserSession _currentSession; - private User _currentUser; - private RSACryptoServiceProvider _cryptoProvider; - private AuthenticationHeaderValue _currentAuthenticationHeader; - private DateTime _lastSessionUpdate; - private DateTime _lastServerStatsUpdate; - - [Conditional("PROFILE")] - private void ProfilerBeginSample(string name) - { - Action beginSampleCallback = CloudXInterface.ProfilerBeginSampleCallback; - if (beginSampleCallback == null) - return; - beginSampleCallback(name); - } - - [Conditional("PROFILE")] - private void ProfilerEndSample() - { - Action endSampleCallback = CloudXInterface.ProfilerEndSampleCallback; - if (endSampleCallback == null) - return; - endSampleCallback(); - } - - public static CloudXInterface.CloudEndpoint CLOUD_ENDPOINT { get; set; } = CloudXInterface.CloudEndpoint.Production; - - public static string NEOS_API - { - get - { - switch (CloudXInterface.CLOUD_ENDPOINT) - { - case CloudXInterface.CloudEndpoint.Production: - return "https://cloudx.azurewebsites.net"; - case CloudXInterface.CloudEndpoint.Staging: - return "https://cloudx-staging.azurewebsites.net"; - case CloudXInterface.CloudEndpoint.Local: - return "http://localhost:60612"; - default: - throw new Exception("Invalid Endpoint: " + CloudXInterface.CLOUD_ENDPOINT.ToString()); - } - } - } - - public static string NEOS_BLOB - { - get - { - switch (CloudXInterface.CLOUD_ENDPOINT) - { - case CloudXInterface.CloudEndpoint.Production: - case CloudXInterface.CloudEndpoint.Staging: - return CloudXInterface.NEOS_CLOUD_BLOB; - case CloudXInterface.CloudEndpoint.Local: - return CloudXInterface.NEOS_CLOUD_BLOB; - default: - throw new Exception("Invalid Endpoint: " + CloudXInterface.CLOUD_ENDPOINT.ToString()); - } - } - } - - public static string NEOS_ASSETS - { - get - { - return CloudXInterface.NEOS_BLOB + "assets/"; - } - } - - public static string NEOS_ASSETS_CDN - { - get - { - return "https://cloudx.azureedge.net/assets/"; - } - } - - public static string NEOS_ASSETS_BLOB - { - get - { - return "https://cloudxstorage.blob.core.windows.net/assets/"; - } - } - - public static string NEOS_THUMBNAILS - { - get - { - return "https://cloudxstorage.blob.core.windows.net/thumbnails/"; - } - } - - public static string NEOS_INSTALL - { - get - { - return "https://cloudx.azureedge.net/install/"; - } - } - - public static string NEOS_CLOUD_BLOB - { - get - { - return !CloudXInterface.USE_CDN ? "https://cloudxstorage.blob.core.windows.net/" : "https://cloudx.azureedge.net/"; - } - } - - public HttpClient HttpClient { get; private set; } - - public RSAParameters PublicKey { get; private set; } - - public ServerStatus ServerStatus - { - get - { - if ((DateTime.UtcNow - this.LastServerStateFetch).TotalSeconds >= 60.0) - return ServerStatus.NoInternet; - if ((DateTime.UtcNow - this.LastServerUpdate).TotalSeconds >= 60.0) - return ServerStatus.Down; - return this.ServerResponseTime > 250L ? ServerStatus.Slow : ServerStatus.Good; - } - } - - public long ServerResponseTime { get; private set; } - - public DateTime LastServerUpdate { get; private set; } - - public DateTime LastServerStateFetch { get; private set; } - - public User CurrentUser - { - get - { - return this._currentUser; - } - set - { - if (value == this._currentUser) - return; - this._currentUser = value; - Action userUpdated = this.UserUpdated; - if (userUpdated == null) - return; - userUpdated(this._currentUser); - } - } - - public UserSession CurrentSession - { - get - { - return this._currentSession; - } - private set - { - if (value == this._currentSession) - return; - lock (this.lockobj) - { - if (this._currentSession?.SessionToken != value?.SessionToken) - this._lastSessionUpdate = DateTime.UtcNow; - this._currentSession = value; - this._currentAuthenticationHeader = value != null ? new AuthenticationHeaderValue("neos", value.UserId + ":" + value.SessionToken) : (AuthenticationHeaderValue) null; - this.OnSessionUpdated(); - try - { - Action sessionChanged = this.SessionChanged; - if (sessionChanged == null) - return; - sessionChanged(this._currentSession); - } - catch (Exception ex) - { - UniLog.Error(string.Format("Exception in SessionChanged. CurrentSession: {0}.\n", (object) this.CurrentSession) + ex?.ToString(), true); - } - } - } - } - - public IEnumerable CurrentUserMemberships - { - get - { - return (IEnumerable) this._groupMemberships; - } - } - - public IEnumerable CurrentUserGroupInfos - { - get - { - return this._groups.Select, Group>((Func, Group>) (p => p.Value)); - } - } - - public IEnumerable CurrentUserMemberInfos - { - get - { - return this._groupMemberInfos.Select, Member>((Func, Member>) (p => p.Value)); - } - } - - public Group TryGetCurrentUserGroupInfo(string groupId) - { - Group group; - this._groups.TryGetValue(groupId, out group); - return group; - } - - public Member TryGetCurrentUserGroupMemberInfo(string groupId) - { - Member member; - this._groupMemberInfos.TryGetValue(groupId, out member); - return member; - } - - public bool IsCurrentUserMemberOfGroup(string groupId) - { - return this.TryGetCurrentUserGroupMemberInfo(groupId) != null; - } - - public Membership TryGetCurrentUserGroupMembership(string groupId) - { - return this._groupMemberships.FirstOrDefault((Func) (m => m.GroupId == groupId)); - } - - public event Action SessionChanged; - - public event Action UserUpdated; - - public event Action> MembershipsUpdated; - - public event Action GroupUpdated; - - public event Action GroupMemberUpdated; - - protected virtual void OnLogin() - { - } - - protected virtual void OnLogout() - { - } - - protected virtual void OnSessionUpdated() - { - } - - public FriendManager Friends { get; private set; } - - public MessageManager Messages { get; private set; } - - public TransactionManager Transactions { get; private set; } - - public CloudXInterface() - { - this.HttpClient = new HttpClient(); - this.HttpClient.Timeout = Timeout.InfiniteTimeSpan; - this.Friends = new FriendManager(this); - this.Messages = new MessageManager(this); - this.Transactions = new TransactionManager(this); - } - - public virtual void Update() - { - lock (this.lockobj) - { - if (this.CurrentSession != null) - { - if ((DateTime.UtcNow - this._lastSessionUpdate).TotalSeconds >= 3600.0) - { - Task.Run(new Func>(this.ExtendSession)); - this._lastSessionUpdate = DateTime.UtcNow; - } - } - } - if ((DateTime.UtcNow - this._lastServerStatsUpdate).TotalSeconds >= 10.0) - { - Task.Run((Func) (async () => - { - CloudResult cloudResult = await this.GetServerStatistics().ConfigureAwait(false); - if (cloudResult.IsOK) - { - this.ServerResponseTime = cloudResult.Entity.ResponseTimeMilliseconds; - this.LastServerUpdate = cloudResult.Entity.LastUpdate; - } - this.LastServerStateFetch = DateTime.UtcNow; - })); - this._lastServerStatsUpdate = DateTime.UtcNow; - } - this.Friends.Update(); - this.Messages.Update(); - } - - public bool HasPotentialAccess(string ownerId) - { - switch (IdUtil.GetOwnerType(ownerId)) - { - case OwnerType.Machine: - return true; - case OwnerType.User: - return ownerId == this.CurrentUser.Id; - case OwnerType.Group: - lock (this.lockobj) - return this.CurrentUserMemberships.Any((Func) (m => m.GroupId == ownerId)); - default: - return false; - } - } - - private void SetMemberships(IEnumerable memberships) - { - lock (this.lockobj) - { - this._groupMemberships.Clear(); - this._groupMemberships.AddRange(memberships); - this.RunMembershipsUpdated(); - } - } - - private void ClearMemberships() - { - lock (this.lockobj) - { - if (this._groupMemberships.Count == 0) - return; - this._groupMemberships.Clear(); - this.RunMembershipsUpdated(); - } - } - - private void AddMembership(Membership membership) - { - lock (this.lockobj) - { - this._groupMemberships.Add(membership); - this.RunMembershipsUpdated(); - } - } - - private async Task RunMembershipsUpdated() - { - foreach (Membership groupMembership in this._groupMemberships) - await this.UpdateGroupInfo(groupMembership.GroupId); - Action> membershipsUpdated = this.MembershipsUpdated; - if (membershipsUpdated == null) - return; - membershipsUpdated((IEnumerable) this._groupMemberships); - } - - public static Uri NeosDBToHttp(Uri neosdb, bool forceCDN = false, bool forceCloudBlob = false) - { - string str1 = CloudXInterface.NeosDBSignature(neosdb); - string str2 = CloudXInterface.NeosDBQuery(neosdb); - string str3 = str1; - if (str2 != null) - str3 = str3 + "/" + str2; - if (CloudXInterface.IsLegacyNeosDB(neosdb)) - return new Uri("https://neoscloud.blob.core.windows.net/assets/" + str3); - return new Uri((forceCDN ? CloudXInterface.NEOS_ASSETS_CDN : (forceCloudBlob ? "https://cloudxstorage.blob.core.windows.net/" : CloudXInterface.NEOS_ASSETS)) + str3); - } - - public static Uri FilterNeosURL(Uri assetURL) - { - if (assetURL.Scheme == "neosdb" && assetURL.Segments.Length >= 2 && assetURL.Segments[1].Contains(".")) - assetURL = new Uri("neosdb:///" + Path.GetFileNameWithoutExtension(assetURL.Segments[1]) + assetURL.Query); - return assetURL; - } - - public static string NeosDBFilename(Uri neosdb) - { - return neosdb.Segments[1] + neosdb.Query; - } - - public static string NeosDBSignature(Uri neosdb) - { - return Path.GetFileNameWithoutExtension(neosdb.Segments[1]); - } - - public static string NeosDBQuery(Uri neosdb) - { - if (string.IsNullOrWhiteSpace(neosdb.Query)) - return (string) null; - return neosdb.Query.Substring(1); - } - - public static Uri NeosThumbnailIdToHttp(string id) - { - return new Uri(CloudXInterface.NEOS_THUMBNAILS + id); - } - - public static Uri TryFromString(string url) - { - if (url == null) - return (Uri) null; - if (Uri.IsWellFormedUriString(url, UriKind.Absolute)) - return new Uri(url); - return (Uri) null; - } - - public static bool IsLegacyNeosDB(Uri uri) - { - if (uri.Scheme != "neosdb") - return false; - return Path.GetFileNameWithoutExtension(uri.Segments[1]).Length < 30; - } - - public Task> GET(string resource, TimeSpan? timeout = null) where T : class, new() - { - return this.RunRequest((Func) (() => this.CreateRequest(resource, HttpMethod.Get)), timeout); - } - - public Task> POST( - string resource, - object entity, - TimeSpan? timeout = null) - where T : class, new() - { - return this.RunRequest((Func) (() => - { - HttpRequestMessage request = this.CreateRequest(resource, HttpMethod.Post); - this.AddBody(request, entity); - return request; - }), timeout); - } - - public Task> POST_File( - string resource, - string filePath, - string fileMIME = null, - IProgressIndicator progressIndicator = null) - where T : class, new() - { - return this.RunRequest((Func) (() => - { - HttpRequestMessage request = this.CreateRequest(resource, HttpMethod.Post); - this.AddFileToRequest(request, filePath, fileMIME, progressIndicator); - return request; - }), new TimeSpan?(TimeSpan.FromMinutes(60.0))); - } - - public Task> PUT( - string resource, - object entity, - TimeSpan? timeout = null) - where T : class, new() - { - return this.RunRequest((Func) (() => - { - HttpRequestMessage request = this.CreateRequest(resource, HttpMethod.Put); - this.AddBody(request, entity); - return request; - }), timeout); - } - - public Task> PATCH( - string resource, - object entity, - TimeSpan? timeout = null) - where T : class, new() - { - return this.RunRequest((Func) (() => - { - HttpRequestMessage request = this.CreateRequest(resource, CloudXInterface.PATCH_METHOD); - this.AddBody(request, entity); - return request; - }), timeout); - } - - public Task> DELETE(string resource, TimeSpan? timeout = null) where T : class, new() - { - return this.RunRequest((Func) (() => this.CreateRequest(resource, HttpMethod.Delete)), timeout); - } - - public Task GET(string resource, TimeSpan? timeout = null) - { - return this.RunRequest((Func) (() => this.CreateRequest(resource, HttpMethod.Get)), timeout); - } - - public Task POST(string resource, object entity, TimeSpan? timeout = null) - { - return this.RunRequest((Func) (() => - { - HttpRequestMessage request = this.CreateRequest(resource, HttpMethod.Post); - this.AddBody(request, entity); - return request; - }), timeout); - } - - public Task POST_File( - string resource, - string filePath, - string fileMIME = null, - IProgressIndicator progressIndicator = null) - { - return this.RunRequest((Func) (() => - { - HttpRequestMessage request = this.CreateRequest(resource, HttpMethod.Post); - this.AddFileToRequest(request, filePath, fileMIME, progressIndicator); - return request; - }), new TimeSpan?(TimeSpan.FromMinutes(60.0))); - } - - public Task PUT(string resource, object entity, TimeSpan? timeout = null) - { - return this.RunRequest((Func) (() => - { - HttpRequestMessage request = this.CreateRequest(resource, HttpMethod.Put); - this.AddBody(request, entity); - return request; - }), timeout); - } - - public Task PATCH( - string resource, - object entity, - TimeSpan? timeout = null) - { - return this.RunRequest((Func) (() => - { - HttpRequestMessage request = this.CreateRequest(resource, CloudXInterface.PATCH_METHOD); - this.AddBody(request, entity); - return request; - }), timeout); - } - - public Task DELETE(string resource, TimeSpan? timeout = null) - { - return this.RunRequest((Func) (() => this.CreateRequest(resource, HttpMethod.Delete)), timeout); - } - - private void AddFileToRequest( - HttpRequestMessage request, - string filePath, - string mime = null, - IProgressIndicator progressIndicator = null) - { - FileStream fileStream = System.IO.File.OpenRead(filePath); - StreamProgressWrapper streamProgressWrapper = new StreamProgressWrapper((Stream) fileStream, progressIndicator, (Action) null, new long?()); - MultipartFormDataContent multipartFormDataContent = new MultipartFormDataContent(); - StreamContent streamContent = new StreamContent((Stream) streamProgressWrapper, 32768); - if (mime != null) - streamContent.Headers.ContentType = MediaTypeHeaderValue.Parse(mime); - streamContent.Headers.ContentLength = new long?(fileStream.Length); - multipartFormDataContent.Add((HttpContent) streamContent, "file", Path.GetFileName(filePath)); - request.Content = (HttpContent) multipartFormDataContent; - } - - private HttpRequestMessage CreateRequest(string resource, HttpMethod method) - { - HttpRequestMessage httpRequestMessage = new HttpRequestMessage(method, CloudXInterface.NEOS_API + "/" + resource); - if (this.CurrentSession != null) - httpRequestMessage.Headers.Authorization = this._currentAuthenticationHeader; - return httpRequestMessage; - } - - private void AddBody(HttpRequestMessage message, object entity) - { - Func memoryStreamAllocator = CloudXInterface.MemoryStreamAllocator; - MemoryStream memoryStream = (memoryStreamAllocator != null ? memoryStreamAllocator() : (MemoryStream) null) ?? new MemoryStream(); - using (Utf8JsonWriter utf8JsonWriter = new Utf8JsonWriter((Stream) memoryStream, new JsonWriterOptions())) - { - Utf8JsonWriter writer = utf8JsonWriter; - object obj = entity; - System.Type inputType = entity?.GetType(); - if ((object) inputType == null) - inputType = typeof (object); - System.Text.Json.JsonSerializer.Serialize(writer, obj, inputType, (JsonSerializerOptions) null); - } - memoryStream.Seek(0L, SeekOrigin.Begin); - StreamContent streamContent = new StreamContent((Stream) memoryStream); - streamContent.Headers.ContentType = CloudXInterface.JSON_MEDIA_TYPE; - message.Content = (HttpContent) streamContent; - } - - private async Task RunRequest( - Func requestSource, - TimeSpan? timeout) - { - return (CloudResult) await this.RunRequest(requestSource, timeout).ConfigureAwait(false); - } - - private async Task> RunRequest( - Func requestSource, - TimeSpan? timeout) - where T : class - { - HttpRequestMessage request = (HttpRequestMessage) null; - HttpResponseMessage result = (HttpResponseMessage) null; - Exception exception = (Exception) null; - int remainingRetries = CloudXInterface.DEFAULT_RETRIES; - int delay = 0; - do - { - try - { - request = requestSource(); - CancellationTokenSource cancellationTokenSource = new CancellationTokenSource(timeout ?? TimeSpan.FromSeconds(30.0)); - result = await this.HttpClient.SendAsync(request, cancellationTokenSource.Token).ConfigureAwait(false); - } - catch (Exception ex) - { - exception = ex; - } - if (result == null) - { - UniLog.Log(string.Format("Exception running {0} request to {1}. Remaining retries: {2}.\n", (object) request.Method, (object) request.RequestUri, (object) remainingRetries) + exception?.ToString(), false); - request.Dispose(); - request = (HttpRequestMessage) null; - await Task.Delay(delay).ConfigureAwait(false); - delay += 250; - } - } - while (result == null && remainingRetries-- > 0); - if (result == null) - { - if (exception == null) - throw new Exception("Failed to get response. Exception is null"); - throw exception; - } - T entity = default (T); - string content = (string) null; - if (result.IsSuccessStatusCode) - { - if (typeof (T) == typeof (string)) - { - content = await result.Content.ReadAsStringAsync().ConfigureAwait(false); - entity = content as T; - } - else - { - try - { - long? contentLength = result.Content.Headers.ContentLength; - long num = 0; - if (contentLength.GetValueOrDefault() > num & contentLength.HasValue) - { - using (Stream responseStream = await result.Content.ReadAsStreamAsync().ConfigureAwait(false)) - entity = await System.Text.Json.JsonSerializer.DeserializeAsync(responseStream, (JsonSerializerOptions) null, new CancellationToken()).ConfigureAwait(false); - } - } - catch (Exception ex) - { - UniLog.Log(string.Format("Exception deserializing {0} response from {1}:{2}\nException:\n", (object) typeof (T), (object) request.Method, (object) request.RequestUri) + ex?.ToString(), false); - } - finally - { - } - } - } - else - content = await result.Content.ReadAsStringAsync(); - CloudResult cloudResult = new CloudResult(entity, result.StatusCode, content); - result.Dispose(); - request.Dispose(); - return cloudResult; - } - - public async Task> Login( - string credential, - string password, - string sessionToken, - string secretMachineId, - bool rememberMe, - string recoverCode) - { - CloudXInterface cloudXinterface = this; - cloudXinterface.Logout(false); - LoginCredentials credentials = new LoginCredentials(); - credentials.Password = password; - credentials.RecoverCode = recoverCode; - credentials.SessionToken = sessionToken; - credentials.SecretMachineId = secretMachineId; - credentials.RememberMe = rememberMe; - if (credential.StartsWith("U-")) - credentials.OwnerId = credential; - else if (credential.Contains("@")) - credentials.Email = credential; - else - credentials.Username = credential; - Task cryptoProviderTask = Task.Run((Func) (() => - { - RSACryptoServiceProvider provider = new RSACryptoServiceProvider(2048); - return new CloudXInterface.CryptoData(provider, provider.ExportParameters(false)); - })); - CloudResult result = await cloudXinterface.POST("api/userSessions", (object) credentials, new TimeSpan?()); - if (result.IsOK) - { - CloudXInterface.CryptoData cryptoData = await cryptoProviderTask.ConfigureAwait(false); - cloudXinterface._cryptoProvider = cryptoData.provider; - cloudXinterface.PublicKey = cryptoData.parameters; - cloudXinterface.CurrentSession = result.Entity; - cloudXinterface.CurrentUser = new User() - { - Id = cloudXinterface.CurrentSession.UserId, - Email = credentials.Email, - Username = credentials.Username - }; - cloudXinterface.UpdateCurrentUserInfo(); - cloudXinterface.UpdateCurrentUserMemberships(); - cloudXinterface.Friends.Update(); - cloudXinterface.OnLogin(); - } - else - UniLog.Warning("Error logging in: " + result.State.ToString() + "\n" + result.Content, false); - return result; - } - - public async Task ExtendSession() - { - return await this.PATCH("api/userSessions", (object) null, new TimeSpan?()); - } - - public async Task> Register( - string username, - string email, - string password) - { - this.Logout(false); - return await this.POST("/api/users", (object) new User() - { - Username = username, - Email = email, - Password = password - }, new TimeSpan?()); - } - - public async Task RequestRecoveryCode(string email) - { - return await this.POST("/api/users/requestlostpassword", (object) new User() - { - Email = email - }, new TimeSpan?()); - } - - public async Task> UpdateCurrentUserInfo() - { - switch (this.CurrentUser?.Id) - { - case null: - throw new Exception("No current user!"); - default: - CloudResult user = await this.GetUser(this.CurrentUser.Id); - User entity = user.Entity; - if (user.IsOK && this.CurrentUser != null && this.CurrentUser.Id == entity.Id) - { - this.CurrentUser = entity; - UserPatreonData patreonData = this.CurrentUser.PatreonData; - int num; - if ((patreonData != null ? (patreonData.IsPatreonSupporter ? 1 : 0) : 0) == 0) - { - List tags = this.CurrentUser.Tags; - // ISSUE: explicit non-virtual call - num = tags != null ? (__nonvirtual (tags.Contains(UserTags.NeosTeam)) ? 1 : 0) : 0; - } - else - num = 1; - CloudXInterface.USE_CDN = num != 0; - } - return user; - } - } - - public async Task> GetUser(string userId) - { - return await this.GET("api/users/" + userId, new TimeSpan?()); - } - - public async Task> GetUserByName(string username) - { - return await this.GET("api/users/" + username + "?byUsername=true", new TimeSpan?()); - } - - public async Task>> GetUsers(string searchName) - { - return await this.GET>("api/users?name=" + Uri.EscapeDataString(searchName), new TimeSpan?()); - } - - public async Task> GetUserCached(string userId) - { - return await this.GetUser(userId); - } - - public void Logout(bool manualLogOut) - { - this.OnLogout(); - if (this.CurrentSession != null && !this.CurrentSession.RememberMe | manualLogOut) - { - string _userId = this.CurrentSession.UserId; - string _sessionToken = this.CurrentSession.SessionToken; - Task.Run((Func>) (async () => await this.DELETE("api/userSessions/" + _userId + "/" + _sessionToken, new TimeSpan?()))); - } - this._cryptoProvider?.Dispose(); - this._cryptoProvider = (RSACryptoServiceProvider) null; - this.PublicKey = new RSAParameters(); - this.CurrentSession = (UserSession) null; - this.CurrentUser = (User) null; - this.ClearMemberships(); - this.Friends.Reset(); - CloudXInterface.USE_CDN = false; - } - - public byte[] SignHash(byte[] hash) - { - return this._cryptoProvider.SignHash(hash, HashAlgorithmName.SHA256, RSASignaturePadding.Pkcs1); - } - - public async Task> FetchRecordCached(Uri recordUri) where R : class, IRecord, new() - { - lock (this.cachedRecords) - { - Dictionary dictionary; - if (!this.cachedRecords.TryGetValue(typeof (R), out dictionary)) - { - dictionary = new Dictionary(); - this.cachedRecords.Add(typeof (R), dictionary); - } - CloudResult cloudResult; - if (dictionary.TryGetValue(recordUri, out cloudResult)) - return (CloudResult) cloudResult; - } - CloudResult cloudResult1 = await this.FetchRecord(recordUri).ConfigureAwait(false); - lock (this.cachedRecords) - { - Dictionary cachedRecord = this.cachedRecords[typeof (R)]; - cachedRecord.Remove(recordUri); - cachedRecord.Add(recordUri, (CloudResult) cloudResult1); - } - return cloudResult1; - } - - public Task> FetchRecord(Uri recordUri) where R : class, IRecord, new() - { - string ownerId; - string recordId; - if (RecordUtil.ExtractRecordID(recordUri, out ownerId, out recordId)) - return this.FetchRecord(ownerId, recordId); - string recordPath; - if (RecordUtil.ExtractRecordPath(recordUri, out ownerId, out recordPath)) - return this.FetchRecordAtPath(ownerId, recordPath); - throw new ArgumentException("Uri is not a record URI"); - } - - public Task> FetchRecord(string ownerId, string recordId) where R : class, IRecord, new() - { - return this.GET("api/" + CloudXInterface.GetOwnerPath(ownerId) + "/" + ownerId + "/records/" + recordId, new TimeSpan?()); - } - - public Task> FetchRecordAtPath(string ownerId, string path) where R : class, IRecord, new() - { - return this.GET("api/" + CloudXInterface.GetOwnerPath(ownerId) + "/" + ownerId + "/records/root/" + path, new TimeSpan?()); - } - - public Task>> GetRecords( - string ownerId, - string tag = null, - string path = null) - where R : class, IRecord, new() - { - string ownerPath = CloudXInterface.GetOwnerPath(ownerId); - string str = ""; - if (tag != null) - str = "?tag=" + Uri.EscapeDataString(tag); - if (path != null) - str = "?path=" + Uri.EscapeDataString(path); - return this.GET>("api/" + ownerPath + "/" + ownerId + "/records" + str, new TimeSpan?()); - } - - public Task>> FindRecords(SearchParameters search) where R : class, IRecord, new() - { - return this.POST>("api/records/search", (object) search, new TimeSpan?()); - } - - public Task> UpsertRecord(R record) where R : class, IRecord, new() - { - string resource; - switch (IdUtil.GetOwnerType(record.OwnerId)) - { - case OwnerType.User: - resource = "api/users/" + record.OwnerId + "/records/" + record.RecordId; - break; - case OwnerType.Group: - resource = "api/groups/" + record.OwnerId + "/records/" + record.RecordId; - break; - default: - throw new Exception("Invalid record owner"); - } - return this.PUT(resource, (object) record, new TimeSpan?()); - } - - public Task> PreprocessRecord( - R record) - where R : class, IRecord, new() - { - string resource; - switch (IdUtil.GetOwnerType(record.OwnerId)) - { - case OwnerType.User: - resource = "api/users/" + record.OwnerId + "/records/" + record.RecordId + "/preprocess"; - break; - case OwnerType.Group: - resource = "api/groups/" + record.OwnerId + "/records/" + record.RecordId + "/preprocess"; - break; - default: - throw new Exception("Invalid record owner"); - } - return this.POST(resource, (object) record, new TimeSpan?()); - } - - public Task> GetPreprocessStatus( - RecordPreprocessStatus status) - { - return this.GetPreprocessStatus(status.OwnerId, status.RecordId, status.PreprocessId); - } - - public Task> GetPreprocessStatus( - string ownerId, - string recordId, - string id) - { - string resource; - switch (IdUtil.GetOwnerType(ownerId)) - { - case OwnerType.User: - resource = "api/users/" + ownerId + "/records/" + recordId + "/preprocess/" + id; - break; - case OwnerType.Group: - resource = "api/groups/" + ownerId + "/records/" + recordId + "/preprocess/" + id; - break; - default: - throw new Exception("Invalid record owner"); - } - return this.GET(resource, new TimeSpan?()); - } - - public Task DeleteRecord(IRecord record) - { - return this.DeleteRecord(record.OwnerId, record.RecordId); - } - - public async Task DeleteRecord(string ownerId, string recordId) - { - CloudResult result = await this.DELETE("api/users/" + ownerId + "/records/" + recordId, new TimeSpan?()).ConfigureAwait(false); - await this.UpdateStorage(ownerId).ConfigureAwait(false); - return result; - } - - public Task AddTag(string ownerId, string recordId, string tag) - { - switch (IdUtil.GetOwnerType(ownerId)) - { - case OwnerType.User: - return this.PUT("api/users/" + ownerId + "/records/" + recordId + "/tags", (object) tag, new TimeSpan?()); - case OwnerType.Group: - return this.PUT("api/groups/" + ownerId + "/records/" + recordId + "/tags", (object) tag, new TimeSpan?()); - default: - throw new Exception("Invalid record owner"); - } - } - - public async Task UpdateStorage(string ownerId) - { - if (this.CurrentUser == null) - return; - OwnerType ownerType = IdUtil.GetOwnerType(ownerId); - string _signedUserId = this.CurrentUser.Id; - float[] numArray = CloudXInterface.storageUpdateDelays; - for (int index = 0; index < numArray.Length; ++index) - { - ConfiguredTaskAwaitable configuredTaskAwaitable = Task.Delay(TimeSpan.FromSeconds((double) numArray[index])).ConfigureAwait(false); - await configuredTaskAwaitable; - if (this.CurrentUser?.Id != _signedUserId) - return; - if (ownerType == OwnerType.User) - { - CloudResult cloudResult = await this.UpdateCurrentUserInfo().ConfigureAwait(false); - } - else - { - configuredTaskAwaitable = this.UpdateGroupInfo(ownerId).ConfigureAwait(false); - await configuredTaskAwaitable; - } - } - numArray = (float[]) null; - } - - public async Task> FetchGlobalAssetInfo( - string hash) - { - return await this.GET("api/assets/" + hash.ToLower(), new TimeSpan?()); - } - - public async Task> FetchUserAssetInfo(string hash) - { - return await this.FetchAssetInfo(this.CurrentUser.Id, hash); - } - - public async Task> FetchAssetInfo( - string ownerId, - string hash) - { - switch (IdUtil.GetOwnerType(ownerId)) - { - case OwnerType.User: - return await this.GET("api/users/" + ownerId + "/assets/" + hash, new TimeSpan?()); - case OwnerType.Group: - return await this.GET("api/groups/" + ownerId + "/assets/" + hash, new TimeSpan?()); - default: - throw new Exception("Invalid ownerId"); - } - } - - public async Task> RegisterAssetInfo( - AssetInfo assetInfo) - { - switch (IdUtil.GetOwnerType(assetInfo.OwnerId)) - { - case OwnerType.User: - return await this.PUT("api/users/" + assetInfo.OwnerId + "/assets/" + assetInfo.AssetHash, (object) assetInfo, new TimeSpan?()); - case OwnerType.Group: - return await this.PUT("api/groups/" + assetInfo.OwnerId + "/assets/" + assetInfo.AssetHash, (object) assetInfo, new TimeSpan?()); - default: - throw new Exception("Invalid ownerId"); - } - } - - private string GetAssetBaseURL(string ownerId, string hash, string variant) - { - hash = hash.ToLower(); - string str = hash; - if (variant != null) - str = str + "&" + variant; - switch (IdUtil.GetOwnerType(ownerId)) - { - case OwnerType.User: - return "api/users/" + ownerId + "/assets/" + str; - case OwnerType.Group: - return "api/groups/" + ownerId + "/assets/" + str; - default: - throw new Exception("Invalid ownerId"); - } - } - - public async Task> UploadAsset( - string ownerId, - string signature, - string variant, - string assetPath, - int retries = 5, - IProgressIndicator progressIndicator = null) - { - ConfiguredTaskAwaitable> configuredTaskAwaitable = this.BeginUploadAsset(ownerId, signature, variant, assetPath, retries, progressIndicator, new long?()).ConfigureAwait(false); - CloudResult cloudResult = await configuredTaskAwaitable; - if (!cloudResult.IsOK) - return cloudResult; - configuredTaskAwaitable = this.WaitForAssetFinishProcessing(cloudResult.Entity).ConfigureAwait(false); - return await configuredTaskAwaitable; - } - - private void EnqueueChunk( - string baseUrl, - string fileName, - CloudXInterface.UploadChunkBuffer buffer, - List processingBuffers) - { - buffer.task = this.RunRequest((Func) (() => - { - HttpRequestMessage request = this.CreateRequest(baseUrl + "/" + buffer.chunk.ToString(), HttpMethod.Post); - request.Content = (HttpContent) new MultipartFormDataContent() - { - { - (HttpContent) new ByteArrayContent(buffer.data, 0, buffer.length) - { - Headers = { - ContentLength = new long?((long) buffer.length) - } - }, - "file", - fileName - } - }; - return request; - }), new TimeSpan?(TimeSpan.FromMinutes(4.0))); - processingBuffers.Add(buffer); - } - - private async Task TakeFinishedBuffer( - List buffers) - { - List tasks = Pool.BorrowList(); - for (int index = 0; index < buffers.Count; ++index) - { - if (buffers[index].task != null) - { - if (CloudXInterface.DEBUG_UPLOAD) - UniLog.Log(string.Format("Adding task from chunk {0}: {1}, IsCompleted: {2}, IsCanceled: {3}, IsFaulted: {4}", (object) buffers[index].chunk, (object) buffers[index].task.Id, (object) buffers[index].task.IsCompleted, (object) buffers[index].task.IsCanceled, (object) buffers[index].task.IsFaulted), false); - tasks.Add((Task) buffers[index].task); - } - } - if (CloudXInterface.DEBUG_UPLOAD) - UniLog.Log("Waiting for any task to finish. Count: " + tasks.Count.ToString(), false); - Task task = await Task.WhenAny((IEnumerable) tasks).ConfigureAwait(false); - if (CloudXInterface.DEBUG_UPLOAD) - UniLog.Log("Task finished, checking buffers", false); - Pool.Return(ref tasks); - CloudXInterface.UploadChunkBuffer uploadChunkBuffer; - using (List.Enumerator enumerator = buffers.GetEnumerator()) - { - CloudXInterface.UploadChunkBuffer current; - do - { - if (enumerator.MoveNext()) - { - current = enumerator.Current; - if (CloudXInterface.DEBUG_UPLOAD) - UniLog.Log(string.Format("Buffer Task {0} from chunk {1}. IsCompleted: {2}. IsCanceled: {3}. IsFaulted: {4}", (object) current.task?.Id, (object) current.chunk, (object) current.task?.IsCompleted, (object) current.task?.IsCanceled, (object) current.task?.IsFaulted), false); - } - else - goto label_20; - } - while (current.task == null || !current.task.IsCompleted); - buffers.Remove(current); - uploadChunkBuffer = current; - goto label_21; - } -label_20: - throw new Exception("No Finished Buffer Available"); -label_21: - return uploadChunkBuffer; - } - - public async Task> BeginUploadAsset( - string ownerId, - string signature, - string variant, - string assetPath, - int retries = 5, - IProgressIndicator progressIndicator = null, - long? bytes = null) - { - string fileName = Path.GetFileName(assetPath); - CloudResult cloudResult; - using (FileStream stream = System.IO.File.OpenRead(assetPath)) - cloudResult = await this.BeginUploadAsset(ownerId, signature, variant, (Stream) stream, fileName, retries, progressIndicator, bytes); - return cloudResult; - } - - public async Task> BeginUploadAsset( - string ownerId, - string signature, - string variant, - Stream fileStream, - string fileName, - int retries = 5, - IProgressIndicator progressIndicator = null, - long? bytes = null) - { - string baseUrl = this.GetAssetBaseURL(ownerId, signature, variant) + "/chunks"; - CloudResult assetUploadResult = await this.POST(baseUrl + (!bytes.HasValue ? "" : string.Format("?bytes={0}", (object) bytes.Value)), (object) null, new TimeSpan?()).ConfigureAwait(false); - if (CloudXInterface.DEBUG_UPLOAD) - UniLog.Log("Initiate Chunk Upload: " + assetUploadResult?.ToString(), false); - if (assetUploadResult.IsError) - return assetUploadResult; - AssetUploadData assetUpload = assetUploadResult.Entity; - List freeBuffers = Pool.BorrowList(); - List processingBuffers = Pool.BorrowList(); - for (int index = 0; index < MathX.Min(assetUpload.TotalChunks, CloudXInterface.UPLOAD_DEGREE_OF_PARALLELISM); ++index) - freeBuffers.Add(new CloudXInterface.UploadChunkBuffer() - { - data = new byte[assetUpload.ChunkSize] - }); - Stopwatch s = Stopwatch.StartNew(); - int enqueuedChunks = 0; - int uploadedChunks = 0; - while (uploadedChunks < assetUpload.TotalChunks) - { - bool flag; - if (freeBuffers.Count > 0 && enqueuedChunks < assetUpload.TotalChunks) - { - CloudXInterface.UploadChunkBuffer last = freeBuffers.TakeLast(); - int num = fileStream.Read(last.data, 0, last.data.Length); - last.chunk = enqueuedChunks; - last.length = num; - if (CloudXInterface.DEBUG_UPLOAD) - UniLog.Log(string.Format("Enqueuing chunk {0}.", (object) enqueuedChunks), false); - this.EnqueueChunk(baseUrl, fileName, last, processingBuffers); - ++enqueuedChunks; - flag = freeBuffers.Count == 0; - } - else - flag = true; - if (flag) - { - if (CloudXInterface.DEBUG_UPLOAD) - UniLog.Log("Waiting for finished buffer", false); - CloudXInterface.UploadChunkBuffer buffer = await this.TakeFinishedBuffer(processingBuffers).ConfigureAwait(false); - if (CloudXInterface.DEBUG_UPLOAD) - UniLog.Log(string.Format("Got finished buffer {0}: ", (object) buffer.chunk) + buffer?.task?.ToString(), false); - if (buffer.task.IsCanceled) - { - if (CloudXInterface.DEBUG_UPLOAD) - UniLog.Log(string.Format("Task is cancelled, enqueuing chunk {0} again", (object) buffer.chunk), false); - this.EnqueueChunk(baseUrl, fileName, buffer, processingBuffers); - } - else - { - CloudResult cloudResult = await buffer.task.ConfigureAwait(false); - if (CloudXInterface.DEBUG_UPLOAD) - UniLog.Log(string.Format("Chunk {0} result: ", (object) buffer.chunk) + cloudResult?.ToString(), false); - if (cloudResult.IsError) - return new CloudResult((AssetUploadData) null, cloudResult.State, cloudResult.Content); - buffer.task = (Task) null; - freeBuffers.Add(buffer); - ++uploadedChunks; - float percent = (float) uploadedChunks / (float) assetUpload.TotalChunks; - progressIndicator?.UpdateProgress(percent, "Upload", string.Format("Chunk {0} out of {1}", (object) uploadedChunks, (object) assetUpload.TotalChunks)); - buffer = (CloudXInterface.UploadChunkBuffer) null; - } - } - } - s.Stop(); - UniLog.Log(string.Format("Asset {0} uploaded in {1}. Average rate: {2}/s", (object) fileName, (object) s.Elapsed, (object) UnitFormatting.FormatBytes((double) assetUpload.TotalBytes / s.Elapsed.TotalSeconds, 2)), false); - Pool.Return(ref processingBuffers); - Pool.Return(ref freeBuffers); - CloudResult cloudResult1 = await this.PATCH(baseUrl, (object) null, new TimeSpan?()).ConfigureAwait(false); - return !cloudResult1.IsError ? assetUploadResult : new CloudResult((AssetUploadData) null, cloudResult1.State, cloudResult1.Content); - } - - public async Task> WaitForAssetFinishProcessing( - AssetUploadData assetUpload) - { - string baseUrl = this.GetAssetBaseURL(assetUpload.OwnerId, assetUpload.Signature, assetUpload.Variant) + "/chunks"; - CloudResult cloudResult; - while (true) - { - cloudResult = await this.GET(baseUrl, new TimeSpan?()).ConfigureAwait(false); - if (!cloudResult.IsError && (cloudResult.Entity.UploadState != UploadState.Uploaded && cloudResult.Entity.UploadState != UploadState.Failed)) - await Task.Delay(250).ConfigureAwait(false); - else - break; - } - return cloudResult; - } - - public Task> UploadThumbnail(string path) - { - return this.POST_File("api/thumbnails", path, "image/webp", (IProgressIndicator) null); - } - - public Task ExtendThumbnailLifetime(ThumbnailInfo thumbnail) - { - return this.PATCH("api/thumbnails", (object) thumbnail, new TimeSpan?()); - } - - public Task DeleteThumbnail(ThumbnailInfo thumbnail) - { - return this.DELETE("api/thumbnails/" + thumbnail.Id + "/" + thumbnail.Key, new TimeSpan?()); - } - - public async Task> GetGroup(string groupId) - { - return await this.GET("api/groups/" + groupId, new TimeSpan?()); - } - - public async Task> GetGroupCached(string groupId) - { - return await this.GetGroup(groupId); - } - - public async Task> CreateGroup(Group group) - { - return await this.POST("api/groups", (object) group, new TimeSpan?()); - } - - public async Task AddGroupMember(Member member) - { - return await this.POST("api/groups/" + member.GroupId + "/members", (object) member, new TimeSpan?()); - } - - public async Task DeleteGroupMember(Member member) - { - return await this.DELETE("api/groups/" + member.GroupId + "/members/" + member.UserId, new TimeSpan?()); - } - - public async Task> GetGroupMember( - string groupId, - string userId) - { - return await this.GET("api/groups/" + groupId + "/members/" + userId, new TimeSpan?()); - } - - public async Task>> GetGroupMembers( - string groupId) - { - return await this.GET>("api/groups/" + groupId + "/members", new TimeSpan?()); - } - - public async Task UpdateCurrentUserMemberships() - { - CloudResult> groupMemeberships = await this.GetUserGroupMemeberships(); - if (groupMemeberships.IsOK) - this.SetMemberships((IEnumerable) groupMemeberships.Entity); - return (CloudResult) groupMemeberships; - } - - public async Task>> GetUserGroupMemeberships() - { - return await this.GetUserGroupMemeberships(this.CurrentUser.Id); - } - - public async Task>> GetUserGroupMemeberships( - string userId) - { - return await this.GET>("api/users/" + userId + "/memberships", new TimeSpan?()); - } - - public async Task UpdateGroupInfo(string groupId) - { - Task> group = this.GetGroup(groupId); - Task> memberTask = this.GetGroupMember(groupId, this.CurrentUser.Id); - CloudResult groupResult = await group; - CloudResult cloudResult = await memberTask; - lock (this.lockobj) - { - if (groupResult.IsOK) - { - this._groups.Remove(groupId); - this._groups.Add(groupId, groupResult.Entity); - Action groupUpdated = this.GroupUpdated; - if (groupUpdated != null) - groupUpdated(groupResult.Entity); - } - if (!cloudResult.IsOK) - return; - this._groupMemberInfos.Remove(groupId); - this._groupMemberInfos.Add(groupId, cloudResult.Entity); - Action groupMemberUpdated = this.GroupMemberUpdated; - if (groupMemberUpdated == null) - return; - groupMemberUpdated(cloudResult.Entity); - } - } - - public async Task> UpsertSubmission( - string groupId, - string ownerId, - string recordId, - bool feature = false) - { - return await this.PUT("api/groups/" + groupId + "/submissions", (object) new Submission() - { - GroupId = groupId, - TargetRecordId = new RecordId(ownerId, recordId), - Featured = feature - }, new TimeSpan?()); - } - - public async Task DeleteSubmission( - string groupId, - string submissionId) - { - return await this.DELETE("api/groups/" + groupId + "/submissions/" + submissionId, new TimeSpan?()); - } - - private static string GetOwnerPath(string ownerId) - { - switch (IdUtil.GetOwnerType(ownerId)) - { - case OwnerType.User: - return "users"; - case OwnerType.Group: - return "groups"; - default: - throw new Exception("Invalid owner type: " + ownerId); - } - } - - public async Task> UpsertVariableDefinition( - CloudVariableDefinition definition) - { - return await this.PUT("api/" + CloudXInterface.GetOwnerPath(definition.DefinitionOwnerId) + "/" + definition.DefinitionOwnerId + "/vardefs/" + definition.Subpath, (object) definition, new TimeSpan?()); - } - - public async Task DeleteVariableDefinition( - string ownerId, - string subpath) - { - return await this.DELETE("api/" + CloudXInterface.GetOwnerPath(ownerId) + "/" + ownerId + "/vardefs/" + subpath, new TimeSpan?()); - } - - public async Task> ReadGlobalVariable(string path) - { - return await this.ReadVariable("GLOBAL", path); - } - - public async Task> ReadVariable(string ownerId, string path) - { - CloudXInterface cloudXinterface = this; - string resource; - if (ownerId == "GLOBAL") - resource = "api/globalvars/" + path; - else - resource = "api/" + CloudXInterface.GetOwnerPath(ownerId) + "/" + ownerId + "/vars/" + path; - CloudResult cloudResult = await cloudXinterface.GET(resource, new TimeSpan?()).ConfigureAwait(false); - if (cloudResult.IsOK) - { - switch (cloudResult.Entity?.Value) - { - case null: - break; - default: - return new CloudResult(JsonConvert.DeserializeObject(cloudResult.Entity.Value, new JsonSerializerSettings() - { - Error = new EventHandler(cloudXinterface.SerializationErrorHandler) - }), cloudResult.State, cloudResult.Content); - } - } - return new CloudResult(default (T), cloudResult.State, cloudResult.Content); - } - - private void SerializationErrorHandler(object sender, Newtonsoft.Json.Serialization.ErrorEventArgs error) - { - UniLog.Error("Deserialization error: " + error.ErrorContext.Error.Message, true); - error.ErrorContext.Handled = true; - } - - public async Task WriteVariable( - string ownerId, - string path, - T value) - { - return await this.PUT("api/" + CloudXInterface.GetOwnerPath(ownerId) + "/" + ownerId + "/vars/" + path, (object) new CloudVariable() - { - Value = JsonConvert.SerializeObject((object) (T) value) - }, new TimeSpan?()); - } - - public async Task DeleteVariable(string ownerId, string path) - { - return await this.DELETE("api/" + CloudXInterface.GetOwnerPath(ownerId) + "/vars/" + path, new TimeSpan?()); - } - - public async Task> ReadVariable(string path) - { - return await this.ReadVariable(this.CurrentUser.Id, path); - } - - public async Task WriteVariable(string path, T value) - { - return await this.WriteVariable(this.CurrentUser.Id, path, value); - } - - public async Task DeleteVariable(string path) - { - return await this.DeleteVariable(this.CurrentUser.Id, path); - } - - public async Task LogVisit(Visit visit) - { - return await this.POST("api/visits", (object) visit, new TimeSpan?()); - } - - public async Task> CreateNeosSession( - NeosSession session) - { - return await this.POST("api/neosSessions", (object) session, new TimeSpan?()); - } - - public async Task> PatchNeosSession( - NeosSession session) - { - return await this.PATCH("api/neosSessions", (object) session, new TimeSpan?()); - } - - public async Task> GetStatus(string userId) - { - return await this.GET("api/users/" + userId + "/status", new TimeSpan?()); - } - - public async Task UpdateStatus(UserStatus status) - { - return await this.UpdateStatus(this.CurrentUser.Id, status); - } - - public async Task UpdateStatus(string userId, UserStatus status) - { - return await this.PUT("api/users/" + userId + "/status", (object) status, new TimeSpan?()); - } - - public async Task UpdateProfile(UserProfile profile) - { - this.CurrentUser.Profile = profile; - return await this.UpdateProfile(this.CurrentUser.Id, profile); - } - - public async Task UpdateProfile(string userId, UserProfile profile) - { - return await this.PUT("api/users/" + userId + "/profile", (object) profile, new TimeSpan?()); - } - - public async Task>> GetFriends( - DateTime? lastStatusUpdate = null) - { - return await this.GetFriends(this.CurrentUser.Id, lastStatusUpdate); - } - - public async Task>> GetFriends( - string userId, - DateTime? lastStatusUpdate = null) - { - string str = (string) null; - if (lastStatusUpdate.HasValue) - str = str + "?lastStatusUpdate=" + lastStatusUpdate.Value.ToUniversalTime().ToString("o"); - return await this.GET>("api/users/" + userId + "/friends" + str, new TimeSpan?()); - } - - public async Task UpsertFriend(Friend friend) - { - if (string.IsNullOrWhiteSpace(friend.OwnerId)) - throw new ArgumentException("friend.OwnerId"); - if (string.IsNullOrWhiteSpace(friend.FriendUserId)) - throw new ArgumentException("friend.FriendUserId"); - return await this.PUT("api/users/" + friend.OwnerId + "/friends/" + friend.FriendUserId, (object) friend, new TimeSpan?()); - } - - public async Task DeleteFriend(Friend friend) - { - if (string.IsNullOrWhiteSpace(friend.OwnerId)) - throw new ArgumentException("friend.OwnerId"); - if (string.IsNullOrWhiteSpace(friend.FriendUserId)) - throw new ArgumentException("friend.FriendUserId"); - return await this.DELETE("api/users/" + friend.OwnerId + "/friends/" + friend.FriendUserId, new TimeSpan?()); - } - - public async Task> SendMessage(Message message) - { - return await this.POST("api/users/" + message.RecipientId + "/messages", (object) message, new TimeSpan?()); - } - - public async Task>> GetUnreadMessages( - DateTime? fromTime = null) - { - return await this.GetMessages(fromTime, -1, (string) null, true); - } - - public async Task>> GetMessageHistory( - string user, - int maxItems = 100) - { - return await this.GetMessages(new DateTime?(), maxItems, user, false); - } - - public async Task>> GetMessages( - DateTime? fromTime, - int maxItems, - string user, - bool unreadOnly) - { - StringBuilder stringBuilder = new StringBuilder(); - stringBuilder.Append(string.Format("?maxItems={0}", (object) maxItems)); - if (fromTime.HasValue) - stringBuilder.Append("&fromTime=" + fromTime.Value.ToUniversalTime().ToString("o")); - if (user != null) - stringBuilder.Append("&user=" + user); - if (unreadOnly) - stringBuilder.Append("&unread=true"); - return await this.GET>(string.Format("api/users/{0}/messages{1}", (object) this.CurrentUser.Id, (object) stringBuilder), new TimeSpan?()); - } - - public async Task MarkMessagesRead(List messageIds) - { - return await this.PATCH("api/users/" + this.CurrentUser.Id + "/messages", (object) messageIds, new TimeSpan?()); - } - - public async Task MarkMessagesRead(List messages) - { - return await this.MarkMessagesRead(messages.Select((Func) (m => m.Id)).ToList()); - } - - public Task UpdateSessions(SessionUpdate update) - { - return this.PUT("api/sessions", (object) update, new TimeSpan?()); - } - - public Task> GetSession(string sessionId) - { - return this.GET("api/sessions/" + sessionId, new TimeSpan?()); - } - - public Task>> GetSessions( - DateTime? updatedSince = null, - bool includeEnded = false, - string compatibilityHash = null, - string name = null, - string hostName = null, - string hostId = null, - int? minActiveUsers = null, - bool includeEmptyHeadless = true) - { - StringBuilder stringBuilder1 = new StringBuilder(); - if (updatedSince.HasValue) - { - StringBuilder stringBuilder2 = stringBuilder1; - DateTime universalTime = updatedSince.Value; - universalTime = universalTime.ToUniversalTime(); - string str = "&updatedSince=" + Uri.EscapeDataString(universalTime.ToString("o")); - stringBuilder2.Append(str); - } - if (includeEnded) - stringBuilder1.Append("&includeEnded=true"); - if (compatibilityHash != null) - stringBuilder1.Append("&compatibilityHash=" + Uri.EscapeDataString(compatibilityHash)); - if (name != null) - stringBuilder1.Append("&name=" + Uri.EscapeDataString(name)); - if (hostName != null) - stringBuilder1.Append("&hostName=" + Uri.EscapeDataString(hostName)); - if (hostId != null) - stringBuilder1.Append("&hostId=" + Uri.EscapeDataString(hostId)); - if (minActiveUsers.HasValue) - stringBuilder1.Append(string.Format("&minActiveUsers={0}", (object) minActiveUsers.Value)); - stringBuilder1.Append("&includeEmptyHeadless=" + (includeEmptyHeadless ? "true" : "false")); - if (stringBuilder1.Length > 0) - stringBuilder1[0] = '?'; - return this.GET>("api/sessions" + stringBuilder1.ToString(), new TimeSpan?()); - } - - public Task SendTransaction(CreditTransaction transaction) - { - return this.POST("api/transactions/" + transaction.Token, (object) transaction, new TimeSpan?()); - } - - public Task RequestDepositAddress() - { - return this.GET("api/users/" + this.CurrentUser.Id + "/despositAddress", new TimeSpan?()); - } - - public Task> GetSugarCube( - string batchId, - int sequenceNumber) - { - return this.GET(string.Format("api/kofi/sugarcube/{0}/{1}", (object) batchId, (object) sequenceNumber), new TimeSpan?()); - } - - public async Task GatherAsset(string signature) - { - try - { - return await this.HttpClient.GetStreamAsync(CloudXInterface.NEOS_ASSETS + signature).ConfigureAwait(false); - } - catch (HttpRequestException ex) - { - return (Stream) null; - } - } - - public Task>> GetAssetMetadata(List hashes) where T : class, IAssetMetadata, new() - { - System.Type type1 = typeof (T); - if (type1 == typeof (BitmapMetadata)) - return this.POST>("api/assets/bitmapMetadata", (object) hashes, new TimeSpan?()); - System.Type type2 = type1; - throw new Exception("Unsupported metadata type: " + ((object) type2 != null ? type2.ToString() : (string) null)); - } - - public async Task> GetAssetMetadata( - AssetVariantType variantType, - string hash) - { - if (variantType == AssetVariantType.Texture) - return (await this.GetAssetMetadata(hash).ConfigureAwait(false)).AsResult(); - throw new Exception("Unsupported metadata type: " + variantType.ToString()); - } - - public Task> GetAssetMetadata(string hash) where T : class, IAssetMetadata, new() - { - System.Type type1 = typeof (T); - if (type1 == typeof (BitmapMetadata)) - return this.GET("api/assets/" + hash + "/bitmapMetadata", new TimeSpan?()); - System.Type type2 = type1; - throw new Exception("Unsupported metadata type: " + ((object) type2 != null ? type2.ToString() : (string) null)); - } - - public Task>> RequestAssetVariant( - string hash, - IAssetVariantDescriptor descriptor) - { - TextureVariantDescriptor variantDescriptor = descriptor as TextureVariantDescriptor; - if ((object) variantDescriptor != null) - return this.POST>("api/assets/" + hash + "/bitmapVariant/" + variantDescriptor.VariantIdentifier, (object) null, new TimeSpan?()); - System.Type type = descriptor.GetType(); - throw new Exception("Unsupported variant descriptor: " + ((object) type != null ? type.ToString() : (string) null)); - } - - public Task>> GetAvailableVariants(Uri neosDbUrl) - { - return this.GetAvailableVariants(CloudXInterface.NeosDBSignature(neosDbUrl)); - } - - public Task>> GetAvailableVariants(string hash) - { - return this.GET>("api/assets/" + hash + "/variants", new TimeSpan?()); - } - - public Task StoreAssetMetadata(IAssetMetadata metadata) - { - BitmapMetadata bitmapMetadata = metadata as BitmapMetadata; - if (bitmapMetadata != null) - return this.PUT("api/assets/" + metadata.AssetIdentifier + "/bitmapMetadata", (object) bitmapMetadata, new TimeSpan?()); - System.Type type = metadata.GetType(); - throw new Exception("Unsupported metadata type: " + ((object) type != null ? type.ToString() : (string) null)); - } - - public Task> GetBitmapMetadata( - string hash) - { - return this.GET("api/assets/" + hash + "/bitmapMetadata", new TimeSpan?()); - } - - public Task>> GetBitmapMetadata( - List hashes) - { - return this.POST>("api/assets/bitmapMetadata", (object) hashes, new TimeSpan?()); - } - - public Task StoreBitmapMetadata( - string hash, - BitmapMetadata metadata) - { - return this.PUT("api/assets/" + hash + "/bitmapMetadata", (object) metadata, new TimeSpan?()); - } - - public Task>> GetAssetComputationTask() - { - return this.GET>(string.Format("api/processing/assetComputations?computeVersion={0}", (object) AssetUtil.COMPUTE_VERSION), new TimeSpan?()); - } - - public async Task ExtendAssetComputationTask( - ExternalQueueObject task) - { - CloudResult cloudResult = await this.PATCH("api/processing/assetComputations", (object) task, new TimeSpan?()); - if (cloudResult.IsOK) - task.PopReceipt = cloudResult.Content; - return cloudResult; - } - - public Task FinishAssetComputation( - ExternalQueueObject task) - { - return this.DELETE("api/processing/assetComputations/" + task.Id + "?popReceipt=" + task.PopReceipt, new TimeSpan?()); - } - - public Task FinishVariantComputation(string hash, string variantId) - { - return this.POST("api/processing/assetComputations/" + hash + "/" + variantId, (object) null, new TimeSpan?()); - } - - public Task Ping() - { - return this.GET("api/testing/ping", new TimeSpan?()); - } - - public async Task> GetServerStatistics() - { - try - { - using (HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, "https://cloudxstorage.blob.core.windows.net/install/ServerResponse")) - { - HttpResponseMessage httpResponseMessage = await this.HttpClient.SendAsync(request).ConfigureAwait(false); - if (!httpResponseMessage.IsSuccessStatusCode) - return new CloudResult((ServerStatistics) null, httpResponseMessage.StatusCode, (string) null); - long? contentLength = httpResponseMessage.Content.Headers.ContentLength; - long num = 0; - if (!(contentLength.GetValueOrDefault() > num & contentLength.HasValue)) - return (CloudResult) null; - using (Stream responseStream = await httpResponseMessage.Content.ReadAsStreamAsync().ConfigureAwait(false)) - return new CloudResult(await System.Text.Json.JsonSerializer.DeserializeAsync(responseStream, (JsonSerializerOptions) null, new CancellationToken()).ConfigureAwait(false), HttpStatusCode.OK, (string) null); - } - } - catch (Exception ex) - { - return (CloudResult) null; - } - } - - public async Task GetOnlineUserCount() - { - CloudResult cloudResult = await this.GET("api/stats/onlineUsers", new TimeSpan?()); - int result; - return !cloudResult.IsOK || !int.TryParse(cloudResult.Content, out result) ? -1 : result; - } - - public enum CloudEndpoint - { - Production, - Staging, - Local, - } - - private readonly struct CryptoData - { - public readonly RSACryptoServiceProvider provider; - public readonly RSAParameters parameters; - - public CryptoData(RSACryptoServiceProvider provider, RSAParameters parameters) - { - this.provider = provider; - this.parameters = parameters; - } - } - - private class UploadChunkBuffer - { - public int chunk = -1; - public int length = -1; - public byte[] data; - public Task task; - } - } -} diff --git a/.API/ComputationLock.cs b/.API/ComputationLock.cs deleted file mode 100644 index 6268773..0000000 --- a/.API/ComputationLock.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: CloudX.Shared.ComputationLock -// Assembly: CloudX.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -// MVID: 6223B97A-06A5-46CB-9E10-78604961D6EE -// Assembly location: J:\D\SteamLibrary\steamapps\common\NeosVR\HeadlessClient\CloudX.Shared.dll - -using Newtonsoft.Json; -using System; - -namespace CloudX.Shared -{ - [JsonObject(MemberSerialization = MemberSerialization.OptIn)] - public struct ComputationLock - { - [JsonProperty(PropertyName = "token")] - public string Token { get; private set; } - - [JsonProperty(PropertyName = "timestamp")] - public DateTime ExpireTimestamp { get; private set; } - - public bool IsLocked - { - get - { - if (string.IsNullOrWhiteSpace(this.Token)) - return false; - return DateTime.UtcNow > this.ExpireTimestamp; - } - } - - public bool TryLock(TimeSpan duration) - { - if (this.IsLocked) - return false; - this.Token = Guid.NewGuid().ToString(); - this.ExpireTimestamp = DateTime.UtcNow + duration; - return true; - } - - public bool TryExtend(string token, TimeSpan duration) - { - if (token != this.Token) - return false; - this.ExpireTimestamp = DateTime.UtcNow + duration; - return true; - } - - public bool TryRelease(string token) - { - if (this.Token != token) - return false; - this.Token = (string) null; - this.ExpireTimestamp = new DateTime(); - return true; - } - } -} diff --git a/.API/CryptoHelper.cs b/.API/CryptoHelper.cs deleted file mode 100644 index 3c5886d..0000000 --- a/.API/CryptoHelper.cs +++ /dev/null @@ -1,69 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: CloudX.Shared.CryptoHelper -// Assembly: CloudX.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -// MVID: 6223B97A-06A5-46CB-9E10-78604961D6EE -// Assembly location: J:\D\SteamLibrary\steamapps\common\NeosVR\HeadlessClient\CloudX.Shared.dll - -using System; -using System.Linq; -using System.Security.Cryptography; -using System.Text; - -namespace CloudX.Shared -{ - public static class CryptoHelper - { - public static readonly RNGCryptoServiceProvider rng = new RNGCryptoServiceProvider(); - public static readonly SHA256Managed sha256 = new SHA256Managed(); - - public static byte[] GenerateCryptoBlob(int length) - { - byte[] data = new byte[length]; - CryptoHelper.rng.GetBytes(data); - return data; - } - - public static string GenerateCryptoToken() - { - return BitConverter.ToString(CryptoHelper.GenerateCryptoBlob(16)).Replace("-", "").ToLower(); - } - - public static string GenerateSalt() - { - return Convert.ToBase64String(CryptoHelper.GenerateCryptoBlob(32)); - } - - public static string HashPassword(string password, string salt) - { - byte[] bytes = Encoding.UTF8.GetBytes(password); - byte[] numArray = Convert.FromBase64String(salt); - byte[] buffer = new byte[bytes.Length + numArray.Length]; - for (int index = 0; index < bytes.Length; ++index) - buffer[index] = bytes[index]; - for (int index = 0; index < numArray.Length; ++index) - buffer[index + bytes.Length] = numArray[index]; - return Convert.ToBase64String(CryptoHelper.sha256.ComputeHash(buffer)); - } - - public static string PasswordRuleDescription - { - get - { - return "Minimum 8 characters, 1 capital letter and 1 digit."; - } - } - - public static bool IsValidPassword(string password) - { - return password != null && password.Length >= 8 && password.Count((Func) (c => char.IsDigit(c))) != 0 && (password.Count((Func) (c => char.IsLetter(c))) != 0 && password.Count((Func) (c => char.IsLower(c))) != 0) && password.Count((Func) (c => char.IsUpper(c))) != 0; - } - - public static string PasswordRequirements - { - get - { - return "Must have at least 8 symbols, 1 digit and 1 uppercase letter"; - } - } - } -} diff --git a/.API/Endpoints.cs b/.API/Endpoints.cs deleted file mode 100644 index b75fc1c..0000000 --- a/.API/Endpoints.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: CloudX.Shared.Endpoints -// Assembly: CloudX.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -// MVID: 6223B97A-06A5-46CB-9E10-78604961D6EE -// Assembly location: J:\D\SteamLibrary\steamapps\common\NeosVR\HeadlessClient\CloudX.Shared.dll - -namespace CloudX.Shared -{ - public static class Endpoints - { - public const string CLOUDX_NEOS_API = "https://cloudx.azurewebsites.net"; - public const string CLOUDX_NEOS_BLOB = "https://cloudxstorage.blob.core.windows.net/assets/"; - public const string CLOUDX_NEOS_THUMBNAILS = "https://cloudxstorage.blob.core.windows.net/thumbnails/"; - } -} diff --git a/.API/FriendManager.cs b/.API/FriendManager.cs deleted file mode 100644 index c7a88a6..0000000 --- a/.API/FriendManager.cs +++ /dev/null @@ -1,263 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: CloudX.Shared.FriendManager -// Assembly: CloudX.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -// MVID: 6223B97A-06A5-46CB-9E10-78604961D6EE -// Assembly location: J:\D\SteamLibrary\steamapps\common\NeosVR\HeadlessClient\CloudX.Shared.dll - -using BaseX; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace CloudX.Shared -{ - public class FriendManager - { - public static float UPDATE_PERIOD_SECONDS = 5f; - private Dictionary friends = new Dictionary(); - private Dictionary _friendSessions = new Dictionary(); - private object _lock = new object(); - private DateTime? lastStatusUpdate; - private DateTime lastRequest; - private bool _friendsChanged; - - public CloudXInterface Cloud { get; private set; } - - public int FriendRequestCount { get; private set; } - - public FriendManager(CloudXInterface cloud) - { - this.Cloud = cloud; - } - - public int FriendCount - { - get - { - return this.friends.Count; - } - } - - public void GetFriends(List list) - { - lock (this._lock) - { - foreach (KeyValuePair friend in this.friends) - list.Add(friend.Value); - } - } - - public void ForeachFriend(Action action) - { - lock (this._lock) - { - foreach (KeyValuePair friend in this.friends) - action(friend.Value); - } - } - - public int GetFriendSessions(List sessions) - { - lock (this._lock) - { - foreach (KeyValuePair friendSession in this._friendSessions) - sessions.Add(friendSession.Value); - return this._friendSessions.Count; - } - } - - public void ForeachFriendSession(Action action) - { - lock (this._lock) - { - foreach (KeyValuePair friendSession in this._friendSessions) - action(friendSession.Value); - } - } - - public Friend GetFriend(string friendId) - { - lock (this._lock) - { - Friend friend; - if (this.friends.TryGetValue(friendId, out friend)) - return friend; - } - return (Friend) null; - } - - public Friend FindFriend(Predicate predicate) - { - lock (this._lock) - { - foreach (KeyValuePair friend in this.friends) - { - if (predicate(friend.Value)) - return friend.Value; - } - } - return (Friend) null; - } - - public bool IsFriend(string userId) - { - lock (this._lock) - { - Friend friend; - if (this.friends.TryGetValue(userId, out friend)) - return friend.FriendStatus == FriendStatus.Accepted; - return false; - } - } - - public void AddFriend(string friendId) - { - this.AddFriend(new Friend() - { - FriendUserId = friendId, - FriendUsername = friendId.Substring(2), - FriendStatus = FriendStatus.Accepted - }); - } - - public void AddFriend(Friend friend) - { - friend.OwnerId = this.Cloud.CurrentUser.Id; - friend.FriendStatus = FriendStatus.Accepted; - this.Cloud.UpsertFriend(friend); - lock (this._lock) - this.AddedOrUpdated(friend); - } - - public void RemoveFriend(Friend friend) - { - friend.OwnerId = this.Cloud.CurrentUser.Id; - friend.FriendStatus = FriendStatus.Ignored; - this.Cloud.DeleteFriend(friend); - lock (this._lock) - this.Removed(friend); - } - - public void IgnoreRequest(Friend friend) - { - friend.OwnerId = this.Cloud.CurrentSession.UserId; - friend.FriendStatus = FriendStatus.Ignored; - this.Cloud.UpsertFriend(friend); - lock (this._lock) - this.AddedOrUpdated(friend); - } - - public event Action FriendAdded; - - public event FriendManager.FriendUpdate FriendUpdated; - - public event Action FriendRemoved; - - public event Action FriendsChanged; - - public event Action FriendRequestCountChanged; - - private void AddedOrUpdated(Friend friend) - { - Friend old; - if (!this.friends.TryGetValue(friend.FriendUserId, out old)) - { - this.friends.Add(friend.FriendUserId, friend); - Action friendAdded = this.FriendAdded; - if (friendAdded != null) - friendAdded(friend); - } - else - { - this.friends[friend.FriendUserId] = friend; - FriendManager.FriendUpdate friendUpdated = this.FriendUpdated; - if (friendUpdated != null) - friendUpdated(friend, old); - } - this._friendsChanged = true; - } - - private void Removed(Friend friend) - { - this.friends.Remove(friend.FriendUserId); - Action friendRemoved = this.FriendRemoved; - if (friendRemoved != null) - friendRemoved(friend); - this._friendsChanged = true; - } - - internal void Reset() - { - foreach (KeyValuePair friend in this.friends) - { - Action friendRemoved = this.FriendRemoved; - if (friendRemoved != null) - friendRemoved(friend.Value); - } - this.friends.Clear(); - this.lastStatusUpdate = new DateTime?(); - this.lastRequest = new DateTime(); - } - - internal void Update() - { - if (this._friendsChanged) - { - this._friendsChanged = false; - int num; - lock (this._lock) - { - num = this.friends.Count>((Func, bool>) (f => - { - if (f.Value.FriendStatus == FriendStatus.Requested) - return f.Value.FriendUserId != this.Cloud.CurrentUser.Id; - return false; - })); - this._friendSessions.Clear(); - foreach (KeyValuePair friend in this.friends) - { - if (friend.Value.UserStatus?.ActiveSessions != null) - { - foreach (SessionInfo activeSession in friend.Value.UserStatus.ActiveSessions) - { - if (activeSession.AccessLevel == SessionAccessLevel.Friends && !this._friendSessions.ContainsKey(activeSession.SessionId)) - this._friendSessions.Add(activeSession.SessionId, activeSession); - } - } - } - } - if (num != this.FriendRequestCount) - { - this.FriendRequestCount = num; - Action requestCountChanged = this.FriendRequestCountChanged; - if (requestCountChanged != null) - requestCountChanged(this.FriendRequestCount); - } - Action friendsChanged = this.FriendsChanged; - if (friendsChanged != null) - friendsChanged(); - } - if (this.Cloud.CurrentUser == null || (DateTime.Now - this.lastRequest).TotalSeconds < (double) FriendManager.UPDATE_PERIOD_SECONDS) - return; - this.lastRequest = DateTime.Now; - Task.Run((Func) (async () => - { - CloudResult> friends = await this.Cloud.GetFriends(this.lastStatusUpdate); - if (!friends.IsOK) - return; - lock (this._lock) - { - foreach (Friend friend in friends.Entity) - { - if (friend.UserStatus != null) - this.lastStatusUpdate = new DateTime?(MathX.Max(this.lastStatusUpdate.GetValueOrDefault(), friend.UserStatus.LastStatusChange)); - this.AddedOrUpdated(friend); - } - } - })); - } - - public delegate void FriendUpdate(Friend updated, Friend old); - } -} diff --git a/.API/FriendStatus.cs b/.API/FriendStatus.cs deleted file mode 100644 index 370df86..0000000 --- a/.API/FriendStatus.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: CloudX.Shared.FriendStatus -// Assembly: CloudX.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -// MVID: 6223B97A-06A5-46CB-9E10-78604961D6EE -// Assembly location: J:\D\SteamLibrary\steamapps\common\NeosVR\HeadlessClient\CloudX.Shared.dll - -namespace CloudX.Shared -{ - public enum FriendStatus - { - None, - SearchResult, - Requested, - Ignored, - Blocked, - Accepted, - } -} diff --git a/.API/IRecord.cs b/.API/IRecord.cs deleted file mode 100644 index aa3f37b..0000000 --- a/.API/IRecord.cs +++ /dev/null @@ -1,62 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: CloudX.Shared.IRecord -// Assembly: CloudX.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -// MVID: 6223B97A-06A5-46CB-9E10-78604961D6EE -// Assembly location: J:\D\SteamLibrary\steamapps\common\NeosVR\HeadlessClient\CloudX.Shared.dll - -using System; -using System.Collections.Generic; - -namespace CloudX.Shared -{ - public interface IRecord - { - string RecordId { get; set; } - - string OwnerId { get; set; } - - string AssetURI { get; set; } - - Uri URL { get; } - - int GlobalVersion { get; set; } - - int LocalVersion { get; set; } - - string LastModifyingUserId { get; set; } - - string LastModifyingMachineId { get; set; } - - string Name { get; set; } - - string OwnerName { get; set; } - - string Description { get; set; } - - string RecordType { get; set; } - - HashSet Tags { get; set; } - - string Path { get; set; } - - string ThumbnailURI { get; set; } - - bool IsPublic { get; set; } - - bool IsForPatrons { get; set; } - - bool IsListed { get; set; } - - int Visits { get; set; } - - double Rating { get; set; } - - DateTime? FirstPublishTime { get; set; } - - DateTime? CreationTime { get; set; } - - DateTime LastModificationTime { get; set; } - - List NeosDBManifest { get; set; } - } -} diff --git a/.API/IdUtil.cs b/.API/IdUtil.cs deleted file mode 100644 index cc2188f..0000000 --- a/.API/IdUtil.cs +++ /dev/null @@ -1,70 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: CloudX.Shared.IdUtil -// Assembly: CloudX.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -// MVID: 6223B97A-06A5-46CB-9E10-78604961D6EE -// Assembly location: J:\D\SteamLibrary\steamapps\common\NeosVR\HeadlessClient\CloudX.Shared.dll - -using BaseX; -using System; -using System.Text; - -namespace CloudX.Shared -{ - public static class IdUtil - { - public const int MAX_NAME_LENGTH = 20; - - public static OwnerType GetOwnerType(string id) - { - if (id == null) - return OwnerType.INVALID; - if (id.StartsWith("M-")) - return OwnerType.Machine; - if (id.StartsWith("U-")) - return OwnerType.User; - return id.StartsWith("G-") ? OwnerType.Group : OwnerType.INVALID; - } - - public static string GenerateId(OwnerType ownerType, string name = null, int randomAppend = 0) - { - name = name != null ? name.RemoveDiacritics().RemoveNonASCII() : (string) null; - StringBuilder stringBuilder = new StringBuilder(); - if (name != null) - { - foreach (char c in name) - { - if (char.IsLetterOrDigit(c)) - stringBuilder.Append(c); - if (char.IsWhiteSpace(c) || c == '_') - stringBuilder.Append("-"); - if (stringBuilder.Length == 20) - break; - } - } - if (stringBuilder.Length == 0 || randomAppend > 0) - { - if (stringBuilder.Length > 0) - stringBuilder.Append("-"); - string str = Guid.NewGuid().ToString(); - if (randomAppend > 0) - str = str.Substring(0, randomAppend); - stringBuilder.Append(str); - } - switch (ownerType) - { - case OwnerType.Machine: - stringBuilder.Insert(0, "M-"); - break; - case OwnerType.User: - stringBuilder.Insert(0, "U-"); - break; - case OwnerType.Group: - stringBuilder.Insert(0, "G-"); - break; - default: - throw new Exception("Invalid owner type"); - } - return stringBuilder.ToString(); - } - } -} diff --git a/.API/MessageManager.cs b/.API/MessageManager.cs deleted file mode 100644 index 03c1443..0000000 --- a/.API/MessageManager.cs +++ /dev/null @@ -1,339 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: CloudX.Shared.MessageManager -// Assembly: CloudX.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -// MVID: 6223B97A-06A5-46CB-9E10-78604961D6EE -// Assembly location: J:\D\SteamLibrary\steamapps\common\NeosVR\HeadlessClient\CloudX.Shared.dll - -using BaseX; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace CloudX.Shared -{ - public class MessageManager - { - public static float UPDATE_PERIOD_SECONDS = 1f; - public static float UPDATE_TIMEOUT_SECONDS = 10f; - private object _messagesLock = new object(); - private Dictionary _messages = new Dictionary(); - private DateTime lastRequest; - private DateTime? lastUnreadMessage; - private volatile bool _unreadCountDirty; - private bool _waitingForRequest; - - public static int MAX_READ_HISTORY - { - get - { - return 100; - } - } - - public static int MAX_UNREAD_HISTORY - { - get - { - return 500; - } - } - - public CloudXInterface Cloud { get; private set; } - - public bool InitialMessagesFetched { get; private set; } - - public int UnreadCount { get; private set; } - - public MessageManager(CloudXInterface cloud) - { - this.Cloud = cloud; - } - - internal void Update() - { - if (this.Cloud.CurrentUser == null) - return; - if (this._unreadCountDirty) - { - this._unreadCountDirty = false; - lock (this._messagesLock) - this.UnreadCount = this._messages.Sum>((Func, int>) (m => m.Value.UnreadCount)); - Action messageCountChanged = this.UnreadMessageCountChanged; - if (messageCountChanged != null) - messageCountChanged(this.UnreadCount); - } - if ((DateTime.Now - this.lastRequest).TotalSeconds < (this._waitingForRequest ? (double) MessageManager.UPDATE_TIMEOUT_SECONDS : (double) MessageManager.UPDATE_PERIOD_SECONDS)) - return; - this.lastRequest = DateTime.Now; - this._waitingForRequest = true; - Task.Run((Func) (async () => - { - CloudResult> cloudResult1 = await this.Cloud.GetUnreadMessages(this.lastUnreadMessage).ConfigureAwait(false); - this._waitingForRequest = false; - if (!cloudResult1.IsOK) - return; - HashSet hashSet = Pool.BorrowHashSet(); - lock (this._messagesLock) - { - foreach (Message message in cloudResult1.Entity) - { - this.lastUnreadMessage = this.lastUnreadMessage.HasValue ? new DateTime?(MathX.Max(this.lastUnreadMessage.Value, message.LastUpdateTime)) : new DateTime?(message.LastUpdateTime); - if (!this.GetUserMessages(message.SenderId).AddMessage(message)) - hashSet.Add(message); - } - } - bool flag1 = false; - foreach (Message message in cloudResult1.Entity) - { - if (!hashSet.Contains(message)) - { - if (this.InitialMessagesFetched && message.MessageType == MessageType.CreditTransfer) - { - TransactionMessage content = message.ExtractContent(); - bool flag2 = content.RecipientId == this.Cloud.CurrentUser.Id; - User currentUser = this.Cloud.CurrentUser; - if (currentUser.Credits != null && currentUser.Credits.ContainsKey(content.Token)) - currentUser.Credits[content.Token] += flag2 ? content.Amount : -content.Amount; - flag1 = true; - } - Action onMessageReceived = this.OnMessageReceived; - if (onMessageReceived != null) - onMessageReceived(message); - Friend friend = this.Cloud.Friends.GetFriend(message.SenderId); - if (friend != null) - friend.LatestMessageTime = MathX.Max(DateTime.UtcNow, message.SendTime); - } - } - Pool.Return(ref hashSet); - this.MarkUnreadCountDirty(); - this.InitialMessagesFetched = true; - if (!flag1) - return; - await Task.Delay(10); - CloudResult cloudResult2 = await this.Cloud.UpdateCurrentUserInfo(); - })); - } - - internal void MarkUnreadCountDirty() - { - this._unreadCountDirty = true; - } - - internal void Reset() - { - lock (this._messagesLock) - { - this._messages.Clear(); - this.lastUnreadMessage = new DateTime?(); - this.InitialMessagesFetched = false; - } - } - - public MessageManager.UserMessages GetUserMessages(string userId) - { - lock (this._messagesLock) - { - MessageManager.UserMessages userMessages1; - if (this._messages.TryGetValue(userId, out userMessages1)) - return userMessages1; - MessageManager.UserMessages userMessages2 = new MessageManager.UserMessages(userId, this); - this._messages.Add(userId, userMessages2); - return userMessages2; - } - } - - public void GetAllUserMessages(List list) - { - lock (this._messagesLock) - { - foreach (KeyValuePair message in this._messages) - list.Add(message.Value); - } - } - - public event Action OnMessageReceived; - - public event Action UnreadMessageCountChanged; - - public class UserMessages - { - private HashSet _messageIds = new HashSet(); - private object _lock = new object(); - private Task>> _historyLoadTask; - private bool _historyLoaded; - - public MessageManager Manager { get; private set; } - - public CloudXInterface Cloud - { - get - { - return this.Manager.Cloud; - } - } - - public string UserId { get; private set; } - - public List Messages { get; private set; } = new List(); - - public int UnreadCount { get; private set; } - - public UserMessages(string userId, MessageManager manager) - { - this.UserId = userId; - this.Manager = manager; - } - - public void MarkAllRead() - { - List ids = (List) null; - lock (this._lock) - { - if (this.UnreadCount == 0) - return; - ids = new List(); - foreach (Message message in this.Messages) - { - if (!message.IsSent && !message.ReadTime.HasValue) - { - message.ReadTime = new DateTime?(DateTime.UtcNow); - ids.Add(message.Id); - } - } - this.UnreadCount = 0; - } - Task.Run((Func>) (async () => await this.Cloud.MarkMessagesRead(ids))); - this.Manager.MarkUnreadCountDirty(); - } - - public Message CreateTextMessage(string text) - { - return new Message() - { - MessageType = MessageType.Text, - Content = text - }; - } - - public Message CreateInviteMessage(SessionInfo sessionInfo) - { - Message message = new Message(); - message.Id = Message.GenerateId(); - message.SendTime = DateTime.UtcNow; - message.MessageType = MessageType.SessionInvite; - message.SetContent(sessionInfo); - return message; - } - - public async Task> SendInviteMessage( - SessionInfo sessionInfo) - { - return await this.SendMessage(this.CreateInviteMessage(sessionInfo)); - } - - public Message AddSentTransactionMessage(string token, Decimal amount, string comment) - { - Message message = new Message() - { - Id = Message.GenerateId(), - OwnerId = this.Cloud.CurrentUser.Id, - RecipientId = this.UserId - }; - message.SenderId = message.OwnerId; - message.SendTime = DateTime.UtcNow; - message.MessageType = MessageType.CreditTransfer; - message.SetContent(new TransactionMessage() - { - Token = token, - Amount = amount, - Comment = comment, - RecipientId = this.UserId - }); - lock (this._lock) - this.Messages.Add(message); - return message; - } - - public async Task> SendMessage(Message message) - { - if (message.Id == null) - message.Id = Message.GenerateId(); - message.RecipientId = this.UserId; - message.SenderId = this.Cloud.CurrentUser.Id; - message.OwnerId = message.SenderId; - message.SendTime = DateTime.UtcNow; - lock (this._lock) - this.Messages.Add(message); - Friend friend = this.Cloud.Friends.GetFriend(message.RecipientId); - if (friend != null) - friend.LatestMessageTime = DateTime.UtcNow; - return await this.Cloud.SendMessage(message).ConfigureAwait(false); - } - - public async Task> SendTextMessage(string text) - { - return await this.SendMessage(this.CreateTextMessage(text)).ConfigureAwait(false); - } - - public async Task EnsureHistory() - { - if (this._historyLoaded) - return; - bool isFirstRequest = false; - lock (this._lock) - { - if (this._historyLoaded) - return; - if (this._historyLoadTask == null) - { - isFirstRequest = true; - this._historyLoadTask = this.Cloud.GetMessageHistory(this.UserId, MessageManager.MAX_READ_HISTORY); - } - } - CloudResult> cloudResult = await this._historyLoadTask.ConfigureAwait(false); - if (!isFirstRequest) - return; - if (!cloudResult.IsOK) - { - this._historyLoadTask = (Task>>) null; - } - else - { - lock (this._lock) - { - this.Messages = cloudResult.Entity; - this.Messages.Reverse(); - this.UnreadCount = this.Messages.Count((Func) (m => !m.ReadTime.HasValue)); - this._historyLoaded = true; - } - } - } - - internal bool AddMessage(Message message) - { - lock (this._lock) - { - if (this._messageIds.Contains(message.Id)) - return false; - this.Messages.Add(message); - this._messageIds.Add(message.Id); - if (message.IsReceived && !message.ReadTime.HasValue) - ++this.UnreadCount; - while (this.Messages.Count > MessageManager.MAX_UNREAD_HISTORY || this.Messages.Count > MessageManager.MAX_READ_HISTORY && (this.Messages[0].IsSent || this.Messages[0].ReadTime.HasValue)) - { - this._messageIds.Remove(this.Messages[0].Id); - this.Messages.RemoveAt(0); - } - return true; - } - } - - public void GetMessages(List messages) - { - lock (this._lock) - messages.AddRange((IEnumerable) this.Messages); - } - } - } -} diff --git a/.API/MessageType.cs b/.API/MessageType.cs deleted file mode 100644 index 9b38967..0000000 --- a/.API/MessageType.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: CloudX.Shared.MessageType -// Assembly: CloudX.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -// MVID: 6223B97A-06A5-46CB-9E10-78604961D6EE -// Assembly location: J:\D\SteamLibrary\steamapps\common\NeosVR\HeadlessClient\CloudX.Shared.dll - -namespace CloudX.Shared -{ - public enum MessageType - { - Text, - Object, - SessionInvite, - CreditTransfer, - SugarCubes, - } -} diff --git a/.API/Models/1HubPatreons.cs b/.API/Models/1HubPatreons.cs deleted file mode 100644 index 23f6857..0000000 --- a/.API/Models/1HubPatreons.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: CloudX.Shared.HubPatrons -// Assembly: CloudX.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -// MVID: 6223B97A-06A5-46CB-9E10-78604961D6EE -// Assembly location: J:\D\SteamLibrary\steamapps\common\NeosVR\HeadlessClient\CloudX.Shared.dll - -using BaseX; -using Newtonsoft.Json; -using System.Collections.Generic; -using System.Text.Json.Serialization; - -namespace CloudX.Shared -{ - public class HubPatrons - { - public const int MAX_NAMES = 400; - public const int MAX_PICTURES = 50; - public const string VARIABLE_NAME = "hub.patrons"; - - [JsonProperty(PropertyName = "patron-names")] - [JsonPropertyName("patron-names")] - public List PatronNames { get; set; } = new List(); - - [JsonProperty(PropertyName = "patron-pictures")] - [JsonPropertyName("patron-pictures")] - public List PatronPictures { get; set; } = new List(); - - public void EnsureMaxLimitsRandomized() - { - while (this.PatronNames.Count > 400) - this.PatronNames.TakeRandom(); - while (this.PatronPictures.Count > 50) - this.PatronPictures.TakeRandom(); - } - } -} diff --git a/.API/Models/AssetDiff.cs b/.API/Models/AssetDiff.cs deleted file mode 100644 index 474d851..0000000 --- a/.API/Models/AssetDiff.cs +++ /dev/null @@ -1,37 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: CloudX.Shared.AssetDiff -// Assembly: CloudX.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -// MVID: 6223B97A-06A5-46CB-9E10-78604961D6EE -// Assembly location: J:\D\SteamLibrary\steamapps\common\NeosVR\HeadlessClient\CloudX.Shared.dll - -using Newtonsoft.Json; -using System.Text.Json.Serialization; - -namespace CloudX.Shared -{ - public class AssetDiff - { - [JsonProperty(PropertyName = "hash")] - [JsonPropertyName("hash")] - public string Hash { get; set; } - - [JsonProperty(PropertyName = "bytes")] - [JsonPropertyName("bytes")] - public long Bytes { get; set; } - - [JsonProperty(PropertyName = "state")] - [JsonPropertyName("state")] - public AssetDiff.Diff State { get; set; } - - [JsonProperty(NullValueHandling = NullValueHandling.Ignore, PropertyName = "isUploaded")] - [JsonPropertyName("isUploaded")] - public bool? IsUploaded { get; set; } - - public enum Diff - { - Added, - Unchanged, - Removed, - } - } -} diff --git a/.API/Models/AssetUploadData.cs b/.API/Models/AssetUploadData.cs deleted file mode 100644 index 589c3fd..0000000 --- a/.API/Models/AssetUploadData.cs +++ /dev/null @@ -1,45 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: CloudX.Shared.AssetUploadData -// Assembly: CloudX.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -// MVID: 6223B97A-06A5-46CB-9E10-78604961D6EE -// Assembly location: J:\D\SteamLibrary\steamapps\common\NeosVR\HeadlessClient\CloudX.Shared.dll - -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using System.Text.Json.Serialization; - -namespace CloudX.Shared -{ - public class AssetUploadData - { - [JsonProperty(PropertyName = "signature")] - [JsonPropertyName("signature")] - public string Signature { get; set; } - - [JsonProperty(PropertyName = "variant")] - [JsonPropertyName("variant")] - public string Variant { get; set; } - - [JsonProperty(PropertyName = "ownerId")] - [JsonPropertyName("ownerId")] - public string OwnerId { get; set; } - - [JsonProperty(PropertyName = "totalBytes")] - [JsonPropertyName("totalBytes")] - public long TotalBytes { get; set; } - - [JsonProperty(PropertyName = "chunkSize")] - [JsonPropertyName("chunkSize")] - public int ChunkSize { get; set; } - - [JsonProperty(PropertyName = "totalChunks")] - [JsonPropertyName("totalChunks")] - public int TotalChunks { get; set; } - - [JsonProperty(PropertyName = "uploadState")] - [JsonPropertyName("uploadState")] - [Newtonsoft.Json.JsonConverter(typeof (StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof (JsonStringEnumConverter))] - public UploadState UploadState { get; set; } - } -} diff --git a/.API/Models/AssetVariantComputationTask.cs b/.API/Models/AssetVariantComputationTask.cs deleted file mode 100644 index 80d3a64..0000000 --- a/.API/Models/AssetVariantComputationTask.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: CloudX.Shared.AssetVariantComputationTask -// Assembly: CloudX.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -// MVID: 6223B97A-06A5-46CB-9E10-78604961D6EE -// Assembly location: J:\D\SteamLibrary\steamapps\common\NeosVR\HeadlessClient\CloudX.Shared.dll - -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using System.Text.Json.Serialization; - -namespace CloudX.Shared -{ - public class AssetVariantComputationTask - { - [JsonProperty(PropertyName = "assetSignature")] - [JsonPropertyName("assetSignature")] - public string AssetSignature { get; set; } - - [JsonProperty(PropertyName = "variantId")] - [JsonPropertyName("variantId")] - public string VariantId { get; set; } - - [JsonProperty(PropertyName = "entityType")] - [JsonPropertyName("entityType")] - [Newtonsoft.Json.JsonConverter(typeof (StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof (JsonStringEnumConverter))] - public AssetVariantEntityType EntityType { get; set; } - } -} diff --git a/.API/Models/ChildRecordDiff.cs b/.API/Models/ChildRecordDiff.cs deleted file mode 100644 index 9b41cce..0000000 --- a/.API/Models/ChildRecordDiff.cs +++ /dev/null @@ -1,37 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: CloudX.Shared.ChildRecordDiff -// Assembly: CloudX.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -// MVID: 6223B97A-06A5-46CB-9E10-78604961D6EE -// Assembly location: J:\D\SteamLibrary\steamapps\common\NeosVR\HeadlessClient\CloudX.Shared.dll - -using Newtonsoft.Json; -using System; -using System.Text.Json.Serialization; - -namespace CloudX.Shared -{ - public class ChildRecordDiff - { - [JsonProperty(PropertyName = "operation")] - [JsonPropertyName("operation")] - public ChildRecordDiff.RecordInfoOperation Operation { get; set; } - - [JsonProperty(PropertyName = "created")] - [JsonPropertyName("created")] - public DateTime Created { get; set; } - - [JsonProperty(PropertyName = "parentRecord")] - [JsonPropertyName("parentRecord")] - public RecordId ParentRecord { get; set; } - - [JsonProperty(PropertyName = "recordInfo")] - [JsonPropertyName("recordInfo")] - public RecordInfo RecordInfo { get; set; } - - public enum RecordInfoOperation - { - Upsert, - Remove, - } - } -} diff --git a/.API/Models/CreditTransaction.cs b/.API/Models/CreditTransaction.cs deleted file mode 100644 index 24495ad..0000000 --- a/.API/Models/CreditTransaction.cs +++ /dev/null @@ -1,47 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: CloudX.Shared.CreditTransaction -// Assembly: CloudX.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -// MVID: 6223B97A-06A5-46CB-9E10-78604961D6EE -// Assembly location: J:\D\SteamLibrary\steamapps\common\NeosVR\HeadlessClient\CloudX.Shared.dll - -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using System; -using System.Text.Json.Serialization; - -namespace CloudX.Shared -{ - [JsonObject(MemberSerialization = MemberSerialization.OptIn)] - public class CreditTransaction - { - [JsonProperty(PropertyName = "token")] - [JsonPropertyName("token")] - public string Token { get; set; } - - [JsonProperty(PropertyName = "fromUserId")] - [JsonPropertyName("fromUserId")] - public string FromUserId { get; set; } - - [JsonProperty(PropertyName = "toUserId")] - [JsonPropertyName("toUserId")] - public string ToUserId { get; set; } - - [JsonProperty(PropertyName = "amount")] - [JsonPropertyName("amount")] - public Decimal Amount { get; set; } - - [JsonProperty(PropertyName = "comment")] - [JsonPropertyName("comment")] - public string Comment { get; set; } - - [JsonProperty(PropertyName = "transactionType")] - [JsonPropertyName("transactionType")] - [Newtonsoft.Json.JsonConverter(typeof (StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof (JsonStringEnumConverter))] - public TransactionType TransactionType { get; set; } - - [JsonProperty(PropertyName = "anonymous")] - [JsonPropertyName("anonymous")] - public bool Anonymous { get; set; } - } -} diff --git a/.API/Models/ExternalQueueObject.cs b/.API/Models/ExternalQueueObject.cs deleted file mode 100644 index 5fa2d28..0000000 --- a/.API/Models/ExternalQueueObject.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: CloudX.Shared.ExternalQueueObject`1 -// Assembly: CloudX.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -// MVID: 6223B97A-06A5-46CB-9E10-78604961D6EE -// Assembly location: J:\D\SteamLibrary\steamapps\common\NeosVR\HeadlessClient\CloudX.Shared.dll - -using Newtonsoft.Json; -using System.Text.Json.Serialization; - -namespace CloudX.Shared -{ - public class ExternalQueueObject - { - [JsonProperty(PropertyName = "id")] - [JsonPropertyName("id")] - public string Id { get; set; } - - [JsonProperty(PropertyName = "popReceipt")] - [JsonPropertyName("popReceipt")] - public string PopReceipt { get; set; } - - [JsonProperty(PropertyName = "object")] - [JsonPropertyName("object")] - public T Object { get; set; } - } -} diff --git a/.API/Models/HubPatreons.cs b/.API/Models/HubPatreons.cs deleted file mode 100644 index 7706fcb..0000000 --- a/.API/Models/HubPatreons.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: CloudX.Shared.PicturePatreon -// Assembly: CloudX.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -// MVID: 6223B97A-06A5-46CB-9E10-78604961D6EE -// Assembly location: J:\D\SteamLibrary\steamapps\common\NeosVR\HeadlessClient\CloudX.Shared.dll - -using Newtonsoft.Json; -using System.Text.Json.Serialization; - -namespace CloudX.Shared -{ - public class PicturePatreon - { - [JsonProperty(PropertyName = "name")] - [JsonPropertyName("name")] - public string Name { get; set; } - - [JsonProperty(PropertyName = "pictureUrl")] - [JsonPropertyName("pictureUrl")] - public string PictureURL { get; set; } - - public PicturePatreon(string name, string url) - { - this.Name = name; - this.PictureURL = url; - } - } -} diff --git a/.API/Models/Integrations/SugarCube.cs b/.API/Models/Integrations/SugarCube.cs deleted file mode 100644 index 057f591..0000000 --- a/.API/Models/Integrations/SugarCube.cs +++ /dev/null @@ -1,73 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: CloudX.Shared.SugarCube -// Assembly: CloudX.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -// MVID: 6223B97A-06A5-46CB-9E10-78604961D6EE -// Assembly location: J:\D\SteamLibrary\steamapps\common\NeosVR\HeadlessClient\CloudX.Shared.dll - -using BaseX; -using Newtonsoft.Json; -using System; -using System.Text.Json.Serialization; - -namespace CloudX.Shared -{ - [JsonObject(MemberSerialization = MemberSerialization.OptIn)] - public class SugarCube - { - [JsonProperty(PropertyName = "batchId")] - [JsonPropertyName("batchId")] - public string BatchId { get; set; } - - [JsonProperty(PropertyName = "sequenceNumber")] - [JsonPropertyName("sequenceNumber")] - public int SequenceNumber { get; set; } - - [JsonProperty(PropertyName = "generatedOn")] - [JsonPropertyName("generatedOn")] - public DateTime GeneratedOn { get; set; } - - [JsonProperty(PropertyName = "consumed")] - [JsonPropertyName("consumed")] - public bool Consumed { get; set; } - - [JsonProperty(PropertyName = "consumedOn")] - [JsonPropertyName("consumedOn")] - public DateTime ConsumedOn { get; set; } - - [JsonProperty(PropertyName = "originalOwnerId")] - [JsonPropertyName("originalOwnerId")] - public string OriginalOwnerId { get; set; } - - [JsonProperty(PropertyName = "currentOwnerId")] - [JsonPropertyName("currentOwnerId")] - public string CurrentOwnerId { get; set; } - - [JsonProperty(PropertyName = "redChannel")] - [JsonPropertyName("redChannel")] - public double RedChannel { get; set; } - - [JsonProperty(PropertyName = "greenChannel")] - [JsonPropertyName("greenChannel")] - public double GreenChannel { get; set; } - - [JsonProperty(PropertyName = "blueChannel")] - [JsonPropertyName("blueChannel")] - public double BlueChannel { get; set; } - - [JsonIgnore] - [JsonIgnore] - public color Color - { - get - { - return new color((float) this.RedChannel, (float) this.GreenChannel, (float) this.BlueChannel, 1f); - } - set - { - this.RedChannel = (double) value.r; - this.GreenChannel = (double) value.g; - this.BlueChannel = (double) value.b; - } - } - } -} diff --git a/.API/Models/License.cs b/.API/Models/License.cs deleted file mode 100644 index e579b8c..0000000 --- a/.API/Models/License.cs +++ /dev/null @@ -1,27 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: CloudX.Shared.License -// Assembly: CloudX.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -// MVID: 6223B97A-06A5-46CB-9E10-78604961D6EE -// Assembly location: J:\D\SteamLibrary\steamapps\common\NeosVR\HeadlessClient\CloudX.Shared.dll - -using Newtonsoft.Json; -using System.Text.Json.Serialization; - -namespace CloudX.Shared -{ - [JsonObject(MemberSerialization = MemberSerialization.OptIn)] - public class License - { - [JsonProperty(PropertyName = "licenseGroup")] - [JsonPropertyName("licenseGroup")] - public string LicenseGroup { get; set; } - - [JsonProperty(PropertyName = "licenseKey")] - [JsonPropertyName("licenseKey")] - public string LicenseKey { get; set; } - - [JsonProperty("pairedMachineUUID")] - [JsonPropertyName("pairedMachineUUID")] - public string PairedMachineUUID { get; set; } - } -} diff --git a/.API/Models/LoginCredentials.cs b/.API/Models/LoginCredentials.cs deleted file mode 100644 index d766d4f..0000000 --- a/.API/Models/LoginCredentials.cs +++ /dev/null @@ -1,62 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: CloudX.Shared.LoginCredentials -// Assembly: CloudX.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -// MVID: 6223B97A-06A5-46CB-9E10-78604961D6EE -// Assembly location: J:\D\SteamLibrary\steamapps\common\NeosVR\HeadlessClient\CloudX.Shared.dll - -using Newtonsoft.Json; -using System.Text.Json.Serialization; - -namespace CloudX.Shared -{ - [JsonObject(MemberSerialization = MemberSerialization.OptIn)] - public class LoginCredentials - { - [JsonProperty(PropertyName = "ownerId")] - [JsonPropertyName("ownerId")] - public string OwnerId { get; set; } - - [JsonProperty(PropertyName = "username")] - [JsonPropertyName("username")] - public string Username { get; set; } - - [JsonProperty(PropertyName = "email")] - [JsonPropertyName("email")] - public string Email { get; set; } - - [JsonProperty(PropertyName = "password")] - [JsonPropertyName("password")] - public string Password { get; set; } - - [JsonProperty(PropertyName = "recoverCode")] - [JsonPropertyName("recoverCode")] - public string RecoverCode { get; set; } - - [JsonProperty(PropertyName = "sessionCode")] - [JsonPropertyName("sessionCode")] - public string SessionToken { get; set; } - - [JsonProperty(PropertyName = "secretMachineId")] - [JsonPropertyName("secretMachineId")] - public string SecretMachineId { get; set; } - - [JsonProperty(PropertyName = "rememberMe")] - [JsonPropertyName("rememberMe")] - public bool RememberMe { get; set; } - - public void Preprocess() - { - this.Username = this.Username?.Trim(); - this.Email = this.Email?.Trim()?.ToLower(); - } - - [JsonIgnore] - public bool IsPasswordValid - { - get - { - return CryptoHelper.IsValidPassword(this.Password); - } - } - } -} diff --git a/.API/Models/NeosAccount.cs b/.API/Models/NeosAccount.cs deleted file mode 100644 index 1a20883..0000000 --- a/.API/Models/NeosAccount.cs +++ /dev/null @@ -1,123 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: CloudX.Shared.NeosAccount -// Assembly: CloudX.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -// MVID: 6223B97A-06A5-46CB-9E10-78604961D6EE -// Assembly location: J:\D\SteamLibrary\steamapps\common\NeosVR\HeadlessClient\CloudX.Shared.dll - -using System; - -namespace CloudX.Shared -{ - public static class NeosAccount - { - public static int MinCents(AccountType type) - { - int num = 100; - switch (type) - { - case AccountType.Normal: - return 0; - case AccountType.AgentSmith: - return num; - case AccountType.BladeRunner: - return num * 6; - case AccountType.Gunter: - return num * 12; - case AccountType.Neuromancer: - return num * 24; - case AccountType.Architect: - return num * 32; - case AccountType.Curator: - return num * 72; - case AccountType.Level144: - return num * 144; - case AccountType.Level250: - return num * 250; - case AccountType.Anorak: - return num * 500; - default: - throw new Exception("Invalid AccountType: " + type.ToString()); - } - } - - public static string AccountName(AccountType type) - { - switch (type) - { - case AccountType.Normal: - return "Standard Account"; - case AccountType.AgentSmith: - return "Agent Smith"; - case AccountType.BladeRunner: - return "Blade Runner"; - case AccountType.Gunter: - return "Gunter"; - case AccountType.Neuromancer: - return "Neuromancer"; - case AccountType.Architect: - return "Architect"; - case AccountType.Curator: - return "Curator"; - case AccountType.Level144: - return "Level 144"; - case AccountType.Level250: - return "Level 250"; - case AccountType.Anorak: - return "Anorak"; - default: - return "Unknown Account Type"; - } - } - - public static long StorageBytes(AccountType type) - { - long num = 1073741824; - switch (type) - { - case AccountType.Normal: - return num; - case AccountType.AgentSmith: - return num * 5L; - case AccountType.BladeRunner: - return num * 25L; - case AccountType.Gunter: - return num * 50L; - case AccountType.Neuromancer: - return num * 100L; - case AccountType.Architect: - return num * 150L; - case AccountType.Curator: - return num * 300L; - case AccountType.Level144: - return num * 600L; - case AccountType.Level250: - return num * 1200L; - case AccountType.Anorak: - return num * 2400L; - default: - throw new Exception("Invalid AccountType: " + type.ToString()); - } - } - - public static bool HasPatreonWorldAccess(AccountType type) - { - switch (type) - { - case AccountType.Normal: - case AccountType.AgentSmith: - return false; - case AccountType.BladeRunner: - case AccountType.Gunter: - case AccountType.Neuromancer: - case AccountType.Architect: - case AccountType.Curator: - case AccountType.Level144: - case AccountType.Level250: - case AccountType.Anorak: - return true; - default: - throw new Exception("Invalid AccountType: " + type.ToString()); - } - } - } -} diff --git a/.API/Models/NeosDBAsset.cs b/.API/Models/NeosDBAsset.cs deleted file mode 100644 index 38bd395..0000000 --- a/.API/Models/NeosDBAsset.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: CloudX.Shared.NeosDBAsset -// Assembly: CloudX.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -// MVID: 6223B97A-06A5-46CB-9E10-78604961D6EE -// Assembly location: J:\D\SteamLibrary\steamapps\common\NeosVR\HeadlessClient\CloudX.Shared.dll - -using Newtonsoft.Json; -using System; -using System.Text.Json.Serialization; - -namespace CloudX.Shared -{ - [JsonObject(MemberSerialization = MemberSerialization.OptIn)] - [Serializable] - public class NeosDBAsset - { - [JsonProperty(PropertyName = "hash")] - [JsonPropertyName("hash")] - public string Hash { get; set; } - - [JsonProperty(PropertyName = "bytes")] - [JsonPropertyName("bytes")] - public long Bytes { get; set; } - } -} diff --git a/.API/Models/RSAParametersData.cs b/.API/Models/RSAParametersData.cs deleted file mode 100644 index 38707ad..0000000 --- a/.API/Models/RSAParametersData.cs +++ /dev/null @@ -1,78 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: CloudX.Shared.RSAParametersData -// Assembly: CloudX.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -// MVID: 6223B97A-06A5-46CB-9E10-78604961D6EE -// Assembly location: J:\D\SteamLibrary\steamapps\common\NeosVR\HeadlessClient\CloudX.Shared.dll - -using Newtonsoft.Json; -using System.Security.Cryptography; -using System.Text.Json.Serialization; - -namespace CloudX.Shared -{ - public class RSAParametersData - { - [JsonProperty(PropertyName = "Exponent")] - [JsonPropertyName("Exponent")] - public byte[] Exponent { get; set; } - - [JsonProperty(PropertyName = "Modulus")] - [JsonPropertyName("Modulus")] - public byte[] Modulus { get; set; } - - [JsonProperty(PropertyName = "P")] - [JsonPropertyName("P")] - public byte[] P { get; set; } - - [JsonProperty(PropertyName = "Q")] - [JsonPropertyName("Q")] - public byte[] Q { get; set; } - - [JsonProperty(PropertyName = "DP")] - [JsonPropertyName("DP")] - public byte[] DP { get; set; } - - [JsonProperty(PropertyName = "DQ")] - [JsonPropertyName("DQ")] - public byte[] DQ { get; set; } - - [JsonProperty(PropertyName = "InverseQ")] - [JsonPropertyName("InverseQ")] - public byte[] InverseQ { get; set; } - - [JsonProperty(PropertyName = "D")] - [JsonPropertyName("D")] - public byte[] D { get; set; } - - public static implicit operator RSAParametersData(RSAParameters rsa) - { - RSAParametersData rsaParametersData = new RSAParametersData() - { - Exponent = rsa.Exponent, - Modulus = rsa.Modulus, - P = rsa.P, - Q = rsa.Q, - DP = rsa.DP, - DQ = rsa.DQ, - InverseQ = rsa.InverseQ - }; - rsaParametersData.D = rsaParametersData.D; - return rsaParametersData; - } - - public static implicit operator RSAParameters(RSAParametersData data) - { - return new RSAParameters() - { - Exponent = data.Exponent, - Modulus = data.Modulus, - P = data.P, - Q = data.Q, - DP = data.DP, - DQ = data.DQ, - InverseQ = data.InverseQ, - D = data.D - }; - } - } -} diff --git a/.API/Models/RecordId.cs b/.API/Models/RecordId.cs deleted file mode 100644 index 487e1a8..0000000 --- a/.API/Models/RecordId.cs +++ /dev/null @@ -1,55 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: CloudX.Shared.RecordId -// Assembly: CloudX.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -// MVID: 6223B97A-06A5-46CB-9E10-78604961D6EE -// Assembly location: J:\D\SteamLibrary\steamapps\common\NeosVR\HeadlessClient\CloudX.Shared.dll - -using Newtonsoft.Json; -using System; -using System.Text.Json.Serialization; - -namespace CloudX.Shared -{ - [JsonObject(MemberSerialization = MemberSerialization.OptIn)] - [Serializable] - public class RecordId : IEquatable - { - [JsonProperty(PropertyName = "recordId")] - [JsonPropertyName("recordId")] - public string Id { get; set; } - - [JsonProperty(PropertyName = "ownerId")] - [JsonPropertyName("ownerId")] - public string OwnerId { get; set; } - - public override bool Equals(object obj) - { - RecordId other = obj as RecordId; - if (other != null) - return this.Equals(other); - return false; - } - - public override int GetHashCode() - { - return this.Id.GetHashCode() ^ this.OwnerId.GetHashCode(); - } - - public bool Equals(RecordId other) - { - if (this.Id == other.Id) - return this.OwnerId == other.OwnerId; - return false; - } - - public RecordId(string ownerId, string recordId) - { - this.OwnerId = ownerId; - this.Id = recordId; - } - - public RecordId() - { - } - } -} diff --git a/.API/Models/RecordInfo.cs b/.API/Models/RecordInfo.cs deleted file mode 100644 index 8945fa1..0000000 --- a/.API/Models/RecordInfo.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: CloudX.Shared.RecordInfo -// Assembly: CloudX.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -// MVID: 6223B97A-06A5-46CB-9E10-78604961D6EE -// Assembly location: J:\D\SteamLibrary\steamapps\common\NeosVR\HeadlessClient\CloudX.Shared.dll - -using Newtonsoft.Json; -using System; -using System.Text.Json.Serialization; - -namespace CloudX.Shared -{ - [JsonObject(MemberSerialization = MemberSerialization.OptIn)] - [Serializable] - public class RecordInfo - { - [JsonProperty(PropertyName = "recordId")] - [JsonPropertyName("recordId")] - public string Id { get; set; } - - [JsonProperty(PropertyName = "ownerId")] - [JsonPropertyName("ownerId")] - public string OwnerId { get; set; } - - [JsonProperty(PropertyName = "name")] - [JsonPropertyName("name")] - public string Name { get; set; } - - [JsonProperty(PropertyName = "assetUri")] - [JsonPropertyName("assetUri")] - public string AssetURI { get; set; } - - [JsonProperty(PropertyName = "thumbnailUri")] - [JsonPropertyName("thumbnailUri")] - public string ThumbnailURI { get; set; } - - [JsonProperty(PropertyName = "globalVersion")] - [JsonPropertyName("globalVersion")] - public int GlobalVersion { get; set; } - } -} diff --git a/.API/Models/RecordPreprocessStatus.cs b/.API/Models/RecordPreprocessStatus.cs deleted file mode 100644 index 7d5788c..0000000 --- a/.API/Models/RecordPreprocessStatus.cs +++ /dev/null @@ -1,46 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: CloudX.Shared.RecordPreprocessStatus -// Assembly: CloudX.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -// MVID: 6223B97A-06A5-46CB-9E10-78604961D6EE -// Assembly location: J:\D\SteamLibrary\steamapps\common\NeosVR\HeadlessClient\CloudX.Shared.dll - -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using System.Collections.Generic; -using System.Text.Json.Serialization; - -namespace CloudX.Shared -{ - public class RecordPreprocessStatus - { - [JsonProperty(PropertyName = "id")] - [JsonPropertyName("id")] - public string PreprocessId { get; set; } - - [JsonProperty(PropertyName = "ownerId")] - [JsonPropertyName("ownerId")] - public string OwnerId { get; set; } - - [JsonProperty(PropertyName = "recordId")] - [JsonPropertyName("recordId")] - public string RecordId { get; set; } - - [JsonProperty(PropertyName = "state")] - [JsonPropertyName("state")] - [Newtonsoft.Json.JsonConverter(typeof (StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof (JsonStringEnumConverter))] - public RecordPreprocessState State { get; set; } - - [JsonProperty(PropertyName = "progress")] - [JsonPropertyName("progress")] - public float Progress { get; set; } - - [JsonProperty(PropertyName = "failReason")] - [JsonPropertyName("failReason")] - public string FailReason { get; set; } - - [JsonProperty(PropertyName = "resultDiffs")] - [JsonPropertyName("resultDiffs")] - public List ResultDiffs { get; set; } - } -} diff --git a/.API/Models/ServerStatistics.cs b/.API/Models/ServerStatistics.cs deleted file mode 100644 index 9dd2a42..0000000 --- a/.API/Models/ServerStatistics.cs +++ /dev/null @@ -1,23 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: CloudX.Shared.ServerStatistics -// Assembly: CloudX.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -// MVID: 6223B97A-06A5-46CB-9E10-78604961D6EE -// Assembly location: J:\D\SteamLibrary\steamapps\common\NeosVR\HeadlessClient\CloudX.Shared.dll - -using Newtonsoft.Json; -using System; -using System.Text.Json.Serialization; - -namespace CloudX.Shared -{ - public class ServerStatistics - { - [JsonProperty(PropertyName = "lastUpdate")] - [JsonPropertyName("lastUpdate")] - public DateTime LastUpdate { get; set; } - - [JsonProperty(PropertyName = "responseTimeMilliseconds")] - [JsonPropertyName("responseTimeMilliseconds")] - public long ResponseTimeMilliseconds { get; set; } - } -} diff --git a/.API/Models/SessionInfo.cs b/.API/Models/SessionInfo.cs deleted file mode 100644 index a55f99b..0000000 --- a/.API/Models/SessionInfo.cs +++ /dev/null @@ -1,154 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: CloudX.Shared.SessionInfo -// Assembly: CloudX.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -// MVID: 6223B97A-06A5-46CB-9E10-78604961D6EE -// Assembly location: J:\D\SteamLibrary\steamapps\common\NeosVR\HeadlessClient\CloudX.Shared.dll - -using BaseX; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text.Json.Serialization; - -namespace CloudX.Shared -{ - [JsonObject(MemberSerialization = MemberSerialization.OptIn)] - public class SessionInfo - { - [JsonProperty(PropertyName = "name")] - [JsonPropertyName("name")] - public string Name { get; set; } - - [JsonProperty(PropertyName = "description")] - [JsonPropertyName("description")] - public string Description { get; set; } - - [JsonProperty(PropertyName = "tags")] - [JsonPropertyName("tags")] - public HashSet Tags { get; set; } - - [JsonProperty(PropertyName = "sessionId")] - [JsonPropertyName("sessionId")] - public string SessionId { get; set; } - - [JsonProperty(PropertyName = "hostUserId")] - [JsonPropertyName("hostUserId")] - public string HostUserId { get; set; } - - [JsonProperty(PropertyName = "hostMachineId")] - [JsonPropertyName("hostMachineId")] - public string HostMachineId { get; set; } - - [JsonProperty(PropertyName = "hostUsername")] - [JsonPropertyName("hostUsername")] - public string HostUsername { get; set; } - - [JsonProperty(PropertyName = "compatibilityHash")] - [JsonPropertyName("compatibilityHash")] - public string CompatibilityHash { get; set; } - - [JsonProperty(PropertyName = "neosVersion")] - [JsonPropertyName("neosVersion")] - public string NeosVersion { get; set; } - - [JsonProperty(PropertyName = "headlessHost")] - [JsonPropertyName("headlessHost")] - public bool HeadlessHost { get; set; } - - [Obsolete] - [JsonProperty(PropertyName = "url")] - [JsonPropertyName("url")] - public string LegacySessionURL { get; set; } - - [JsonProperty(PropertyName = "sessionURLs")] - [JsonPropertyName("sessionURLs")] - public List SessionURLs { get; set; } - - [JsonProperty(PropertyName = "sessionUsers")] - [JsonPropertyName("sessionUsers")] - public List SessionUsers { get; set; } - - public List GetSessionURLs() - { - if (this.SessionURLs != null) - return this.SessionURLs.Where((Func) (str => Uri.IsWellFormedUriString(str, UriKind.Absolute))).Select((Func) (str => new Uri(str))).ToList(); - List uriList = new List(); - if (this.LegacySessionURL != null) - uriList.Add(new Uri(this.LegacySessionURL)); - return uriList; - } - - [JsonProperty(PropertyName = "thumbnail")] - [JsonPropertyName("thumbnail")] - public string Thumbnail { get; set; } - - [JsonProperty(PropertyName = "joinedUsers")] - [JsonPropertyName("joinedUsers")] - public int JoinedUsers { get; set; } - - [JsonProperty(PropertyName = "activeUsers")] - [JsonPropertyName("activeUsers")] - public int ActiveUsers { get; set; } - - [JsonProperty(PropertyName = "maxUsers")] - [JsonPropertyName("maxUsers")] - public int MaximumUsers { get; set; } - - [JsonProperty(PropertyName = "mobileFriendly")] - [JsonPropertyName("mobileFriendly")] - public bool MobileFriendly { get; set; } - - [JsonProperty(PropertyName = "sessionBeginTime")] - [JsonPropertyName("sessionBeginTime")] - public DateTime SessionBeginTime { get; set; } - - [JsonProperty(PropertyName = "lastUpdate")] - [JsonPropertyName("lastUpdate")] - public DateTime LastUpdate { get; set; } - - [JsonProperty(PropertyName = "awaySince")] - [JsonPropertyName("awaySince")] - public DateTime? AwaySince { get; set; } - - [JsonProperty(PropertyName = "accessLevel")] - [JsonPropertyName("accessLevel")] - [Newtonsoft.Json.JsonConverter(typeof (StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof (JsonStringEnumConverter))] - public SessionAccessLevel AccessLevel { get; set; } - - [JsonIgnore] - [JsonIgnore] - public bool IsLAN { get; set; } - - public bool HasEnded - { - get - { - if (this.SessionURLs == null || this.SessionURLs.Count == 0) - return this.LegacySessionURL == null; - return false; - } - } - - public void SetEnded() - { - this.LegacySessionURL = (string) null; - this.SessionURLs = (List) null; - } - - public bool IsSame(SessionInfo other) - { - if (!(this.Name == other.Name) || !(this.Description == other.Description) || (!this.Tags.IsSame(other.Tags) || !(this.SessionId == other.SessionId)) || (!(this.HostUserId == other.HostUserId) || !(this.HostMachineId == other.HostMachineId) || (!(this.HostUsername == other.HostUsername) || !(this.CompatibilityHash == other.CompatibilityHash))) || (!(this.NeosVersion == other.NeosVersion) || this.HeadlessHost != other.HeadlessHost || (!(this.LegacySessionURL == other.LegacySessionURL) || !this.SessionURLs.ElementWiseEquals((IList) other.SessionURLs)) || (!this.SessionUsers.ElementWiseEquals((IList) other.SessionUsers) || !(this.Thumbnail == other.Thumbnail) || (this.JoinedUsers != other.JoinedUsers || this.ActiveUsers != other.ActiveUsers))) || (this.MaximumUsers != other.MaximumUsers || this.MobileFriendly != other.MobileFriendly || (this.IsLAN != other.IsLAN || this.AccessLevel != other.AccessLevel))) - return false; - DateTime? awaySince1 = this.AwaySince; - DateTime? awaySince2 = other.AwaySince; - if (awaySince1.HasValue != awaySince2.HasValue) - return false; - if (!awaySince1.HasValue) - return true; - return awaySince1.GetValueOrDefault() == awaySince2.GetValueOrDefault(); - } - } -} diff --git a/.API/Models/SessionUpdate.cs b/.API/Models/SessionUpdate.cs deleted file mode 100644 index b0691a2..0000000 --- a/.API/Models/SessionUpdate.cs +++ /dev/null @@ -1,23 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: CloudX.Shared.SessionUpdate -// Assembly: CloudX.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -// MVID: 6223B97A-06A5-46CB-9E10-78604961D6EE -// Assembly location: J:\D\SteamLibrary\steamapps\common\NeosVR\HeadlessClient\CloudX.Shared.dll - -using Newtonsoft.Json; -using System.Collections.Generic; -using System.Text.Json.Serialization; - -namespace CloudX.Shared -{ - public class SessionUpdate - { - [JsonProperty(PropertyName = "hostedSessions")] - [JsonPropertyName("hostedSessions")] - public List HostedSessions { get; set; } - - [JsonProperty(PropertyName = "removedSessions")] - [JsonPropertyName("removedSessions")] - public List RemovedSessions { get; set; } - } -} diff --git a/.API/Models/ThumbnailInfo.cs b/.API/Models/ThumbnailInfo.cs deleted file mode 100644 index 9c9e875..0000000 --- a/.API/Models/ThumbnailInfo.cs +++ /dev/null @@ -1,24 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: CloudX.Shared.ThumbnailInfo -// Assembly: CloudX.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -// MVID: 6223B97A-06A5-46CB-9E10-78604961D6EE -// Assembly location: J:\D\SteamLibrary\steamapps\common\NeosVR\HeadlessClient\CloudX.Shared.dll - -using Newtonsoft.Json; -using System.Text.Json.Serialization; - -namespace CloudX.Shared -{ - public class ThumbnailInfo - { - public const int MAX_THUMBNAIL_LIFETIME_MINUTES = 10; - - [JsonProperty(PropertyName = "id")] - [JsonPropertyName("id")] - public string Id { get; set; } - - [JsonProperty(NullValueHandling = NullValueHandling.Ignore, PropertyName = "key")] - [JsonPropertyName("key")] - public string Key { get; set; } - } -} diff --git a/.API/Models/TransactionMessage.cs b/.API/Models/TransactionMessage.cs deleted file mode 100644 index d5dd93c..0000000 --- a/.API/Models/TransactionMessage.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: CloudX.Shared.TransactionMessage -// Assembly: CloudX.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -// MVID: 6223B97A-06A5-46CB-9E10-78604961D6EE -// Assembly location: J:\D\SteamLibrary\steamapps\common\NeosVR\HeadlessClient\CloudX.Shared.dll - -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using System; -using System.Text.Json.Serialization; - -namespace CloudX.Shared -{ - [JsonObject(MemberSerialization = MemberSerialization.OptIn)] - public class TransactionMessage - { - [JsonProperty("token")] - [JsonPropertyName("token")] - public string Token { get; set; } - - [JsonProperty("recipientId")] - [JsonPropertyName("recipientId")] - public string RecipientId { get; set; } - - [JsonProperty(PropertyName = "amount")] - [JsonPropertyName("amount")] - public Decimal Amount { get; set; } - - [JsonProperty(PropertyName = "comment")] - [JsonPropertyName("comment")] - public string Comment { get; set; } - - [JsonProperty(PropertyName = "transactionType")] - [JsonPropertyName("transactionType")] - [Newtonsoft.Json.JsonConverter(typeof (StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof (JsonStringEnumConverter))] - public TransactionType TransactionType { get; set; } - } -} diff --git a/.API/Models/UserPatreonData.cs b/.API/Models/UserPatreonData.cs deleted file mode 100644 index e56fefe..0000000 --- a/.API/Models/UserPatreonData.cs +++ /dev/null @@ -1,164 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: CloudX.Shared.UserPatreonData -// Assembly: CloudX.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -// MVID: 6223B97A-06A5-46CB-9E10-78604961D6EE -// Assembly location: J:\D\SteamLibrary\steamapps\common\NeosVR\HeadlessClient\CloudX.Shared.dll - -using Newtonsoft.Json; -using System; -using System.Text.Json.Serialization; - -namespace CloudX.Shared -{ - [JsonObject(MemberSerialization = MemberSerialization.OptIn)] - public class UserPatreonData - { - public const int MIN_WORLD_ACCESS_CENTS = 600; - public const int ACTIVATION_LENGTH = 40; - - [NullOnExternal] - [JsonProperty(PropertyName = "email")] - [JsonPropertyName("email")] - public string Email { get; set; } - - [JsonProperty(PropertyName = "isPatreonSupporter")] - [JsonPropertyName("isPatreonSupporter")] - public bool IsPatreonSupporter { get; set; } - - [JsonProperty(PropertyName = "lastPatreonPledgeCents")] - [JsonPropertyName("lastPatreonPledgeCents")] - public int LastPatreonPledgeCents { get; set; } - - [JsonProperty(PropertyName = "lastTotalCents")] - [JsonPropertyName("lastTotalCents")] - public int LastTotalCents { get; set; } - - [JsonProperty(PropertyName = "rewardMultiplier")] - [JsonPropertyName("rewardMultiplier")] - public double? RewardMultiplier { get; set; } - - [JsonProperty(PropertyName = "rewardType")] - [JsonPropertyName("rewardType")] - public string RewardType { get; set; } - - [JsonProperty(PropertyName = "customTier")] - [JsonPropertyName("customTier")] - public string CustomTier { get; set; } - - [Obsolete] - [JsonProperty(PropertyName = "lastPlusActivationTime")] - [JsonPropertyName("lastPlusActivationTime")] - public DateTime LastPlusActivationTime - { - get - { - return this.LastActivationTime; - } - set - { - this.LastActivationTime = value; - } - } - - [JsonProperty(PropertyName = "lastActivationTime")] - [JsonPropertyName("lastActivationTime")] - public DateTime LastActivationTime { get; set; } - - [Obsolete] - [JsonProperty(PropertyName = "lastPlusPledgeAmount")] - [JsonPropertyName("lastPlusPledgeAmount")] - public int LastPlusPledgeAmount - { - get - { - return this.LastPaidPledgeAmount; - } - set - { - this.LastPaidPledgeAmount = value; - } - } - - [JsonProperty(PropertyName = "lastPaidPledgeAmount")] - [JsonPropertyName("lastPaidPledgeAmount")] - public int LastPaidPledgeAmount { get; set; } - - public string AccountName - { - get - { - if (this.CustomTier != null) - return this.CustomTier; - return NeosAccount.AccountName(this.CurrentAccountType); - } - } - - public AccountType CurrentAccountType - { - get - { - if ((DateTime.UtcNow - this.LastActivationTime).TotalDays <= 40.0) - return UserPatreonData.GetAccountType(this.LastPaidPledgeAmount); - return AccountType.Normal; - } - } - - public AccountType PledgedAccountType - { - get - { - return UserPatreonData.GetAccountType(this.LastPatreonPledgeCents); - } - } - - public bool UpdatePatreonStatus(int currentTotalCents, out bool extendedPlus) - { - extendedPlus = false; - int num = currentTotalCents - this.LastTotalCents; - if (num <= 0) - { - if (this.LastActivationTime.Year > 2016) - return false; - num = this.LastPaidPledgeAmount; - } - if (num > 0) - { - this.LastActivationTime = DateTime.UtcNow; - this.LastPaidPledgeAmount = num; - extendedPlus = true; - } - this.LastTotalCents = currentTotalCents; - return true; - } - - private static AccountType GetAccountType(int cents) - { - for (AccountType type = AccountType.Anorak; type >= AccountType.Normal; --type) - { - if (cents >= NeosAccount.MinCents(type)) - return type; - } - return AccountType.Normal; - } - - [JsonIgnore] - [JsonIgnore] - public bool HasPledgedEnoughForPlus - { - get - { - return Math.Max(this.LastPatreonPledgeCents, this.LastPaidPledgeAmount) >= NeosAccount.MinCents(AccountType.BladeRunner); - } - } - - [JsonIgnore] - [JsonIgnore] - public bool HasPledgedEnoughForWorlds - { - get - { - return Math.Max(this.LastPatreonPledgeCents, this.LastPaidPledgeAmount) >= 600; - } - } - } -} diff --git a/.API/Models/UserProfile.cs b/.API/Models/UserProfile.cs deleted file mode 100644 index 7cfc451..0000000 --- a/.API/Models/UserProfile.cs +++ /dev/null @@ -1,70 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: CloudX.Shared.UserProfile -// Assembly: CloudX.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -// MVID: 6223B97A-06A5-46CB-9E10-78604961D6EE -// Assembly location: J:\D\SteamLibrary\steamapps\common\NeosVR\HeadlessClient\CloudX.Shared.dll - -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text.Json.Serialization; - -namespace CloudX.Shared -{ - [JsonObject(MemberSerialization = MemberSerialization.OptIn)] - public class UserProfile - { - public static int MAX_SHOWCASE_ITEMS - { - get - { - return 6; - } - } - - [JsonProperty(PropertyName = "iconUrl")] - [JsonPropertyName("iconUrl")] - public string IconUrl { get; set; } - - [JsonProperty(PropertyName = "backgroundUrl")] - [JsonPropertyName("backgroundUrl")] - public string BackgroundUrl { get; set; } - - [JsonProperty(PropertyName = "tagline")] - [JsonPropertyName("tagline")] - public string Tagline { get; set; } - - [JsonProperty(PropertyName = "description")] - [JsonPropertyName("description")] - public string Description { get; set; } - - [JsonProperty(PropertyName = "profileWorldUrl")] - [JsonPropertyName("profileWorldUrl")] - public string ProfileWorldUrl { get; set; } - - [JsonProperty(PropertyName = "showcaseItems")] - [JsonPropertyName("showcaseItems")] - public List ShowcaseItems { get; set; } - - [JsonProperty(PropertyName = "tokenOptOut")] - [JsonPropertyName("tokenOptOut")] - public List TokenOptOut { get; set; } - - [JsonIgnore] - [JsonIgnore] - public bool IsValid - { - get - { - List showcaseItems = this.ShowcaseItems; - return (showcaseItems != null ? __nonvirtual (showcaseItems.Count) : 0) <= UserProfile.MAX_SHOWCASE_ITEMS; - } - } - - public bool AcceptsToken(string token) - { - return this.TokenOptOut == null || !this.TokenOptOut.Any((Func) (s => s.Equals(token, StringComparison.InvariantCultureIgnoreCase))); - } - } -} diff --git a/.API/Models/UserStatus.cs b/.API/Models/UserStatus.cs deleted file mode 100644 index d336d71..0000000 --- a/.API/Models/UserStatus.cs +++ /dev/null @@ -1,115 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: CloudX.Shared.UserStatus -// Assembly: CloudX.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -// MVID: 6223B97A-06A5-46CB-9E10-78604961D6EE -// Assembly location: J:\D\SteamLibrary\steamapps\common\NeosVR\HeadlessClient\CloudX.Shared.dll - -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text.Json.Serialization; - -namespace CloudX.Shared -{ - [JsonObject(MemberSerialization = MemberSerialization.OptIn)] - public class UserStatus - { - public static int STATUS_RESET_SECONDS - { - get - { - return 120; - } - } - - public static int REMOVED_STATUS_KEEP_SECONDS - { - get - { - return 300; - } - } - - [JsonProperty(PropertyName = "onlineStatus")] - [JsonPropertyName("onlineStatus")] - [Newtonsoft.Json.JsonConverter(typeof (StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof (JsonStringEnumConverter))] - public OnlineStatus OnlineStatus { get; set; } - - [JsonProperty(PropertyName = "lastStatusChange")] - [JsonPropertyName("lastStatusChange")] - public DateTime LastStatusChange { get; set; } - - [JsonProperty(PropertyName = "currentSessionId")] - [JsonPropertyName("currentSessionId")] - public string CurrentSessionId { get; set; } - - [JsonProperty(PropertyName = "compatibilityHash")] - [JsonPropertyName("compatibilityHash")] - public string CompatibilityHash { get; set; } - - [JsonProperty(PropertyName = "neosVersion")] - [JsonPropertyName("neosVersion")] - public string NeosVersion { get; set; } - - [JsonProperty(PropertyName = "publicRSAKey")] - [JsonPropertyName("publicRSAKey")] - public RSAParametersData PublicRSAKey { get; set; } - - public SessionInfo CurrentSession - { - get - { - List activeSessions = this.ActiveSessions; - if (activeSessions == null) - return (SessionInfo) null; - return activeSessions.FirstOrDefault((Func) (s => s.SessionId == this.CurrentSessionId)); - } - } - - [JsonProperty(PropertyName = "activeSessions")] - [JsonPropertyName("activeSessions")] - public List ActiveSessions { get; set; } - - public bool IsSame(UserStatus other) - { - if (other == null || this.OnlineStatus != other.OnlineStatus || this.CurrentSessionId != other.CurrentSessionId) - return false; - List activeSessions1 = this.ActiveSessions; - // ISSUE: explicit non-virtual call - int num1 = activeSessions1 != null ? __nonvirtual (activeSessions1.Count) : 0; - List activeSessions2 = this.ActiveSessions; - // ISSUE: explicit non-virtual call - int num2 = activeSessions2 != null ? __nonvirtual (activeSessions2.Count) : 0; - List activeSessions3 = other.ActiveSessions; - // ISSUE: explicit non-virtual call - int num3 = activeSessions3 != null ? __nonvirtual (activeSessions3.Count) : 0; - if (num2 != num3) - return false; - for (int index = 0; index < num1; ++index) - { - if (!this.ActiveSessions[index].IsSame(other.ActiveSessions[index])) - return false; - } - return true; - } - - public void SortSessions() - { - if (this.ActiveSessions == null) - return; - this.ActiveSessions.Sort((Comparison) ((a, b) => - { - if (a.SessionId == this.CurrentSessionId) - return -1; - if (b.SessionId == this.CurrentSessionId) - return 1; - if (a.AwaySince.HasValue && b.AwaySince.HasValue) - return a.AwaySince.Value.CompareTo(b.AwaySince.Value); - return a.SessionId.CompareTo(b.SessionId); - })); - } - } -} diff --git a/.API/NullOnExternalAttribute.cs b/.API/NullOnExternalAttribute.cs deleted file mode 100644 index 3025584..0000000 --- a/.API/NullOnExternalAttribute.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: CloudX.Shared.NullOnExternalAttribute -// Assembly: CloudX.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -// MVID: 6223B97A-06A5-46CB-9E10-78604961D6EE -// Assembly location: J:\D\SteamLibrary\steamapps\common\NeosVR\HeadlessClient\CloudX.Shared.dll - -using System; - -namespace CloudX.Shared -{ - public class NullOnExternalAttribute : Attribute - { - } -} diff --git a/.API/OnlineStatus.cs b/.API/OnlineStatus.cs deleted file mode 100644 index 7c46f5a..0000000 --- a/.API/OnlineStatus.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: CloudX.Shared.OnlineStatus -// Assembly: CloudX.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -// MVID: 6223B97A-06A5-46CB-9E10-78604961D6EE -// Assembly location: J:\D\SteamLibrary\steamapps\common\NeosVR\HeadlessClient\CloudX.Shared.dll - -namespace CloudX.Shared -{ - public enum OnlineStatus - { - Offline, - Invisible, - Away, - Busy, - Online, - } -} diff --git a/.API/OwnerType.cs b/.API/OwnerType.cs deleted file mode 100644 index 30a3dc0..0000000 --- a/.API/OwnerType.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: CloudX.Shared.OwnerType -// Assembly: CloudX.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -// MVID: 6223B97A-06A5-46CB-9E10-78604961D6EE -// Assembly location: J:\D\SteamLibrary\steamapps\common\NeosVR\HeadlessClient\CloudX.Shared.dll - -namespace CloudX.Shared -{ - public enum OwnerType - { - Machine, - User, - Group, - INVALID, - } -} diff --git a/.API/RecordPreprocessState.cs b/.API/RecordPreprocessState.cs deleted file mode 100644 index 6eb017f..0000000 --- a/.API/RecordPreprocessState.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: CloudX.Shared.RecordPreprocessState -// Assembly: CloudX.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -// MVID: 6223B97A-06A5-46CB-9E10-78604961D6EE -// Assembly location: J:\D\SteamLibrary\steamapps\common\NeosVR\HeadlessClient\CloudX.Shared.dll - -namespace CloudX.Shared -{ - public enum RecordPreprocessState - { - Preprocessing, - Success, - Failed, - } -} diff --git a/.API/RecordTags.cs b/.API/RecordTags.cs deleted file mode 100644 index 2d9cf15..0000000 --- a/.API/RecordTags.cs +++ /dev/null @@ -1,202 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: CloudX.Shared.RecordTags -// Assembly: CloudX.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -// MVID: 6223B97A-06A5-46CB-9E10-78604961D6EE -// Assembly location: J:\D\SteamLibrary\steamapps\common\NeosVR\HeadlessClient\CloudX.Shared.dll - -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Linq; -using System.Text; - -namespace CloudX.Shared -{ - public static class RecordTags - { - private static HashSet IGNORE_TAGS = new HashSet() - { - "a", - "an", - "the", - "and" - }; - - public static string CommonAvatar - { - get - { - return "common_avatar"; - } - } - - public static string ProfileIcon - { - get - { - return "profile_icon"; - } - } - - public static string MessageItem - { - get - { - return "message_item"; - } - } - - public static string WorldOrb - { - get - { - return "world_orb"; - } - } - - public static string VirtualKeyboard - { - get - { - return "virtual_keyboard"; - } - } - - public static string InteractiveCamera - { - get - { - return "interactive_camera"; - } - } - - public static string Photo - { - get - { - return "camera_photo"; - } - } - - public static string VRPhoto - { - get - { - return "vr_photo"; - } - } - - public static string Photo360 - { - get - { - return "360_photo"; - } - } - - public static string PhotoStereo - { - get - { - return "stereo_photo"; - } - } - - public static string AudioClip - { - get - { - return "audio_clip"; - } - } - - public static string VideoClip - { - get - { - return "video_clip"; - } - } - - public static string ClipAsset(string url) - { - return "clip_asset:" + url; - } - - public static string ClipLength(double length) - { - return "clip_length:" + length.ToString((IFormatProvider) CultureInfo.InvariantCulture); - } - - public static string LocationName(string name) - { - return "location_name:" + name; - } - - public static string PresentUser(string userId) - { - return "user:" + userId; - } - - public static string Timestamp(DateTime time) - { - return "timestamp:" + time.ToString("o"); - } - - public static string CorrespondingMessageId(string messageId) - { - return "message_id:" + messageId; - } - - public static string CorrespondingWorldUrl(string worldUrl) - { - return "world_url:" + worldUrl; - } - - public static string GetCorrespondingMessageId(HashSet tags) - { - return RecordTags.ExtractValue(tags, "message_id:"); - } - - public static string GetCorrespondingWorldUrl(HashSet tags) - { - return RecordTags.ExtractValue(tags, "world_url:"); - } - - private static string ExtractValue(HashSet tags, string prefix) - { - if (tags == null) - return (string) null; - string str = tags.FirstOrDefault((Func) (s => s.StartsWith(prefix))); - if (str != null) - str = str.Substring(prefix.Length); - return str; - } - - public static void GenerateTagsFromName(string name, HashSet tags) - { - if (string.IsNullOrWhiteSpace(name)) - return; - StringBuilder tagBuilder = new StringBuilder(); - foreach (char c in name) - { - if (char.IsLetter(c)) - tagBuilder.Append(char.ToLower(c)); - else - RecordTags.ExtractTag(tagBuilder, tags); - } - RecordTags.ExtractTag(tagBuilder, tags); - } - - private static void ExtractTag(StringBuilder tagBuilder, HashSet tags) - { - if (tagBuilder.Length > 1) - { - string str = tagBuilder.ToString(); - if (!RecordTags.IGNORE_TAGS.Contains(str)) - tags.Add(str); - } - tagBuilder.Clear(); - } - } -} diff --git a/.API/RecordUtil.cs b/.API/RecordUtil.cs deleted file mode 100644 index a533e56..0000000 --- a/.API/RecordUtil.cs +++ /dev/null @@ -1,60 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: CloudX.Shared.RecordUtil -// Assembly: CloudX.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -// MVID: 6223B97A-06A5-46CB-9E10-78604961D6EE -// Assembly location: J:\D\SteamLibrary\steamapps\common\NeosVR\HeadlessClient\CloudX.Shared.dll - -using System; -using System.Text; - -namespace CloudX.Shared -{ - public static class RecordUtil - { - public static Uri GenerateUri(string ownerId, string recordId) - { - return new Uri("neosrec:///" + ownerId + "/" + recordId); - } - - public static bool IsValidRecordID(string recordId) - { - return !string.IsNullOrWhiteSpace(recordId) && recordId.StartsWith("R-") && recordId.Length > "R-".Length; - } - - public static bool ExtractRecordID(Uri recordUri, out string ownerId, out string recordId) - { - ownerId = (string) null; - recordId = (string) null; - if (recordUri == (Uri) null || recordUri.Scheme != "neosrec" || recordUri.Segments.Length != 3) - return false; - ownerId = recordUri.Segments[1]; - if (string.IsNullOrEmpty(ownerId)) - return false; - ownerId = ownerId.Substring(0, ownerId.Length - 1); - recordId = recordUri.Segments[2]; - return !string.IsNullOrEmpty(recordId) && RecordUtil.IsValidRecordID(recordId); - } - - public static bool ExtractRecordPath(Uri recordUri, out string ownerId, out string recordPath) - { - ownerId = (string) null; - recordPath = (string) null; - if (recordUri == (Uri) null || recordUri.Scheme != "neosrec" || recordUri.Segments.Length < 3) - return false; - ownerId = recordUri.Segments[1]; - if (string.IsNullOrEmpty(ownerId)) - return false; - ownerId = ownerId.Substring(0, ownerId.Length - 1); - StringBuilder stringBuilder = new StringBuilder(); - for (int index = 2; index < recordUri.Segments.Length; ++index) - stringBuilder.Append(recordUri.Segments[index]); - recordPath = stringBuilder.ToString(); - return true; - } - - public static string GenerateRecordID() - { - return "R-" + Guid.NewGuid().ToString(); - } - } -} diff --git a/.API/SearchParameters.cs b/.API/SearchParameters.cs deleted file mode 100644 index de55efc..0000000 --- a/.API/SearchParameters.cs +++ /dev/null @@ -1,162 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: CloudX.Shared.SearchParameters -// Assembly: CloudX.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -// MVID: 6223B97A-06A5-46CB-9E10-78604961D6EE -// Assembly location: J:\D\SteamLibrary\steamapps\common\NeosVR\HeadlessClient\CloudX.Shared.dll - -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using System; -using System.Collections.Generic; -using System.Text.Json.Serialization; - -namespace CloudX.Shared -{ - [JsonObject(MemberSerialization = MemberSerialization.OptIn)] - public class SearchParameters : IEquatable - { - private bool _isNormalized; - - [JsonProperty(PropertyName = "private")] - [JsonPropertyName("private")] - public bool Private { get; set; } - - [JsonProperty(PropertyName = "byOwner")] - [JsonPropertyName("byOwner")] - public string ByOwner { get; set; } - - [JsonProperty(PropertyName = "ownerType")] - [JsonPropertyName("ownerType")] - [Newtonsoft.Json.JsonConverter(typeof (StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof (JsonStringEnumConverter))] - public OwnerType OwnerType { get; set; } = OwnerType.User; - - [JsonProperty(PropertyName = "submittedTo")] - [JsonPropertyName("submittedTo")] - public string SubmittedTo { get; set; } - - [JsonProperty(PropertyName = "onlyFeatured")] - [JsonPropertyName("onlyFeatured")] - public bool OnlyFeatured { get; set; } - - [JsonProperty(PropertyName = "recordType")] - [JsonPropertyName("recordType")] - public string RecordType { get; set; } - - [JsonProperty(PropertyName = "requiredTags")] - [JsonPropertyName("requiredTags")] - public List RequiredTags { get; set; } - - [JsonProperty(PropertyName = "minDate")] - [JsonPropertyName("minDate")] - public DateTime? MinDate { get; set; } - - [JsonProperty(PropertyName = "maxDate")] - [JsonPropertyName("maxDate")] - public DateTime? MaxDate { get; set; } - - [JsonProperty(PropertyName = "sortBy")] - [JsonPropertyName("sortBy")] - [Newtonsoft.Json.JsonConverter(typeof (StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof (JsonStringEnumConverter))] - public SearchSortParameter SortBy { get; set; } - - [JsonProperty(PropertyName = "sortDirection")] - [JsonPropertyName("sortDirection")] - [Newtonsoft.Json.JsonConverter(typeof (StringEnumConverter))] - [System.Text.Json.Serialization.JsonConverter(typeof (JsonStringEnumConverter))] - public SearchSortDirection SortDirection { get; set; } - - [JsonIgnore] - [JsonIgnore] - public List ExtraSignatures { get; set; } - - public void Normalize() - { - if (this._isNormalized) - return; - if (this.RequiredTags != null) - { - this.RequiredTags.Sort(); - if (this.RequiredTags.Count == 0) - this.RequiredTags = (List) null; - } - if (this.ExtraSignatures != null) - { - this.ExtraSignatures.Sort(); - if (this.ExtraSignatures.Count == 0) - this.ExtraSignatures = (List) null; - } - this._isNormalized = true; - } - - public bool Equals(SearchParameters other) - { - if (this.Private != other.Private || this.ByOwner != other.ByOwner || (this.OwnerType != other.OwnerType || this.SubmittedTo != other.SubmittedTo) || this.RecordType != other.RecordType) - return false; - DateTime? nullable1 = this.MinDate; - DateTime? nullable2 = other.MinDate; - if ((nullable1.HasValue == nullable2.HasValue ? (nullable1.HasValue ? (nullable1.GetValueOrDefault() != nullable2.GetValueOrDefault() ? 1 : 0) : 0) : 1) != 0) - return false; - nullable2 = this.MaxDate; - nullable1 = other.MaxDate; - if ((nullable2.HasValue == nullable1.HasValue ? (nullable2.HasValue ? (nullable2.GetValueOrDefault() != nullable1.GetValueOrDefault() ? 1 : 0) : 0) : 1) != 0 || this.SortBy != other.SortBy || (this.OnlyFeatured != other.OnlyFeatured || this.SortDirection != other.SortDirection)) - return false; - this.Normalize(); - other.Normalize(); - return SearchParameters.ListsEqual(this.RequiredTags, other.RequiredTags) && SearchParameters.ListsEqual(this.ExtraSignatures, other.ExtraSignatures); - } - - private static bool ListsEqual(List a, List b) - { - // ISSUE: explicit non-virtual call - int num1 = a != null ? __nonvirtual (a.Count) : 0; - // ISSUE: explicit non-virtual call - int num2 = b != null ? __nonvirtual (b.Count) : 0; - if (num1 != num2) - return false; - for (int index = 0; index < num1; ++index) - { - if (a[index] != b[index]) - return false; - } - return true; - } - - public static bool operator ==(SearchParameters a, SearchParameters b) - { - if ((object) a == null && (object) b == null) - return true; - if ((object) a == null || (object) b == null) - return false; - return a.Equals(b); - } - - public static bool operator !=(SearchParameters a, SearchParameters b) - { - return !(a == b); - } - - public override int GetHashCode() - { - this.Normalize(); - int num = (((((((((-1854586267 * -1521134295 + EqualityComparer.Default.GetHashCode(this.Private)) * -1521134295 + EqualityComparer.Default.GetHashCode(this.ByOwner)) * -1521134295 + EqualityComparer.Default.GetHashCode(this.OwnerType)) * -1521134295 + EqualityComparer.Default.GetHashCode(this.SubmittedTo)) * -1521134295 + EqualityComparer.Default.GetHashCode(this.OnlyFeatured)) * -1521134295 + EqualityComparer.Default.GetHashCode(this.RecordType)) * -1521134295 + EqualityComparer.Default.GetHashCode(this.MinDate)) * -1521134295 + EqualityComparer.Default.GetHashCode(this.MaxDate)) * -1521134295 + this.SortBy.GetHashCode()) * -1521134295 + this.SortDirection.GetHashCode(); - if (this.RequiredTags != null) - { - foreach (string requiredTag in this.RequiredTags) - num = num * -1521134295 + EqualityComparer.Default.GetHashCode(requiredTag); - } - if (this.ExtraSignatures != null) - { - foreach (string extraSignature in this.ExtraSignatures) - num = num * -1521134295 + EqualityComparer.Default.GetHashCode(extraSignature); - } - return num; - } - - public override bool Equals(object obj) - { - return this == obj as SearchParameters; - } - } -} diff --git a/.API/SearchSortDirection.cs b/.API/SearchSortDirection.cs deleted file mode 100644 index 5137348..0000000 --- a/.API/SearchSortDirection.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: CloudX.Shared.SearchSortDirection -// Assembly: CloudX.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -// MVID: 6223B97A-06A5-46CB-9E10-78604961D6EE -// Assembly location: J:\D\SteamLibrary\steamapps\common\NeosVR\HeadlessClient\CloudX.Shared.dll - -namespace CloudX.Shared -{ - public enum SearchSortDirection - { - Ascending, - Descending, - } -} diff --git a/.API/SearchSortParameter.cs b/.API/SearchSortParameter.cs deleted file mode 100644 index 8e5c147..0000000 --- a/.API/SearchSortParameter.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: CloudX.Shared.SearchSortParameter -// Assembly: CloudX.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -// MVID: 6223B97A-06A5-46CB-9E10-78604961D6EE -// Assembly location: J:\D\SteamLibrary\steamapps\common\NeosVR\HeadlessClient\CloudX.Shared.dll - -namespace CloudX.Shared -{ - public enum SearchSortParameter - { - CreationDate, - LastUpdateDate, - FirstPublishTime, - TotalVisits, - Name, - } -} diff --git a/.API/ServerStatus.cs b/.API/ServerStatus.cs deleted file mode 100644 index 821aae1..0000000 --- a/.API/ServerStatus.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: CloudX.Shared.ServerStatus -// Assembly: CloudX.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -// MVID: 6223B97A-06A5-46CB-9E10-78604961D6EE -// Assembly location: J:\D\SteamLibrary\steamapps\common\NeosVR\HeadlessClient\CloudX.Shared.dll - -namespace CloudX.Shared -{ - public enum ServerStatus - { - Good, - Slow, - Down, - NoInternet, - } -} diff --git a/.API/SessionAccessLevel.cs b/.API/SessionAccessLevel.cs deleted file mode 100644 index 464ab7c..0000000 --- a/.API/SessionAccessLevel.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: CloudX.Shared.SessionAccessLevel -// Assembly: CloudX.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -// MVID: 6223B97A-06A5-46CB-9E10-78604961D6EE -// Assembly location: J:\D\SteamLibrary\steamapps\common\NeosVR\HeadlessClient\CloudX.Shared.dll - -namespace CloudX.Shared -{ - public enum SessionAccessLevel - { - Private, - LAN, - Friends, - RegisteredUsers, - Anyone, - } -} diff --git a/.API/TransactionManager.cs b/.API/TransactionManager.cs deleted file mode 100644 index 01dd57e..0000000 --- a/.API/TransactionManager.cs +++ /dev/null @@ -1,98 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: CloudX.Shared.TransactionManager -// Assembly: CloudX.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -// MVID: 6223B97A-06A5-46CB-9E10-78604961D6EE -// Assembly location: J:\D\SteamLibrary\steamapps\common\NeosVR\HeadlessClient\CloudX.Shared.dll - -using BaseX; -using System; -using System.Threading.Tasks; - -namespace CloudX.Shared -{ - public class TransactionManager - { - public CloudXInterface Cloud { get; private set; } - - public Decimal? NCRConversionRatio { get; private set; } - - public TransactionManager(CloudXInterface cloud) - { - this.Cloud = cloud; - Task.Run((Func) (async () => await this.LoadConversionData())); - } - - private async Task LoadConversionData() - { - CloudResult cloudResult = await this.Cloud.ReadGlobalVariable(TransactionUtil.NCR_CONVERSION_VARIABLE); - if (cloudResult.IsOK) - this.NCRConversionRatio = new Decimal?(cloudResult.Entity); - else - UniLog.Warning("Error getting conversion ratio. " + cloudResult.State.ToString() + "\n\n" + cloudResult.Content, false); - } - - public Decimal? TryConvert(string sourceToken, Decimal sourceAmount, string targetToken) - { - if (sourceToken == "USD") - { - if (targetToken == null || !(targetToken == "NCR")) - return new Decimal?(); - Decimal num = sourceAmount; - Decimal? ncrConversionRatio = this.NCRConversionRatio; - if (!ncrConversionRatio.HasValue) - return new Decimal?(); - return new Decimal?(num / ncrConversionRatio.GetValueOrDefault()); - } - if (!(targetToken == "USD")) - return new Decimal?(); - if (sourceToken != null) - { - if (!(sourceToken == "NCR")) - { - if (sourceToken == "KFC") - return new Decimal?(new Decimal()); - } - else - { - Decimal num = sourceAmount; - Decimal? ncrConversionRatio = this.NCRConversionRatio; - if (!ncrConversionRatio.HasValue) - return new Decimal?(); - return new Decimal?(num * ncrConversionRatio.GetValueOrDefault()); - } - } - return new Decimal?(); - } - - public bool IsValidToken(string token) - { - return token != null && (token == "NCR" || token == "KFC"); - } - - public Decimal? ToUSD(string token, Decimal amount) - { - if (token != null) - { - if (!(token == "NCR")) - { - if (token == "KFC") - return new Decimal?(new Decimal()); - } - else - { - if (!this.NCRConversionRatio.HasValue) - return new Decimal?(); - return new Decimal?(this.NCRConversionRatio.Value * amount); - } - } - throw new Exception("Invalid token: " + token); - } - - public static string FormatCurrency(Decimal? amount) - { - if (!amount.HasValue) - return "N/A"; - return amount.Value.ToString("#,0.00####################"); - } - } -} diff --git a/.API/TransactionType.cs b/.API/TransactionType.cs deleted file mode 100644 index 6571214..0000000 --- a/.API/TransactionType.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: CloudX.Shared.TransactionType -// Assembly: CloudX.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -// MVID: 6223B97A-06A5-46CB-9E10-78604961D6EE -// Assembly location: J:\D\SteamLibrary\steamapps\common\NeosVR\HeadlessClient\CloudX.Shared.dll - -namespace CloudX.Shared -{ - public enum TransactionType - { - User2User, - Withdrawal, - Deposit, - Tip, - } -} diff --git a/.API/TransactionUtil.cs b/.API/TransactionUtil.cs deleted file mode 100644 index 5f272eb..0000000 --- a/.API/TransactionUtil.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: CloudX.Shared.TransactionUtil -// Assembly: CloudX.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -// MVID: 6223B97A-06A5-46CB-9E10-78604961D6EE -// Assembly location: J:\D\SteamLibrary\steamapps\common\NeosVR\HeadlessClient\CloudX.Shared.dll - -namespace CloudX.Shared -{ - public static class TransactionUtil - { - public static string NCR_CONVERSION_VARIABLE = "NCR_CONVERSION"; - } -} diff --git a/.API/UploadState.cs b/.API/UploadState.cs deleted file mode 100644 index 9177f9d..0000000 --- a/.API/UploadState.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: CloudX.Shared.UploadState -// Assembly: CloudX.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -// MVID: 6223B97A-06A5-46CB-9E10-78604961D6EE -// Assembly location: J:\D\SteamLibrary\steamapps\common\NeosVR\HeadlessClient\CloudX.Shared.dll - -namespace CloudX.Shared -{ - public enum UploadState - { - UploadingChunks, - Finalizing, - Uploaded, - Failed, - } -} diff --git a/.API/UserTags.cs b/.API/UserTags.cs deleted file mode 100644 index ae374c4..0000000 --- a/.API/UserTags.cs +++ /dev/null @@ -1,137 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: CloudX.Shared.UserTags -// Assembly: CloudX.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -// MVID: 6223B97A-06A5-46CB-9E10-78604961D6EE -// Assembly location: J:\D\SteamLibrary\steamapps\common\NeosVR\HeadlessClient\CloudX.Shared.dll - -using System; - -namespace CloudX.Shared -{ - public static class UserTags - { - public static string NeosTeam - { - get - { - return "neos team"; - } - } - - public static string NeosAdmin - { - get - { - return "neos admin"; - } - } - - public static string NeosModerator - { - get - { - return "neos moderator"; - } - } - - public static string NeosCommunityManager - { - get - { - return "neos community manager"; - } - } - - public static string DiagnoseRecordSync - { - get - { - return "diagnose record sync"; - } - } - - public static string HearingImpaired - { - get - { - return "hearing impaired"; - } - } - - public static string Potato - { - get - { - return "potato"; - } - } - - public static string Coffee - { - get - { - return "coffee"; - } - } - - public static string Java - { - get - { - return "java"; - } - } - - public static string CustomBadge(Uri neosDb, bool pointFiltering) - { - string str = "custom badge:" + CloudXInterface.NeosDBSignature(neosDb); - if (pointFiltering) - str += ".point"; - return str; - } - - public static Uri GetCustomBadge(string badge, out bool pointFiltering) - { - if (!badge.StartsWith("custom badge:")) - { - pointFiltering = false; - return (Uri) null; - } - badge = badge.Substring("custom badge:".Length).Trim(); - pointFiltering = badge.Contains(".point"); - return new Uri("neosdb:///" + badge.Trim()); - } - - public static string NCC_Participant - { - get - { - return "ncc participant"; - } - } - - public static string NCC_Diamond - { - get - { - return "ncc diamond"; - } - } - - public static string NCC_Gold - { - get - { - return "ncc gold"; - } - } - - public static string NCC_Silver - { - get - { - return "ncc silver"; - } - } - } -} diff --git a/.API/lib/BaseX.dll b/.API/lib/BaseX.dll deleted file mode 100644 index 6187a04..0000000 Binary files a/.API/lib/BaseX.dll and /dev/null differ diff --git a/.API/lib/CodeX.dll b/.API/lib/CodeX.dll deleted file mode 100644 index e5e5061..0000000 Binary files a/.API/lib/CodeX.dll and /dev/null differ diff --git a/.API/lib/Newtonsoft.Json.dll b/.API/lib/Newtonsoft.Json.dll deleted file mode 100644 index 4395f61..0000000 Binary files a/.API/lib/Newtonsoft.Json.dll and /dev/null differ diff --git a/.API/lib/System.Text.Json.dll b/.API/lib/System.Text.Json.dll deleted file mode 100644 index dbd9722..0000000 Binary files a/.API/lib/System.Text.Json.dll and /dev/null differ diff --git a/.API/lib/System.Threading.Tasks.Extensions.dll b/.API/lib/System.Threading.Tasks.Extensions.dll deleted file mode 100644 index e059050..0000000 Binary files a/.API/lib/System.Threading.Tasks.Extensions.dll and /dev/null differ diff --git a/.API/obj/Debug/CloudX.Shared.csproj.CoreCompileInputs.cache b/.API/obj/Debug/CloudX.Shared.csproj.CoreCompileInputs.cache deleted file mode 100644 index 8d087bc..0000000 --- a/.API/obj/Debug/CloudX.Shared.csproj.CoreCompileInputs.cache +++ /dev/null @@ -1 +0,0 @@ -280f82a7e4425a44372bddceb7dc0e75a8596dd2 diff --git a/.API/obj/Debug/CloudX.Shared.csprojAssemblyReference.cache b/.API/obj/Debug/CloudX.Shared.csprojAssemblyReference.cache deleted file mode 100644 index 8fbd771..0000000 Binary files a/.API/obj/Debug/CloudX.Shared.csprojAssemblyReference.cache and /dev/null differ diff --git a/.API/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs b/.API/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs deleted file mode 100644 index e69de29..0000000 diff --git a/.API/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs b/.API/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs deleted file mode 100644 index e69de29..0000000 diff --git a/.API/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs b/.API/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs deleted file mode 100644 index e69de29..0000000 diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 0000000..9a81a27 --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,17 @@ +{ + "env": { + "browser": true, + "commonjs": true, + "es6": true + }, + "extends": "eslint:recommended", + "globals": { + "Atomics": "readonly", + "SharedArrayBuffer": "readonly" + }, + "parserOptions": { + "ecmaVersion": 2018 + }, + "rules": { + } +} \ No newline at end of file diff --git a/Server.js b/Server.js index 259c9fd..a07b94f 100644 --- a/Server.js +++ b/Server.js @@ -14,6 +14,7 @@ var strings */ const DefaultConfig = { + "comment":"This config was generated by HeadlessCORE", "tickRate": 60.0, "usernameOverride": null, "loginCredential": null, @@ -26,6 +27,7 @@ const DefaultConfig = { "tags": null, "mobileFriendly": false, "loadWorldURL": null, + "saveAsOwner": null, "loadWorldPresetName": "SpaceWorld", "forcePort": null, "keepOriginalRoles": false, @@ -36,7 +38,8 @@ const DefaultConfig = { "idleRestartInterval": -1.0, "forcedRestartInterval": -1.0, "saveOnExit": false, - "autosaveInterval": -1.0 + "autosaveInterval": -1.0, + "awayKickMinutes": -1.0 }], "dataFolder": null, "cacheFolder": null, @@ -57,7 +60,7 @@ make sure to trim() user * App Config Store */ const path = require('path') -const {store,config,themes} = require(path.join(__dirname,"Pages/Resources/store")) +const {store,config} = require(path.join(__dirname,"Pages/Resources/store")) const fs = require('fs-extra'); //Recursive Folder Delete const uuidv4 = require('uuid/v4'); /** @@ -90,34 +93,18 @@ class Server { * @param {string} [autoInviteMessage=null] Message to send with Invite * @memberof Server */ - constructor(sessionsDir, UUID = uuidv4(), usernameOverride = null, sessionName = "DefaultWorld", loadWorldURL = null, maxUsers = 32, description = null, saveOnExit = false, autosaveInterval = -1.0, accessLevel = "Anyone", loadWorldPresetName = "SpaceWorld", autoRecover = false, mobileFriendly = false, tickRate = 60, keepOriginalRoles = false, defaultUserRoles = null, idleRestartInterval = -1.0, forcedRestartInterval = -1.0, forcePort = null, autoInviteUsernames = null, autoInviteMessage = null) { - if (!fs.existsSync(sessionsDir)) { - fs.mkdirSync(sessionsDir) + constructor(session){ + if (!fs.existsSync(session.sessionsDir)) { + fs.mkdirSync(session.sessionsDir) } this.Config = DefaultConfig - this.ID = UUID - this.sessionName = sessionName - this.accessLevel = accessLevel.replace(' ','') + this.ID = session.UUID + this.sessionName = session.sessionName + this.accessLevel = session.accessLevel.replace(' ','') console.log(this.accessLevel) - this.sessionDir = path.join(sessionsDir, UUID) - this.Config.startWorlds[0].sessionName = sessionName - this.Config.startWorlds[0].description = description - this.Config.startWorlds[0].maxUsers = parseInt(maxUsers, 10) + 1 - this.Config.startWorlds[0].accessLevel = accessLevel - this.Config.startWorlds[0].saveOnExit = saveOnExit - this.Config.startWorlds[0].autosaveInterval = parseFloat(autosaveInterval) - this.Config.startWorlds[0].loadWorldURL = loadWorldURL - this.Config.startWorlds[0].loadWorldPresetName = loadWorldPresetName - this.Config.startWorlds[0].autoRecover = autoRecover - this.Config.startWorlds[0].mobileFriendly = mobileFriendly - this.Config.startWorlds[0].keepOriginalRoles = keepOriginalRoles - this.Config.startWorlds[0].defaultUserRoles = defaultUserRoles - this.Config.startWorlds[0].idleRestartInterval = parseFloat(idleRestartInterval) - this.Config.startWorlds[0].forcedRestartInterval = parseFloat(forcedRestartInterval) - this.Config.startWorlds[0].forcePort = parseInt(forcePort, 10) - this.Config.startWorlds[0].autoInviteMessage = autoInviteMessage - this.Config.startWorlds[0].autoInviteUsernames = autoInviteUsernames - this.Config.tickRate = parseInt(tickRate, 10) + this.sessionDir = path.join(session.sessionsDir, session.UUID) + this.Config.startWorlds[0] = session + this.Config.tickRate = parseInt(session.tickRate, 10) this.Config.usernameOverride = (config.get('usernameOverride') === '' ? null : config.get('usernameOverride')) this.Config.loginCredential = store.get('loginCredentials') this.Config.loginPassword = store.get('loginPassword') @@ -534,7 +521,7 @@ class Instances { if (!session.UUID) { session.UUID = uuidv4() } - this.Instances[session.UUID] = new Server(session.sessionsDir, session.UUID, session.usernameOverride, session.sessionName, session.loadWorldURL, session.maxUsers, session.description, session.saveOnExit, session.autosaveInterval, session.accessLevel, session.loadWorldPresetName, session.autoRecover, session.mobileFriendly, session.tickRate, session.keepOriginalRoles, session.defaultUserRoles, session.idleRestartInterval, session.forcedRestartInterval, session.forcePort, session.autoInviteUsernames, session.autoInviteMessage) + this.Instances[session.UUID] = new Server(session) } } diff --git a/package-lock.json b/package-lock.json index b14c264..a53af7a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4,6 +4,32 @@ "lockfileVersion": 1, "requires": true, "dependencies": { + "@babel/code-frame": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.8.3.tgz", + "integrity": "sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g==", + "dev": true, + "requires": { + "@babel/highlight": "^7.8.3" + } + }, + "@babel/helper-validator-identifier": { + "version": "7.9.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.9.5.tgz", + "integrity": "sha512-/8arLKUFq882w4tWGj9JYzRpAlZgiWUJ+dtteNTDqrRBz9Iguck9Rn3ykuBDoUwh2TO4tSAJlrxDUOXWklJe4g==", + "dev": true + }, + "@babel/highlight": { + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.9.0.tgz", + "integrity": "sha512-lJZPilxX7Op3Nv/2cvFdnlepPXDxi29wxteT57Q965oc5R9v86ztx0jfxVrTcBk8C2kcPkkDa2Z4T3ZsPPVWsQ==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.9.0", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + }, "@babel/parser": { "version": "7.7.5", "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.7.5.tgz", @@ -85,6 +111,18 @@ "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.30.tgz", "integrity": "sha512-sz9MF/zk6qVr3pAnM0BSQvYIBK44tS75QC5N+VbWSE4DjCV/pJ+UzCW/F+vVnl7TkOPcuwQureKNtSSwjBTaMg==" }, + "acorn": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.1.1.tgz", + "integrity": "sha512-add7dgA5ppRPxCFJoAGfMDi7PIBXq1RtGo7BhbLaxwrXPOmw8gq48Y9ozT01hUKy9byMjlR20EJhu5zlkErEkg==", + "dev": true + }, + "acorn-jsx": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.2.0.tgz", + "integrity": "sha512-HiUX/+K2YpkpJ+SzBffkM/AQ2YE03S0U1kjTLVpoJdhZMOWy8qvXVN9JdLqv2QsaQ6MPYQIuNmwD8zOiYUofLQ==", + "dev": true + }, "ajv": { "version": "6.10.2", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.2.tgz", @@ -111,6 +149,23 @@ } } }, + "ansi-escapes": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.1.tgz", + "integrity": "sha512-JWF7ocqNrp8u9oqpgV+wH5ftbt+cfvv+PTjOvKLT3AdYly/LmORARfEVT1iyjwN+4MqE5UmVKoAdIBqeoCHgLA==", + "dev": true, + "requires": { + "type-fest": "^0.11.0" + }, + "dependencies": { + "type-fest": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.11.0.tgz", + "integrity": "sha512-OdjXJxnCN1AvyLSzeKIgXTXxV+99ZuXl3Hpo9XpJAv9MBcHrrJOQ5kV7ypXOuQie+AmWG25hLbiKdwYTifzcfQ==", + "dev": true + } + } + }, "ansi-regex": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", @@ -310,6 +365,12 @@ } } }, + "callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true + }, "camelcase": { "version": "5.3.1", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", @@ -329,6 +390,55 @@ "lodash": "^4.17.14" } }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + } + } + }, + "chardet": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", + "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", + "dev": true + }, "chromium-pickle-js": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/chromium-pickle-js/-/chromium-pickle-js-0.2.0.tgz", @@ -340,6 +450,15 @@ "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==" }, + "cli-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", + "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", + "dev": true, + "requires": { + "restore-cursor": "^3.1.0" + } + }, "cli-truncate": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-2.1.0.tgz", @@ -349,6 +468,12 @@ "string-width": "^4.2.0" } }, + "cli-width": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.1.tgz", + "integrity": "sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw==", + "dev": true + }, "clone-response": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.2.tgz", @@ -550,6 +675,27 @@ "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" }, + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } + } + }, "cross-zip": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/cross-zip/-/cross-zip-3.0.0.tgz", @@ -629,6 +775,12 @@ "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==" }, + "deep-is": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", + "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", + "dev": true + }, "defer-to-connect": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-1.1.3.tgz", @@ -680,6 +832,15 @@ } } }, + "doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "requires": { + "esutils": "^2.0.2" + } + }, "dot-prop": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.2.0.tgz", @@ -983,6 +1144,154 @@ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==" }, + "eslint": { + "version": "6.8.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-6.8.0.tgz", + "integrity": "sha512-K+Iayyo2LtyYhDSYwz5D5QdWw0hCacNzyq1Y821Xna2xSJj7cijoLLYmLxTQgcgZ9mC61nryMy9S7GRbYpI5Ig==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "ajv": "^6.10.0", + "chalk": "^2.1.0", + "cross-spawn": "^6.0.5", + "debug": "^4.0.1", + "doctrine": "^3.0.0", + "eslint-scope": "^5.0.0", + "eslint-utils": "^1.4.3", + "eslint-visitor-keys": "^1.1.0", + "espree": "^6.1.2", + "esquery": "^1.0.1", + "esutils": "^2.0.2", + "file-entry-cache": "^5.0.1", + "functional-red-black-tree": "^1.0.1", + "glob-parent": "^5.0.0", + "globals": "^12.1.0", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "inquirer": "^7.0.0", + "is-glob": "^4.0.0", + "js-yaml": "^3.13.1", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.3.0", + "lodash": "^4.17.14", + "minimatch": "^3.0.4", + "mkdirp": "^0.5.1", + "natural-compare": "^1.4.0", + "optionator": "^0.8.3", + "progress": "^2.0.0", + "regexpp": "^2.0.1", + "semver": "^6.1.2", + "strip-ansi": "^5.2.0", + "strip-json-comments": "^3.0.1", + "table": "^5.2.3", + "text-table": "^0.2.0", + "v8-compile-cache": "^2.0.3" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } + } + }, + "eslint-scope": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.0.0.tgz", + "integrity": "sha512-oYrhJW7S0bxAFDvWqzvMPRm6pcgcnWc4QnofCAqRTRfQC0JcwenzGglTtsLyIuuWFfkqDG9vz67cnttSd53djw==", + "dev": true, + "requires": { + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" + } + }, + "eslint-utils": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.4.3.tgz", + "integrity": "sha512-fbBN5W2xdY45KulGXmLHZ3c3FHfVYmKg0IrAKGOkT/464PQsx2UeIzfz1RmEci+KLm1bBaAzZAh8+/E+XAeZ8Q==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^1.1.0" + } + }, + "eslint-visitor-keys": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz", + "integrity": "sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A==", + "dev": true + }, + "espree": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-6.2.1.tgz", + "integrity": "sha512-ysCxRQY3WaXJz9tdbWOwuWr5Y/XrPTGX9Kiz3yoUXwW0VZ4w30HTkQLaGx/+ttFjF8i+ACbArnB4ce68a9m5hw==", + "dev": true, + "requires": { + "acorn": "^7.1.1", + "acorn-jsx": "^5.2.0", + "eslint-visitor-keys": "^1.1.0" + } + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + }, + "esquery": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.3.1.tgz", + "integrity": "sha512-olpvt9QG0vniUBZspVRN6lwB7hOZoTRtT+jzR+tS4ffYx2mzbw+z0XCOk44aaLYKApNX5nMm+E+P6o25ip/DHQ==", + "dev": true, + "requires": { + "estraverse": "^5.1.0" + }, + "dependencies": { + "estraverse": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.1.0.tgz", + "integrity": "sha512-FyohXK+R0vE+y1nHLoBM7ZTyqRpqAlhdZHCWIWEviFLiGB8b04H6bQs8G+XTthacvT8VuwvteiP7RJSxMs8UEw==", + "dev": true + } + } + }, + "esrecurse": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", + "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", + "dev": true, + "requires": { + "estraverse": "^4.1.0" + } + }, + "estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true + }, + "esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true + }, "ext-list": { "version": "2.2.2", "resolved": "https://registry.npmjs.org/ext-list/-/ext-list-2.2.2.tgz", @@ -1005,6 +1314,28 @@ "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" }, + "external-editor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", + "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", + "dev": true, + "requires": { + "chardet": "^0.7.0", + "iconv-lite": "^0.4.24", + "tmp": "^0.0.33" + }, + "dependencies": { + "tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dev": true, + "requires": { + "os-tmpdir": "~1.0.2" + } + } + } + }, "extract-zip": { "version": "1.6.7", "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-1.6.7.tgz", @@ -1046,6 +1377,12 @@ "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=" }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true + }, "fd-slicer": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.0.1.tgz", @@ -1054,6 +1391,32 @@ "pend": "~1.2.0" } }, + "figures": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", + "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", + "dev": true, + "requires": { + "escape-string-regexp": "^1.0.5" + }, + "dependencies": { + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + } + } + }, + "file-entry-cache": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz", + "integrity": "sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g==", + "dev": true, + "requires": { + "flat-cache": "^2.0.1" + } + }, "file-set": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/file-set/-/file-set-3.0.0.tgz", @@ -1087,6 +1450,34 @@ "locate-path": "^2.0.0" } }, + "flat-cache": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz", + "integrity": "sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA==", + "dev": true, + "requires": { + "flatted": "^2.0.0", + "rimraf": "2.6.3", + "write": "1.0.3" + }, + "dependencies": { + "rimraf": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", + "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + } + } + }, + "flatted": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.2.tgz", + "integrity": "sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==", + "dev": true + }, "flora-colossus": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/flora-colossus/-/flora-colossus-1.0.1.tgz", @@ -1145,6 +1536,12 @@ "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" }, + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "dev": true + }, "galactus": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/galactus/-/galactus-0.2.1.tgz", @@ -1236,6 +1633,15 @@ "path-is-absolute": "^1.0.0" } }, + "glob-parent": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", + "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + }, "global-agent": { "version": "2.1.8", "resolved": "https://registry.npmjs.org/global-agent/-/global-agent-2.1.8.tgz", @@ -1263,6 +1669,15 @@ "tunnel": "^0.0.6" } }, + "globals": { + "version": "12.4.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", + "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", + "dev": true, + "requires": { + "type-fest": "^0.8.1" + } + }, "globalthis": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.1.tgz", @@ -1320,6 +1735,12 @@ "har-schema": "^2.0.0" } }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, "hosted-git-info": { "version": "2.8.8", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", @@ -1341,6 +1762,31 @@ "sshpk": "^1.7.0" } }, + "iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dev": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true + }, + "import-fresh": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.2.1.tgz", + "integrity": "sha512-6e1q1cnWP2RXD9/keSkxHScg508CdXqXWgWBaETNhyuBFz+kUZlKboh+ISK+bU++DmbHimVBrOz/zzPe0sZ3sQ==", + "dev": true, + "requires": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + } + }, "imurmurhash": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", @@ -1366,17 +1812,80 @@ "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", "optional": true }, + "inquirer": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-7.1.0.tgz", + "integrity": "sha512-5fJMWEmikSYu0nv/flMc475MhGbB7TSPd/2IpFV4I4rMklboCH2rQjYY5kKiYGHqUF9gvaambupcJFFG9dvReg==", + "dev": true, + "requires": { + "ansi-escapes": "^4.2.1", + "chalk": "^3.0.0", + "cli-cursor": "^3.1.0", + "cli-width": "^2.0.0", + "external-editor": "^3.0.3", + "figures": "^3.0.0", + "lodash": "^4.17.15", + "mute-stream": "0.0.8", + "run-async": "^2.4.0", + "rxjs": "^6.5.3", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0", + "through": "^2.3.6" + }, + "dependencies": { + "chalk": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", + "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", + "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, "is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", "dev": true }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true + }, "is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" }, + "is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, "is-obj": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz", @@ -1387,6 +1896,12 @@ "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=" }, + "is-promise": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", + "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=", + "dev": true + }, "is-typedarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", @@ -1406,6 +1921,12 @@ "buffer-alloc": "^1.2.0" } }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, "isstream": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", @@ -1416,6 +1937,22 @@ "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.4.1.tgz", "integrity": "sha512-36+AdBzCL+y6qjw5Tx7HgzeGCzC81MDDgaUP8ld2zhx58HdqXGoBd+tHdrBMiyjGQs0Hxs/MLZTu/eHNJJuWPw==" }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "js-yaml": { + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", + "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, "js2xmlparser": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js2xmlparser/-/js2xmlparser-4.0.0.tgz", @@ -1558,6 +2095,12 @@ "resolved": "https://registry.npmjs.org/json-schema-typed/-/json-schema-typed-7.0.3.tgz", "integrity": "sha512-7DE8mpG+/fVw+dTpjbxnx47TaMnDfOI1jwft9g1VybltZCduyRQPJPvc+zzKY9WPHxhPWczyFuYa6I8Mw4iU5A==" }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true + }, "json-stringify-safe": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", @@ -1614,6 +2157,16 @@ "graceful-fs": "^4.1.9" } }, + "levn": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "dev": true, + "requires": { + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" + } + }, "linkify-it": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-2.2.0.tgz", @@ -1808,6 +2361,18 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, + "mute-stream": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", + "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==", + "dev": true + }, + "natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true + }, "neo-async": { "version": "2.6.1", "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.1.tgz", @@ -1818,6 +2383,12 @@ "resolved": "https://registry.npmjs.org/new-github-issue-url/-/new-github-issue-url-0.2.1.tgz", "integrity": "sha512-md4cGoxuT4T4d/HDOXbrUHkTKrp/vp+m3aOA7XXVYwNsUNMK49g3SQicTSeV5GIz/5QVGAeYRAOlyp9OvlgsYA==" }, + "nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true + }, "node-fetch": { "version": "2.6.0", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.0.tgz", @@ -1904,6 +2475,26 @@ "wordwrap": "~0.0.2" } }, + "optionator": { + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", + "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", + "dev": true, + "requires": { + "deep-is": "~0.1.3", + "fast-levenshtein": "~2.0.6", + "levn": "~0.3.0", + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2", + "word-wrap": "~1.2.3" + } + }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "dev": true + }, "p-cancelable": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-1.1.0.tgz", @@ -1938,6 +2529,15 @@ "resolved": "https://registry.npmjs.org/packpath/-/packpath-0.1.0.tgz", "integrity": "sha1-pSFTQiLf6qnGEu8MZA7DmRSezdg=" }, + "parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "requires": { + "callsites": "^3.0.0" + } + }, "parse-author": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/parse-author/-/parse-author-2.0.0.tgz", @@ -1966,6 +2566,12 @@ "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" }, + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true + }, "path-parse": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", @@ -2069,6 +2675,12 @@ "resolved": "https://registry.npmjs.org/popper.js/-/popper.js-1.16.1.tgz", "integrity": "sha512-Wb4p1J4zyFTbM+u6WuO4XstYx4Ky9Cewe4DWrel7B0w6VVICvPwdOpotjzcf6eD8TsckVnIMNONQyPIUFOUbCQ==" }, + "prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", + "dev": true + }, "prepend-http": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz", @@ -2227,6 +2839,12 @@ } } }, + "regexpp": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", + "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==", + "dev": true + }, "request": { "version": "2.88.0", "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", @@ -2271,6 +2889,12 @@ "path-parse": "^1.0.6" } }, + "resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true + }, "responselike": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/responselike/-/responselike-1.0.2.tgz", @@ -2279,6 +2903,16 @@ "lowercase-keys": "^1.0.0" } }, + "restore-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", + "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", + "dev": true, + "requires": { + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" + } + }, "rimraf": { "version": "2.7.1", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", @@ -2310,6 +2944,24 @@ "packpath": "~0.1.0" } }, + "run-async": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.0.tgz", + "integrity": "sha512-xJTbh/d7Lm7SBhc1tNvTpeCHaEzoyxPrqNlvSdMfBTYwaY++UJFyXUOxAtsRUXjlqOfj8luNaR9vjCh4KeV+pg==", + "dev": true, + "requires": { + "is-promise": "^2.1.0" + } + }, + "rxjs": { + "version": "6.5.5", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.5.tgz", + "integrity": "sha512-WfQI+1gohdf0Dai/Bbmk5L5ItH5tYqm3ki2c5GdWhKjalzjg93N3avFjVStyZZz+A2Em+ZxKH5bNghw9UeylGQ==", + "dev": true, + "requires": { + "tslib": "^1.9.0" + } + }, "safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", @@ -2349,6 +3001,21 @@ "type-fest": "^0.8.0" } }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, + "requires": { + "shebang-regex": "^1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "dev": true + }, "signal-exit": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", @@ -2527,6 +3194,108 @@ "debug": "^4.1.0" } }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "table": { + "version": "5.4.6", + "resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz", + "integrity": "sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug==", + "dev": true, + "requires": { + "ajv": "^6.10.2", + "lodash": "^4.17.14", + "slice-ansi": "^2.1.0", + "string-width": "^3.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "astral-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", + "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", + "dev": true + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "slice-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", + "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.0", + "astral-regex": "^1.0.0", + "is-fullwidth-code-point": "^2.0.0" + } + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } + } + }, "table-layout": { "version": "0.4.5", "resolved": "https://registry.npmjs.org/table-layout/-/table-layout-0.4.5.tgz", @@ -2578,6 +3347,18 @@ } } }, + "text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true + }, + "through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", + "dev": true + }, "tmp": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.1.0.tgz", @@ -2626,6 +3407,12 @@ "utf8-byte-length": "^1.0.1" } }, + "tslib": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.11.1.tgz", + "integrity": "sha512-aZW88SY8kQbU7gpV19lN24LtXh/yD4ZZg6qieAJDDg+YBsJcSmLGK9QpnUjAKVG/xefmvJGd1WUmfpT/g6AJGA==", + "dev": true + }, "tunnel": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", @@ -2645,11 +3432,19 @@ "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=" }, + "type-check": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "dev": true, + "requires": { + "prelude-ls": "~1.1.2" + } + }, "type-fest": { "version": "0.8.1", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", - "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", - "optional": true + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==" }, "typedarray": { "version": "0.0.6", @@ -2749,6 +3544,12 @@ "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==" }, + "v8-compile-cache": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.1.0.tgz", + "integrity": "sha512-usZBT3PW+LOjM25wbqIlZwPeJV+3OSz3M1k1Ws8snlW39dZyYL9lOGC5FgPVHfk0jKmjiDV8Z0mIbVQPiwFs7g==", + "dev": true + }, "validate-npm-package-license": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", @@ -2774,6 +3575,21 @@ "resolved": "https://registry.npmjs.org/walk-back/-/walk-back-4.0.0.tgz", "integrity": "sha512-kudCA8PXVQfrqv2mFTG72vDBRi8BKWxGgFLwPpzHcpZnSwZk93WMwUDVcLHWNsnm+Y0AC4Vb6MUNRgaHfyV2DQ==" }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "word-wrap": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", + "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "dev": true + }, "wordwrap": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", @@ -2793,6 +3609,15 @@ "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" }, + "write": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/write/-/write-1.0.3.tgz", + "integrity": "sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig==", + "dev": true, + "requires": { + "mkdirp": "^0.5.1" + } + }, "write-file-atomic": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", diff --git a/package.json b/package.json index a723ee7..6fc31a2 100644 --- a/package.json +++ b/package.json @@ -38,6 +38,7 @@ "uuid": "^3.4.0" }, "devDependencies": { - "electron-packager": "^14.2.1" + "electron-packager": "^14.2.1", + "eslint": "^6.8.0" } } diff --git a/start.js b/start.js index 7444b21..8bfd9bf 100644 --- a/start.js +++ b/start.js @@ -1,4 +1,7 @@ -process.env.NODE_ENV = ((process.argv.indexOf("--debug")>-1)?'Dev':'production'); +process.env.NODE_ENV = ((process.argv.indexOf("--debug")>-1)?'development':'production'); +const os = require("os"); +const PLATFORM = os.platform() +console.log(PLATFORM) console.log(process.env.NODE_ENV) const unhandled = require('electron-unhandled'); unhandled(); @@ -27,7 +30,7 @@ const { Tray, remote } = electron; -const NeosAPI = require('@bombitmanbomb/neosjs') +const NEOS = require('@bombitmanbomb/neosjs') /** * Window Manager */