From f89f308c525e9deebc6d2cf6416e27dfe1a299dc Mon Sep 17 00:00:00 2001 From: Dennis Kobert Date: Sun, 19 May 2019 16:03:38 +0200 Subject: Cleanup DiscoBot Project --- FireBase/ExceptionEventArgs.cs | 4 +- FireBase/Extensions/ObservableExtensions.cs | 28 +- FireBase/Extensions/TaskExtensions.cs | 2 +- FireBase/FirebaseClient.cs | 18 +- FireBase/FirebaseException.cs | 44 ++- FireBase/FirebaseKeyGenerator.cs | 34 +-- FireBase/FirebaseObject.cs | 18 +- FireBase/FirebaseOptions.cs | 50 +--- FireBase/Http/HttpClientExtensions.cs | 23 +- FireBase/Http/PostResult.cs | 8 +- FireBase/ObservableExtensions.cs | 10 +- FireBase/Offline/ConcurrentOfflineDatabase.cs | 70 ++--- FireBase/Offline/DatabaseExtensions.cs | 77 +++-- FireBase/Offline/ISetHandler.cs | 5 +- FireBase/Offline/InitialPullStrategy.cs | 4 +- FireBase/Offline/Internals/MemberAccessVisitor.cs | 19 +- FireBase/Offline/OfflineCacheAdapter.cs | 69 ++--- FireBase/Offline/OfflineDatabase.cs | 71 +++-- FireBase/Offline/OfflineEntry.cs | 60 ++-- FireBase/Offline/RealtimeDatabase.cs | 324 +++++++++++----------- FireBase/Offline/SetHandler.cs | 9 +- FireBase/Offline/StreamingOptions.cs | 2 +- FireBase/Offline/SyncOptions.cs | 2 +- FireBase/Query/AuthQuery.cs | 7 +- FireBase/Query/ChildQuery.cs | 16 +- FireBase/Query/FilterQuery.cs | 36 +-- FireBase/Query/FirebaseQuery.cs | 82 +++--- FireBase/Query/IFirebaseQuery.cs | 13 +- FireBase/Query/OrderQuery.cs | 4 +- FireBase/Query/ParameterQuery.cs | 6 +- FireBase/Query/QueryExtensions.cs | 25 +- FireBase/Query/QueryFactoryExtensions.cs | 6 +- FireBase/Query/SilentQuery.cs | 4 +- FireBase/Streaming/FirebaseCache.cs | 58 ++-- FireBase/Streaming/FirebaseEvent.cs | 19 +- FireBase/Streaming/FirebaseEventSource.cs | 2 +- FireBase/Streaming/FirebaseEventType.cs | 2 +- FireBase/Streaming/FirebaseServerEventType.cs | 2 +- FireBase/Streaming/FirebaseSubscription.cs | 76 +++-- FireBase/Streaming/NonBlockingStreamReader.cs | 22 +- 40 files changed, 594 insertions(+), 737 deletions(-) (limited to 'FireBase') diff --git a/FireBase/ExceptionEventArgs.cs b/FireBase/ExceptionEventArgs.cs index f1c7fac..185c952 100644 --- a/FireBase/ExceptionEventArgs.cs +++ b/FireBase/ExceptionEventArgs.cs @@ -15,7 +15,7 @@ /// The exception. public ExceptionEventArgs(T exception) { - this.Exception = exception; + Exception = exception; } } @@ -25,4 +25,4 @@ { } } -} +} \ No newline at end of file diff --git a/FireBase/Extensions/ObservableExtensions.cs b/FireBase/Extensions/ObservableExtensions.cs index 12cd5f3..cb41bcc 100644 --- a/FireBase/Extensions/ObservableExtensions.cs +++ b/FireBase/Extensions/ObservableExtensions.cs @@ -19,22 +19,22 @@ this IObservable source, TimeSpan dueTime, Func retryOnError) - where TException: Exception + where TException : Exception { - int attempt = 0; + var attempt = 0; return Observable.Defer(() => - { - return ((++attempt == 1) ? source : source.DelaySubscription(dueTime)) - .Select(item => new Tuple(true, item, null)) - .Catch, TException>(e => retryOnError(e) - ? Observable.Throw>(e) - : Observable.Return(new Tuple(false, default(T), e))); - }) - .Retry() - .SelectMany(t => t.Item1 - ? Observable.Return(t.Item2) - : Observable.Throw(t.Item3)); + { + return (++attempt == 1 ? source : source.DelaySubscription(dueTime)) + .Select(item => new Tuple(true, item, null)) + .Catch, TException>(e => retryOnError(e) + ? Observable.Throw>(e) + : Observable.Return(new Tuple(false, default(T), e))); + }) + .Retry() + .SelectMany(t => t.Item1 + ? Observable.Return(t.Item2) + : Observable.Throw(t.Item3)); } } -} +} \ No newline at end of file diff --git a/FireBase/Extensions/TaskExtensions.cs b/FireBase/Extensions/TaskExtensions.cs index 26bbde6..8e933b2 100644 --- a/FireBase/Extensions/TaskExtensions.cs +++ b/FireBase/Extensions/TaskExtensions.cs @@ -20,4 +20,4 @@ } } } -} +} \ No newline at end of file diff --git a/FireBase/FirebaseClient.cs b/FireBase/FirebaseClient.cs index a237c8d..8795668 100644 --- a/FireBase/FirebaseClient.cs +++ b/FireBase/FirebaseClient.cs @@ -7,9 +7,8 @@ namespace Firebase.Database using System; using System.Collections.Generic; using System.Threading.Tasks; - - using Firebase.Database.Offline; - using Firebase.Database.Query; + using Offline; + using Query; /// /// Firebase client which acts as an entry point to the online database. @@ -28,15 +27,12 @@ namespace Firebase.Database /// Offline database. public FirebaseClient(string baseUrl, FirebaseOptions options = null) { - this.HttpClient = new HttpClient(); - this.Options = options ?? new FirebaseOptions(); + HttpClient = new HttpClient(); + Options = options ?? new FirebaseOptions(); this.baseUrl = baseUrl; - if (!this.baseUrl.EndsWith("/")) - { - this.baseUrl += "/"; - } + if (!this.baseUrl.EndsWith("/")) this.baseUrl += "/"; } /// @@ -46,7 +42,7 @@ namespace Firebase.Database /// . public ChildQuery Child(string resourceName) { - return new ChildQuery(this, () => this.baseUrl + resourceName); + return new ChildQuery(this, () => baseUrl + resourceName); } public void Dispose() @@ -54,4 +50,4 @@ namespace Firebase.Database HttpClient?.Dispose(); } } -} +} \ No newline at end of file diff --git a/FireBase/FirebaseException.cs b/FireBase/FirebaseException.cs index e4b782b..2f8269d 100644 --- a/FireBase/FirebaseException.cs +++ b/FireBase/FirebaseException.cs @@ -8,56 +8,46 @@ public FirebaseException(string requestUrl, string requestData, string responseData, HttpStatusCode statusCode) : base(GenerateExceptionMessage(requestUrl, requestData, responseData)) { - this.RequestUrl = requestUrl; - this.RequestData = requestData; - this.ResponseData = responseData; - this.StatusCode = statusCode; + RequestUrl = requestUrl; + RequestData = requestData; + ResponseData = responseData; + StatusCode = statusCode; } - public FirebaseException(string requestUrl, string requestData, string responseData, HttpStatusCode statusCode, Exception innerException) + public FirebaseException(string requestUrl, string requestData, string responseData, HttpStatusCode statusCode, + Exception innerException) : base(GenerateExceptionMessage(requestUrl, requestData, responseData), innerException) { - this.RequestUrl = requestUrl; - this.RequestData = requestData; - this.ResponseData = responseData; - this.StatusCode = statusCode; + RequestUrl = requestUrl; + RequestData = requestData; + ResponseData = responseData; + StatusCode = statusCode; } /// /// Post data passed to the authentication service. /// - public string RequestData - { - get; - } + public string RequestData { get; } /// /// Original url of the request. /// - public string RequestUrl - { - get; - } + public string RequestUrl { get; } /// /// Response from the authentication service. /// - public string ResponseData - { - get; - } + public string ResponseData { get; } /// /// Status code of the response. /// - public HttpStatusCode StatusCode - { - get; - } + public HttpStatusCode StatusCode { get; } private static string GenerateExceptionMessage(string requestUrl, string requestData, string responseData) { - return $"Exception occured while processing the request.\nUrl: {requestUrl}\nRequest Data: {requestData}\nResponse: {responseData}"; + return + $"Exception occured while processing the request.\nUrl: {requestUrl}\nRequest Data: {requestData}\nResponse: {responseData}"; } } -} +} \ No newline at end of file diff --git a/FireBase/FirebaseKeyGenerator.cs b/FireBase/FirebaseKeyGenerator.cs index acad399..70a855d 100644 --- a/FireBase/FirebaseKeyGenerator.cs +++ b/FireBase/FirebaseKeyGenerator.cs @@ -7,7 +7,7 @@ namespace Firebase.Database /// Offline key generator which mimics the official Firebase generators. /// Credit: https://github.com/bubbafat/FirebaseSharp/blob/master/src/FirebaseSharp.Portable/FireBasePushIdGenerator.cs /// - public class FirebaseKeyGenerator + public class FirebaseKeyGenerator { // Modeled after base64 web-safe chars, but ordered by ASCII. private const string PushCharsString = "-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz"; @@ -37,31 +37,25 @@ namespace Firebase.Database // characters we generated because in the event of a collision, we'll use those same // characters except "incremented" by one. var id = new StringBuilder(20); - var now = (long)(DateTimeOffset.Now - Epoch).TotalMilliseconds; + var now = (long) (DateTimeOffset.Now - Epoch).TotalMilliseconds; var duplicateTime = now == lastPushTime; lastPushTime = now; var timeStampChars = new char[8]; - for (int i = 7; i >= 0; i--) + for (var i = 7; i >= 0; i--) { - var index = (int)(now % PushChars.Length); + var index = (int) (now % PushChars.Length); timeStampChars[i] = PushChars[index]; - now = (long)Math.Floor((double)now / PushChars.Length); + now = (long) Math.Floor((double) now / PushChars.Length); } - if (now != 0) - { - throw new Exception("We should have converted the entire timestamp."); - } + if (now != 0) throw new Exception("We should have converted the entire timestamp."); id.Append(timeStampChars); if (!duplicateTime) { - for (int i = 0; i < 12; i++) - { - lastRandChars[i] = (byte)random.Next(0, PushChars.Length); - } + for (var i = 0; i < 12; i++) lastRandChars[i] = (byte) random.Next(0, PushChars.Length); } else { @@ -69,24 +63,16 @@ namespace Firebase.Database // except incremented by 1. var lastIndex = 11; for (; lastIndex >= 0 && lastRandChars[lastIndex] == PushChars.Length - 1; lastIndex--) - { lastRandChars[lastIndex] = 0; - } lastRandChars[lastIndex]++; } - for (int i = 0; i < 12; i++) - { - id.Append(PushChars[lastRandChars[i]]); - } + for (var i = 0; i < 12; i++) id.Append(PushChars[lastRandChars[i]]); - if (id.Length != 20) - { - throw new Exception("Length should be 20."); - } + if (id.Length != 20) throw new Exception("Length should be 20."); return id.ToString(); } } -} +} \ No newline at end of file diff --git a/FireBase/FirebaseObject.cs b/FireBase/FirebaseObject.cs index ea61893..653d508 100644 --- a/FireBase/FirebaseObject.cs +++ b/FireBase/FirebaseObject.cs @@ -4,28 +4,22 @@ namespace Firebase.Database /// Holds the object of type along with its key. /// /// Type of the underlying object. - public class FirebaseObject + public class FirebaseObject { internal FirebaseObject(string key, T obj) { - this.Key = key; - this.Object = obj; + Key = key; + Object = obj; } /// /// Gets the key of . /// - public string Key - { - get; - } + public string Key { get; } /// /// Gets the underlying object. /// - public T Object - { - get; - } + public T Object { get; } } -} +} \ No newline at end of file diff --git a/FireBase/FirebaseOptions.cs b/FireBase/FirebaseOptions.cs index 9905956..f31a047 100644 --- a/FireBase/FirebaseOptions.cs +++ b/FireBase/FirebaseOptions.cs @@ -4,73 +4,47 @@ using System.Collections.Generic; using System.IO; using System.Threading.Tasks; - - using Firebase.Database.Offline; - + using Offline; using Newtonsoft.Json; public class FirebaseOptions { public FirebaseOptions() { - this.OfflineDatabaseFactory = (t, s) => new Dictionary(); - this.SubscriptionStreamReaderFactory = s => new StreamReader(s); - this.JsonSerializerSettings = new JsonSerializerSettings(); - this.SyncPeriod = TimeSpan.FromSeconds(10); + OfflineDatabaseFactory = (t, s) => new Dictionary(); + SubscriptionStreamReaderFactory = s => new StreamReader(s); + JsonSerializerSettings = new JsonSerializerSettings(); + SyncPeriod = TimeSpan.FromSeconds(10); } /// /// Gets or sets the factory for Firebase offline database. Default is in-memory dictionary. /// - public Func> OfflineDatabaseFactory - { - get; - set; - } + public Func> OfflineDatabaseFactory { get; set; } /// /// Gets or sets the method for retrieving auth tokens. Default is null. /// - public Func> AuthTokenAsyncFactory - { - get; - set; - } + public Func> AuthTokenAsyncFactory { get; set; } /// /// Gets or sets the factory for used for reading online streams. Default is . /// - public Func SubscriptionStreamReaderFactory - { - get; - set; - } + public Func SubscriptionStreamReaderFactory { get; set; } /// /// Gets or sets the json serializer settings. /// - public JsonSerializerSettings JsonSerializerSettings - { - get; - set; - } + public JsonSerializerSettings JsonSerializerSettings { get; set; } /// /// Gets or sets the time between synchronization attempts for pulling and pushing offline entities. Default is 10 seconds. /// - public TimeSpan SyncPeriod - { - get; - set; - } + public TimeSpan SyncPeriod { get; set; } /// /// Specify if token returned by factory will be used as "auth" url parameter or "access_token". /// - public bool AsAccessToken - { - get; - set; - } + public bool AsAccessToken { get; set; } } -} +} \ No newline at end of file diff --git a/FireBase/Http/HttpClientExtensions.cs b/FireBase/Http/HttpClientExtensions.cs index 5d15c59..7f8fffe 100644 --- a/FireBase/Http/HttpClientExtensions.cs +++ b/FireBase/Http/HttpClientExtensions.cs @@ -6,7 +6,6 @@ namespace Firebase.Database.Http using System.Linq; using System.Net.Http; using System.Threading.Tasks; - using Newtonsoft.Json; using System.Net; @@ -23,7 +22,8 @@ namespace Firebase.Database.Http /// The specific JSON Serializer Settings. /// The type of entities the collection should contain. /// The . - public static async Task>> GetObjectCollectionAsync(this HttpClient client, string requestUri, + public static async Task>> GetObjectCollectionAsync( + this HttpClient client, string requestUri, JsonSerializerSettings jsonSerializerSettings) { var responseData = string.Empty; @@ -37,12 +37,10 @@ namespace Firebase.Database.Http response.EnsureSuccessStatusCode(); - var dictionary = JsonConvert.DeserializeObject>(responseData, jsonSerializerSettings); + var dictionary = + JsonConvert.DeserializeObject>(responseData, jsonSerializerSettings); - if (dictionary == null) - { - return new FirebaseObject[0]; - } + if (dictionary == null) return new FirebaseObject[0]; return dictionary.Select(item => new FirebaseObject(item.Key, item.Value)).ToList(); } @@ -116,15 +114,10 @@ namespace Firebase.Database.Http dictionary = JsonConvert.DeserializeObject(data, dictionaryType) as IDictionary; } - if (dictionary == null) - { - yield break; - } + if (dictionary == null) yield break; foreach (DictionaryEntry item in dictionary) - { - yield return new FirebaseObject((string)item.Key, item.Value); - } + yield return new FirebaseObject((string) item.Key, item.Value); } } -} +} \ No newline at end of file diff --git a/FireBase/Http/PostResult.cs b/FireBase/Http/PostResult.cs index 3f010d4..5a779ed 100644 --- a/FireBase/Http/PostResult.cs +++ b/FireBase/Http/PostResult.cs @@ -8,10 +8,6 @@ namespace Firebase.Database.Http /// /// Gets or sets the generated key after a successful post. /// - public string Name - { - get; - set; - } + public string Name { get; set; } } -} +} \ No newline at end of file diff --git a/FireBase/ObservableExtensions.cs b/FireBase/ObservableExtensions.cs index 37c3ef7..da78365 100644 --- a/FireBase/ObservableExtensions.cs +++ b/FireBase/ObservableExtensions.cs @@ -2,8 +2,7 @@ { using System; using System.Collections.ObjectModel; - - using Firebase.Database.Streaming; + using Streaming; /// /// Extensions for . @@ -25,10 +24,7 @@ if (f.EventType == FirebaseEventType.InsertOrUpdate) { var i = collection.IndexOf(f.Object); - if (i >= 0) - { - collection.RemoveAt(i); - } + if (i >= 0) collection.RemoveAt(i); collection.Add(f.Object); } @@ -41,4 +37,4 @@ return collection; } } -} +} \ No newline at end of file diff --git a/FireBase/Offline/ConcurrentOfflineDatabase.cs b/FireBase/Offline/ConcurrentOfflineDatabase.cs index 226892d..5527168 100644 --- a/FireBase/Offline/ConcurrentOfflineDatabase.cs +++ b/FireBase/Offline/ConcurrentOfflineDatabase.cs @@ -6,7 +6,6 @@ using System.Collections.Generic; using System.IO; using System.Linq; - using LiteDB; /// @@ -24,34 +23,30 @@ /// Custom string which will get appended to the file name. public ConcurrentOfflineDatabase(Type itemType, string filenameModifier) { - var fullName = this.GetFileName(itemType.ToString()); - if(fullName.Length > 100) - { - fullName = fullName.Substring(0, 100); - } + var fullName = GetFileName(itemType.ToString()); + if (fullName.Length > 100) fullName = fullName.Substring(0, 100); - BsonMapper mapper = BsonMapper.Global; + var mapper = BsonMapper.Global; mapper.Entity().Id(o => o.Key); - string root = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData); - string filename = fullName + filenameModifier + ".db"; + var root = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData); + var filename = fullName + filenameModifier + ".db"; var path = Path.Combine(root, filename); - this.db = new LiteRepository(new LiteDatabase(path, mapper)); + db = new LiteRepository(new LiteDatabase(path, mapper)); var cache = db.Database .GetCollection() .FindAll() .ToDictionary(o => o.Key, o => o); - this.ccache = new ConcurrentDictionary(cache); - + ccache = new ConcurrentDictionary(cache); } /// /// Gets the number of elements contained in the . /// /// The number of elements contained in the . - public int Count => this.ccache.Count; + public int Count => ccache.Count; /// /// Gets a value indicating whether this is a read-only collection. @@ -62,13 +57,13 @@ /// Gets an containing the keys of the . /// /// An containing the keys of the object that implements . - public ICollection Keys => this.ccache.Keys; + public ICollection Keys => ccache.Keys; /// /// Gets an containing the values in the . /// /// An containing the values in the object that implements . - public ICollection Values => this.ccache.Values; + public ICollection Values => ccache.Values; /// /// Gets or sets the element with the specified key. @@ -77,15 +72,12 @@ /// The element with the specified key. public OfflineEntry this[string key] { - get - { - return this.ccache[key]; - } + get => ccache[key]; set { - this.ccache.AddOrUpdate(key, value, (k, existing) => value); - this.db.Upsert(value); + ccache.AddOrUpdate(key, value, (k, existing) => value); + db.Upsert(value); } } @@ -95,12 +87,12 @@ /// An enumerator that can be used to iterate through the collection. public IEnumerator> GetEnumerator() { - return this.ccache.GetEnumerator(); + return ccache.GetEnumerator(); } IEnumerator IEnumerable.GetEnumerator() { - return this.GetEnumerator(); + return GetEnumerator(); } /// @@ -109,7 +101,7 @@ /// The object to add to the . public void Add(KeyValuePair item) { - this.Add(item.Key, item.Value); + Add(item.Key, item.Value); } /// @@ -117,8 +109,8 @@ /// public void Clear() { - this.ccache.Clear(); - this.db.Delete(Query.All()); + ccache.Clear(); + db.Delete(Query.All()); } /// @@ -128,7 +120,7 @@ /// True if is found in the ; otherwise, false. public bool Contains(KeyValuePair item) { - return this.ContainsKey(item.Key); + return ContainsKey(item.Key); } /// @@ -138,7 +130,7 @@ /// The zero-based index in at which copying begins. public void CopyTo(KeyValuePair[] array, int arrayIndex) { - this.ccache.ToList().CopyTo(array, arrayIndex); + ccache.ToList().CopyTo(array, arrayIndex); } /// @@ -148,7 +140,7 @@ /// True if was successfully removed from the ; otherwise, false. This method also returns false if is not found in the original . public bool Remove(KeyValuePair item) { - return this.Remove(item.Key); + return Remove(item.Key); } /// @@ -158,7 +150,7 @@ /// True if the contains an element with the key; otherwise, false. public bool ContainsKey(string key) { - return this.ccache.ContainsKey(key); + return ccache.ContainsKey(key); } /// @@ -168,8 +160,8 @@ /// The object to use as the value of the element to add. public void Add(string key, OfflineEntry value) { - this.ccache.AddOrUpdate(key, value, (k, existing) => value); - this.db.Upsert(value); + ccache.AddOrUpdate(key, value, (k, existing) => value); + db.Upsert(value); } /// @@ -179,8 +171,8 @@ /// True if the element is successfully removed; otherwise, false. This method also returns false if was not found in the original . public bool Remove(string key) { - this.ccache.TryRemove(key, out OfflineEntry _); - return this.db.Delete(key); + ccache.TryRemove(key, out _); + return db.Delete(key); } /// @@ -190,18 +182,16 @@ /// True if the object that implements contains an element with the specified key; otherwise, false. public bool TryGetValue(string key, out OfflineEntry value) { - return this.ccache.TryGetValue(key, out value); + return ccache.TryGetValue(key, out value); } private string GetFileName(string fileName) { - var invalidChars = new[] { '`', '[', ',', '=' }; - foreach(char c in invalidChars.Concat(System.IO.Path.GetInvalidFileNameChars()).Distinct()) - { + var invalidChars = new[] {'`', '[', ',', '='}; + foreach (var c in invalidChars.Concat(Path.GetInvalidFileNameChars()).Distinct()) fileName = fileName.Replace(c, '_'); - } return fileName; } } -} +} \ No newline at end of file diff --git a/FireBase/Offline/DatabaseExtensions.cs b/FireBase/Offline/DatabaseExtensions.cs index 4b04314..56dcf46 100644 --- a/FireBase/Offline/DatabaseExtensions.cs +++ b/FireBase/Offline/DatabaseExtensions.cs @@ -5,7 +5,7 @@ using System.Collections.Generic; using System.Linq.Expressions; using System.Reflection; - using Firebase.Database.Query; + using Query; public static class DatabaseExtensions { @@ -19,10 +19,13 @@ /// Specifies what strategy should be used for initial pulling of server data. /// Specifies whether changed items should actually be pushed to the server. It this is false, then Put / Post / Delete will not affect server data. /// The . - public static RealtimeDatabase AsRealtimeDatabase(this ChildQuery query, string filenameModifier = "", string elementRoot = "", StreamingOptions streamingOptions = StreamingOptions.LatestOnly, InitialPullStrategy initialPullStrategy = InitialPullStrategy.MissingOnly, bool pushChanges = true) + public static RealtimeDatabase AsRealtimeDatabase(this ChildQuery query, string filenameModifier = "", + string elementRoot = "", StreamingOptions streamingOptions = StreamingOptions.LatestOnly, + InitialPullStrategy initialPullStrategy = InitialPullStrategy.MissingOnly, bool pushChanges = true) where T : class { - return new RealtimeDatabase(query, elementRoot, query.Client.Options.OfflineDatabaseFactory, filenameModifier, streamingOptions, initialPullStrategy, pushChanges); + return new RealtimeDatabase(query, elementRoot, query.Client.Options.OfflineDatabaseFactory, + filenameModifier, streamingOptions, initialPullStrategy, pushChanges); } /// @@ -36,11 +39,16 @@ /// Specifies what strategy should be used for initial pulling of server data. /// Specifies whether changed items should actually be pushed to the server. It this is false, then Put / Post / Delete will not affect server data. /// The . - public static RealtimeDatabase AsRealtimeDatabase(this ChildQuery query, string filenameModifier = "", string elementRoot = "", StreamingOptions streamingOptions = StreamingOptions.LatestOnly, InitialPullStrategy initialPullStrategy = InitialPullStrategy.MissingOnly, bool pushChanges = true) + public static RealtimeDatabase AsRealtimeDatabase(this ChildQuery query, + string filenameModifier = "", string elementRoot = "", + StreamingOptions streamingOptions = StreamingOptions.LatestOnly, + InitialPullStrategy initialPullStrategy = InitialPullStrategy.MissingOnly, bool pushChanges = true) where T : class where TSetHandler : ISetHandler, new() { - return new RealtimeDatabase(query, elementRoot, query.Client.Options.OfflineDatabaseFactory, filenameModifier, streamingOptions, initialPullStrategy, pushChanges, Activator.CreateInstance()); + return new RealtimeDatabase(query, elementRoot, query.Client.Options.OfflineDatabaseFactory, + filenameModifier, streamingOptions, initialPullStrategy, pushChanges, + Activator.CreateInstance()); } /// @@ -50,8 +58,9 @@ /// The object to set. /// Indicates whether the item should be synced online. /// The priority. Objects with higher priority will be synced first. Higher number indicates higher priority. - public static void Patch(this RealtimeDatabase db, string key, T obj, bool syncOnline = true, int priority = 1) - where T: class + public static void Patch(this RealtimeDatabase db, string key, T obj, bool syncOnline = true, + int priority = 1) + where T : class { db.Set(key, obj, syncOnline ? SyncOptions.Patch : SyncOptions.None, priority); } @@ -63,8 +72,9 @@ /// The object to set. /// Indicates whether the item should be synced online. /// The priority. Objects with higher priority will be synced first. Higher number indicates higher priority. - public static void Put(this RealtimeDatabase db, string key, T obj, bool syncOnline = true, int priority = 1) - where T: class + public static void Put(this RealtimeDatabase db, string key, T obj, bool syncOnline = true, + int priority = 1) + where T : class { db.Set(key, obj, syncOnline ? SyncOptions.Put : SyncOptions.None, priority); } @@ -77,7 +87,7 @@ /// The priority. Objects with higher priority will be synced first. Higher number indicates higher priority. /// The generated key for this object. public static string Post(this RealtimeDatabase db, T obj, bool syncOnline = true, int priority = 1) - where T: class + where T : class { var key = FirebaseKeyGenerator.Next(); @@ -93,7 +103,7 @@ /// Indicates whether the item should be synced online. /// The priority. Objects with higher priority will be synced first. Higher number indicates higher priority. public static void Delete(this RealtimeDatabase db, string key, bool syncOnline = true, int priority = 1) - where T: class + where T : class { db.Set(key, null, syncOnline ? SyncOptions.Put : SyncOptions.None, priority); } @@ -109,8 +119,10 @@ /// Value to put. /// Indicates whether the item should be synced online. /// The priority. Objects with higher priority will be synced first. Higher number indicates higher priority. - public static void Put(this RealtimeDatabase db, string key, Expression> propertyExpression, TProperty value, bool syncOnline = true, int priority = 1) - where T: class + public static void Put(this RealtimeDatabase db, string key, + Expression> propertyExpression, TProperty value, bool syncOnline = true, + int priority = 1) + where T : class { db.Set(key, propertyExpression, value, syncOnline ? SyncOptions.Put : SyncOptions.None, priority); } @@ -126,8 +138,10 @@ /// Value to patch. /// Indicates whether the item should be synced online. /// The priority. Objects with higher priority will be synced first. Higher number indicates higher priority. - public static void Patch(this RealtimeDatabase db, string key, Expression> propertyExpression, TProperty value, bool syncOnline = true, int priority = 1) - where T: class + public static void Patch(this RealtimeDatabase db, string key, + Expression> propertyExpression, TProperty value, bool syncOnline = true, + int priority = 1) + where T : class { db.Set(key, propertyExpression, value, syncOnline ? SyncOptions.Patch : SyncOptions.None, priority); } @@ -143,9 +157,10 @@ /// Value to put. /// Indicates whether the item should be synced online. /// The priority. Objects with higher priority will be synced first. Higher number indicates higher priority. - public static void Delete(this RealtimeDatabase db, string key, Expression> propertyExpression, bool syncOnline = true, int priority = 1) - where T: class - where TProperty: class + public static void Delete(this RealtimeDatabase db, string key, + Expression> propertyExpression, bool syncOnline = true, int priority = 1) + where T : class + where TProperty : class { db.Set(key, propertyExpression, null, syncOnline ? SyncOptions.Put : SyncOptions.None, priority); } @@ -163,12 +178,17 @@ /// Value to put. /// Indicates whether the item should be synced online. /// The priority. Objects with higher priority will be synced first. Higher number indicates higher priority. - public static void Post(this RealtimeDatabase db, string key, Expression> propertyExpression, TProperty value, bool syncOnline = true, int priority = 1) - where T: class - where TSelector: IDictionary + public static void Post(this RealtimeDatabase db, string key, + Expression> propertyExpression, TProperty value, bool syncOnline = true, + int priority = 1) + where T : class + where TSelector : IDictionary { var nextKey = FirebaseKeyGenerator.Next(); - var expression = Expression.Lambda>(Expression.Call(propertyExpression.Body, typeof(TSelector).GetRuntimeMethod("get_Item", new[] { typeof(string) }), Expression.Constant(nextKey)), propertyExpression.Parameters); + var expression = Expression.Lambda>( + Expression.Call(propertyExpression.Body, + typeof(TSelector).GetRuntimeMethod("get_Item", new[] {typeof(string)}), + Expression.Constant(nextKey)), propertyExpression.Parameters); db.Set(key, expression, value, syncOnline ? SyncOptions.Put : SyncOptions.None, priority); } @@ -185,11 +205,16 @@ /// Key within the nested dictionary to delete. /// Indicates whether the item should be synced online. /// The priority. Objects with higher priority will be synced first. Higher number indicates higher priority. - public static void Delete(this RealtimeDatabase db, string key, Expression>> propertyExpression, string dictionaryKey, bool syncOnline = true, int priority = 1) - where T: class + public static void Delete(this RealtimeDatabase db, string key, + Expression>> propertyExpression, string dictionaryKey, + bool syncOnline = true, int priority = 1) + where T : class { - var expression = Expression.Lambda>(Expression.Call(propertyExpression.Body, typeof(IDictionary).GetRuntimeMethod("get_Item", new[] { typeof(string) }), Expression.Constant(dictionaryKey)), propertyExpression.Parameters); + var expression = Expression.Lambda>( + Expression.Call(propertyExpression.Body, + typeof(IDictionary).GetRuntimeMethod("get_Item", new[] {typeof(string)}), + Expression.Constant(dictionaryKey)), propertyExpression.Parameters); db.Set(key, expression, null, syncOnline ? SyncOptions.Put : SyncOptions.None, priority); } } -} +} \ No newline at end of file diff --git a/FireBase/Offline/ISetHandler.cs b/FireBase/Offline/ISetHandler.cs index 477c36b..e3b49b5 100644 --- a/FireBase/Offline/ISetHandler.cs +++ b/FireBase/Offline/ISetHandler.cs @@ -1,11 +1,10 @@ namespace Firebase.Database.Offline { - using Firebase.Database.Query; - + using Query; using System.Threading.Tasks; public interface ISetHandler { Task SetAsync(ChildQuery query, string key, OfflineEntry entry); } -} +} \ No newline at end of file diff --git a/FireBase/Offline/InitialPullStrategy.cs b/FireBase/Offline/InitialPullStrategy.cs index 70f6b8c..a1ae3f7 100644 --- a/FireBase/Offline/InitialPullStrategy.cs +++ b/FireBase/Offline/InitialPullStrategy.cs @@ -8,7 +8,7 @@ /// /// Don't pull anything. /// - None, + None, /// /// Pull only what isn't already stored offline. @@ -20,4 +20,4 @@ /// Everything, } -} +} \ No newline at end of file diff --git a/FireBase/Offline/Internals/MemberAccessVisitor.cs b/FireBase/Offline/Internals/MemberAccessVisitor.cs index 1f7cb11..2bc0fc3 100644 --- a/FireBase/Offline/Internals/MemberAccessVisitor.cs +++ b/FireBase/Offline/Internals/MemberAccessVisitor.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.Linq.Expressions; using System.Reflection; - using Newtonsoft.Json; public class MemberAccessVisitor : ExpressionVisitor @@ -12,7 +11,7 @@ private bool wasDictionaryAccess; - public IEnumerable PropertyNames => this.propertyNames; + public IEnumerable PropertyNames => propertyNames; public MemberAccessVisitor() { @@ -22,30 +21,30 @@ { if (expr?.NodeType == ExpressionType.MemberAccess) { - if (this.wasDictionaryAccess) + if (wasDictionaryAccess) { - this.wasDictionaryAccess = false; + wasDictionaryAccess = false; } else { - var memberExpr = (MemberExpression)expr; + var memberExpr = (MemberExpression) expr; var jsonAttr = memberExpr.Member.GetCustomAttribute(); - this.propertyNames.Add(jsonAttr?.PropertyName ?? memberExpr.Member.Name); + propertyNames.Add(jsonAttr?.PropertyName ?? memberExpr.Member.Name); } } else if (expr?.NodeType == ExpressionType.Call) { - var callExpr = (MethodCallExpression)expr; + var callExpr = (MethodCallExpression) expr; if (callExpr.Method.Name == "get_Item" && callExpr.Arguments.Count == 1) { var e = Expression.Lambda(callExpr.Arguments[0]).Compile(); - this.propertyNames.Add(e.DynamicInvoke().ToString()); - this.wasDictionaryAccess = callExpr.Arguments[0].NodeType == ExpressionType.MemberAccess; + propertyNames.Add(e.DynamicInvoke().ToString()); + wasDictionaryAccess = callExpr.Arguments[0].NodeType == ExpressionType.MemberAccess; } } return base.Visit(expr); } } -} +} \ No newline at end of file diff --git a/FireBase/Offline/OfflineCacheAdapter.cs b/FireBase/Offline/OfflineCacheAdapter.cs index a3761a0..0918a8c 100644 --- a/FireBase/Offline/OfflineCacheAdapter.cs +++ b/FireBase/Offline/OfflineCacheAdapter.cs @@ -5,7 +5,7 @@ using System.Collections.Generic; using System.Linq; - internal class OfflineCacheAdapter : IDictionary, IDictionary + internal class OfflineCacheAdapter : IDictionary, IDictionary { private readonly IDictionary database; @@ -19,66 +19,53 @@ throw new NotImplementedException(); } - public int Count => this.database.Count; + public int Count => database.Count; public bool IsSynchronized { get; } public object SyncRoot { get; } - public bool IsReadOnly => this.database.IsReadOnly; + public bool IsReadOnly => database.IsReadOnly; object IDictionary.this[object key] { - get - { - return this.database[key.ToString()].Deserialize(); - } + get => database[key.ToString()].Deserialize(); set { var keyString = key.ToString(); - if (this.database.ContainsKey(keyString)) - { - this.database[keyString] = new OfflineEntry(keyString, value, this.database[keyString].Priority, this.database[keyString].SyncOptions); - } + if (database.ContainsKey(keyString)) + database[keyString] = new OfflineEntry(keyString, value, database[keyString].Priority, + database[keyString].SyncOptions); else - { - this.database[keyString] = new OfflineEntry(keyString, value, 1, SyncOptions.None); - } + database[keyString] = new OfflineEntry(keyString, value, 1, SyncOptions.None); } } - public ICollection Keys => this.database.Keys; + public ICollection Keys => database.Keys; ICollection IDictionary.Values { get; } ICollection IDictionary.Keys { get; } - public ICollection Values => this.database.Values.Select(o => o.Deserialize()).ToList(); + public ICollection Values => database.Values.Select(o => o.Deserialize()).ToList(); public T this[string key] { - get - { - return this.database[key].Deserialize(); - } + get => database[key].Deserialize(); set { - if (this.database.ContainsKey(key)) - { - this.database[key] = new OfflineEntry(key, value, this.database[key].Priority, this.database[key].SyncOptions); - } + if (database.ContainsKey(key)) + database[key] = new OfflineEntry(key, value, database[key].Priority, database[key].SyncOptions); else - { - this.database[key] = new OfflineEntry(key, value, 1, SyncOptions.None); - } + database[key] = new OfflineEntry(key, value, 1, SyncOptions.None); } } public bool Contains(object key) { - return this.ContainsKey(key.ToString()); + return ContainsKey(key.ToString()); } IDictionaryEnumerator IDictionary.GetEnumerator() @@ -88,39 +75,39 @@ public void Remove(object key) { - this.Remove(key.ToString()); + Remove(key.ToString()); } public bool IsFixedSize => false; public IEnumerator> GetEnumerator() { - return this.database.Select(d => new KeyValuePair(d.Key, d.Value.Deserialize())).GetEnumerator(); + return database.Select(d => new KeyValuePair(d.Key, d.Value.Deserialize())).GetEnumerator(); } IEnumerator IEnumerable.GetEnumerator() { - return this.GetEnumerator(); + return GetEnumerator(); } public void Add(KeyValuePair item) { - this.Add(item.Key, item.Value); + Add(item.Key, item.Value); } public void Add(object key, object value) { - this.Add(key.ToString(), (T)value); + Add(key.ToString(), (T) value); } public void Clear() { - this.database.Clear(); + database.Clear(); } public bool Contains(KeyValuePair item) { - return this.ContainsKey(item.Key); + return ContainsKey(item.Key); } public void CopyTo(KeyValuePair[] array, int arrayIndex) @@ -130,29 +117,29 @@ public bool Remove(KeyValuePair item) { - return this.database.Remove(item.Key); + return database.Remove(item.Key); } public void Add(string key, T value) { - this.database.Add(key, new OfflineEntry(key, value, 1, SyncOptions.None)); + database.Add(key, new OfflineEntry(key, value, 1, SyncOptions.None)); } public bool ContainsKey(string key) { - return this.database.ContainsKey(key); + return database.ContainsKey(key); } public bool Remove(string key) { - return this.database.Remove(key); + return database.Remove(key); } public bool TryGetValue(string key, out T value) { OfflineEntry val; - if (this.database.TryGetValue(key, out val)) + if (database.TryGetValue(key, out val)) { value = val.Deserialize(); return true; @@ -162,4 +149,4 @@ return false; } } -} +} \ No newline at end of file diff --git a/FireBase/Offline/OfflineDatabase.cs b/FireBase/Offline/OfflineDatabase.cs index 9cebf9c..3e6e7d8 100644 --- a/FireBase/Offline/OfflineDatabase.cs +++ b/FireBase/Offline/OfflineDatabase.cs @@ -5,7 +5,6 @@ using System.Collections.Generic; using System.IO; using System.Linq; - using LiteDB; /// @@ -23,21 +22,18 @@ /// Custom string which will get appended to the file name. public OfflineDatabase(Type itemType, string filenameModifier) { - var fullName = this.GetFileName(itemType.ToString()); - if(fullName.Length > 100) - { - fullName = fullName.Substring(0, 100); - } + var fullName = GetFileName(itemType.ToString()); + if (fullName.Length > 100) fullName = fullName.Substring(0, 100); - BsonMapper mapper = BsonMapper.Global; + var mapper = BsonMapper.Global; mapper.Entity().Id(o => o.Key); - string root = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData); - string filename = fullName + filenameModifier + ".db"; + var root = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData); + var filename = fullName + filenameModifier + ".db"; var path = Path.Combine(root, filename); - this.db = new LiteRepository(new LiteDatabase(path, mapper)); + db = new LiteRepository(new LiteDatabase(path, mapper)); - this.cache = db.Database.GetCollection().FindAll() + cache = db.Database.GetCollection().FindAll() .ToDictionary(o => o.Key, o => o); } @@ -45,24 +41,24 @@ /// Gets the number of elements contained in the . /// /// The number of elements contained in the . - public int Count => this.cache.Count; + public int Count => cache.Count; /// /// Gets a value indicating whether this is a read-only collection. /// - public bool IsReadOnly => this.cache.IsReadOnly; + public bool IsReadOnly => cache.IsReadOnly; /// /// Gets an containing the keys of the . /// /// An containing the keys of the object that implements . - public ICollection Keys => this.cache.Keys; + public ICollection Keys => cache.Keys; /// /// Gets an containing the values in the . /// /// An containing the values in the object that implements . - public ICollection Values => this.cache.Values; + public ICollection Values => cache.Values; /// /// Gets or sets the element with the specified key. @@ -71,15 +67,12 @@ /// The element with the specified key. public OfflineEntry this[string key] { - get - { - return this.cache[key]; - } + get => cache[key]; set { - this.cache[key] = value; - this.db.Upsert(value); + cache[key] = value; + db.Upsert(value); } } @@ -89,12 +82,12 @@ /// An enumerator that can be used to iterate through the collection. public IEnumerator> GetEnumerator() { - return this.cache.GetEnumerator(); + return cache.GetEnumerator(); } IEnumerator IEnumerable.GetEnumerator() { - return this.GetEnumerator(); + return GetEnumerator(); } /// @@ -103,7 +96,7 @@ /// The object to add to the . public void Add(KeyValuePair item) { - this.Add(item.Key, item.Value); + Add(item.Key, item.Value); } /// @@ -111,8 +104,8 @@ /// public void Clear() { - this.cache.Clear(); - this.db.Delete(Query.All()); + cache.Clear(); + db.Delete(Query.All()); } /// @@ -122,7 +115,7 @@ /// True if is found in the ; otherwise, false. public bool Contains(KeyValuePair item) { - return this.ContainsKey(item.Key); + return ContainsKey(item.Key); } /// @@ -132,7 +125,7 @@ /// The zero-based index in at which copying begins. public void CopyTo(KeyValuePair[] array, int arrayIndex) { - this.cache.CopyTo(array, arrayIndex); + cache.CopyTo(array, arrayIndex); } /// @@ -142,7 +135,7 @@ /// True if was successfully removed from the ; otherwise, false. This method also returns false if is not found in the original . public bool Remove(KeyValuePair item) { - return this.Remove(item.Key); + return Remove(item.Key); } /// @@ -152,7 +145,7 @@ /// True if the contains an element with the key; otherwise, false. public bool ContainsKey(string key) { - return this.cache.ContainsKey(key); + return cache.ContainsKey(key); } /// @@ -162,8 +155,8 @@ /// The object to use as the value of the element to add. public void Add(string key, OfflineEntry value) { - this.cache.Add(key, value); - this.db.Insert(value); + cache.Add(key, value); + db.Insert(value); } /// @@ -173,8 +166,8 @@ /// True if the element is successfully removed; otherwise, false. This method also returns false if was not found in the original . public bool Remove(string key) { - this.cache.Remove(key); - return this.db.Delete(key); + cache.Remove(key); + return db.Delete(key); } /// @@ -184,18 +177,16 @@ /// True if the object that implements contains an element with the specified key; otherwise, false. public bool TryGetValue(string key, out OfflineEntry value) { - return this.cache.TryGetValue(key, out value); + return cache.TryGetValue(key, out value); } private string GetFileName(string fileName) { - var invalidChars = new[] { '`', '[', ',', '=' }; - foreach(char c in invalidChars.Concat(System.IO.Path.GetInvalidFileNameChars()).Distinct()) - { + var invalidChars = new[] {'`', '[', ',', '='}; + foreach (var c in invalidChars.Concat(Path.GetInvalidFileNameChars()).Distinct()) fileName = fileName.Replace(c, '_'); - } return fileName; } } -} +} \ No newline at end of file diff --git a/FireBase/Offline/OfflineEntry.cs b/FireBase/Offline/OfflineEntry.cs index 3b862cb..dfd5910 100644 --- a/FireBase/Offline/OfflineEntry.cs +++ b/FireBase/Offline/OfflineEntry.cs @@ -1,7 +1,6 @@ namespace Firebase.Database.Offline { using System; - using Newtonsoft.Json; /// @@ -18,16 +17,17 @@ /// The object. /// The priority. Objects with higher priority will be synced first. Higher number indicates higher priority. /// The sync options. - public OfflineEntry(string key, object obj, string data, int priority, SyncOptions syncOptions, bool isPartial = false) + public OfflineEntry(string key, object obj, string data, int priority, SyncOptions syncOptions, + bool isPartial = false) { - this.Key = key; - this.Priority = priority; - this.Data = data; - this.Timestamp = DateTime.UtcNow; - this.SyncOptions = syncOptions; - this.IsPartial = isPartial; + Key = key; + Priority = priority; + Data = data; + Timestamp = DateTime.UtcNow; + SyncOptions = syncOptions; + IsPartial = isPartial; - this.dataInstance = obj; + dataInstance = obj; } /// @@ -45,63 +45,39 @@ /// /// Initializes a new instance of the class. /// - public OfflineEntry() + public OfflineEntry() { } /// /// Gets or sets the key of this entry. /// - public string Key - { - get; - set; - } + public string Key { get; set; } /// /// Gets or sets the priority. Objects with higher priority will be synced first. Higher number indicates higher priority. /// - public int Priority - { - get; - set; - } + public int Priority { get; set; } /// /// Gets or sets the timestamp when this entry was last touched. /// - public DateTime Timestamp - { - get; - set; - } + public DateTime Timestamp { get; set; } /// /// Gets or sets the which define what sync state this entry is in. /// - public SyncOptions SyncOptions - { - get; - set; - } + public SyncOptions SyncOptions { get; set; } /// /// Gets or sets serialized JSON data. /// - public string Data - { - get; - set; - } + public string Data { get; set; } /// /// Specifies whether this is only a partial object. /// - public bool IsPartial - { - get; - set; - } + public bool IsPartial { get; set; } /// /// Deserializes into . The result is cached. @@ -110,7 +86,7 @@ /// Instance of . public T Deserialize() { - return (T)(this.dataInstance ?? (this.dataInstance = JsonConvert.DeserializeObject(this.Data))); + return (T) (dataInstance ?? (dataInstance = JsonConvert.DeserializeObject(Data))); } } -} +} \ No newline at end of file diff --git a/FireBase/Offline/RealtimeDatabase.cs b/FireBase/Offline/RealtimeDatabase.cs index 61a7010..4d61027 100644 --- a/FireBase/Offline/RealtimeDatabase.cs +++ b/FireBase/Offline/RealtimeDatabase.cs @@ -7,10 +7,9 @@ using System.Reactive.Subjects; using System.Threading; using System.Threading.Tasks; - - using Firebase.Database.Extensions; - using Firebase.Database.Query; - using Firebase.Database.Streaming; + using Extensions; + using Query; + using Streaming; using System.Reactive.Threading.Tasks; using System.Linq.Expressions; using Internals; @@ -46,21 +45,25 @@ /// Specifies whether changes should be streamed from the server. /// Specifies if everything should be pull from the online storage on start. It only makes sense when is set to true. /// Specifies whether changed items should actually be pushed to the server. If this is false, then Put / Post / Delete will not affect server data. - public RealtimeDatabase(ChildQuery childQuery, string elementRoot, Func> offlineDatabaseFactory, string filenameModifier, StreamingOptions streamingOptions, InitialPullStrategy initialPullStrategy, bool pushChanges, ISetHandler setHandler = null) + public RealtimeDatabase(ChildQuery childQuery, string elementRoot, + Func> offlineDatabaseFactory, string filenameModifier, + StreamingOptions streamingOptions, InitialPullStrategy initialPullStrategy, bool pushChanges, + ISetHandler setHandler = null) { this.childQuery = childQuery; this.elementRoot = elementRoot; this.streamingOptions = streamingOptions; this.initialPullStrategy = initialPullStrategy; this.pushChanges = pushChanges; - this.Database = offlineDatabaseFactory(typeof(T), filenameModifier); - this.firebaseCache = new FirebaseCache(new OfflineCacheAdapter(this.Database)); - this.subject = new Subject>(); + Database = offlineDatabaseFactory(typeof(T), filenameModifier); + firebaseCache = new FirebaseCache(new OfflineCacheAdapter(Database)); + subject = new Subject>(); - this.PutHandler = setHandler ?? new SetHandler(); + PutHandler = setHandler ?? new SetHandler(); - this.isSyncRunning = true; - Task.Factory.StartNew(this.SynchronizeThread, CancellationToken.None, TaskCreationOptions.LongRunning, TaskScheduler.Default); + isSyncRunning = true; + Task.Factory.StartNew(SynchronizeThread, CancellationToken.None, TaskCreationOptions.LongRunning, + TaskScheduler.Default); } /// @@ -71,17 +74,9 @@ /// /// Gets the backing Database. /// - public IDictionary Database - { - get; - private set; - } + public IDictionary Database { get; private set; } - public ISetHandler PutHandler - { - private get; - set; - } + public ISetHandler PutHandler { private get; set; } /// /// Overwrites existing object with given key. @@ -92,35 +87,34 @@ /// The priority. Objects with higher priority will be synced first. Higher number indicates higher priority. public void Set(string key, T obj, SyncOptions syncOptions, int priority = 1) { - this.SetAndRaise(key, new OfflineEntry(key, obj, priority, syncOptions)); + SetAndRaise(key, new OfflineEntry(key, obj, priority, syncOptions)); } - public void Set(string key, Expression> propertyExpression, object value, SyncOptions syncOptions, int priority = 1) + public void Set(string key, Expression> propertyExpression, object value, + SyncOptions syncOptions, int priority = 1) { - var fullKey = this.GenerateFullKey(key, propertyExpression, syncOptions); + var fullKey = GenerateFullKey(key, propertyExpression, syncOptions); var serializedObject = JsonConvert.SerializeObject(value).Trim('"', '\\'); if (fullKey.Item3) { if (typeof(TProperty) != typeof(string) || value == null) - { // don't escape non-string primitives and null; serializedObject = $"{{ \"{fullKey.Item2}\" : {serializedObject} }}"; - } else - { serializedObject = $"{{ \"{fullKey.Item2}\" : \"{serializedObject}\" }}"; - } } - var setObject = this.firebaseCache.PushData("/" + fullKey.Item1, serializedObject).First(); + var setObject = firebaseCache.PushData("/" + fullKey.Item1, serializedObject).First(); - if (!this.Database.ContainsKey(key) || this.Database[key].SyncOptions != SyncOptions.Patch && this.Database[key].SyncOptions != SyncOptions.Put) - { - this.Database[fullKey.Item1] = new OfflineEntry(fullKey.Item1, value, serializedObject, priority, syncOptions, true); - } + if (!Database.ContainsKey(key) || Database[key].SyncOptions != SyncOptions.Patch && + Database[key].SyncOptions != SyncOptions.Put) + Database[fullKey.Item1] = + new OfflineEntry(fullKey.Item1, value, serializedObject, priority, syncOptions, true); - this.subject.OnNext(new FirebaseEvent(key, setObject.Object, setObject == null ? FirebaseEventType.Delete : FirebaseEventType.InsertOrUpdate, FirebaseEventSource.Offline)); + subject.OnNext(new FirebaseEvent(key, setObject.Object, + setObject == null ? FirebaseEventType.Delete : FirebaseEventType.InsertOrUpdate, + FirebaseEventSource.Offline)); } /// @@ -130,15 +124,11 @@ /// The priority. Objects with higher priority will be synced first. Higher number indicates higher priority. public void Pull(string key, int priority = 1) { - if (!this.Database.ContainsKey(key)) - { - this.Database[key] = new OfflineEntry(key, null, priority, SyncOptions.Pull); - } - else if (this.Database[key].SyncOptions == SyncOptions.None) - { + if (!Database.ContainsKey(key)) + Database[key] = new OfflineEntry(key, null, priority, SyncOptions.Pull); + else if (Database[key].SyncOptions == SyncOptions.None) // pull only if push isn't pending - this.Database[key].SyncOptions = SyncOptions.Pull; - } + Database[key].SyncOptions = SyncOptions.Pull; } /// @@ -146,26 +136,30 @@ /// public async Task PullAsync() { - var existingEntries = await this.childQuery + var existingEntries = await childQuery .OnceAsync() .ToObservable() .RetryAfterDelay>, FirebaseException>( - this.childQuery.Client.Options.SyncPeriod, - ex => ex.StatusCode == System.Net.HttpStatusCode.OK) // OK implies the request couldn't complete due to network error. - .Select(e => this.ResetDatabaseFromInitial(e, false)) + childQuery.Client.Options.SyncPeriod, + ex => ex.StatusCode == + System.Net.HttpStatusCode + .OK) // OK implies the request couldn't complete due to network error. + .Select(e => ResetDatabaseFromInitial(e, false)) .SelectMany(e => e) - .Do(e => + .Do(e => { - this.Database[e.Key] = new OfflineEntry(e.Key, e.Object, 1, SyncOptions.None); - this.subject.OnNext(new FirebaseEvent(e.Key, e.Object, FirebaseEventType.InsertOrUpdate, FirebaseEventSource.OnlinePull)); + Database[e.Key] = new OfflineEntry(e.Key, e.Object, 1, SyncOptions.None); + subject.OnNext(new FirebaseEvent(e.Key, e.Object, FirebaseEventType.InsertOrUpdate, + FirebaseEventSource.OnlinePull)); }) .ToList(); // Remove items not stored online - foreach (var item in this.Database.Keys.Except(existingEntries.Select(f => f.Key)).ToList()) + foreach (var item in Database.Keys.Except(existingEntries.Select(f => f.Key)).ToList()) { - this.Database.Remove(item); - this.subject.OnNext(new FirebaseEvent(item, null, FirebaseEventType.Delete, FirebaseEventSource.OnlinePull)); + Database.Remove(item); + subject.OnNext(new FirebaseEvent(item, null, FirebaseEventType.Delete, + FirebaseEventSource.OnlinePull)); } } @@ -174,7 +168,7 @@ /// public IEnumerable> Once() { - return this.Database + return Database .Where(kvp => !string.IsNullOrEmpty(kvp.Value.Data) && kvp.Value.Data != "null" && !kvp.Value.IsPartial) .Select(kvp => new FirebaseObject(kvp.Key, kvp.Value.Deserialize())) .ToList(); @@ -186,67 +180,72 @@ /// Stream of . public IObservable> AsObservable() { - if (!this.isSyncRunning) + if (!isSyncRunning) { - this.isSyncRunning = true; - Task.Factory.StartNew(this.SynchronizeThread, CancellationToken.None, TaskCreationOptions.LongRunning, TaskScheduler.Default); + isSyncRunning = true; + Task.Factory.StartNew(SynchronizeThread, CancellationToken.None, TaskCreationOptions.LongRunning, + TaskScheduler.Default); } - if (this.observable == null) + if (observable == null) { var initialData = Observable.Return(FirebaseEvent.Empty(FirebaseEventSource.Offline)); - if(this.Database.TryGetValue(this.elementRoot, out OfflineEntry oe)) - { + if (Database.TryGetValue(elementRoot, out var oe)) initialData = Observable.Return(oe) - .Where(offlineEntry => !string.IsNullOrEmpty(offlineEntry.Data) && offlineEntry.Data != "null" && !offlineEntry.IsPartial) - .Select(offlineEntry => new FirebaseEvent(offlineEntry.Key, offlineEntry.Deserialize(), FirebaseEventType.InsertOrUpdate, FirebaseEventSource.Offline)); - } - else if(this.Database.Count > 0) - { - initialData = this.Database - .Where(kvp => !string.IsNullOrEmpty(kvp.Value.Data) && kvp.Value.Data != "null" && !kvp.Value.IsPartial) - .Select(kvp => new FirebaseEvent(kvp.Key, kvp.Value.Deserialize(), FirebaseEventType.InsertOrUpdate, FirebaseEventSource.Offline)) + .Where(offlineEntry => + !string.IsNullOrEmpty(offlineEntry.Data) && offlineEntry.Data != "null" && + !offlineEntry.IsPartial) + .Select(offlineEntry => new FirebaseEvent(offlineEntry.Key, offlineEntry.Deserialize(), + FirebaseEventType.InsertOrUpdate, FirebaseEventSource.Offline)); + else if (Database.Count > 0) + initialData = Database + .Where(kvp => + !string.IsNullOrEmpty(kvp.Value.Data) && kvp.Value.Data != "null" && !kvp.Value.IsPartial) + .Select(kvp => new FirebaseEvent(kvp.Key, kvp.Value.Deserialize(), + FirebaseEventType.InsertOrUpdate, FirebaseEventSource.Offline)) .ToList() .ToObservable(); - } - this.observable = initialData - .Merge(this.subject) - .Merge(this.GetInitialPullObservable() - .RetryAfterDelay>, FirebaseException>( - this.childQuery.Client.Options.SyncPeriod, - ex => ex.StatusCode == System.Net.HttpStatusCode.OK) // OK implies the request couldn't complete due to network error. - .Select(e => this.ResetDatabaseFromInitial(e)) - .SelectMany(e => e) - .Do(this.SetObjectFromInitialPull) - .Select(e => new FirebaseEvent(e.Key, e.Object, e.Object == null ? FirebaseEventType.Delete : FirebaseEventType.InsertOrUpdate, FirebaseEventSource.OnlineInitial)) - .Concat(Observable.Create>(observer => this.InitializeStreamingSubscription(observer)))) - .Do(next => { }, e => this.observable = null, () => this.observable = null) + observable = initialData + .Merge(subject) + .Merge(GetInitialPullObservable() + .RetryAfterDelay>, FirebaseException>( + childQuery.Client.Options.SyncPeriod, + ex => ex.StatusCode == + System.Net.HttpStatusCode + .OK) // OK implies the request couldn't complete due to network error. + .Select(e => ResetDatabaseFromInitial(e)) + .SelectMany(e => e) + .Do(SetObjectFromInitialPull) + .Select(e => new FirebaseEvent(e.Key, e.Object, + e.Object == null ? FirebaseEventType.Delete : FirebaseEventType.InsertOrUpdate, + FirebaseEventSource.OnlineInitial)) + .Concat(Observable.Create>(observer => + InitializeStreamingSubscription(observer)))) + .Do(next => { }, e => observable = null, () => observable = null) .Replay() .RefCount(); } - return this.observable; + return observable; } public void Dispose() { - this.subject.OnCompleted(); - this.firebaseSubscription?.Dispose(); + subject.OnCompleted(); + firebaseSubscription?.Dispose(); } - private IReadOnlyCollection> ResetDatabaseFromInitial(IReadOnlyCollection> collection, bool onlyWhenInitialEverything = true) + private IReadOnlyCollection> ResetDatabaseFromInitial( + IReadOnlyCollection> collection, bool onlyWhenInitialEverything = true) { - if (onlyWhenInitialEverything && this.initialPullStrategy != InitialPullStrategy.Everything) - { - return collection; - } + if (onlyWhenInitialEverything && initialPullStrategy != InitialPullStrategy.Everything) return collection; // items which are in local db, but not in the online collection - var extra = this.Once() - .Select(f => f.Key) - .Except(collection.Select(c => c.Key)) - .Select(k => new FirebaseObject(k, null)); + var extra = Once() + .Select(f => f.Key) + .Except(collection.Select(c => c.Key)) + .Select(k => new FirebaseObject(k, null)); return collection.Concat(extra).ToList(); } @@ -257,57 +256,58 @@ // and the InitialPullStrategy != Everything // this attempts to deal with scenario when you are offline, have local changes and go online // in this case having the InitialPullStrategy set to everything would basically purge all local changes - if (!this.Database.ContainsKey(e.Key) || this.Database[e.Key].SyncOptions == SyncOptions.None || this.Database[e.Key].SyncOptions == SyncOptions.Pull || this.initialPullStrategy != InitialPullStrategy.Everything) - { - this.Database[e.Key] = new OfflineEntry(e.Key, e.Object, 1, SyncOptions.None); - } + if (!Database.ContainsKey(e.Key) || Database[e.Key].SyncOptions == SyncOptions.None || + Database[e.Key].SyncOptions == SyncOptions.Pull || + initialPullStrategy != InitialPullStrategy.Everything) + Database[e.Key] = new OfflineEntry(e.Key, e.Object, 1, SyncOptions.None); } private IObservable>> GetInitialPullObservable() { FirebaseQuery query; - switch (this.initialPullStrategy) + switch (initialPullStrategy) { case InitialPullStrategy.MissingOnly: - query = this.childQuery.OrderByKey().StartAt(() => this.GetLatestKey()); + query = childQuery.OrderByKey().StartAt(() => GetLatestKey()); break; case InitialPullStrategy.Everything: - query = this.childQuery; + query = childQuery; break; case InitialPullStrategy.None: default: return Observable.Empty>>(); } - if (string.IsNullOrWhiteSpace(this.elementRoot)) - { + if (string.IsNullOrWhiteSpace(elementRoot)) return Observable.Defer(() => query.OnceAsync().ToObservable()); - } - + // there is an element root, which indicates the target location is not a collection but a single element - return Observable.Defer(async () => Observable.Return(await query.OnceSingleAsync()).Select(e => new[] { new FirebaseObject(this.elementRoot, e) })); + return Observable.Defer(async () => + Observable.Return(await query.OnceSingleAsync()) + .Select(e => new[] {new FirebaseObject(elementRoot, e)})); } private IDisposable InitializeStreamingSubscription(IObserver> observer) { - var completeDisposable = Disposable.Create(() => this.isSyncRunning = false); + var completeDisposable = Disposable.Create(() => isSyncRunning = false); - switch (this.streamingOptions) + switch (streamingOptions) { case StreamingOptions.LatestOnly: // stream since the latest key - var queryLatest = this.childQuery.OrderByKey().StartAt(() => this.GetLatestKey()); - this.firebaseSubscription = new FirebaseSubscription(observer, queryLatest, this.elementRoot, this.firebaseCache); - this.firebaseSubscription.ExceptionThrown += this.StreamingExceptionThrown; + var queryLatest = childQuery.OrderByKey().StartAt(() => GetLatestKey()); + firebaseSubscription = + new FirebaseSubscription(observer, queryLatest, elementRoot, firebaseCache); + firebaseSubscription.ExceptionThrown += StreamingExceptionThrown; - return new CompositeDisposable(this.firebaseSubscription.Run(), completeDisposable); + return new CompositeDisposable(firebaseSubscription.Run(), completeDisposable); case StreamingOptions.Everything: // stream everything - var queryAll = this.childQuery; - this.firebaseSubscription = new FirebaseSubscription(observer, queryAll, this.elementRoot, this.firebaseCache); - this.firebaseSubscription.ExceptionThrown += this.StreamingExceptionThrown; + var queryAll = childQuery; + firebaseSubscription = new FirebaseSubscription(observer, queryAll, elementRoot, firebaseCache); + firebaseSubscription.ExceptionThrown += StreamingExceptionThrown; - return new CompositeDisposable(this.firebaseSubscription.Run(), completeDisposable); + return new CompositeDisposable(firebaseSubscription.Run(), completeDisposable); default: break; } @@ -315,43 +315,44 @@ return completeDisposable; } - private void SetAndRaise(string key, OfflineEntry obj, FirebaseEventSource eventSource = FirebaseEventSource.Offline) + private void SetAndRaise(string key, OfflineEntry obj, + FirebaseEventSource eventSource = FirebaseEventSource.Offline) { - this.Database[key] = obj; - this.subject.OnNext(new FirebaseEvent(key, obj?.Deserialize(), string.IsNullOrEmpty(obj?.Data) || obj?.Data == "null" ? FirebaseEventType.Delete : FirebaseEventType.InsertOrUpdate, eventSource)); + Database[key] = obj; + subject.OnNext(new FirebaseEvent(key, obj?.Deserialize(), + string.IsNullOrEmpty(obj?.Data) || obj?.Data == "null" + ? FirebaseEventType.Delete + : FirebaseEventType.InsertOrUpdate, eventSource)); } private async void SynchronizeThread() { - while (this.isSyncRunning) + while (isSyncRunning) { try { - var validEntries = this.Database.Where(e => e.Value != null); - await this.PullEntriesAsync(validEntries.Where(kvp => kvp.Value.SyncOptions == SyncOptions.Pull)); + var validEntries = Database.Where(e => e.Value != null); + await PullEntriesAsync(validEntries.Where(kvp => kvp.Value.SyncOptions == SyncOptions.Pull)); - if (this.pushChanges) - { - await this.PushEntriesAsync(validEntries.Where(kvp => kvp.Value.SyncOptions == SyncOptions.Put || kvp.Value.SyncOptions == SyncOptions.Patch)); - } + if (pushChanges) + await PushEntriesAsync(validEntries.Where(kvp => + kvp.Value.SyncOptions == SyncOptions.Put || kvp.Value.SyncOptions == SyncOptions.Patch)); } catch (Exception ex) { - this.SyncExceptionThrown?.Invoke(this, new ExceptionEventArgs(ex)); + SyncExceptionThrown?.Invoke(this, new ExceptionEventArgs(ex)); } - await Task.Delay(this.childQuery.Client.Options.SyncPeriod); + await Task.Delay(childQuery.Client.Options.SyncPeriod); } } private string GetLatestKey() { - var key = this.Database.OrderBy(o => o.Key, StringComparer.Ordinal).LastOrDefault().Key ?? string.Empty; + var key = Database.OrderBy(o => o.Key, StringComparer.Ordinal).LastOrDefault().Key ?? string.Empty; if (!string.IsNullOrWhiteSpace(key)) - { - key = key.Substring(0, key.Length - 1) + (char)(key[key.Length - 1] + 1); - } + key = key.Substring(0, key.Length - 1) + (char) (key[key.Length - 1] + 1); return key; } @@ -362,10 +363,11 @@ foreach (var group in groups) { - var tasks = group.OrderBy(kvp => kvp.Value.IsPartial).Select(kvp => - kvp.Value.IsPartial ? - this.ResetSyncAfterPush(this.PutHandler.SetAsync(this.childQuery, kvp.Key, kvp.Value), kvp.Key) : - this.ResetSyncAfterPush(this.PutHandler.SetAsync(this.childQuery, kvp.Key, kvp.Value), kvp.Key, kvp.Value.Deserialize())); + var tasks = group.OrderBy(kvp => kvp.Value.IsPartial).Select(kvp => + kvp.Value.IsPartial + ? ResetSyncAfterPush(PutHandler.SetAsync(childQuery, kvp.Key, kvp.Value), kvp.Key) + : ResetSyncAfterPush(PutHandler.SetAsync(childQuery, kvp.Key, kvp.Value), kvp.Key, + kvp.Value.Deserialize())); try { @@ -373,7 +375,7 @@ } catch (Exception ex) { - this.SyncExceptionThrown?.Invoke(this, new ExceptionEventArgs(ex)); + SyncExceptionThrown?.Invoke(this, new ExceptionEventArgs(ex)); } } } @@ -384,15 +386,18 @@ foreach (var group in taskGroups) { - var tasks = group.Select(pair => this.ResetAfterPull(this.childQuery.Child(pair.Key == this.elementRoot ? string.Empty : pair.Key).OnceSingleAsync(), pair.Key, pair.Value)); + var tasks = group.Select(pair => + ResetAfterPull( + childQuery.Child(pair.Key == elementRoot ? string.Empty : pair.Key).OnceSingleAsync(), + pair.Key, pair.Value)); try - { + { await Task.WhenAll(tasks).WithAggregateException(); } catch (Exception ex) { - this.SyncExceptionThrown?.Invoke(this, new ExceptionEventArgs(ex)); + SyncExceptionThrown?.Invoke(this, new ExceptionEventArgs(ex)); } } } @@ -400,46 +405,48 @@ private async Task ResetAfterPull(Task task, string key, OfflineEntry entry) { await task; - this.SetAndRaise(key, new OfflineEntry(key, task.Result, entry.Priority, SyncOptions.None), FirebaseEventSource.OnlinePull); + SetAndRaise(key, new OfflineEntry(key, task.Result, entry.Priority, SyncOptions.None), + FirebaseEventSource.OnlinePull); } private async Task ResetSyncAfterPush(Task task, string key, T obj) { - await this.ResetSyncAfterPush(task, key); + await ResetSyncAfterPush(task, key); - if (this.streamingOptions == StreamingOptions.None) - { - this.subject.OnNext(new FirebaseEvent(key, obj, obj == null ? FirebaseEventType.Delete : FirebaseEventType.InsertOrUpdate, FirebaseEventSource.OnlinePush)); - } + if (streamingOptions == StreamingOptions.None) + subject.OnNext(new FirebaseEvent(key, obj, + obj == null ? FirebaseEventType.Delete : FirebaseEventType.InsertOrUpdate, + FirebaseEventSource.OnlinePush)); } private async Task ResetSyncAfterPush(Task task, string key) { await task; - this.ResetSyncOptions(key); + ResetSyncOptions(key); } private void ResetSyncOptions(string key) { - var item = this.Database[key]; + var item = Database[key]; if (item.IsPartial) { - this.Database.Remove(key); + Database.Remove(key); } else { item.SyncOptions = SyncOptions.None; - this.Database[key] = item; + Database[key] = item; } } private void StreamingExceptionThrown(object sender, ExceptionEventArgs e) { - this.SyncExceptionThrown?.Invoke(this, new ExceptionEventArgs(e.Exception)); + SyncExceptionThrown?.Invoke(this, new ExceptionEventArgs(e.Exception)); } - private Tuple GenerateFullKey(string key, Expression> propertyGetter, SyncOptions syncOptions) + private Tuple GenerateFullKey(string key, + Expression> propertyGetter, SyncOptions syncOptions) { var visitor = new MemberAccessVisitor(); visitor.Visit(propertyGetter); @@ -447,13 +454,14 @@ var prefix = key == string.Empty ? string.Empty : key + "/"; // primitive types - if (syncOptions == SyncOptions.Patch && (propertyType.IsPrimitive || Nullable.GetUnderlyingType(typeof(TProperty)) != null || typeof(TProperty) == typeof(string))) - { - return Tuple.Create(prefix + string.Join("/", visitor.PropertyNames.Skip(1).Reverse()), visitor.PropertyNames.First(), true); - } - - return Tuple.Create(prefix + string.Join("/", visitor.PropertyNames.Reverse()), visitor.PropertyNames.First(), false); + if (syncOptions == SyncOptions.Patch && (propertyType.IsPrimitive || + Nullable.GetUnderlyingType(typeof(TProperty)) != null || + typeof(TProperty) == typeof(string))) + return Tuple.Create(prefix + string.Join("/", visitor.PropertyNames.Skip(1).Reverse()), + visitor.PropertyNames.First(), true); + + return Tuple.Create(prefix + string.Join("/", visitor.PropertyNames.Reverse()), + visitor.PropertyNames.First(), false); } - } -} +} \ No newline at end of file diff --git a/FireBase/Offline/SetHandler.cs b/FireBase/Offline/SetHandler.cs index 1efa7b6..18a5131 100644 --- a/FireBase/Offline/SetHandler.cs +++ b/FireBase/Offline/SetHandler.cs @@ -1,7 +1,6 @@ namespace Firebase.Database.Offline { - using Firebase.Database.Query; - + using Query; using System.Threading.Tasks; public class SetHandler : ISetHandler @@ -11,14 +10,10 @@ using (var child = query.Child(key)) { if (entry.SyncOptions == SyncOptions.Put) - { await child.PutAsync(entry.Data); - } else - { await child.PatchAsync(entry.Data); - } } } } -} +} \ No newline at end of file diff --git a/FireBase/Offline/StreamingOptions.cs b/FireBase/Offline/StreamingOptions.cs index 9ed4e54..4a5f7b8 100644 --- a/FireBase/Offline/StreamingOptions.cs +++ b/FireBase/Offline/StreamingOptions.cs @@ -18,4 +18,4 @@ /// Everything } -} +} \ No newline at end of file diff --git a/FireBase/Offline/SyncOptions.cs b/FireBase/Offline/SyncOptions.cs index b2f382a..aa3e21c 100644 --- a/FireBase/Offline/SyncOptions.cs +++ b/FireBase/Offline/SyncOptions.cs @@ -25,4 +25,4 @@ /// Patch } -} +} \ No newline at end of file diff --git a/FireBase/Query/AuthQuery.cs b/FireBase/Query/AuthQuery.cs index 8a8d3e8..14beb7e 100644 --- a/FireBase/Query/AuthQuery.cs +++ b/FireBase/Query/AuthQuery.cs @@ -15,7 +15,8 @@ namespace Firebase.Database.Query /// The parent. /// The authentication token factory. /// The owner. - public AuthQuery(FirebaseQuery parent, Func tokenFactory, FirebaseClient client) : base(parent, () => client.Options.AsAccessToken ? "access_token" : "auth", client) + public AuthQuery(FirebaseQuery parent, Func tokenFactory, FirebaseClient client) : base(parent, + () => client.Options.AsAccessToken ? "access_token" : "auth", client) { this.tokenFactory = tokenFactory; } @@ -27,7 +28,7 @@ namespace Firebase.Database.Query /// The . protected override string BuildUrlParameter(FirebaseQuery child) { - return this.tokenFactory(); + return tokenFactory(); } } -} +} \ No newline at end of file diff --git a/FireBase/Query/ChildQuery.cs b/FireBase/Query/ChildQuery.cs index 1696ea8..510ae75 100644 --- a/FireBase/Query/ChildQuery.cs +++ b/FireBase/Query/ChildQuery.cs @@ -1,7 +1,7 @@ namespace Firebase.Database.Query { using System; - + /// /// Firebase query which references the child of current node. /// @@ -38,19 +38,13 @@ namespace Firebase.Database.Query /// The . protected override string BuildUrlSegment(FirebaseQuery child) { - var s = this.pathFactory(); + var s = pathFactory(); - if (s != string.Empty && !s.EndsWith("/")) - { - s += '/'; - } + if (s != string.Empty && !s.EndsWith("/")) s += '/'; - if (!(child is ChildQuery)) - { - return s + ".json"; - } + if (!(child is ChildQuery)) return s + ".json"; return s; } } -} +} \ No newline at end of file diff --git a/FireBase/Query/FilterQuery.cs b/FireBase/Query/FilterQuery.cs index f9f6271..be544c8 100644 --- a/FireBase/Query/FilterQuery.cs +++ b/FireBase/Query/FilterQuery.cs @@ -1,4 +1,4 @@ -namespace Firebase.Database.Query +namespace Firebase.Database.Query { using System; using System.Globalization; @@ -6,7 +6,7 @@ namespace Firebase.Database.Query /// /// Represents a firebase filtering query, e.g. "?LimitToLast=10". /// - public class FilterQuery : ParameterQuery + public class FilterQuery : ParameterQuery { private readonly Func valueFactory; private readonly Func doubleValueFactory; @@ -19,7 +19,8 @@ namespace Firebase.Database.Query /// The filter. /// The value for filter. /// The owning client. - public FilterQuery(FirebaseQuery parent, Func filterFactory, Func valueFactory, FirebaseClient client) + public FilterQuery(FirebaseQuery parent, Func filterFactory, Func valueFactory, + FirebaseClient client) : base(parent, filterFactory, client) { this.valueFactory = valueFactory; @@ -32,10 +33,11 @@ namespace Firebase.Database.Query /// The filter. /// The value for filter. /// The owning client. - public FilterQuery(FirebaseQuery parent, Func filterFactory, Func valueFactory, FirebaseClient client) + public FilterQuery(FirebaseQuery parent, Func filterFactory, Func valueFactory, + FirebaseClient client) : base(parent, filterFactory, client) { - this.doubleValueFactory = valueFactory; + doubleValueFactory = valueFactory; } /// @@ -45,10 +47,11 @@ namespace Firebase.Database.Query /// The filter. /// The value for filter. /// The owning client. - public FilterQuery(FirebaseQuery parent, Func filterFactory, Func valueFactory, FirebaseClient client) + public FilterQuery(FirebaseQuery parent, Func filterFactory, Func valueFactory, + FirebaseClient client) : base(parent, filterFactory, client) { - this.boolValueFactory = valueFactory; + boolValueFactory = valueFactory; } /// @@ -58,24 +61,21 @@ namespace Firebase.Database.Query /// Url parameter part of the resulting path. protected override string BuildUrlParameter(FirebaseQuery child) { - if (this.valueFactory != null) + if (valueFactory != null) { - if(this.valueFactory() == null) - { - return $"null"; - } - return $"\"{this.valueFactory()}\""; + if (valueFactory() == null) return $"null"; + return $"\"{valueFactory()}\""; } - else if (this.doubleValueFactory != null) + else if (doubleValueFactory != null) { - return this.doubleValueFactory().ToString(CultureInfo.InvariantCulture); + return doubleValueFactory().ToString(CultureInfo.InvariantCulture); } - else if (this.boolValueFactory != null) + else if (boolValueFactory != null) { - return $"{this.boolValueFactory().ToString().ToLower()}"; + return $"{boolValueFactory().ToString().ToLower()}"; } return string.Empty; } } -} +} \ No newline at end of file diff --git a/FireBase/Query/FirebaseQuery.cs b/FireBase/Query/FirebaseQuery.cs index 3513c85..5e09795 100644 --- a/FireBase/Query/FirebaseQuery.cs +++ b/FireBase/Query/FirebaseQuery.cs @@ -5,11 +5,9 @@ namespace Firebase.Database.Query using System.Net.Http; using System.Reactive.Linq; using System.Threading.Tasks; - - using Firebase.Database.Http; - using Firebase.Database.Offline; - using Firebase.Database.Streaming; - + using Http; + using Offline; + using Streaming; using Newtonsoft.Json; using System.Net; @@ -31,17 +29,14 @@ namespace Firebase.Database.Query /// The owning client. protected FirebaseQuery(FirebaseQuery parent, FirebaseClient client) { - this.Client = client; - this.Parent = parent; + Client = client; + Parent = parent; } /// /// Gets the client. /// - public FirebaseClient Client - { - get; - } + public FirebaseClient Client { get; } /// /// Queries the firebase server once returning collection of items. @@ -55,14 +50,15 @@ namespace Firebase.Database.Query try { - url = await this.BuildUrlAsync().ConfigureAwait(false); + url = await BuildUrlAsync().ConfigureAwait(false); } catch (Exception ex) { - throw new FirebaseException("Couldn't build the url", string.Empty, string.Empty, HttpStatusCode.OK, ex); + throw new FirebaseException("Couldn't build the url", string.Empty, string.Empty, HttpStatusCode.OK, + ex); } - return await this.GetClient(timeout).GetObjectCollectionAsync(url, Client.Options.JsonSerializerSettings) + return await GetClient(timeout).GetObjectCollectionAsync(url, Client.Options.JsonSerializerSettings) .ConfigureAwait(false); } @@ -97,7 +93,7 @@ namespace Firebase.Database.Query try { - url = await this.BuildUrlAsync().ConfigureAwait(false); + url = await BuildUrlAsync().ConfigureAwait(false); } catch (Exception ex) { @@ -106,7 +102,7 @@ namespace Firebase.Database.Query try { - var response = await this.GetClient(timeout).GetAsync(url).ConfigureAwait(false); + var response = await GetClient(timeout).GetAsync(url).ConfigureAwait(false); statusCode = response.StatusCode; responseData = await response.Content.ReadAsStringAsync().ConfigureAwait(false); @@ -127,7 +123,8 @@ namespace Firebase.Database.Query /// Type of elements. /// Optional custom root element of received json items. /// Observable stream of . - public IObservable> AsObservable(EventHandler> exceptionHandler = null, string elementRoot = "") + public IObservable> AsObservable( + EventHandler> exceptionHandler = null, string elementRoot = "") { return Observable.Create>(observer => { @@ -144,13 +141,13 @@ namespace Firebase.Database.Query public async Task BuildUrlAsync() { // if token factory is present on the parent then use it to generate auth token - if (this.Client.Options.AuthTokenAsyncFactory != null) + if (Client.Options.AuthTokenAsyncFactory != null) { - var token = await this.Client.Options.AuthTokenAsyncFactory().ConfigureAwait(false); + var token = await Client.Options.AuthTokenAsyncFactory().ConfigureAwait(false); return this.WithAuth(token).BuildUrl(null); } - return this.BuildUrl(null); + return BuildUrl(null); } /// @@ -161,20 +158,21 @@ namespace Firebase.Database.Query /// Optional timeout value. /// Type of /// Resulting firebase object with populated key. - public async Task> PostAsync(string data, bool generateKeyOffline = true, TimeSpan? timeout = null) + public async Task> PostAsync(string data, bool generateKeyOffline = true, + TimeSpan? timeout = null) { // post generates a new key server-side, while put can be used with an already generated local key if (generateKeyOffline) { var key = FirebaseKeyGenerator.Next(); - await new ChildQuery(this, () => key, this.Client).PutAsync(data).ConfigureAwait(false); + await new ChildQuery(this, () => key, Client).PutAsync(data).ConfigureAwait(false); return new FirebaseObject(key, data); } else { - var c = this.GetClient(timeout); - var sendData = await this.SendAsync(c, data, HttpMethod.Post).ConfigureAwait(false); + var c = GetClient(timeout); + var sendData = await SendAsync(c, data, HttpMethod.Post).ConfigureAwait(false); var result = JsonConvert.DeserializeObject(sendData, Client.Options.JsonSerializerSettings); return new FirebaseObject(result.Name, data); @@ -190,7 +188,7 @@ namespace Firebase.Database.Query /// The . public async Task PatchAsync(string data, TimeSpan? timeout = null) { - var c = this.GetClient(timeout); + var c = GetClient(timeout); await this.Silent().SendAsync(c, data, new HttpMethod("PATCH")).ConfigureAwait(false); } @@ -204,7 +202,7 @@ namespace Firebase.Database.Query /// The . public async Task PutAsync(string data, TimeSpan? timeout = null) { - var c = this.GetClient(timeout); + var c = GetClient(timeout); await this.Silent().SendAsync(c, data, HttpMethod.Put).ConfigureAwait(false); } @@ -216,14 +214,14 @@ namespace Firebase.Database.Query /// The . public async Task DeleteAsync(TimeSpan? timeout = null) { - var c = this.GetClient(timeout); + var c = GetClient(timeout); var url = string.Empty; var responseData = string.Empty; var statusCode = HttpStatusCode.OK; try { - url = await this.BuildUrlAsync().ConfigureAwait(false); + url = await BuildUrlAsync().ConfigureAwait(false); } catch (Exception ex) { @@ -249,7 +247,7 @@ namespace Firebase.Database.Query /// public void Dispose() { - this.client?.Dispose(); + client?.Dispose(); } /// @@ -261,33 +259,23 @@ namespace Firebase.Database.Query private string BuildUrl(FirebaseQuery child) { - var url = this.BuildUrlSegment(child); + var url = BuildUrlSegment(child); - if (this.Parent != null) - { - url = this.Parent.BuildUrl(this) + url; - } + if (Parent != null) url = Parent.BuildUrl(this) + url; return url; } private HttpClient GetClient(TimeSpan? timeout = null) { - if (this.client == null) - { - this.client = new HttpClient(); - } + if (client == null) client = new HttpClient(); if (!timeout.HasValue) - { - this.client.Timeout = DEFAULT_HTTP_CLIENT_TIMEOUT; - } + client.Timeout = DEFAULT_HTTP_CLIENT_TIMEOUT; else - { - this.client.Timeout = timeout.Value; - } + client.Timeout = timeout.Value; - return this.client; + return client; } private async Task SendAsync(HttpClient client, string data, HttpMethod method) @@ -299,7 +287,7 @@ namespace Firebase.Database.Query try { - url = await this.BuildUrlAsync().ConfigureAwait(false); + url = await BuildUrlAsync().ConfigureAwait(false); } catch (Exception ex) { @@ -327,4 +315,4 @@ namespace Firebase.Database.Query } } } -} +} \ No newline at end of file diff --git a/FireBase/Query/IFirebaseQuery.cs b/FireBase/Query/IFirebaseQuery.cs index 2e8c671..9f6e36c 100644 --- a/FireBase/Query/IFirebaseQuery.cs +++ b/FireBase/Query/IFirebaseQuery.cs @@ -3,8 +3,7 @@ using System; using System.Collections.Generic; using System.Threading.Tasks; - - using Firebase.Database.Streaming; + using Streaming; /// /// The FirebaseQuery interface. @@ -14,10 +13,7 @@ /// /// Gets the owning client of this query. /// - FirebaseClient Client - { - get; - } + FirebaseClient Client { get; } /// /// Retrieves items which exist on the location specified by this query instance. @@ -32,7 +28,8 @@ /// /// Type of the items. /// Cold observable of . - IObservable> AsObservable(EventHandler> exceptionHandler, string elementRoot = ""); + IObservable> AsObservable( + EventHandler> exceptionHandler, string elementRoot = ""); /// /// Builds the actual url of this query. @@ -40,4 +37,4 @@ /// The . Task BuildUrlAsync(); } -} +} \ No newline at end of file diff --git a/FireBase/Query/OrderQuery.cs b/FireBase/Query/OrderQuery.cs index 46ebd2c..16adba7 100644 --- a/FireBase/Query/OrderQuery.cs +++ b/FireBase/Query/OrderQuery.cs @@ -28,7 +28,7 @@ namespace Firebase.Database.Query /// The . protected override string BuildUrlParameter(FirebaseQuery child) { - return $"\"{this.propertyNameFactory()}\""; + return $"\"{propertyNameFactory()}\""; } } -} +} \ No newline at end of file diff --git a/FireBase/Query/ParameterQuery.cs b/FireBase/Query/ParameterQuery.cs index e3d9717..fb273a3 100644 --- a/FireBase/Query/ParameterQuery.cs +++ b/FireBase/Query/ParameterQuery.cs @@ -20,7 +20,7 @@ namespace Firebase.Database.Query : base(parent, client) { this.parameterFactory = parameterFactory; - this.separator = (this.Parent is ChildQuery) ? "?" : "&"; + separator = Parent is ChildQuery ? "?" : "&"; } /// @@ -30,7 +30,7 @@ namespace Firebase.Database.Query /// The . protected override string BuildUrlSegment(FirebaseQuery child) { - return $"{this.separator}{this.parameterFactory()}={this.BuildUrlParameter(child)}"; + return $"{separator}{parameterFactory()}={BuildUrlParameter(child)}"; } /// @@ -40,4 +40,4 @@ namespace Firebase.Database.Query /// The . protected abstract string BuildUrlParameter(FirebaseQuery child); } -} +} \ No newline at end of file diff --git a/FireBase/Query/QueryExtensions.cs b/FireBase/Query/QueryExtensions.cs index 77db644..735fe0a 100644 --- a/FireBase/Query/QueryExtensions.cs +++ b/FireBase/Query/QueryExtensions.cs @@ -119,7 +119,7 @@ namespace Firebase.Database.Query { return child.EqualTo(() => value); } - + /// /// Instructs firebase to send data equal to the . This must be preceded by an OrderBy query. /// @@ -129,7 +129,7 @@ namespace Firebase.Database.Query public static FilterQuery EqualTo(this ParameterQuery child, bool value) { return child.EqualTo(() => value); - } + } /// /// Instructs firebase to send data equal to null. This must be preceded by an OrderBy query. @@ -139,7 +139,7 @@ namespace Firebase.Database.Query public static FilterQuery EqualTo(this ParameterQuery child) { return child.EqualTo(() => null); - } + } /// /// Limits the result to first items. @@ -173,9 +173,12 @@ namespace Firebase.Database.Query return query.PatchAsync(JsonConvert.SerializeObject(obj, query.Client.Options.JsonSerializerSettings)); } - public static async Task> PostAsync(this FirebaseQuery query, T obj, bool generateKeyOffline = true) + public static async Task> PostAsync(this FirebaseQuery query, T obj, + bool generateKeyOffline = true) { - var result = await query.PostAsync(JsonConvert.SerializeObject(obj, query.Client.Options.JsonSerializerSettings), generateKeyOffline); + var result = + await query.PostAsync(JsonConvert.SerializeObject(obj, query.Client.Options.JsonSerializerSettings), + generateKeyOffline); return new FirebaseObject(result.Key, obj); } @@ -189,19 +192,13 @@ namespace Firebase.Database.Query /// Locations where to store the item. public static async Task FanOut(this ChildQuery child, T item, params string[] relativePaths) { - if (relativePaths == null) - { - throw new ArgumentNullException(nameof(relativePaths)); - } + if (relativePaths == null) throw new ArgumentNullException(nameof(relativePaths)); var fanoutObject = new Dictionary(relativePaths.Length); - foreach (var path in relativePaths) - { - fanoutObject.Add(path, item); - } + foreach (var path in relativePaths) fanoutObject.Add(path, item); await child.PatchAsync(fanoutObject); } } -} +} \ No newline at end of file diff --git a/FireBase/Query/QueryFactoryExtensions.cs b/FireBase/Query/QueryFactoryExtensions.cs index b36e74a..b54c315 100644 --- a/FireBase/Query/QueryFactoryExtensions.cs +++ b/FireBase/Query/QueryFactoryExtensions.cs @@ -139,7 +139,7 @@ namespace Firebase.Database.Query { return new FilterQuery(child, () => "equalTo", valueFactory, child.Client); } - + /// /// Instructs firebase to send data equal to the . This must be preceded by an OrderBy query. /// @@ -149,7 +149,7 @@ namespace Firebase.Database.Query public static FilterQuery EqualTo(this ParameterQuery child, Func valueFactory) { return new FilterQuery(child, () => "equalTo", valueFactory, child.Client); - } + } /// /// Limits the result to first items. @@ -173,4 +173,4 @@ namespace Firebase.Database.Query return new FilterQuery(child, () => "limitToLast", () => countFactory(), child.Client); } } -} +} \ No newline at end of file diff --git a/FireBase/Query/SilentQuery.cs b/FireBase/Query/SilentQuery.cs index 15584f6..1960426 100644 --- a/FireBase/Query/SilentQuery.cs +++ b/FireBase/Query/SilentQuery.cs @@ -5,7 +5,7 @@ /// public class SilentQuery : ParameterQuery { - public SilentQuery(FirebaseQuery parent, FirebaseClient client) + public SilentQuery(FirebaseQuery parent, FirebaseClient client) : base(parent, () => "print", client) { } @@ -15,4 +15,4 @@ return "silent"; } } -} +} \ No newline at end of file diff --git a/FireBase/Streaming/FirebaseCache.cs b/FireBase/Streaming/FirebaseCache.cs index ba7990b..77fc622 100644 --- a/FireBase/Streaming/FirebaseCache.cs +++ b/FireBase/Streaming/FirebaseCache.cs @@ -5,9 +5,7 @@ namespace Firebase.Database.Streaming using System.Collections.Generic; using System.Linq; using System.Reflection; - - using Firebase.Database.Http; - + using Http; using Newtonsoft.Json; /// @@ -18,6 +16,7 @@ namespace Firebase.Database.Streaming { private readonly IDictionary dictionary; private readonly bool isDictionaryType; + private readonly JsonSerializerSettings serializerSettings = new JsonSerializerSettings() { ObjectCreationHandling = ObjectCreationHandling.Replace @@ -26,7 +25,7 @@ namespace Firebase.Database.Streaming /// /// Initializes a new instance of the class. /// - public FirebaseCache() + public FirebaseCache() : this(new Dictionary()) { } @@ -37,8 +36,8 @@ namespace Firebase.Database.Streaming /// The existing items. public FirebaseCache(IDictionary existingItems) { - this.dictionary = existingItems; - this.isDictionaryType = typeof(IDictionary).GetTypeInfo().IsAssignableFrom(typeof(T).GetTypeInfo()); + dictionary = existingItems; + isDictionaryType = typeof(IDictionary).GetTypeInfo().IsAssignableFrom(typeof(T).GetTypeInfo()); } /// @@ -53,11 +52,11 @@ namespace Firebase.Database.Streaming Action primitiveObjSetter = null; Action objDeleter = null; - var pathElements = path.Split(new[] { "/" }, removeEmptyEntries ? StringSplitOptions.RemoveEmptyEntries : StringSplitOptions.None); + var pathElements = path.Split(new[] {"/"}, + removeEmptyEntries ? StringSplitOptions.RemoveEmptyEntries : StringSplitOptions.None); // first find where we should insert the data to foreach (var element in pathElements) - { if (obj is IDictionary) { // if it's a dictionary, then it's just a matter of inserting into it / accessing existing object by key @@ -73,7 +72,7 @@ namespace Firebase.Database.Streaming } else { - dictionary[element] = this.CreateInstance(valueType); + dictionary[element] = CreateInstance(valueType); obj = dictionary[element]; } } @@ -84,24 +83,24 @@ namespace Firebase.Database.Streaming var property = objParent .GetType() .GetRuntimeProperties() - .First(p => p.Name.Equals(element, StringComparison.OrdinalIgnoreCase) || element == p.GetCustomAttribute()?.PropertyName); + .First(p => p.Name.Equals(element, StringComparison.OrdinalIgnoreCase) || + element == p.GetCustomAttribute()?.PropertyName); objDeleter = () => property.SetValue(objParent, null); primitiveObjSetter = (d) => property.SetValue(objParent, d); obj = property.GetValue(obj); if (obj == null) { - obj = this.CreateInstance(property.PropertyType); + obj = CreateInstance(property.PropertyType); property.SetValue(objParent, obj); } } - } // if data is null (=empty string) delete it if (string.IsNullOrWhiteSpace(data) || data == "null") { var key = pathElements[0]; - var target = this.dictionary[key]; + var target = dictionary[key]; objDeleter(); @@ -110,7 +109,7 @@ namespace Firebase.Database.Streaming } // now insert the data - if (obj is IDictionary && !this.isDictionaryType) + if (obj is IDictionary && !isDictionaryType) { // insert data into dictionary and return it as a collection of FirebaseObject var dictionary = obj as IDictionary; @@ -122,10 +121,7 @@ namespace Firebase.Database.Streaming dictionary[item.Key] = item.Object; // top level dictionary changed - if (!pathElements.Any()) - { - yield return new FirebaseObject(item.Key, (T)item.Object); - } + if (!pathElements.Any()) yield return new FirebaseObject(item.Key, (T) item.Object); } // nested dictionary changed @@ -141,52 +137,46 @@ namespace Firebase.Database.Streaming var valueType = obj.GetType(); // firebase sends strings without double quotes - var targetObject = valueType == typeof(string) ? data.ToString() : JsonConvert.DeserializeObject(data, valueType); + var targetObject = valueType == typeof(string) + ? data.ToString() + : JsonConvert.DeserializeObject(data, valueType); if ((valueType.GetTypeInfo().IsPrimitive || valueType == typeof(string)) && primitiveObjSetter != null) - { // handle primitive (value) types separately primitiveObjSetter(targetObject); - } else - { - JsonConvert.PopulateObject(data, obj, this.serializerSettings); - } + JsonConvert.PopulateObject(data, obj, serializerSettings); - this.dictionary[pathElements[0]] = this.dictionary[pathElements[0]]; - yield return new FirebaseObject(pathElements[0], this.dictionary[pathElements[0]]); + dictionary[pathElements[0]] = dictionary[pathElements[0]]; + yield return new FirebaseObject(pathElements[0], dictionary[pathElements[0]]); } } public bool Contains(string key) { - return this.dictionary.Keys.Contains(key); + return dictionary.Keys.Contains(key); } private object CreateInstance(Type type) { if (type == typeof(string)) - { return string.Empty; - } else - { return Activator.CreateInstance(type); - } } #region IEnumerable IEnumerator IEnumerable.GetEnumerator() { - return this.GetEnumerator(); + return GetEnumerator(); } public IEnumerator> GetEnumerator() { - return this.dictionary.Select(p => new FirebaseObject(p.Key, p.Value)).GetEnumerator(); + return dictionary.Select(p => new FirebaseObject(p.Key, p.Value)).GetEnumerator(); } #endregion } -} +} \ No newline at end of file diff --git a/FireBase/Streaming/FirebaseEvent.cs b/FireBase/Streaming/FirebaseEvent.cs index c2338ca..e4fd238 100644 --- a/FireBase/Streaming/FirebaseEvent.cs +++ b/FireBase/Streaming/FirebaseEvent.cs @@ -15,26 +15,23 @@ namespace Firebase.Database.Streaming public FirebaseEvent(string key, T obj, FirebaseEventType eventType, FirebaseEventSource eventSource) : base(key, obj) { - this.EventType = eventType; - this.EventSource = eventSource; + EventType = eventType; + EventSource = eventSource; } /// /// Gets the source of the event. /// - public FirebaseEventSource EventSource - { - get; - } + public FirebaseEventSource EventSource { get; } /// /// Gets the event type. /// - public FirebaseEventType EventType + public FirebaseEventType EventType { get; } + + public static FirebaseEvent Empty(FirebaseEventSource source) { - get; + return new FirebaseEvent(string.Empty, default(T), FirebaseEventType.InsertOrUpdate, source); } - - public static FirebaseEvent Empty(FirebaseEventSource source) => new FirebaseEvent(string.Empty, default(T), FirebaseEventType.InsertOrUpdate, source); } -} +} \ No newline at end of file diff --git a/FireBase/Streaming/FirebaseEventSource.cs b/FireBase/Streaming/FirebaseEventSource.cs index 98df977..0a397ad 100644 --- a/FireBase/Streaming/FirebaseEventSource.cs +++ b/FireBase/Streaming/FirebaseEventSource.cs @@ -35,4 +35,4 @@ /// Online = OnlineInitial | OnlinePull | OnlinePush | OnlineStream } -} +} \ No newline at end of file diff --git a/FireBase/Streaming/FirebaseEventType.cs b/FireBase/Streaming/FirebaseEventType.cs index 5fb21ef..d8c65b3 100644 --- a/FireBase/Streaming/FirebaseEventType.cs +++ b/FireBase/Streaming/FirebaseEventType.cs @@ -15,4 +15,4 @@ namespace Firebase.Database.Streaming /// Delete } -} +} \ No newline at end of file diff --git a/FireBase/Streaming/FirebaseServerEventType.cs b/FireBase/Streaming/FirebaseServerEventType.cs index 1f10bc8..79c816d 100644 --- a/FireBase/Streaming/FirebaseServerEventType.cs +++ b/FireBase/Streaming/FirebaseServerEventType.cs @@ -12,4 +12,4 @@ namespace Firebase.Database.Streaming AuthRevoked } -} +} \ No newline at end of file diff --git a/FireBase/Streaming/FirebaseSubscription.cs b/FireBase/Streaming/FirebaseSubscription.cs index 4b5e643..acdc76c 100644 --- a/FireBase/Streaming/FirebaseSubscription.cs +++ b/FireBase/Streaming/FirebaseSubscription.cs @@ -7,9 +7,7 @@ namespace Firebase.Database.Streaming using System.Net.Http.Headers; using System.Threading; using System.Threading.Tasks; - - using Firebase.Database.Query; - + using Query; using Newtonsoft.Json.Linq; using System.Net; @@ -50,26 +48,27 @@ namespace Firebase.Database.Streaming /// The observer. /// The query. /// The cache. - public FirebaseSubscription(IObserver> observer, IFirebaseQuery query, string elementRoot, FirebaseCache cache) + public FirebaseSubscription(IObserver> observer, IFirebaseQuery query, string elementRoot, + FirebaseCache cache) { this.observer = observer; this.query = query; this.elementRoot = elementRoot; - this.cancel = new CancellationTokenSource(); + cancel = new CancellationTokenSource(); this.cache = cache; - this.client = query.Client; + client = query.Client; } public event EventHandler> ExceptionThrown; public void Dispose() { - this.cancel.Cancel(); + cancel.Cancel(); } public IDisposable Run() { - Task.Run(() => this.ReceiveThread()); + Task.Run(() => ReceiveThread()); return this; } @@ -84,15 +83,17 @@ namespace Firebase.Database.Streaming try { - this.cancel.Token.ThrowIfCancellationRequested(); + cancel.Token.ThrowIfCancellationRequested(); // initialize network connection - url = await this.query.BuildUrlAsync().ConfigureAwait(false); + url = await query.BuildUrlAsync().ConfigureAwait(false); var request = new HttpRequestMessage(HttpMethod.Get, url); var serverEvent = FirebaseServerEventType.KeepAlive; - var client = this.GetHttpClient(); - var response = await client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead, this.cancel.Token).ConfigureAwait(false); + var client = GetHttpClient(); + var response = await client + .SendAsync(request, HttpCompletionOption.ResponseHeadersRead, cancel.Token) + .ConfigureAwait(false); statusCode = response.StatusCode; response.EnsureSuccessStatusCode(); @@ -102,32 +103,28 @@ namespace Firebase.Database.Streaming { while (true) { - this.cancel.Token.ThrowIfCancellationRequested(); + cancel.Token.ThrowIfCancellationRequested(); line = reader.ReadLine()?.Trim(); - if (string.IsNullOrWhiteSpace(line)) - { - continue; - } + if (string.IsNullOrWhiteSpace(line)) continue; + + var tuple = line.Split(new[] {':'}, 2, StringSplitOptions.RemoveEmptyEntries) + .Select(s => s.Trim()).ToArray(); - var tuple = line.Split(new[] { ':' }, 2, StringSplitOptions.RemoveEmptyEntries).Select(s => s.Trim()).ToArray(); - switch (tuple[0].ToLower()) { case "event": - serverEvent = this.ParseServerEvent(serverEvent, tuple[1]); + serverEvent = ParseServerEvent(serverEvent, tuple[1]); break; case "data": - this.ProcessServerData(url, serverEvent, tuple[1]); + ProcessServerData(url, serverEvent, tuple[1]); break; } if (serverEvent == FirebaseServerEventType.AuthRevoked) - { // auth token no longer valid, reconnect break; - } } } } @@ -137,13 +134,15 @@ namespace Firebase.Database.Streaming } catch (Exception ex) when (statusCode != HttpStatusCode.OK) { - this.observer.OnError(new FirebaseException(url, string.Empty, line, statusCode, ex)); - this.Dispose(); + observer.OnError(new FirebaseException(url, string.Empty, line, statusCode, ex)); + Dispose(); break; } catch (Exception ex) { - this.ExceptionThrown?.Invoke(this, new ExceptionEventArgs(new FirebaseException(url, string.Empty, line, statusCode, ex))); + ExceptionThrown?.Invoke(this, + new ExceptionEventArgs(new FirebaseException(url, string.Empty, line, + statusCode, ex))); await Task.Delay(2000).ConfigureAwait(false); } @@ -185,30 +184,29 @@ namespace Firebase.Database.Streaming var data = result["data"].ToString(); // If an elementRoot parameter is provided, but it's not in the cache, it was already deleted. So we can return an empty object. - if(string.IsNullOrWhiteSpace(this.elementRoot) || !this.cache.Contains(this.elementRoot)) - { - if(path == "/" && data == string.Empty) + if (string.IsNullOrWhiteSpace(elementRoot) || !cache.Contains(elementRoot)) + if (path == "/" && data == string.Empty) { - this.observer.OnNext(FirebaseEvent.Empty(FirebaseEventSource.OnlineStream)); + observer.OnNext(FirebaseEvent.Empty(FirebaseEventSource.OnlineStream)); return; } - } - var eventType = string.IsNullOrWhiteSpace(data) ? FirebaseEventType.Delete : FirebaseEventType.InsertOrUpdate; + var eventType = string.IsNullOrWhiteSpace(data) + ? FirebaseEventType.Delete + : FirebaseEventType.InsertOrUpdate; - var items = this.cache.PushData(this.elementRoot + path, data); + var items = cache.PushData(elementRoot + path, data); foreach (var i in items.ToList()) - { - this.observer.OnNext(new FirebaseEvent(i.Key, i.Object, eventType, FirebaseEventSource.OnlineStream)); - } + observer.OnNext(new FirebaseEvent(i.Key, i.Object, eventType, + FirebaseEventSource.OnlineStream)); break; case FirebaseServerEventType.KeepAlive: break; case FirebaseServerEventType.Cancel: - this.observer.OnError(new FirebaseException(url, string.Empty, serverData, HttpStatusCode.Unauthorized)); - this.Dispose(); + observer.OnError(new FirebaseException(url, string.Empty, serverData, HttpStatusCode.Unauthorized)); + Dispose(); break; } } @@ -218,4 +216,4 @@ namespace Firebase.Database.Streaming return http; } } -} +} \ No newline at end of file diff --git a/FireBase/Streaming/NonBlockingStreamReader.cs b/FireBase/Streaming/NonBlockingStreamReader.cs index 2ac83fd..ab01510 100644 --- a/FireBase/Streaming/NonBlockingStreamReader.cs +++ b/FireBase/Streaming/NonBlockingStreamReader.cs @@ -17,29 +17,29 @@ private readonly int bufferSize; private string cachedData; - - public NonBlockingStreamReader(Stream stream, int bufferSize = DefaultBufferSize) + + public NonBlockingStreamReader(Stream stream, int bufferSize = DefaultBufferSize) { this.stream = stream; this.bufferSize = bufferSize; - this.buffer = new byte[bufferSize]; + buffer = new byte[bufferSize]; - this.cachedData = string.Empty; + cachedData = string.Empty; } public override string ReadLine() { - var currentString = this.TryGetNewLine(); - + var currentString = TryGetNewLine(); + while (currentString == null) { - var read = this.stream.Read(this.buffer, 0, this.bufferSize); + var read = stream.Read(buffer, 0, bufferSize); var str = Encoding.UTF8.GetString(buffer, 0, read); cachedData += str; - currentString = this.TryGetNewLine(); + currentString = TryGetNewLine(); } - + return currentString; } @@ -50,11 +50,11 @@ if (newLine >= 0) { var r = cachedData.Substring(0, newLine + 1); - this.cachedData = cachedData.Remove(0, r.Length); + cachedData = cachedData.Remove(0, r.Length); return r.Trim(); } return null; } } -} +} \ No newline at end of file -- cgit v1.2.3-54-g00ecf From c4d046858e0822b7c2c540ac2368b2c0e88e7a26 Mon Sep 17 00:00:00 2001 From: Dennis Kobert Date: Sun, 19 May 2019 17:00:02 +0200 Subject: general refectoring added 42 as dummy Token --- DSACore/Auxiliary/Calculator/Argument.cs | 8 +- DSACore/Auxiliary/Calculator/ISolvable.cs | 2 +- DSACore/Auxiliary/Calculator/Operator.cs | 2 +- DSACore/Auxiliary/Calculator/Ops.cs | 2 +- DSACore/Auxiliary/Calculator/StringSolver.cs | 21 ++- DSACore/Auxiliary/CommandInfo.cs | 6 +- DSACore/Auxiliary/SpellCorrect.cs | 10 +- DSACore/Auxiliary/TalentEnumerableExtension.cs | 4 +- DSACore/Auxiliary/WeaponImporter.cs | 10 +- DSACore/Commands/CommandHandler.cs | 4 +- DSACore/Commands/FileHandler.cs | 11 +- DSACore/Commands/Gm.cs | 9 +- DSACore/Commands/HeldList.cs | 2 +- DSACore/Commands/Help.cs | 27 +--- DSACore/Commands/LebenUndAstral.cs | 4 +- DSACore/Commands/List.cs | 3 +- DSACore/Commands/MiscCommands.cs | 13 +- DSACore/Commands/NpcCommands.cs | 3 - DSACore/Controllers/CommandsController.cs | 7 +- DSACore/Controllers/LobbyController.cs | 5 +- DSACore/Controllers/TokensController.cs | 11 +- DSACore/DSA_Game/Characters/Character.cs | 14 +- DSACore/DSA_Game/Characters/NPC.cs | 4 - DSACore/DSA_Game/Dsa.cs | 15 +- DSACore/DSA_Game/Save/Properties.cs | 9 +- DSACore/DSA_Game/Save/SaveCommand.cs | 10 +- DSACore/DSA_Game/Save/Session.cs | 7 +- DSACore/FireBase/Database.cs | 55 ++++---- DSACore/Hubs/Login.cs | 30 ++-- DSACore/Models/Database/DSA/DatabaseChar.cs | 3 +- DSACore/Models/Database/DSA/Weapon.cs | 18 +-- DSACore/Models/Network/Command.cs | 4 +- DSACore/Models/Network/CommandResponse.cs | 7 +- DSACore/Models/Network/Group.cs | 2 - DSACore/Models/Network/Token.cs | 10 +- DSACore/Models/Network/User.cs | 7 +- DSACore/Program.cs | 10 +- DSACore/Startup.cs | 9 +- DSALib/Characters/Being.cs | 4 +- DSALib/Characters/Critter.cs | 53 ++++--- DSALib/Characters/ICombatant.cs | 8 +- DSALib/CritterAttack.cs | 8 +- FireBase/ExceptionEventArgs.cs | 10 +- FireBase/Extensions/ObservableExtensions.cs | 15 +- FireBase/Extensions/TaskExtensions.cs | 10 +- FireBase/FirebaseClient.cs | 34 ++--- FireBase/FirebaseException.cs | 16 +-- FireBase/FirebaseKeyGenerator.cs | 15 +- FireBase/FirebaseObject.cs | 10 +- FireBase/FirebaseOptions.cs | 30 ++-- FireBase/Http/HttpClientExtensions.cs | 32 ++--- FireBase/Http/PostResult.cs | 4 +- FireBase/ObservableExtensions.cs | 16 +-- FireBase/Offline/ConcurrentOfflineDatabase.cs | 128 +++++++++++------ FireBase/Offline/DatabaseExtensions.cs | 111 ++++++++++----- FireBase/Offline/ISetHandler.cs | 8 +- FireBase/Offline/InitialPullStrategy.cs | 10 +- FireBase/Offline/Internals/MemberAccessVisitor.cs | 16 +-- FireBase/Offline/OfflineCacheAdapter.cs | 64 ++++----- FireBase/Offline/OfflineDatabase.cs | 126 +++++++++++------ FireBase/Offline/OfflineEntry.cs | 43 +++--- FireBase/Offline/RealtimeDatabase.cs | 118 +++++++++------- FireBase/Offline/SetHandler.cs | 8 +- FireBase/Offline/StreamingOptions.cs | 10 +- FireBase/Offline/SyncOptions.cs | 10 +- FireBase/Query/AuthQuery.cs | 14 +- FireBase/Query/ChildQuery.cs | 14 +- FireBase/Query/FilterQuery.cs | 38 +++-- FireBase/Query/FirebaseQuery.cs | 162 +++++++++++----------- FireBase/Query/IFirebaseQuery.cs | 28 ++-- FireBase/Query/OrderQuery.cs | 12 +- FireBase/Query/ParameterQuery.cs | 18 +-- FireBase/Query/QueryExtensions.cs | 68 ++++----- FireBase/Query/QueryFactoryExtensions.cs | 85 +++++++----- FireBase/Query/SilentQuery.cs | 2 +- FireBase/Streaming/FirebaseCache.cs | 39 +++--- FireBase/Streaming/FirebaseEvent.cs | 8 +- FireBase/Streaming/FirebaseEventSource.cs | 14 +- FireBase/Streaming/FirebaseEventType.cs | 6 +- FireBase/Streaming/FirebaseSubscription.cs | 38 +++-- FireBase/Streaming/NonBlockingStreamReader.cs | 21 +-- ZooBOTanica/CritCreate.cs | 11 +- ZooBOTanica/Program.cs | 5 +- ZooBOTanica/Properties/AssemblyInfo.cs | 1 - 84 files changed, 947 insertions(+), 932 deletions(-) (limited to 'FireBase') diff --git a/DSACore/Auxiliary/Calculator/Argument.cs b/DSACore/Auxiliary/Calculator/Argument.cs index 14982aa..5ed9ee3 100644 --- a/DSACore/Auxiliary/Calculator/Argument.cs +++ b/DSACore/Auxiliary/Calculator/Argument.cs @@ -1,9 +1,9 @@ -namespace DSACore.Auxiliary.Calculator -{ - using System; +using System; +namespace DSACore.Auxiliary.Calculator +{ /// - /// Provides an ISolvable class to save numbers. The class handles Argument checking and conversion from string to int. + /// Provides an ISolvable class to save numbers. The class handles Argument checking and conversion from string to int. /// public class Argument : ISolvable { diff --git a/DSACore/Auxiliary/Calculator/ISolvable.cs b/DSACore/Auxiliary/Calculator/ISolvable.cs index 2acbd11..7be4d19 100644 --- a/DSACore/Auxiliary/Calculator/ISolvable.cs +++ b/DSACore/Auxiliary/Calculator/ISolvable.cs @@ -1,7 +1,7 @@ namespace DSACore.Auxiliary.Calculator { /// - /// Object has to be able to return an integer as it's value + /// Object has to be able to return an integer as it's value /// public interface ISolvable { diff --git a/DSACore/Auxiliary/Calculator/Operator.cs b/DSACore/Auxiliary/Calculator/Operator.cs index ed46186..31b2a9b 100644 --- a/DSACore/Auxiliary/Calculator/Operator.cs +++ b/DSACore/Auxiliary/Calculator/Operator.cs @@ -4,7 +4,7 @@ using DSACorev.Auxiliary.Calculator; namespace DSACore.Auxiliary.Calculator { /// - /// The Operator Class represents a binary operator with tow Arguments and an Operation type + /// The Operator Class represents a binary operator with tow Arguments and an Operation type /// public class Operator : ISolvable { diff --git a/DSACore/Auxiliary/Calculator/Ops.cs b/DSACore/Auxiliary/Calculator/Ops.cs index c804257..a5c9a2d 100644 --- a/DSACore/Auxiliary/Calculator/Ops.cs +++ b/DSACore/Auxiliary/Calculator/Ops.cs @@ -1,7 +1,7 @@ namespace DSACorev.Auxiliary.Calculator { /// - /// The Different Operations, witch can be performed in execution-order + /// The Different Operations, witch can be performed in execution-order /// public enum Ops { diff --git a/DSACore/Auxiliary/Calculator/StringSolver.cs b/DSACore/Auxiliary/Calculator/StringSolver.cs index 212f812..b2a7d83 100644 --- a/DSACore/Auxiliary/Calculator/StringSolver.cs +++ b/DSACore/Auxiliary/Calculator/StringSolver.cs @@ -5,28 +5,20 @@ using DSACorev.Auxiliary.Calculator; namespace DSACore.Auxiliary.Calculator { - using System; - using System.Collections.Generic; - using System.Linq; - /// - /// The StringSolver divides the calculation string into operations and SubStringSolvers if the string contains parentheses + /// The StringSolver divides the calculation string into operations and SubStringSolvers if the string contains + /// parentheses /// public class StringSolver : ISolvable { - private readonly string input; private readonly List arguments = new List(); + private readonly string input; public StringSolver(string input) { this.input = input; } - public override string ToString() - { - return "(0+" + input.Replace(" ", string.Empty).ToLower() + ")"; - } - public int Solve() { var workInput = "0+" + input.Replace(" ", string.Empty).ToLower(); @@ -42,6 +34,11 @@ namespace DSACore.Auxiliary.Calculator return ((ISolvable) arguments.First()).Solve(); } + public override string ToString() + { + return "(0+" + input.Replace(" ", string.Empty).ToLower() + ")"; + } + private static string GetInner(ref string input) // extract the inner bracket an remove the section from the input string { @@ -123,7 +120,7 @@ namespace DSACore.Auxiliary.Calculator switch (c) { case ')': - throw new ArgumentException($"Unmögliche Anordnung von Klammern"); + throw new ArgumentException("Unmögliche Anordnung von Klammern"); case '(': arguments.Add(new StringSolver(GetInner(ref workInput))); index = -1; diff --git a/DSACore/Auxiliary/CommandInfo.cs b/DSACore/Auxiliary/CommandInfo.cs index 9afe6c0..1472587 100644 --- a/DSACore/Auxiliary/CommandInfo.cs +++ b/DSACore/Auxiliary/CommandInfo.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.Linq; namespace DSACore.Auxiliary { diff --git a/DSACore/Auxiliary/SpellCorrect.cs b/DSACore/Auxiliary/SpellCorrect.cs index 3ef7bb6..77d1cf3 100644 --- a/DSACore/Auxiliary/SpellCorrect.cs +++ b/DSACore/Auxiliary/SpellCorrect.cs @@ -1,9 +1,9 @@ -namespace DSACore.Auxiliary -{ - using System; - using System.Diagnostics; - using System.Linq; +using System; +using System.Diagnostics; +using System.Linq; +namespace DSACore.Auxiliary +{ public class SpellCorrect : StringComparer { public const int ErrorThreshold = 94100; diff --git a/DSACore/Auxiliary/TalentEnumerableExtension.cs b/DSACore/Auxiliary/TalentEnumerableExtension.cs index 159480d..d83114c 100644 --- a/DSACore/Auxiliary/TalentEnumerableExtension.cs +++ b/DSACore/Auxiliary/TalentEnumerableExtension.cs @@ -1,7 +1,7 @@ -using DSACore.DSA_Game.Characters; -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; using System.Text; +using DSACore.DSA_Game.Characters; using DSALib; namespace DSACore.Auxiliary diff --git a/DSACore/Auxiliary/WeaponImporter.cs b/DSACore/Auxiliary/WeaponImporter.cs index ab51efb..3375236 100644 --- a/DSACore/Auxiliary/WeaponImporter.cs +++ b/DSACore/Auxiliary/WeaponImporter.cs @@ -1,5 +1,4 @@ -using DSACore.Models.Database; -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Net.Http; @@ -7,14 +6,13 @@ using System.Text.RegularExpressions; using System.Threading.Tasks; using DSACore.FireBase; using DSACore.Models.Database.DSA; -using Group = System.Text.RegularExpressions.Group; namespace DSACore.Auxiliary { public class WeaponImporter { - private List Weapons = new List(); - private List Range = new List(); + private readonly List Range = new List(); + private readonly List Weapons = new List(); public async Task DownloadWeapons() { @@ -48,7 +46,7 @@ namespace DSACore.Auxiliary { var talent = lines[j]; - var values = await client.GetStringAsync($"http://diarium.eu/dsa4-forge/ajax/calculate/" + i + "/" + + var values = await client.GetStringAsync("http://diarium.eu/dsa4-forge/ajax/calculate/" + i + "/" + ids[j] + "/0/0/0/0/0/10/0/0/0"); values = Regex.Unescape(values.Replace(@"\t", "")); diff --git a/DSACore/Commands/CommandHandler.cs b/DSACore/Commands/CommandHandler.cs index 6879045..f74f87f 100644 --- a/DSACore/Commands/CommandHandler.cs +++ b/DSACore/Commands/CommandHandler.cs @@ -1,7 +1,7 @@ using System; using DSACore.Auxiliary; +using DSACore.Auxiliary.Calculator; using DSACore.DSA_Game; -using DSACore.Models; using DSACore.Models.Network; namespace DSACore.Commands @@ -49,7 +49,7 @@ namespace DSACore.Commands res = RandomMisc.Roll(cmd.CmdText + " " + cmd.Cmdmodifier); break; case "solve": - res = new Auxiliary.Calculator.StringSolver(cmd.CmdText + cmd.Cmdmodifier).Solve().ToString(); + res = new StringSolver(cmd.CmdText + cmd.Cmdmodifier).Solve().ToString(); break; case "npc": res = NpcCommands.CreateNpc(cmd.CharId, cmd.CmdTexts, cmd.Cmdmodifier); diff --git a/DSACore/Commands/FileHandler.cs b/DSACore/Commands/FileHandler.cs index d8fb585..bce7c54 100644 --- a/DSACore/Commands/FileHandler.cs +++ b/DSACore/Commands/FileHandler.cs @@ -1,13 +1,12 @@ -using DSACore.DSA_Game; +using System; +using System.Linq; +using System.Net; +using DSACore.DSA_Game; using DSACore.DSA_Game.Characters; +using DSALib; namespace DSACore.Commands { - using System; - using System.Linq; - using System.Net; - using DSALib; - public class FileHandler { public static string AddChar(ulong id, string url) diff --git a/DSACore/Commands/Gm.cs b/DSACore/Commands/Gm.cs index 59b3129..98b62db 100644 --- a/DSACore/Commands/Gm.cs +++ b/DSACore/Commands/Gm.cs @@ -1,12 +1,5 @@ -using DSACore.Auxiliary; -using DSACore.DSA_Game; - -namespace DSACore.Commands +namespace DSACore.Commands { - using System.Linq; - using System.Threading.Tasks; - using DSALib.Characters; - /*public class Iam { diff --git a/DSACore/Commands/HeldList.cs b/DSACore/Commands/HeldList.cs index 73861b7..370af34 100644 --- a/DSACore/Commands/HeldList.cs +++ b/DSACore/Commands/HeldList.cs @@ -1,9 +1,9 @@ using System.Collections.Generic; using System.Linq; using System.Text; -using DSACore.DSA_Game.Characters; using DSACore.Auxiliary; using DSACore.DSA_Game; +using DSACore.DSA_Game.Characters; namespace DSACore.Commands { diff --git a/DSACore/Commands/Help.cs b/DSACore/Commands/Help.cs index 6458c20..974c44c 100644 --- a/DSACore/Commands/Help.cs +++ b/DSACore/Commands/Help.cs @@ -1,39 +1,18 @@ using System.Linq; -using System.Threading.Tasks; using DSACore.Auxiliary; +using DSACore.DSA_Game.Save; namespace DSACore.Commands { public class Help { - static Help() - { - /*TextReader stream = new StreamReader(@"..\..\Help.json"); // Load command-description file - var reader = new JsonTextReader(stream); // create stream reader - - reader.Read(); // step into structure, until the array starts - reader.Read(); - reader.Read(); - - try - { - var test = new JsonSerializer().Deserialize>(reader); // Deserialize Data and create CommandInfo Struct - - Commands.AddRange(test); // Add new CommandInfos to List - } - catch (Exception e) - { - // ignored - }*/ - } - //public static List Commands { get; } = new List(); public static string Get_Specific_Help(string command) { // return command specific help - var com = DSA_Game.Save.Properties.CommandInfos + var com = Properties.CommandInfos .OrderBy(x => SpellCorrect.CompareEasy(x.Name, command.ToLower())).First(); // get best fit command return com.GetDescription(); } @@ -41,7 +20,7 @@ namespace DSACore.Commands public static string Get_Generic_Help() { var res = ""; - foreach (var com in DSA_Game.Save.Properties.CommandInfos) + foreach (var com in Properties.CommandInfos) { var first_column_width = 8; res += ("!" + com.Name + ": ").AddSpaces(first_column_width) + com.Brief; diff --git a/DSACore/Commands/LebenUndAstral.cs b/DSACore/Commands/LebenUndAstral.cs index 7e0cb5c..a671296 100644 --- a/DSACore/Commands/LebenUndAstral.cs +++ b/DSACore/Commands/LebenUndAstral.cs @@ -1,8 +1,6 @@ using System; -using System.Linq; -using System.Threading.Tasks; -using DSACore.DSA_Game; using DSACore.Auxiliary; +using DSACore.DSA_Game; using DSALib.Characters; namespace DSACore.Commands diff --git a/DSACore/Commands/List.cs b/DSACore/Commands/List.cs index 2c8f3d0..7fc682f 100644 --- a/DSACore/Commands/List.cs +++ b/DSACore/Commands/List.cs @@ -1,9 +1,8 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Threading.Tasks; -using DSACore.DSA_Game; using DSACore.Audio; +using DSACore.DSA_Game; namespace DSACore.Commands { diff --git a/DSACore/Commands/MiscCommands.cs b/DSACore/Commands/MiscCommands.cs index 36d5fb1..ebd1598 100644 --- a/DSACore/Commands/MiscCommands.cs +++ b/DSACore/Commands/MiscCommands.cs @@ -1,15 +1,4 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Net.Http; -using System.Text; -using System.Threading.Tasks; -using DSACore.DSA_Game; -using DSACore.Auxiliary; -using Microsoft.AspNetCore.Hosting.Internal; - -namespace DSACore.Commands +namespace DSACore.Commands { public class MiscCommands { diff --git a/DSACore/Commands/NpcCommands.cs b/DSACore/Commands/NpcCommands.cs index 9a27e6a..95243ca 100644 --- a/DSACore/Commands/NpcCommands.cs +++ b/DSACore/Commands/NpcCommands.cs @@ -1,12 +1,9 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Threading.Tasks; using DSACore.Characters; using DSACore.DSA_Game; using DSACore.DSA_Game.Characters; -using DSACore.Auxiliary; -using Microsoft.AspNetCore.Mvc.Internal; namespace DSACore.Commands { diff --git a/DSACore/Controllers/CommandsController.cs b/DSACore/Controllers/CommandsController.cs index e9700ff..5addf82 100644 --- a/DSACore/Controllers/CommandsController.cs +++ b/DSACore/Controllers/CommandsController.cs @@ -1,8 +1,5 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using DSACore.Models; +using DSACore.Commands; using DSACore.Models.Network; using Microsoft.AspNetCore.Mvc; @@ -33,7 +30,7 @@ namespace DSACore.Controllers { try { - return Commands.CommandHandler.ExecuteCommand(cmd).message; + return CommandHandler.ExecuteCommand(cmd).message; } catch (Exception e) { diff --git a/DSACore/Controllers/LobbyController.cs b/DSACore/Controllers/LobbyController.cs index 100fb5b..df22607 100644 --- a/DSACore/Controllers/LobbyController.cs +++ b/DSACore/Controllers/LobbyController.cs @@ -1,5 +1,6 @@ -using DSACore.Models.Network; using System; +using DSACore.Commands; +using DSACore.Models.Network; using Microsoft.AspNetCore.Mvc; namespace DSACore.Controllers @@ -19,7 +20,7 @@ namespace DSACore.Controllers { try { - return Commands.CommandHandler.ExecuteCommand(cmd).message; + return CommandHandler.ExecuteCommand(cmd).message; } catch (Exception e) { diff --git a/DSACore/Controllers/TokensController.cs b/DSACore/Controllers/TokensController.cs index 6a59db4..a85cabe 100644 --- a/DSACore/Controllers/TokensController.cs +++ b/DSACore/Controllers/TokensController.cs @@ -1,3 +1,4 @@ +using DSACore.Hubs; using Microsoft.AspNetCore.Mvc; namespace DSACore.Controllers @@ -10,13 +11,15 @@ namespace DSACore.Controllers [HttpGet("{token}")] public ActionResult Get(string token) { - if (!int.TryParse(token, out var inttoken)) + if (!int.TryParse(token, out var intToken)) return BadRequest("The token has to be a 32 bit unsigned integer"); - if (!Hubs.Users.Tokens.Exists(x => x.GetHashCode() == inttoken)) return NotFound(); + if (intToken == 42) return Ok("Scribble"); + + if (!Users.Tokens.Exists(x => x.GetHashCode() == intToken)) return NotFound(); - var group = Hubs.Users.Tokens.Find(x => x.GetHashCode() == inttoken); - return Ok(group); + var group = Users.Tokens.Find(x => x.GetHashCode() == intToken); + return Ok(group.Group); } } } \ No newline at end of file diff --git a/DSACore/DSA_Game/Characters/Character.cs b/DSACore/DSA_Game/Characters/Character.cs index 62d2e11..ac890cb 100644 --- a/DSACore/DSA_Game/Characters/Character.cs +++ b/DSACore/DSA_Game/Characters/Character.cs @@ -1,17 +1,15 @@ -using System.IO; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Xml; using DSACore.Auxiliary; using DSALib; using DSALib.Characters; namespace DSACore.DSA_Game.Characters { - using System; - using System.Collections.Generic; - using System.Linq; - using System.Text; - using System.Xml; - - public class Character : Being, ICharacter { public Character() diff --git a/DSACore/DSA_Game/Characters/NPC.cs b/DSACore/DSA_Game/Characters/NPC.cs index e6b7bed..75c3fe9 100644 --- a/DSACore/DSA_Game/Characters/NPC.cs +++ b/DSACore/DSA_Game/Characters/NPC.cs @@ -4,10 +4,6 @@ using DSALib.Characters; namespace DSACore.Characters { - using System; - using Auxiliary; - using DSACore.DSA_Game.Characters; - public class Npc : Being, ICharacter { private readonly int mean, stDv; diff --git a/DSACore/DSA_Game/Dsa.cs b/DSACore/DSA_Game/Dsa.cs index f2ffe48..18d0b81 100644 --- a/DSACore/DSA_Game/Dsa.cs +++ b/DSACore/DSA_Game/Dsa.cs @@ -1,18 +1,13 @@ using System; -using DSACore.Auxiliary; -using DSACore.FireBase; +using System.Collections.Generic; +using System.Linq; +using DSACore.DSA_Game.Characters; +using DSACore.DSA_Game.Save; using DSALib; using DSALib.Characters; -using Microsoft.EntityFrameworkCore.Design; namespace DSACore.DSA_Game { - using System.Collections.Generic; - using System.IO; - using System.Linq; - using Characters; - using Save; - public static class Dsa { #if DEBUG @@ -59,7 +54,7 @@ namespace DSACore.DSA_Game } */ - Properties.Deserialize(rootPath + "Properties"); + Properties.Deserialize(); Properties.Serialize(rootPath + "Properties"); diff --git a/DSACore/DSA_Game/Save/Properties.cs b/DSACore/DSA_Game/Save/Properties.cs index 50bd8fa..7eba911 100644 --- a/DSACore/DSA_Game/Save/Properties.cs +++ b/DSACore/DSA_Game/Save/Properties.cs @@ -1,4 +1,5 @@ using System; +using System.Collections; using System.Collections.Generic; using System.IO; using System.Linq; @@ -8,10 +9,6 @@ using Newtonsoft.Json; namespace DSACore.DSA_Game.Save { - using System.Collections; - using System.IO; - using Newtonsoft.Json; - public static class Properties { public static Dictionary objects; @@ -64,7 +61,7 @@ namespace DSACore.DSA_Game.Save foreach (var o in objects) { var assembly = o.Value is IList list - ? ((IList) list)[0]?.GetType().FullName + ? list[0]?.GetType().FullName : o.Value.GetType().FullName; var name = path + assembly.Replace('.', '-') + ".json"; @@ -76,7 +73,7 @@ namespace DSACore.DSA_Game.Save catch (Exception e) { // ignored - Console.WriteLine($"Speichern von Save-File fehlgeschlagen." + e); + Console.WriteLine("Speichern von Save-File fehlgeschlagen." + e); } } } diff --git a/DSACore/DSA_Game/Save/SaveCommand.cs b/DSACore/DSA_Game/Save/SaveCommand.cs index 80d4426..f358047 100644 --- a/DSACore/DSA_Game/Save/SaveCommand.cs +++ b/DSACore/DSA_Game/Save/SaveCommand.cs @@ -1,18 +1,16 @@ using System; +using System.IO; using System.Linq; -using System.Threading.Tasks; namespace DSACore.DSA_Game.Save { - using System.IO; - public class SaveCommand { public void LoadSession(string name = "") { if (name.Equals("?") || name.Equals(string.Empty)) { - Console.WriteLine($"Gespeicherte Sessions:"); + Console.WriteLine("Gespeicherte Sessions:"); Console.WriteLine(ListSessions()); return; } @@ -32,7 +30,7 @@ namespace DSACore.DSA_Game.Save if (name.Equals("?") || name.Equals(string.Empty)) { - Console.WriteLine($"Gespeicherte Sessions:"); + Console.WriteLine("Gespeicherte Sessions:"); Console.WriteLine(ListSessions()); return; } @@ -49,7 +47,7 @@ namespace DSACore.DSA_Game.Save { Directory.CreateDirectory(path); Dsa.Session.SessionName = name; - Dsa.Session.Save(path + "\\" + name + $"-0.json"); + Dsa.Session.Save(path + "\\" + name + "-0.json"); } Console.WriteLine($"{name} wurde gespeichert"); diff --git a/DSACore/DSA_Game/Save/Session.cs b/DSACore/DSA_Game/Save/Session.cs index 595f0e8..6944fb1 100644 --- a/DSACore/DSA_Game/Save/Session.cs +++ b/DSACore/DSA_Game/Save/Session.cs @@ -1,12 +1,11 @@ using System; using System.Collections.Generic; +using System.IO; +using DSACore.DSA_Game.Characters; +using Newtonsoft.Json; namespace DSACore.DSA_Game.Save { - using System.IO; - using Characters; - using Newtonsoft.Json; - public class Session { public static string DirectoryPath { get; set; } = Dsa.rootPath + @"sessions"; diff --git a/DSACore/FireBase/Database.cs b/DSACore/FireBase/Database.cs index abe2b92..8946cf0 100644 --- a/DSACore/FireBase/Database.cs +++ b/DSACore/FireBase/Database.cs @@ -1,14 +1,13 @@ -using DSACore.DSA_Game.Characters; -using DSACore.Models.Database; -using Firebase.Database; -using Firebase.Database.Query; -using System.Collections.Generic; +using System.Collections.Generic; using System.IO; using System.Linq; using System.Threading.Tasks; +using DSACore.DSA_Game; +using DSACore.DSA_Game.Characters; using DSACore.Models.Database.DSA; -using DSACore.Models.Database.Groups; - +using DSACore.Models.Network; +using Firebase.Database; +using Firebase.Database.Query; namespace DSACore.FireBase { @@ -16,9 +15,19 @@ namespace DSACore.FireBase { public static FirebaseClient firebase; + public static Dictionary Chars = new Dictionary(); + + public static Dictionary MeleeList = new Dictionary(); + + public static Dictionary RangedWeapons = new Dictionary(); + + public static Dictionary Talents = new Dictionary(); + + public static Dictionary Spells = new Dictionary(); + static Database() { - var auth = File.ReadAllText(DSA_Game.Dsa.rootPath + "Token"); + var auth = File.ReadAllText(Dsa.rootPath + "Token"); ; // your app secret firebase = new FirebaseClient( "https://heldenonline-4d828.firebaseio.com/", @@ -49,17 +58,7 @@ namespace DSACore.FireBase foreach (var firebaseObject in temp) list.Add(firebaseObject.Key, firebaseObject.Object); } - public static Dictionary Chars = new Dictionary(); - - public static Dictionary MeleeList = new Dictionary(); - - public static Dictionary RangedWeapons = new Dictionary(); - - public static Dictionary Talents = new Dictionary(); - - public static Dictionary Spells = new Dictionary(); - - public static async Task AddChar(Character file, Models.Network.Group group) + public static async Task AddChar(Character file, Group group) { DatabaseChar.LoadChar(file, out var groupChar, out var data); @@ -216,36 +215,36 @@ namespace DSACore.FireBase .OnceSingleAsync(); } - public static async Task> GetGroups() + public static async Task> GetGroups() { var groups = await firebase .Child("Groups") .OrderByKey() - .OnceAsync(); - var ret = new List(); + .OnceAsync(); + var ret = new List(); foreach (var firebaseObject in groups) - ret.Add(new Models.Network.Group(firebaseObject.Object.Name, firebaseObject.Object.Password)); + ret.Add(new Group(firebaseObject.Object.Name, firebaseObject.Object.Password)); return ret; } - public static async Task GetGroup(int id) + public static async Task GetGroup(int id) { var group = await firebase .Child("Groups") .Child("Group" + id) - .OnceSingleAsync(); + .OnceSingleAsync(); return group; } - public static async Task AddGroup(Group group) + public static async Task AddGroup(Models.Database.Groups.Group group) { var lastChar = await firebase .Child("Groups") .OrderByKey() .LimitToLast(1) - .OnceAsync(); + .OnceAsync(); var id = group.Id = lastChar.First().Object.Id + 1; await firebase @@ -254,7 +253,7 @@ namespace DSACore.FireBase .PutAsync(group); } - public static async void SetGroup(Group group) + public static async void SetGroup(Models.Database.Groups.Group group) { await firebase .Child("Groups") diff --git a/DSACore/Hubs/Login.cs b/DSACore/Hubs/Login.cs index f589e49..1f6ca39 100644 --- a/DSACore/Hubs/Login.cs +++ b/DSACore/Hubs/Login.cs @@ -1,14 +1,14 @@ -using DSACore.DSA_Game.Characters; -using DSACore.FireBase; -using DSACore.Models.Network; -using Microsoft.AspNetCore.SignalR; -using System; +using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using Microsoft.CodeAnalysis.CSharp.Syntax; +using DSACore.Commands; +using DSACore.DSA_Game.Characters; +using DSACore.FireBase; +using DSACore.Models.Network; +using Microsoft.AspNetCore.SignalR; namespace DSACore.Hubs { @@ -18,9 +18,6 @@ namespace DSACore.Hubs private const string ReceiveMethod = "ReceiveMessage"; //receiveMethod; - private static List DsaGroups { get; set; } - public static List Tokens { get; } = new List(); - static Users() { DsaGroups = Database.GetGroups().Result; @@ -29,6 +26,9 @@ namespace DSACore.Hubs //AddGroups(); } + private static List DsaGroups { get; } + public static List Tokens { get; } = new List(); + [Obsolete] private static async void AddGroups() @@ -60,7 +60,7 @@ namespace DSACore.Hubs var ident = args.First().Replace("/", ""); if (args.Count > 0) args.RemoveAt(0); - var ret = Commands.CommandHandler.ExecuteCommand(new Command + var ret = CommandHandler.ExecuteCommand(new Command { CharId = 0, CmdIdentifier = ident, @@ -116,8 +116,8 @@ namespace DSACore.Hubs var test = await Database.GetGroups(); foreach (var group in test) - if (!DsaGroups.Exists(x => x.Name.Equals(@group.Name))) - DsaGroups.Add(@group); + if (!DsaGroups.Exists(x => x.Name.Equals(group.Name))) + DsaGroups.Add(group); await Clients.Caller.SendCoreAsync("ListGroups", new object[] {DsaGroups.Select(x => x.SendGroup())}); //throw new NotImplementedException("add database call to get groups"); @@ -128,7 +128,7 @@ namespace DSACore.Hubs DsaGroups.Add(new Group(group, password)); var Dgroup = new Models.Database.Groups.Group {Name = group, Id = DsaGroups.Count - 1}; //Database.AddGroup(Dgroup); - await Clients.Caller.SendCoreAsync(ReceiveMethod, new[] {$"group {@group} sucessfully added"}); + await Clients.Caller.SendCoreAsync(ReceiveMethod, new[] {$"group {group} sucessfully added"}); //throw new NotImplementedException("add database call to add groups"); } @@ -202,8 +202,8 @@ namespace DSACore.Hubs await Clients.Caller.SendAsync("PlayerStatusChanged", new[] {user.Name, "offline"}); //await SendToGroup(user.Name + " disconnected from the Server"); - @group.Users.Remove(user); - await Groups.RemoveFromGroupAsync(Context.ConnectionId, @group.Name); + group.Users.Remove(user); + await Groups.RemoveFromGroupAsync(Context.ConnectionId, group.Name); } catch (Exception e) { diff --git a/DSACore/Models/Database/DSA/DatabaseChar.cs b/DSACore/Models/Database/DSA/DatabaseChar.cs index 6a57629..872b82e 100644 --- a/DSACore/Models/Database/DSA/DatabaseChar.cs +++ b/DSACore/Models/Database/DSA/DatabaseChar.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using DSACore.DSA_Game.Characters; namespace DSACore.Models.Database.DSA { @@ -40,7 +41,7 @@ namespace DSACore.Models.Database.DSA public List WeaponTalents { get; set; } = new List(); - public static void LoadChar(DSA_Game.Characters.Character file, out GroupChar group, out DatabaseChar data) + public static void LoadChar(Character file, out GroupChar group, out DatabaseChar data) { group = new GroupChar(); data = new DatabaseChar(); diff --git a/DSACore/Models/Database/DSA/Weapon.cs b/DSACore/Models/Database/DSA/Weapon.cs index d6d7999..58a44cd 100644 --- a/DSACore/Models/Database/DSA/Weapon.cs +++ b/DSACore/Models/Database/DSA/Weapon.cs @@ -26,27 +26,27 @@ namespace DSACore.Models.Database.DSA public class MeleeWeapon : Weapon { - public string TpKK { get; set; } - public int INI { get; set; } - public string MW { get; set; } - public MeleeWeapon(string name, string damage, int weight, string weaponTalent, string price) : base(name, damage, weight, weaponTalent, price) { } + + public string TpKK { get; set; } + public int INI { get; set; } + public string MW { get; set; } } public class RangedWeapon : Weapon { + public RangedWeapon(string name, string damage, int weight, string weaponTalent, string price) : base(name, + damage, weight, weaponTalent, price) + { + } + public int AtMod { get; set; } public int KKMod { get; set; } public string AtReach { get; set; } public string TpReach { get; set; } public int LoadTime { get; set; } - - public RangedWeapon(string name, string damage, int weight, string weaponTalent, string price) : base(name, - damage, weight, weaponTalent, price) - { - } } } \ No newline at end of file diff --git a/DSACore/Models/Network/Command.cs b/DSACore/Models/Network/Command.cs index 316461e..00b00a6 100644 --- a/DSACore/Models/Network/Command.cs +++ b/DSACore/Models/Network/Command.cs @@ -1,7 +1,5 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; -using System.Threading.Tasks; namespace DSACore.Models.Network { diff --git a/DSACore/Models/Network/CommandResponse.cs b/DSACore/Models/Network/CommandResponse.cs index 7478397..c7a410a 100644 --- a/DSACore/Models/Network/CommandResponse.cs +++ b/DSACore/Models/Network/CommandResponse.cs @@ -1,7 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; namespace DSACore.Models.Network { @@ -13,8 +10,8 @@ namespace DSACore.Models.Network ResponseType = responseType; } - public string message { get; private set; } - public ResponseType ResponseType { get; private set; } + public string message { get; } + public ResponseType ResponseType { get; } public override string ToString() { diff --git a/DSACore/Models/Network/Group.cs b/DSACore/Models/Network/Group.cs index 3a8ce77..efe12ee 100644 --- a/DSACore/Models/Network/Group.cs +++ b/DSACore/Models/Network/Group.cs @@ -1,7 +1,5 @@ using System; using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; namespace DSACore.Models.Network { diff --git a/DSACore/Models/Network/Token.cs b/DSACore/Models/Network/Token.cs index 0021317..451cafc 100644 --- a/DSACore/Models/Network/Token.cs +++ b/DSACore/Models/Network/Token.cs @@ -1,18 +1,18 @@ using System; -using Microsoft.EntityFrameworkCore; namespace DSACore.Models.Network { public class Token { - public string Group { get; set; } - private DateTime creation = DateTime.Now; + private readonly DateTime creation = DateTime.Now; - public Token(string @group) + public Token(string group) { - Group = @group; + Group = group; } + public string Group { get; set; } + public bool IsValid() { return DateTime.Now - creation < TimeSpan.FromMinutes(1); diff --git a/DSACore/Models/Network/User.cs b/DSACore/Models/Network/User.cs index 97a9224..8b8008c 100644 --- a/DSACore/Models/Network/User.cs +++ b/DSACore/Models/Network/User.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace DSACore.Models.Network +namespace DSACore.Models.Network { public class User { diff --git a/DSACore/Program.cs b/DSACore/Program.cs index 357f919..46baf2d 100644 --- a/DSACore/Program.cs +++ b/DSACore/Program.cs @@ -1,13 +1,7 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Threading.Tasks; +using DSACore.DSA_Game; using DSACore.FireBase; using Microsoft.AspNetCore; using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.Logging; namespace DSACore { @@ -16,7 +10,7 @@ namespace DSACore public static void Main(string[] args) { Database.GetGroup(0).Wait(); - DSA_Game.Dsa.Startup(); + Dsa.Startup(); CreateWebHostBuilder(args).Build().Run(); } diff --git a/DSACore/Startup.cs b/DSACore/Startup.cs index 6f3ec79..372caca 100644 --- a/DSACore/Startup.cs +++ b/DSACore/Startup.cs @@ -1,16 +1,9 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; +using DSACore.Hubs; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.HttpsPolicy; using Microsoft.AspNetCore.Mvc; -using DSACore.Hubs; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Logging; -using Microsoft.Extensions.Options; namespace DSACore { diff --git a/DSALib/Characters/Being.cs b/DSALib/Characters/Being.cs index cf338f9..27879a1 100644 --- a/DSALib/Characters/Being.cs +++ b/DSALib/Characters/Being.cs @@ -1,6 +1,4 @@ -using DiscoBot.DSA_Game.Characters; - -namespace DSALib.Characters +namespace DSALib.Characters { public class Being : Entity { diff --git a/DSALib/Characters/Critter.cs b/DSALib/Characters/Critter.cs index c511090..d9f8b53 100644 --- a/DSALib/Characters/Critter.cs +++ b/DSALib/Characters/Critter.cs @@ -1,14 +1,32 @@ using System; using System.Collections.Generic; +using System.IO; +using DiscoBot.DSA_Game.Characters; +using Newtonsoft.Json; namespace DSALib.Characters { - using System.IO; - using DiscoBot.DSA_Game.Characters; - using Newtonsoft.Json; - public class Critter : Being, ICombatant { + public CritterAttack lastAttack; + + public Critter(int gw, int gs, int rs, int mr, int ko, int pa, string ini, List critterAttacks) + { + Gw = gw; + Gs = gs; + Rs = rs; + Mr = mr; + Ko = ko; + Pa = pa; + Ini = ini; + CritterAttacks = critterAttacks; + lastAttack = CritterAttacks[new Random().Next(critterAttacks.Count)]; + } + + public Critter() + { + } + public int Rs { get; set; } public int Mr { get; set; } @@ -27,23 +45,14 @@ namespace DSALib.Characters public List CritterAttacks { get; set; } - public CritterAttack lastAttack; - - public Critter(int gw, int gs, int rs, int mr, int ko, int pa, string ini, List critterAttacks) + public string Angriff(string talent, int erschwernis = 0) { - Gw = gw; - Gs = gs; - Rs = rs; - Mr = mr; - Ko = ko; - Pa = pa; - Ini = ini; - CritterAttacks = critterAttacks; - lastAttack = CritterAttacks[new Random().Next(critterAttacks.Count)]; + throw new NotImplementedException(); } - public Critter() + public string Parade(string talent, int erschwernis = 0) { + throw new NotImplementedException(); } public static Critter Load(string path) @@ -61,16 +70,6 @@ namespace DSALib.Characters } } - public string Angriff(string talent, int erschwernis = 0) - { - throw new NotImplementedException(); - } - - public string Parade(string talent, int erschwernis = 0) - { - throw new NotImplementedException(); - } - public void Save(string path = @"..\..\Critters\") { try diff --git a/DSALib/Characters/ICombatant.cs b/DSALib/Characters/ICombatant.cs index 887893c..a4ce601 100644 --- a/DSALib/Characters/ICombatant.cs +++ b/DSALib/Characters/ICombatant.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace DiscoBot.DSA_Game.Characters +namespace DiscoBot.DSA_Game.Characters { public interface ICombatant { diff --git a/DSALib/CritterAttack.cs b/DSALib/CritterAttack.cs index 5fdcffa..3b0a11d 100644 --- a/DSALib/CritterAttack.cs +++ b/DSALib/CritterAttack.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace DSALib +namespace DSALib { public class CritterAttack { diff --git a/FireBase/ExceptionEventArgs.cs b/FireBase/ExceptionEventArgs.cs index 185c952..09c205a 100644 --- a/FireBase/ExceptionEventArgs.cs +++ b/FireBase/ExceptionEventArgs.cs @@ -1,16 +1,16 @@ -namespace Firebase.Database -{ - using System; +using System; +namespace Firebase.Database +{ /// - /// Event args holding the object. + /// Event args holding the object. /// public class ExceptionEventArgs : EventArgs where T : Exception { public readonly T Exception; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// The exception. public ExceptionEventArgs(T exception) diff --git a/FireBase/Extensions/ObservableExtensions.cs b/FireBase/Extensions/ObservableExtensions.cs index cb41bcc..0a672d7 100644 --- a/FireBase/Extensions/ObservableExtensions.cs +++ b/FireBase/Extensions/ObservableExtensions.cs @@ -1,19 +1,20 @@ -namespace Firebase.Database.Extensions -{ - using System; - using System.Reactive.Linq; +using System; +using System.Reactive.Linq; +namespace Firebase.Database.Extensions +{ public static class ObservableExtensions { /// - /// Returns a cold observable which retries (re-subscribes to) the source observable on error until it successfully terminates. + /// Returns a cold observable which retries (re-subscribes to) the source observable on error until it successfully + /// terminates. /// /// The source observable. /// How long to wait between attempts. /// A predicate determining for which exceptions to retry. Defaults to all /// - /// A cold observable which retries (re-subscribes to) the source observable on error up to the - /// specified number of times or until it successfully terminates. + /// A cold observable which retries (re-subscribes to) the source observable on error up to the + /// specified number of times or until it successfully terminates. /// public static IObservable RetryAfterDelay( this IObservable source, diff --git a/FireBase/Extensions/TaskExtensions.cs b/FireBase/Extensions/TaskExtensions.cs index 8e933b2..c955b3a 100644 --- a/FireBase/Extensions/TaskExtensions.cs +++ b/FireBase/Extensions/TaskExtensions.cs @@ -1,12 +1,12 @@ -namespace Firebase.Database.Extensions -{ - using System; - using System.Threading.Tasks; +using System; +using System.Threading.Tasks; +namespace Firebase.Database.Extensions +{ public static class TaskExtensions { /// - /// Instead of unwrapping it throws it as it is. + /// Instead of unwrapping it throws it as it is. /// public static async Task WithAggregateException(this Task source) { diff --git a/FireBase/FirebaseClient.cs b/FireBase/FirebaseClient.cs index 8795668..3079f3b 100644 --- a/FireBase/FirebaseClient.cs +++ b/FireBase/FirebaseClient.cs @@ -1,30 +1,26 @@ +using System; using System.Net.Http; +using System.Runtime.CompilerServices; +using Firebase.Database.Query; -[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("Firebase.Database.Tests")] +[assembly: InternalsVisibleTo("Firebase.Database.Tests")] namespace Firebase.Database { - using System; - using System.Collections.Generic; - using System.Threading.Tasks; - using Offline; - using Query; - /// - /// Firebase client which acts as an entry point to the online database. + /// Firebase client which acts as an entry point to the online database. /// public class FirebaseClient : IDisposable { + private readonly string baseUrl; internal readonly HttpClient HttpClient; internal readonly FirebaseOptions Options; - private readonly string baseUrl; - /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// The base url. - /// Offline database. + /// Offline database. public FirebaseClient(string baseUrl, FirebaseOptions options = null) { HttpClient = new HttpClient(); @@ -35,19 +31,19 @@ namespace Firebase.Database if (!this.baseUrl.EndsWith("/")) this.baseUrl += "/"; } + public void Dispose() + { + HttpClient?.Dispose(); + } + /// - /// Queries for a child of the data root. + /// Queries for a child of the data root. /// /// Name of the child. - /// . + /// . public ChildQuery Child(string resourceName) { return new ChildQuery(this, () => baseUrl + resourceName); } - - public void Dispose() - { - HttpClient?.Dispose(); - } } } \ No newline at end of file diff --git a/FireBase/FirebaseException.cs b/FireBase/FirebaseException.cs index 2f8269d..cfc09d3 100644 --- a/FireBase/FirebaseException.cs +++ b/FireBase/FirebaseException.cs @@ -1,8 +1,8 @@ -namespace Firebase.Database -{ - using System; - using System.Net; +using System; +using System.Net; +namespace Firebase.Database +{ public class FirebaseException : Exception { public FirebaseException(string requestUrl, string requestData, string responseData, HttpStatusCode statusCode) @@ -25,22 +25,22 @@ } /// - /// Post data passed to the authentication service. + /// Post data passed to the authentication service. /// public string RequestData { get; } /// - /// Original url of the request. + /// Original url of the request. /// public string RequestUrl { get; } /// - /// Response from the authentication service. + /// Response from the authentication service. /// public string ResponseData { get; } /// - /// Status code of the response. + /// Status code of the response. /// public HttpStatusCode StatusCode { get; } diff --git a/FireBase/FirebaseKeyGenerator.cs b/FireBase/FirebaseKeyGenerator.cs index 70a855d..37beed5 100644 --- a/FireBase/FirebaseKeyGenerator.cs +++ b/FireBase/FirebaseKeyGenerator.cs @@ -1,11 +1,11 @@ +using System; +using System.Text; + namespace Firebase.Database { - using System; - using System.Text; - /// - /// Offline key generator which mimics the official Firebase generators. - /// Credit: https://github.com/bubbafat/FirebaseSharp/blob/master/src/FirebaseSharp.Portable/FireBasePushIdGenerator.cs + /// Offline key generator which mimics the official Firebase generators. + /// Credit: https://github.com/bubbafat/FirebaseSharp/blob/master/src/FirebaseSharp.Portable/FireBasePushIdGenerator.cs /// public class FirebaseKeyGenerator { @@ -26,10 +26,11 @@ namespace Firebase.Database } /// - /// Returns next firebase key based on current time. + /// Returns next firebase key based on current time. /// /// - /// The . + /// The . + /// public static string Next() { // We generate 72-bits of randomness which get turned into 12 characters and diff --git a/FireBase/FirebaseObject.cs b/FireBase/FirebaseObject.cs index 653d508..2e0fd20 100644 --- a/FireBase/FirebaseObject.cs +++ b/FireBase/FirebaseObject.cs @@ -1,9 +1,11 @@ namespace Firebase.Database { /// - /// Holds the object of type along with its key. + /// Holds the object of type + /// + /// along with its key. /// - /// Type of the underlying object. + /// Type of the underlying object. public class FirebaseObject { internal FirebaseObject(string key, T obj) @@ -13,12 +15,12 @@ namespace Firebase.Database } /// - /// Gets the key of . + /// Gets the key of . /// public string Key { get; } /// - /// Gets the underlying object. + /// Gets the underlying object. /// public T Object { get; } } diff --git a/FireBase/FirebaseOptions.cs b/FireBase/FirebaseOptions.cs index f31a047..b4a5e51 100644 --- a/FireBase/FirebaseOptions.cs +++ b/FireBase/FirebaseOptions.cs @@ -1,12 +1,12 @@ -namespace Firebase.Database -{ - using System; - using System.Collections.Generic; - using System.IO; - using System.Threading.Tasks; - using Offline; - using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using Firebase.Database.Offline; +using Newtonsoft.Json; +namespace Firebase.Database +{ public class FirebaseOptions { public FirebaseOptions() @@ -18,32 +18,34 @@ } /// - /// Gets or sets the factory for Firebase offline database. Default is in-memory dictionary. + /// Gets or sets the factory for Firebase offline database. Default is in-memory dictionary. /// public Func> OfflineDatabaseFactory { get; set; } /// - /// Gets or sets the method for retrieving auth tokens. Default is null. + /// Gets or sets the method for retrieving auth tokens. Default is null. /// public Func> AuthTokenAsyncFactory { get; set; } /// - /// Gets or sets the factory for used for reading online streams. Default is . + /// Gets or sets the factory for used for reading online streams. Default is + /// . /// public Func SubscriptionStreamReaderFactory { get; set; } /// - /// Gets or sets the json serializer settings. + /// Gets or sets the json serializer settings. /// public JsonSerializerSettings JsonSerializerSettings { get; set; } /// - /// Gets or sets the time between synchronization attempts for pulling and pushing offline entities. Default is 10 seconds. + /// Gets or sets the time between synchronization attempts for pulling and pushing offline entities. Default is 10 + /// seconds. /// public TimeSpan SyncPeriod { get; set; } /// - /// Specify if token returned by factory will be used as "auth" url parameter or "access_token". + /// Specify if token returned by factory will be used as "auth" url parameter or "access_token". /// public bool AsAccessToken { get; set; } } diff --git a/FireBase/Http/HttpClientExtensions.cs b/FireBase/Http/HttpClientExtensions.cs index 7f8fffe..6582769 100644 --- a/FireBase/Http/HttpClientExtensions.cs +++ b/FireBase/Http/HttpClientExtensions.cs @@ -1,27 +1,27 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.Net.Http; +using System.Threading.Tasks; +using Newtonsoft.Json; + namespace Firebase.Database.Http { - using System; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net.Http; - using System.Threading.Tasks; - using Newtonsoft.Json; - using System.Net; - /// - /// The http client extensions for object deserializations. + /// The http client extensions for object deserializations. /// internal static class HttpClientExtensions { /// - /// The get object collection async. + /// The get object collection async. /// /// The client. - /// The request uri. - /// The specific JSON Serializer Settings. + /// The request uri. + /// The specific JSON Serializer Settings. /// The type of entities the collection should contain. - /// The . + /// The . public static async Task>> GetObjectCollectionAsync( this HttpClient client, string requestUri, JsonSerializerSettings jsonSerializerSettings) @@ -91,11 +91,11 @@ namespace Firebase.Database.Http }*/ /// - /// The get object collection async. + /// The get object collection async. /// /// The json data. /// The type of entities the collection should contain. - /// The . + /// The . public static IEnumerable> GetObjectCollection(this string data, Type elementType) { var dictionaryType = typeof(Dictionary<,>).MakeGenericType(typeof(string), elementType); diff --git a/FireBase/Http/PostResult.cs b/FireBase/Http/PostResult.cs index 5a779ed..15a4894 100644 --- a/FireBase/Http/PostResult.cs +++ b/FireBase/Http/PostResult.cs @@ -1,12 +1,12 @@ namespace Firebase.Database.Http { /// - /// Represents data returned after a successful POST to firebase server. + /// Represents data returned after a successful POST to firebase server. /// public class PostResult { /// - /// Gets or sets the generated key after a successful post. + /// Gets or sets the generated key after a successful post. /// public string Name { get; set; } } diff --git a/FireBase/ObservableExtensions.cs b/FireBase/ObservableExtensions.cs index da78365..bc46261 100644 --- a/FireBase/ObservableExtensions.cs +++ b/FireBase/ObservableExtensions.cs @@ -1,20 +1,20 @@ -namespace Firebase.Database -{ - using System; - using System.Collections.ObjectModel; - using Streaming; +using System; +using System.Collections.ObjectModel; +using Firebase.Database.Streaming; +namespace Firebase.Database +{ /// - /// Extensions for . + /// Extensions for . /// public static class ObservableExtensions { /// - /// Starts observing on given firebase observable and propagates event into an . + /// Starts observing on given firebase observable and propagates event into an . /// /// The observable. /// Type of entity. - /// The . + /// The . public static ObservableCollection AsObservableCollection(this IObservable> observable) { var collection = new ObservableCollection(); diff --git a/FireBase/Offline/ConcurrentOfflineDatabase.cs b/FireBase/Offline/ConcurrentOfflineDatabase.cs index 5527168..1a9e607 100644 --- a/FireBase/Offline/ConcurrentOfflineDatabase.cs +++ b/FireBase/Offline/ConcurrentOfflineDatabase.cs @@ -1,23 +1,23 @@ -namespace Firebase.Database.Offline +using System; +using System.Collections; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using LiteDB; + +namespace Firebase.Database.Offline { - using System; - using System.Collections; - using System.Collections.Concurrent; - using System.Collections.Generic; - using System.IO; - using System.Linq; - using LiteDB; - /// - /// The offline database. + /// The offline database. /// public class ConcurrentOfflineDatabase : IDictionary { - private readonly LiteRepository db; private readonly ConcurrentDictionary ccache; + private readonly LiteRepository db; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// The item type which is used to determine the database file name. /// Custom string which will get appended to the file name. @@ -43,33 +43,41 @@ } /// - /// Gets the number of elements contained in the . + /// Gets the number of elements contained in the . /// - /// The number of elements contained in the . + /// The number of elements contained in the . public int Count => ccache.Count; /// - /// Gets a value indicating whether this is a read-only collection. + /// Gets a value indicating whether this is a read-only collection. /// public bool IsReadOnly => false; /// - /// Gets an containing the keys of the . + /// Gets an containing the keys of the + /// . /// - /// An containing the keys of the object that implements . + /// + /// An containing the keys of the object that + /// implements . + /// public ICollection Keys => ccache.Keys; /// - /// Gets an containing the values in the . + /// Gets an containing the values in the + /// . /// - /// An containing the values in the object that implements . + /// + /// An containing the values in the object that + /// implements . + /// public ICollection Values => ccache.Values; /// - /// Gets or sets the element with the specified key. + /// Gets or sets the element with the specified key. /// /// The key of the element to get or set. - /// The element with the specified key. + /// The element with the specified key. public OfflineEntry this[string key] { get => ccache[key]; @@ -82,7 +90,7 @@ } /// - /// Returns an enumerator that iterates through the collection. + /// Returns an enumerator that iterates through the collection. /// /// An enumerator that can be used to iterate through the collection. public IEnumerator> GetEnumerator() @@ -96,65 +104,82 @@ } /// - /// Adds an item to the . + /// Adds an item to the . /// - /// The object to add to the . + /// The object to add to the . public void Add(KeyValuePair item) { Add(item.Key, item.Value); } /// - /// Removes all items from the . - /// + /// Removes all items from the . + /// public void Clear() { ccache.Clear(); - db.Delete(Query.All()); + db.Delete(LiteDB.Query.All()); } /// - /// Determines whether the contains a specific value. + /// Determines whether the contains a specific value. /// - /// The object to locate in the . - /// True if is found in the ; otherwise, false. + /// The object to locate in the . + /// + /// True if is found in the ; + /// otherwise, false. + /// public bool Contains(KeyValuePair item) { return ContainsKey(item.Key); } /// - /// Copies the elements of the to an , starting at a particular index. + /// Copies the elements of the to an + /// , starting at a particular index. /// - /// The one-dimensional that is the destination of the elements copied from . The must have zero-based indexing. - /// The zero-based index in at which copying begins. + /// + /// The one-dimensional that is the destination of the elements copied + /// from . The must have + /// zero-based indexing. + /// + /// The zero-based index in at which copying begins. public void CopyTo(KeyValuePair[] array, int arrayIndex) { ccache.ToList().CopyTo(array, arrayIndex); } /// - /// Removes the first occurrence of a specific object from the . + /// Removes the first occurrence of a specific object from the + /// . /// - /// The object to remove from the . - /// True if was successfully removed from the ; otherwise, false. This method also returns false if is not found in the original . + /// The object to remove from the . + /// + /// True if was successfully removed from the + /// ; otherwise, false. This method also returns false if + /// is not found in the original . + /// public bool Remove(KeyValuePair item) { return Remove(item.Key); } /// - /// Determines whether the contains an element with the specified key. + /// Determines whether the contains an element with the + /// specified key. /// - /// The key to locate in the . - /// True if the contains an element with the key; otherwise, false. + /// The key to locate in the . + /// + /// True if the contains an element with the key; + /// otherwise, false. + /// public bool ContainsKey(string key) { return ccache.ContainsKey(key); } /// - /// Adds an element with the provided key and value to the . + /// Adds an element with the provided key and value to the . /// /// The object to use as the key of the element to add. /// The object to use as the value of the element to add. @@ -165,10 +190,13 @@ } /// - /// Removes the element with the specified key from the . + /// Removes the element with the specified key from the . /// /// The key of the element to remove. - /// True if the element is successfully removed; otherwise, false. This method also returns false if was not found in the original . + /// + /// True if the element is successfully removed; otherwise, false. This method also returns false if + /// was not found in the original . + /// public bool Remove(string key) { ccache.TryRemove(key, out _); @@ -176,10 +204,18 @@ } /// - /// Gets the value associated with the specified key. - /// - /// The key whose value to get.When this method returns, the value associated with the specified key, if the key is found; otherwise, the default value for the type of the parameter. This parameter is passed uninitialized. - /// True if the object that implements contains an element with the specified key; otherwise, false. + /// Gets the value associated with the specified key. + /// + /// The key whose value to get. + /// + /// When this method returns, the value associated with the specified key, if the key is found; + /// otherwise, the default value for the type of the parameter. This parameter is passed + /// uninitialized. + /// + /// + /// True if the object that implements contains an + /// element with the specified key; otherwise, false. + /// public bool TryGetValue(string key, out OfflineEntry value) { return ccache.TryGetValue(key, out value); diff --git a/FireBase/Offline/DatabaseExtensions.cs b/FireBase/Offline/DatabaseExtensions.cs index 56dcf46..e7c4074 100644 --- a/FireBase/Offline/DatabaseExtensions.cs +++ b/FireBase/Offline/DatabaseExtensions.cs @@ -1,24 +1,26 @@ -namespace Firebase.Database.Offline -{ - using System; - using System.Collections; - using System.Collections.Generic; - using System.Linq.Expressions; - using System.Reflection; - using Query; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Reflection; +using Firebase.Database.Query; +namespace Firebase.Database.Offline +{ public static class DatabaseExtensions { /// - /// Create new instances of the . + /// Create new instances of the . /// /// Type of elements. /// Custom string which will get appended to the file name. /// Optional custom root element of received json items. - /// Realtime streaming options. + /// Realtime streaming options. /// Specifies what strategy should be used for initial pulling of server data. - /// Specifies whether changed items should actually be pushed to the server. It this is false, then Put / Post / Delete will not affect server data. - /// The . + /// + /// Specifies whether changed items should actually be pushed to the server. It this is false, + /// then Put / Post / Delete will not affect server data. + /// + /// The . public static RealtimeDatabase AsRealtimeDatabase(this ChildQuery query, string filenameModifier = "", string elementRoot = "", StreamingOptions streamingOptions = StreamingOptions.LatestOnly, InitialPullStrategy initialPullStrategy = InitialPullStrategy.MissingOnly, bool pushChanges = true) @@ -29,16 +31,19 @@ } /// - /// Create new instances of the . + /// Create new instances of the . /// /// Type of elements. - /// Type of the custom to use. + /// Type of the custom to use. /// Custom string which will get appended to the file name. /// Optional custom root element of received json items. - /// Realtime streaming options. + /// Realtime streaming options. /// Specifies what strategy should be used for initial pulling of server data. - /// Specifies whether changed items should actually be pushed to the server. It this is false, then Put / Post / Delete will not affect server data. - /// The . + /// + /// Specifies whether changed items should actually be pushed to the server. It this is false, + /// then Put / Post / Delete will not affect server data. + /// + /// The . public static RealtimeDatabase AsRealtimeDatabase(this ChildQuery query, string filenameModifier = "", string elementRoot = "", StreamingOptions streamingOptions = StreamingOptions.LatestOnly, @@ -52,12 +57,15 @@ } /// - /// Overwrites existing object with given key leaving any missing properties intact in firebase. + /// Overwrites existing object with given key leaving any missing properties intact in firebase. /// /// The key. /// The object to set. /// Indicates whether the item should be synced online. - /// The priority. Objects with higher priority will be synced first. Higher number indicates higher priority. + /// + /// The priority. Objects with higher priority will be synced first. Higher number indicates higher + /// priority. + /// public static void Patch(this RealtimeDatabase db, string key, T obj, bool syncOnline = true, int priority = 1) where T : class @@ -66,12 +74,15 @@ } /// - /// Overwrites existing object with given key. + /// Overwrites existing object with given key. /// /// The key. /// The object to set. /// Indicates whether the item should be synced online. - /// The priority. Objects with higher priority will be synced first. Higher number indicates higher priority. + /// + /// The priority. Objects with higher priority will be synced first. Higher number indicates higher + /// priority. + /// public static void Put(this RealtimeDatabase db, string key, T obj, bool syncOnline = true, int priority = 1) where T : class @@ -80,11 +91,14 @@ } /// - /// Adds a new entity to the Database. + /// Adds a new entity to the Database. /// /// The object to add. /// Indicates whether the item should be synced online. - /// The priority. Objects with higher priority will be synced first. Higher number indicates higher priority. + /// + /// The priority. Objects with higher priority will be synced first. Higher number indicates higher + /// priority. + /// /// The generated key for this object. public static string Post(this RealtimeDatabase db, T obj, bool syncOnline = true, int priority = 1) where T : class @@ -97,11 +111,14 @@ } /// - /// Deletes the entity with the given key. + /// Deletes the entity with the given key. /// /// The key. /// Indicates whether the item should be synced online. - /// The priority. Objects with higher priority will be synced first. Higher number indicates higher priority. + /// + /// The priority. Objects with higher priority will be synced first. Higher number indicates higher + /// priority. + /// public static void Delete(this RealtimeDatabase db, string key, bool syncOnline = true, int priority = 1) where T : class { @@ -109,7 +126,8 @@ } /// - /// Do a Put for a nested property specified by of an object with key . + /// Do a Put for a nested property specified by of an object with key + /// . /// /// Type of the root elements. /// Type of the property being modified @@ -118,7 +136,10 @@ /// Expression on the root element leading to target value to modify. /// Value to put. /// Indicates whether the item should be synced online. - /// The priority. Objects with higher priority will be synced first. Higher number indicates higher priority. + /// + /// The priority. Objects with higher priority will be synced first. Higher number indicates higher + /// priority. + /// public static void Put(this RealtimeDatabase db, string key, Expression> propertyExpression, TProperty value, bool syncOnline = true, int priority = 1) @@ -128,7 +149,8 @@ } /// - /// Do a Patch for a nested property specified by of an object with key . + /// Do a Patch for a nested property specified by of an object with key + /// . /// /// Type of the root elements. /// Type of the property being modified @@ -137,7 +159,10 @@ /// Expression on the root element leading to target value to modify. /// Value to patch. /// Indicates whether the item should be synced online. - /// The priority. Objects with higher priority will be synced first. Higher number indicates higher priority. + /// + /// The priority. Objects with higher priority will be synced first. Higher number indicates higher + /// priority. + /// public static void Patch(this RealtimeDatabase db, string key, Expression> propertyExpression, TProperty value, bool syncOnline = true, int priority = 1) @@ -147,7 +172,8 @@ } /// - /// Delete a nested property specified by of an object with key . This basically does a Put with null value. + /// Delete a nested property specified by of an object with key + /// . This basically does a Put with null value. /// /// Type of the root elements. /// Type of the property being modified @@ -156,7 +182,10 @@ /// Expression on the root element leading to target value to modify. /// Value to put. /// Indicates whether the item should be synced online. - /// The priority. Objects with higher priority will be synced first. Higher number indicates higher priority. + /// + /// The priority. Objects with higher priority will be synced first. Higher number indicates higher + /// priority. + /// public static void Delete(this RealtimeDatabase db, string key, Expression> propertyExpression, bool syncOnline = true, int priority = 1) where T : class @@ -166,8 +195,9 @@ } /// - /// Post a new entity into the nested dictionary specified by of an object with key . - /// The key of the new entity is automatically generated. + /// Post a new entity into the nested dictionary specified by of an object with + /// key . + /// The key of the new entity is automatically generated. /// /// Type of the root elements. /// Type of the dictionary being modified @@ -177,7 +207,10 @@ /// Expression on the root element leading to target value to modify. /// Value to put. /// Indicates whether the item should be synced online. - /// The priority. Objects with higher priority will be synced first. Higher number indicates higher priority. + /// + /// The priority. Objects with higher priority will be synced first. Higher number indicates higher + /// priority. + /// public static void Post(this RealtimeDatabase db, string key, Expression> propertyExpression, TProperty value, bool syncOnline = true, int priority = 1) @@ -193,8 +226,9 @@ } /// - /// Delete an entity with key in the nested dictionary specified by of an object with key . - /// The key of the new entity is automatically generated. + /// Delete an entity with key in the nested dictionary specified by + /// of an object with key . + /// The key of the new entity is automatically generated. /// /// Type of the root elements. /// Type of the dictionary being modified @@ -204,7 +238,10 @@ /// Expression on the root element leading to target value to modify. /// Key within the nested dictionary to delete. /// Indicates whether the item should be synced online. - /// The priority. Objects with higher priority will be synced first. Higher number indicates higher priority. + /// + /// The priority. Objects with higher priority will be synced first. Higher number indicates higher + /// priority. + /// public static void Delete(this RealtimeDatabase db, string key, Expression>> propertyExpression, string dictionaryKey, bool syncOnline = true, int priority = 1) diff --git a/FireBase/Offline/ISetHandler.cs b/FireBase/Offline/ISetHandler.cs index e3b49b5..c04bd41 100644 --- a/FireBase/Offline/ISetHandler.cs +++ b/FireBase/Offline/ISetHandler.cs @@ -1,8 +1,8 @@ -namespace Firebase.Database.Offline -{ - using Query; - using System.Threading.Tasks; +using System.Threading.Tasks; +using Firebase.Database.Query; +namespace Firebase.Database.Offline +{ public interface ISetHandler { Task SetAsync(ChildQuery query, string key, OfflineEntry entry); diff --git a/FireBase/Offline/InitialPullStrategy.cs b/FireBase/Offline/InitialPullStrategy.cs index a1ae3f7..ca2bebf 100644 --- a/FireBase/Offline/InitialPullStrategy.cs +++ b/FireBase/Offline/InitialPullStrategy.cs @@ -1,23 +1,23 @@ namespace Firebase.Database.Offline { /// - /// Specifies the strategy for initial pull of server data. + /// Specifies the strategy for initial pull of server data. /// public enum InitialPullStrategy { /// - /// Don't pull anything. + /// Don't pull anything. /// None, /// - /// Pull only what isn't already stored offline. + /// Pull only what isn't already stored offline. /// MissingOnly, /// - /// Pull everything that exists on the server. + /// Pull everything that exists on the server. /// - Everything, + Everything } } \ No newline at end of file diff --git a/FireBase/Offline/Internals/MemberAccessVisitor.cs b/FireBase/Offline/Internals/MemberAccessVisitor.cs index 2bc0fc3..89a77da 100644 --- a/FireBase/Offline/Internals/MemberAccessVisitor.cs +++ b/FireBase/Offline/Internals/MemberAccessVisitor.cs @@ -1,10 +1,10 @@ -namespace Firebase.Database.Offline.Internals -{ - using System.Collections.Generic; - using System.Linq.Expressions; - using System.Reflection; - using Newtonsoft.Json; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Reflection; +using Newtonsoft.Json; +namespace Firebase.Database.Offline.Internals +{ public class MemberAccessVisitor : ExpressionVisitor { private readonly IList propertyNames = new List(); @@ -13,10 +13,6 @@ public IEnumerable PropertyNames => propertyNames; - public MemberAccessVisitor() - { - } - public override Expression Visit(Expression expr) { if (expr?.NodeType == ExpressionType.MemberAccess) diff --git a/FireBase/Offline/OfflineCacheAdapter.cs b/FireBase/Offline/OfflineCacheAdapter.cs index 0918a8c..3153d1b 100644 --- a/FireBase/Offline/OfflineCacheAdapter.cs +++ b/FireBase/Offline/OfflineCacheAdapter.cs @@ -1,10 +1,10 @@ -namespace Firebase.Database.Offline -{ - using System; - using System.Collections; - using System.Collections.Generic; - using System.Linq; +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +namespace Firebase.Database.Offline +{ internal class OfflineCacheAdapter : IDictionary, IDictionary { private readonly IDictionary database; @@ -19,14 +19,10 @@ throw new NotImplementedException(); } - public int Count => database.Count; - public bool IsSynchronized { get; } public object SyncRoot { get; } - public bool IsReadOnly => database.IsReadOnly; - object IDictionary.this[object key] { get => database[key.ToString()].Deserialize(); @@ -42,27 +38,10 @@ } } - public ICollection Keys => database.Keys; - ICollection IDictionary.Values { get; } ICollection IDictionary.Keys { get; } - public ICollection Values => database.Values.Select(o => o.Deserialize()).ToList(); - - public T this[string key] - { - get => database[key].Deserialize(); - - set - { - if (database.ContainsKey(key)) - database[key] = new OfflineEntry(key, value, database[key].Priority, database[key].SyncOptions); - else - database[key] = new OfflineEntry(key, value, 1, SyncOptions.None); - } - } - public bool Contains(object key) { return ContainsKey(key.ToString()); @@ -80,6 +59,32 @@ public bool IsFixedSize => false; + public void Add(object key, object value) + { + Add(key.ToString(), (T) value); + } + + public int Count => database.Count; + + public bool IsReadOnly => database.IsReadOnly; + + public ICollection Keys => database.Keys; + + public ICollection Values => database.Values.Select(o => o.Deserialize()).ToList(); + + public T this[string key] + { + get => database[key].Deserialize(); + + set + { + if (database.ContainsKey(key)) + database[key] = new OfflineEntry(key, value, database[key].Priority, database[key].SyncOptions); + else + database[key] = new OfflineEntry(key, value, 1, SyncOptions.None); + } + } + public IEnumerator> GetEnumerator() { return database.Select(d => new KeyValuePair(d.Key, d.Value.Deserialize())).GetEnumerator(); @@ -95,11 +100,6 @@ Add(item.Key, item.Value); } - public void Add(object key, object value) - { - Add(key.ToString(), (T) value); - } - public void Clear() { database.Clear(); diff --git a/FireBase/Offline/OfflineDatabase.cs b/FireBase/Offline/OfflineDatabase.cs index 3e6e7d8..be0380b 100644 --- a/FireBase/Offline/OfflineDatabase.cs +++ b/FireBase/Offline/OfflineDatabase.cs @@ -1,22 +1,22 @@ -namespace Firebase.Database.Offline +using System; +using System.Collections; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using LiteDB; + +namespace Firebase.Database.Offline { - using System; - using System.Collections; - using System.Collections.Generic; - using System.IO; - using System.Linq; - using LiteDB; - /// - /// The offline database. + /// The offline database. /// public class OfflineDatabase : IDictionary { - private readonly LiteRepository db; private readonly IDictionary cache; + private readonly LiteRepository db; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// The item type which is used to determine the database file name. /// Custom string which will get appended to the file name. @@ -38,33 +38,41 @@ } /// - /// Gets the number of elements contained in the . + /// Gets the number of elements contained in the . /// - /// The number of elements contained in the . + /// The number of elements contained in the . public int Count => cache.Count; /// - /// Gets a value indicating whether this is a read-only collection. + /// Gets a value indicating whether this is a read-only collection. /// public bool IsReadOnly => cache.IsReadOnly; /// - /// Gets an containing the keys of the . + /// Gets an containing the keys of the + /// . /// - /// An containing the keys of the object that implements . + /// + /// An containing the keys of the object that + /// implements . + /// public ICollection Keys => cache.Keys; /// - /// Gets an containing the values in the . + /// Gets an containing the values in the + /// . /// - /// An containing the values in the object that implements . + /// + /// An containing the values in the object that + /// implements . + /// public ICollection Values => cache.Values; /// - /// Gets or sets the element with the specified key. + /// Gets or sets the element with the specified key. /// /// The key of the element to get or set. - /// The element with the specified key. + /// The element with the specified key. public OfflineEntry this[string key] { get => cache[key]; @@ -77,7 +85,7 @@ } /// - /// Returns an enumerator that iterates through the collection. + /// Returns an enumerator that iterates through the collection. /// /// An enumerator that can be used to iterate through the collection. public IEnumerator> GetEnumerator() @@ -91,65 +99,82 @@ } /// - /// Adds an item to the . + /// Adds an item to the . /// - /// The object to add to the . + /// The object to add to the . public void Add(KeyValuePair item) { Add(item.Key, item.Value); } /// - /// Removes all items from the . - /// + /// Removes all items from the . + /// public void Clear() { cache.Clear(); - db.Delete(Query.All()); + db.Delete(LiteDB.Query.All()); } /// - /// Determines whether the contains a specific value. + /// Determines whether the contains a specific value. /// - /// The object to locate in the . - /// True if is found in the ; otherwise, false. + /// The object to locate in the . + /// + /// True if is found in the ; + /// otherwise, false. + /// public bool Contains(KeyValuePair item) { return ContainsKey(item.Key); } /// - /// Copies the elements of the to an , starting at a particular index. + /// Copies the elements of the to an + /// , starting at a particular index. /// - /// The one-dimensional that is the destination of the elements copied from . The must have zero-based indexing. - /// The zero-based index in at which copying begins. + /// + /// The one-dimensional that is the destination of the elements copied + /// from . The must have + /// zero-based indexing. + /// + /// The zero-based index in at which copying begins. public void CopyTo(KeyValuePair[] array, int arrayIndex) { cache.CopyTo(array, arrayIndex); } /// - /// Removes the first occurrence of a specific object from the . + /// Removes the first occurrence of a specific object from the + /// . /// - /// The object to remove from the . - /// True if was successfully removed from the ; otherwise, false. This method also returns false if is not found in the original . + /// The object to remove from the . + /// + /// True if was successfully removed from the + /// ; otherwise, false. This method also returns false if + /// is not found in the original . + /// public bool Remove(KeyValuePair item) { return Remove(item.Key); } /// - /// Determines whether the contains an element with the specified key. + /// Determines whether the contains an element with the + /// specified key. /// - /// The key to locate in the . - /// True if the contains an element with the key; otherwise, false. + /// The key to locate in the . + /// + /// True if the contains an element with the key; + /// otherwise, false. + /// public bool ContainsKey(string key) { return cache.ContainsKey(key); } /// - /// Adds an element with the provided key and value to the . + /// Adds an element with the provided key and value to the . /// /// The object to use as the key of the element to add. /// The object to use as the value of the element to add. @@ -160,10 +185,13 @@ } /// - /// Removes the element with the specified key from the . + /// Removes the element with the specified key from the . /// /// The key of the element to remove. - /// True if the element is successfully removed; otherwise, false. This method also returns false if was not found in the original . + /// + /// True if the element is successfully removed; otherwise, false. This method also returns false if + /// was not found in the original . + /// public bool Remove(string key) { cache.Remove(key); @@ -171,10 +199,18 @@ } /// - /// Gets the value associated with the specified key. - /// - /// The key whose value to get.When this method returns, the value associated with the specified key, if the key is found; otherwise, the default value for the type of the parameter. This parameter is passed uninitialized. - /// True if the object that implements contains an element with the specified key; otherwise, false. + /// Gets the value associated with the specified key. + /// + /// The key whose value to get. + /// + /// When this method returns, the value associated with the specified key, if the key is found; + /// otherwise, the default value for the type of the parameter. This parameter is passed + /// uninitialized. + /// + /// + /// True if the object that implements contains an + /// element with the specified key; otherwise, false. + /// public bool TryGetValue(string key, out OfflineEntry value) { return cache.TryGetValue(key, out value); diff --git a/FireBase/Offline/OfflineEntry.cs b/FireBase/Offline/OfflineEntry.cs index dfd5910..9feffa3 100644 --- a/FireBase/Offline/OfflineEntry.cs +++ b/FireBase/Offline/OfflineEntry.cs @@ -1,21 +1,24 @@ -namespace Firebase.Database.Offline -{ - using System; - using Newtonsoft.Json; +using System; +using Newtonsoft.Json; +namespace Firebase.Database.Offline +{ /// - /// Represents an object stored in offline storage. + /// Represents an object stored in offline storage. /// public class OfflineEntry { private object dataInstance; /// - /// Initializes a new instance of the class with an already serialized object. + /// Initializes a new instance of the class with an already serialized object. /// /// The key. /// The object. - /// The priority. Objects with higher priority will be synced first. Higher number indicates higher priority. + /// + /// The priority. Objects with higher priority will be synced first. Higher number indicates higher + /// priority. + /// /// The sync options. public OfflineEntry(string key, object obj, string data, int priority, SyncOptions syncOptions, bool isPartial = false) @@ -31,11 +34,14 @@ } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// The key. /// The object. - /// The priority. Objects with higher priority will be synced first. Higher number indicates higher priority. + /// + /// The priority. Objects with higher priority will be synced first. Higher number indicates higher + /// priority. + /// /// The sync options. public OfflineEntry(string key, object obj, int priority, SyncOptions syncOptions, bool isPartial = false) : this(key, obj, JsonConvert.SerializeObject(obj), priority, syncOptions, isPartial) @@ -43,47 +49,48 @@ } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// public OfflineEntry() { } /// - /// Gets or sets the key of this entry. + /// Gets or sets the key of this entry. /// public string Key { get; set; } /// - /// Gets or sets the priority. Objects with higher priority will be synced first. Higher number indicates higher priority. + /// Gets or sets the priority. Objects with higher priority will be synced first. Higher number indicates higher + /// priority. /// public int Priority { get; set; } /// - /// Gets or sets the timestamp when this entry was last touched. + /// Gets or sets the timestamp when this entry was last touched. /// public DateTime Timestamp { get; set; } /// - /// Gets or sets the which define what sync state this entry is in. + /// Gets or sets the which define what sync state this entry is in. /// public SyncOptions SyncOptions { get; set; } /// - /// Gets or sets serialized JSON data. + /// Gets or sets serialized JSON data. /// public string Data { get; set; } /// - /// Specifies whether this is only a partial object. + /// Specifies whether this is only a partial object. /// public bool IsPartial { get; set; } /// - /// Deserializes into . The result is cached. + /// Deserializes into . The result is cached. /// /// Type of object to deserialize into. - /// Instance of . + /// Instance of . public T Deserialize() { return (T) (dataInstance ?? (dataInstance = JsonConvert.DeserializeObject(Data))); diff --git a/FireBase/Offline/RealtimeDatabase.cs b/FireBase/Offline/RealtimeDatabase.cs index 4d61027..973db46 100644 --- a/FireBase/Offline/RealtimeDatabase.cs +++ b/FireBase/Offline/RealtimeDatabase.cs @@ -1,50 +1,57 @@ -namespace Firebase.Database.Offline +using System; +using System.Collections.Generic; +using System.Linq; +using System.Linq.Expressions; +using System.Net; +using System.Reactive.Disposables; +using System.Reactive.Linq; +using System.Reactive.Subjects; +using System.Reactive.Threading.Tasks; +using System.Reflection; +using System.Threading; +using System.Threading.Tasks; +using Firebase.Database.Extensions; +using Firebase.Database.Offline.Internals; +using Firebase.Database.Query; +using Firebase.Database.Streaming; +using Newtonsoft.Json; + +namespace Firebase.Database.Offline { - using System; - using System.Collections.Generic; - using System.Linq; - using System.Reactive.Linq; - using System.Reactive.Subjects; - using System.Threading; - using System.Threading.Tasks; - using Extensions; - using Query; - using Streaming; - using System.Reactive.Threading.Tasks; - using System.Linq.Expressions; - using Internals; - using Newtonsoft.Json; - using System.Reflection; - using System.Reactive.Disposables; - /// - /// The real-time Database which synchronizes online and offline data. + /// The real-time Database which synchronizes online and offline data. /// /// Type of entities. - public partial class RealtimeDatabase : IDisposable where T : class + public class RealtimeDatabase : IDisposable where T : class { private readonly ChildQuery childQuery; private readonly string elementRoot; - private readonly StreamingOptions streamingOptions; - private readonly Subject> subject; + private readonly FirebaseCache firebaseCache; private readonly InitialPullStrategy initialPullStrategy; private readonly bool pushChanges; - private readonly FirebaseCache firebaseCache; + private readonly StreamingOptions streamingOptions; + private readonly Subject> subject; + private FirebaseSubscription firebaseSubscription; private bool isSyncRunning; private IObservable> observable; - private FirebaseSubscription firebaseSubscription; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// The child query. /// The element Root. /// The offline database factory. /// Custom string which will get appended to the file name. /// Specifies whether changes should be streamed from the server. - /// Specifies if everything should be pull from the online storage on start. It only makes sense when is set to true. - /// Specifies whether changed items should actually be pushed to the server. If this is false, then Put / Post / Delete will not affect server data. + /// + /// Specifies if everything should be pull from the online storage on start. It only + /// makes sense when is set to true. + /// + /// + /// Specifies whether changed items should actually be pushed to the server. If this is false, + /// then Put / Post / Delete will not affect server data. + /// public RealtimeDatabase(ChildQuery childQuery, string elementRoot, Func> offlineDatabaseFactory, string filenameModifier, StreamingOptions streamingOptions, InitialPullStrategy initialPullStrategy, bool pushChanges, @@ -67,24 +74,34 @@ } /// - /// Event raised whenever an exception is thrown in the synchronization thread. Exception thrown in there are swallowed, so this event is the only way to get to them. + /// Gets the backing Database. /// - public event EventHandler SyncExceptionThrown; + public IDictionary Database { get; } + + public ISetHandler PutHandler { private get; set; } + + public void Dispose() + { + subject.OnCompleted(); + firebaseSubscription?.Dispose(); + } /// - /// Gets the backing Database. + /// Event raised whenever an exception is thrown in the synchronization thread. Exception thrown in there are + /// swallowed, so this event is the only way to get to them. /// - public IDictionary Database { get; private set; } - - public ISetHandler PutHandler { private get; set; } + public event EventHandler SyncExceptionThrown; /// - /// Overwrites existing object with given key. + /// Overwrites existing object with given key. /// /// The key. /// The object to set. /// Indicates whether the item should be synced online. - /// The priority. Objects with higher priority will be synced first. Higher number indicates higher priority. + /// + /// The priority. Objects with higher priority will be synced first. Higher number indicates higher + /// priority. + /// public void Set(string key, T obj, SyncOptions syncOptions, int priority = 1) { SetAndRaise(key, new OfflineEntry(key, obj, priority, syncOptions)); @@ -118,10 +135,13 @@ } /// - /// Fetches an object with the given key and adds it to the Database. + /// Fetches an object with the given key and adds it to the Database. /// /// The key. - /// The priority. Objects with higher priority will be synced first. Higher number indicates higher priority. + /// + /// The priority. Objects with higher priority will be synced first. Higher number indicates higher + /// priority. + /// public void Pull(string key, int priority = 1) { if (!Database.ContainsKey(key)) @@ -132,7 +152,7 @@ } /// - /// Fetches everything from the remote database. + /// Fetches everything from the remote database. /// public async Task PullAsync() { @@ -142,7 +162,7 @@ .RetryAfterDelay>, FirebaseException>( childQuery.Client.Options.SyncPeriod, ex => ex.StatusCode == - System.Net.HttpStatusCode + HttpStatusCode .OK) // OK implies the request couldn't complete due to network error. .Select(e => ResetDatabaseFromInitial(e, false)) .SelectMany(e => e) @@ -164,7 +184,7 @@ } /// - /// Retrieves all offline items currently stored in local database. + /// Retrieves all offline items currently stored in local database. /// public IEnumerable> Once() { @@ -174,10 +194,10 @@ .ToList(); } - /// - /// Starts observing the real-time Database. Events will be fired both when change is done locally and remotely. - /// - /// Stream of . + /// + /// Starts observing the real-time Database. Events will be fired both when change is done locally and remotely. + /// + /// Stream of . public IObservable> AsObservable() { if (!isSyncRunning) @@ -212,7 +232,7 @@ .RetryAfterDelay>, FirebaseException>( childQuery.Client.Options.SyncPeriod, ex => ex.StatusCode == - System.Net.HttpStatusCode + HttpStatusCode .OK) // OK implies the request couldn't complete due to network error. .Select(e => ResetDatabaseFromInitial(e)) .SelectMany(e => e) @@ -230,12 +250,6 @@ return observable; } - public void Dispose() - { - subject.OnCompleted(); - firebaseSubscription?.Dispose(); - } - private IReadOnlyCollection> ResetDatabaseFromInitial( IReadOnlyCollection> collection, bool onlyWhenInitialEverything = true) { @@ -308,8 +322,6 @@ firebaseSubscription.ExceptionThrown += StreamingExceptionThrown; return new CompositeDisposable(firebaseSubscription.Run(), completeDisposable); - default: - break; } return completeDisposable; diff --git a/FireBase/Offline/SetHandler.cs b/FireBase/Offline/SetHandler.cs index 18a5131..6314c3c 100644 --- a/FireBase/Offline/SetHandler.cs +++ b/FireBase/Offline/SetHandler.cs @@ -1,8 +1,8 @@ -namespace Firebase.Database.Offline -{ - using Query; - using System.Threading.Tasks; +using System.Threading.Tasks; +using Firebase.Database.Query; +namespace Firebase.Database.Offline +{ public class SetHandler : ISetHandler { public virtual async Task SetAsync(ChildQuery query, string key, OfflineEntry entry) diff --git a/FireBase/Offline/StreamingOptions.cs b/FireBase/Offline/StreamingOptions.cs index 4a5f7b8..a420cbb 100644 --- a/FireBase/Offline/StreamingOptions.cs +++ b/FireBase/Offline/StreamingOptions.cs @@ -3,18 +3,20 @@ public enum StreamingOptions { /// - /// No realtime streaming. + /// No realtime streaming. /// None, /// - /// Streaming of only new items - not the existing ones. + /// Streaming of only new items - not the existing ones. /// LatestOnly, /// - /// Streaming of all items. This will also pull all existing items on start, so be mindful about the number of items in your DB. - /// When used, consider not setting the to because you would pointlessly pull everything twice. + /// Streaming of all items. This will also pull all existing items on start, so be mindful about the number of items in + /// your DB. + /// When used, consider not setting the to + /// because you would pointlessly pull everything twice. /// Everything } diff --git a/FireBase/Offline/SyncOptions.cs b/FireBase/Offline/SyncOptions.cs index aa3e21c..ca68d0a 100644 --- a/FireBase/Offline/SyncOptions.cs +++ b/FireBase/Offline/SyncOptions.cs @@ -1,27 +1,27 @@ namespace Firebase.Database.Offline { /// - /// Specifies type of sync requested for given data. + /// Specifies type of sync requested for given data. /// public enum SyncOptions { /// - /// No sync needed for given data. + /// No sync needed for given data. /// None, /// - /// Data should be pulled from firebase. + /// Data should be pulled from firebase. /// Pull, /// - /// Data should be put to firebase. + /// Data should be put to firebase. /// Put, /// - /// Data should be patched in firebase. + /// Data should be patched in firebase. /// Patch } diff --git a/FireBase/Query/AuthQuery.cs b/FireBase/Query/AuthQuery.cs index 14beb7e..2cfda3c 100644 --- a/FireBase/Query/AuthQuery.cs +++ b/FireBase/Query/AuthQuery.cs @@ -1,18 +1,18 @@ +using System; + namespace Firebase.Database.Query { - using System; - /// - /// Represents an auth parameter in firebase query, e.g. "?auth=xyz". + /// Represents an auth parameter in firebase query, e.g. "?auth=xyz". /// public class AuthQuery : ParameterQuery { private readonly Func tokenFactory; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - /// The parent. + /// The parent. /// The authentication token factory. /// The owner. public AuthQuery(FirebaseQuery parent, Func tokenFactory, FirebaseClient client) : base(parent, @@ -22,10 +22,10 @@ namespace Firebase.Database.Query } /// - /// Build the url parameter value of this child. + /// Build the url parameter value of this child. /// /// The child of this child. - /// The . + /// The . protected override string BuildUrlParameter(FirebaseQuery child) { return tokenFactory(); diff --git a/FireBase/Query/ChildQuery.cs b/FireBase/Query/ChildQuery.cs index 510ae75..014fe09 100644 --- a/FireBase/Query/ChildQuery.cs +++ b/FireBase/Query/ChildQuery.cs @@ -1,16 +1,16 @@ +using System; + namespace Firebase.Database.Query { - using System; - /// - /// Firebase query which references the child of current node. + /// Firebase query which references the child of current node. /// public class ChildQuery : FirebaseQuery { private readonly Func pathFactory; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// The parent. /// The path to the child node. @@ -22,7 +22,7 @@ namespace Firebase.Database.Query } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// The client. /// The path to the child node. @@ -32,10 +32,10 @@ namespace Firebase.Database.Query } /// - /// Build the url segment of this child. + /// Build the url segment of this child. /// /// The child of this child. - /// The . + /// The . protected override string BuildUrlSegment(FirebaseQuery child) { var s = pathFactory(); diff --git a/FireBase/Query/FilterQuery.cs b/FireBase/Query/FilterQuery.cs index be544c8..3434d1d 100644 --- a/FireBase/Query/FilterQuery.cs +++ b/FireBase/Query/FilterQuery.cs @@ -1,24 +1,24 @@ +using System; +using System.Globalization; + namespace Firebase.Database.Query { - using System; - using System.Globalization; - /// - /// Represents a firebase filtering query, e.g. "?LimitToLast=10". + /// Represents a firebase filtering query, e.g. "?LimitToLast=10". /// public class FilterQuery : ParameterQuery { - private readonly Func valueFactory; - private readonly Func doubleValueFactory; private readonly Func boolValueFactory; + private readonly Func doubleValueFactory; + private readonly Func valueFactory; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// The parent. /// The filter. /// The value for filter. - /// The owning client. + /// The owning client. public FilterQuery(FirebaseQuery parent, Func filterFactory, Func valueFactory, FirebaseClient client) : base(parent, filterFactory, client) @@ -27,7 +27,7 @@ namespace Firebase.Database.Query } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// The parent. /// The filter. @@ -41,7 +41,7 @@ namespace Firebase.Database.Query } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// The parent. /// The filter. @@ -55,25 +55,21 @@ namespace Firebase.Database.Query } /// - /// The build url parameter. + /// The build url parameter. /// - /// The child. - /// Url parameter part of the resulting path. + /// The child. + /// Url parameter part of the resulting path. protected override string BuildUrlParameter(FirebaseQuery child) { if (valueFactory != null) { - if (valueFactory() == null) return $"null"; + if (valueFactory() == null) return "null"; return $"\"{valueFactory()}\""; } - else if (doubleValueFactory != null) - { + + if (doubleValueFactory != null) return doubleValueFactory().ToString(CultureInfo.InvariantCulture); - } - else if (boolValueFactory != null) - { - return $"{boolValueFactory().ToString().ToLower()}"; - } + if (boolValueFactory != null) return $"{boolValueFactory().ToString().ToLower()}"; return string.Empty; } diff --git a/FireBase/Query/FirebaseQuery.cs b/FireBase/Query/FirebaseQuery.cs index 5e09795..60d0289 100644 --- a/FireBase/Query/FirebaseQuery.cs +++ b/FireBase/Query/FirebaseQuery.cs @@ -1,29 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Net; +using System.Net.Http; +using System.Reactive.Linq; +using System.Threading.Tasks; +using Firebase.Database.Http; +using Firebase.Database.Streaming; +using Newtonsoft.Json; + namespace Firebase.Database.Query { - using System; - using System.Collections.Generic; - using System.Net.Http; - using System.Reactive.Linq; - using System.Threading.Tasks; - using Http; - using Offline; - using Streaming; - using Newtonsoft.Json; - using System.Net; - /// - /// Represents a firebase query. + /// Represents a firebase query. /// public abstract class FirebaseQuery : IFirebaseQuery, IDisposable { - protected TimeSpan DEFAULT_HTTP_CLIENT_TIMEOUT = new TimeSpan(0, 0, 180); - protected readonly FirebaseQuery Parent; private HttpClient client; + protected TimeSpan DEFAULT_HTTP_CLIENT_TIMEOUT = new TimeSpan(0, 0, 180); - /// - /// Initializes a new instance of the class. + /// + /// Initializes a new instance of the class. /// /// The parent of this query. /// The owning client. @@ -34,16 +32,24 @@ namespace Firebase.Database.Query } /// - /// Gets the client. + /// Disposes this instance. + /// + public void Dispose() + { + client?.Dispose(); + } + + /// + /// Gets the client. /// public FirebaseClient Client { get; } /// - /// Queries the firebase server once returning collection of items. + /// Queries the firebase server once returning collection of items. /// /// Optional timeout value. /// Type of elements. - /// Collection of holding the entities returned by server. + /// Collection of holding the entities returned by server. public async Task>> OnceAsync(TimeSpan? timeout = null) { var url = string.Empty; @@ -62,6 +68,39 @@ namespace Firebase.Database.Query .ConfigureAwait(false); } + /// + /// Starts observing this query watching for changes real time sent by the server. + /// + /// Type of elements. + /// Optional custom root element of received json items. + /// Observable stream of . + public IObservable> AsObservable( + EventHandler> exceptionHandler = null, string elementRoot = "") + { + return Observable.Create>(observer => + { + var sub = new FirebaseSubscription(observer, this, elementRoot, new FirebaseCache()); + sub.ExceptionThrown += exceptionHandler; + return sub.Run(); + }); + } + + /// + /// Builds the actual URL of this query. + /// + /// The . + public async Task BuildUrlAsync() + { + // if token factory is present on the parent then use it to generate auth token + if (Client.Options.AuthTokenAsyncFactory != null) + { + var token = await Client.Options.AuthTokenAsyncFactory().ConfigureAwait(false); + return this.WithAuth(token).BuildUrl(null); + } + + return BuildUrl(null); + } + /*public async Task>> OnceAsync(Type dataType, TimeSpan? timeout = null) { var url = string.Empty; @@ -80,11 +119,11 @@ namespace Firebase.Database.Query }*/ /// - /// Assumes given query is pointing to a single object of type and retrieves it. + /// Assumes given query is pointing to a single object of type and retrieves it. /// /// Optional timeout value. /// Type of elements. - /// Single object of type . + /// Single object of type . public async Task OnceSingleAsync(TimeSpan? timeout = null) { var responseData = string.Empty; @@ -118,45 +157,12 @@ namespace Firebase.Database.Query } /// - /// Starts observing this query watching for changes real time sent by the server. - /// - /// Type of elements. - /// Optional custom root element of received json items. - /// Observable stream of . - public IObservable> AsObservable( - EventHandler> exceptionHandler = null, string elementRoot = "") - { - return Observable.Create>(observer => - { - var sub = new FirebaseSubscription(observer, this, elementRoot, new FirebaseCache()); - sub.ExceptionThrown += exceptionHandler; - return sub.Run(); - }); - } - - /// - /// Builds the actual URL of this query. - /// - /// The . - public async Task BuildUrlAsync() - { - // if token factory is present on the parent then use it to generate auth token - if (Client.Options.AuthTokenAsyncFactory != null) - { - var token = await Client.Options.AuthTokenAsyncFactory().ConfigureAwait(false); - return this.WithAuth(token).BuildUrl(null); - } - - return BuildUrl(null); - } - - /// - /// Posts given object to repository. + /// Posts given object to repository. /// /// The object. /// Specifies whether the key should be generated offline instead of online. /// Optional timeout value. - /// Type of + /// Type of /// Resulting firebase object with populated key. public async Task> PostAsync(string data, bool generateKeyOffline = true, TimeSpan? timeout = null) @@ -169,23 +175,21 @@ namespace Firebase.Database.Query return new FirebaseObject(key, data); } - else - { - var c = GetClient(timeout); - var sendData = await SendAsync(c, data, HttpMethod.Post).ConfigureAwait(false); - var result = JsonConvert.DeserializeObject(sendData, Client.Options.JsonSerializerSettings); - return new FirebaseObject(result.Name, data); - } + var c = GetClient(timeout); + var sendData = await SendAsync(c, data, HttpMethod.Post).ConfigureAwait(false); + var result = JsonConvert.DeserializeObject(sendData, Client.Options.JsonSerializerSettings); + + return new FirebaseObject(result.Name, data); } /// - /// Patches data at given location instead of overwriting them. - /// + /// Patches data at given location instead of overwriting them. + /// /// The object. /// Optional timeout value. - /// Type of - /// The . + /// Type of + /// The . public async Task PatchAsync(string data, TimeSpan? timeout = null) { var c = GetClient(timeout); @@ -194,12 +198,12 @@ namespace Firebase.Database.Query } /// - /// Sets or overwrites data at given location. - /// + /// Sets or overwrites data at given location. + /// /// The object. /// Optional timeout value. - /// Type of - /// The . + /// Type of + /// The . public async Task PutAsync(string data, TimeSpan? timeout = null) { var c = GetClient(timeout); @@ -208,10 +212,10 @@ namespace Firebase.Database.Query } /// - /// Deletes data from given location. + /// Deletes data from given location. /// /// Optional timeout value. - /// The . + /// The . public async Task DeleteAsync(TimeSpan? timeout = null) { var c = GetClient(timeout); @@ -243,18 +247,10 @@ namespace Firebase.Database.Query } /// - /// Disposes this instance. - /// - public void Dispose() - { - client?.Dispose(); - } - - /// - /// Build the url segment of this child. + /// Build the url segment of this child. /// /// The child of this query. - /// The . + /// The . protected abstract string BuildUrlSegment(FirebaseQuery child); private string BuildUrl(FirebaseQuery child) diff --git a/FireBase/Query/IFirebaseQuery.cs b/FireBase/Query/IFirebaseQuery.cs index 9f6e36c..0da4b15 100644 --- a/FireBase/Query/IFirebaseQuery.cs +++ b/FireBase/Query/IFirebaseQuery.cs @@ -1,40 +1,40 @@ -namespace Firebase.Database.Query -{ - using System; - using System.Collections.Generic; - using System.Threading.Tasks; - using Streaming; +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Firebase.Database.Streaming; +namespace Firebase.Database.Query +{ /// - /// The FirebaseQuery interface. + /// The FirebaseQuery interface. /// public interface IFirebaseQuery { /// - /// Gets the owning client of this query. + /// Gets the owning client of this query. /// FirebaseClient Client { get; } /// - /// Retrieves items which exist on the location specified by this query instance. + /// Retrieves items which exist on the location specified by this query instance. /// /// Optional timeout value. /// Type of the items. - /// Collection of . + /// Collection of . Task>> OnceAsync(TimeSpan? timeout = null); /// - /// Returns current location as an observable which allows to real-time listening to events from the firebase server. + /// Returns current location as an observable which allows to real-time listening to events from the firebase server. /// /// Type of the items. - /// Cold observable of . + /// Cold observable of . IObservable> AsObservable( EventHandler> exceptionHandler, string elementRoot = ""); /// - /// Builds the actual url of this query. + /// Builds the actual url of this query. /// - /// The . + /// The . Task BuildUrlAsync(); } } \ No newline at end of file diff --git a/FireBase/Query/OrderQuery.cs b/FireBase/Query/OrderQuery.cs index 16adba7..302d1a3 100644 --- a/FireBase/Query/OrderQuery.cs +++ b/FireBase/Query/OrderQuery.cs @@ -1,16 +1,16 @@ +using System; + namespace Firebase.Database.Query { - using System; - /// - /// Represents a firebase ordering query, e.g. "?OrderBy=Foo". + /// Represents a firebase ordering query, e.g. "?OrderBy=Foo". /// public class OrderQuery : ParameterQuery { private readonly Func propertyNameFactory; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// The query parent. /// The property name. @@ -22,10 +22,10 @@ namespace Firebase.Database.Query } /// - /// The build url parameter. + /// The build url parameter. /// /// The child. - /// The . + /// The . protected override string BuildUrlParameter(FirebaseQuery child) { return $"\"{propertyNameFactory()}\""; diff --git a/FireBase/Query/ParameterQuery.cs b/FireBase/Query/ParameterQuery.cs index fb273a3..572224c 100644 --- a/FireBase/Query/ParameterQuery.cs +++ b/FireBase/Query/ParameterQuery.cs @@ -1,9 +1,9 @@ +using System; + namespace Firebase.Database.Query { - using System; - /// - /// Represents a parameter in firebase query, e.g. "?data=foo". + /// Represents a parameter in firebase query, e.g. "?data=foo". /// public abstract class ParameterQuery : FirebaseQuery { @@ -11,7 +11,7 @@ namespace Firebase.Database.Query private readonly string separator; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// The parent of this query. /// The parameter. @@ -24,20 +24,20 @@ namespace Firebase.Database.Query } /// - /// Build the url segment represented by this query. - /// + /// Build the url segment represented by this query. + /// /// The child. - /// The . + /// The . protected override string BuildUrlSegment(FirebaseQuery child) { return $"{separator}{parameterFactory()}={BuildUrlParameter(child)}"; } /// - /// The build url parameter. + /// The build url parameter. /// /// The child. - /// The . + /// The . protected abstract string BuildUrlParameter(FirebaseQuery child); } } \ No newline at end of file diff --git a/FireBase/Query/QueryExtensions.cs b/FireBase/Query/QueryExtensions.cs index 735fe0a..df2edfc 100644 --- a/FireBase/Query/QueryExtensions.cs +++ b/FireBase/Query/QueryExtensions.cs @@ -6,158 +6,163 @@ using Newtonsoft.Json; namespace Firebase.Database.Query { /// - /// Query extensions providing linq like syntax for firebase server methods. + /// Query extensions providing linq like syntax for firebase server methods. /// public static class QueryExtensions { /// - /// Adds an auth parameter to the query. + /// Adds an auth parameter to the query. /// /// The child. /// The auth token. - /// The . + /// The . internal static AuthQuery WithAuth(this FirebaseQuery node, string token) { return node.WithAuth(() => token); } /// - /// Appends print=silent to save bandwidth. + /// Appends print=silent to save bandwidth. /// /// The child. - /// The . + /// The . internal static SilentQuery Silent(this FirebaseQuery node) { return new SilentQuery(node, node.Client); } /// - /// References a sub child of the existing node. + /// References a sub child of the existing node. /// /// The child. /// The path of sub child. - /// The . + /// The . public static ChildQuery Child(this ChildQuery node, string path) { return node.Child(() => path); } /// - /// Order data by given . Note that this is used mainly for following filtering queries and due to firebase implementation - /// the data may actually not be ordered. + /// Order data by given . Note that this is used mainly for following filtering queries and + /// due to firebase implementation + /// the data may actually not be ordered. /// /// The child. /// The property name. - /// The . + /// The . public static OrderQuery OrderBy(this ChildQuery child, string propertyName) { return child.OrderBy(() => propertyName); } /// - /// Instructs firebase to send data greater or equal to the . This must be preceded by an OrderBy query. + /// Instructs firebase to send data greater or equal to the . This must be preceded by an OrderBy + /// query. /// /// Current node. /// Value to start at. - /// The . + /// The . public static FilterQuery StartAt(this ParameterQuery child, string value) { return child.StartAt(() => value); } /// - /// Instructs firebase to send data lower or equal to the . This must be preceded by an OrderBy query. + /// Instructs firebase to send data lower or equal to the . This must be preceded by an OrderBy + /// query. /// /// Current node. /// Value to start at. - /// The . + /// The . public static FilterQuery EndAt(this ParameterQuery child, string value) { return child.EndAt(() => value); } /// - /// Instructs firebase to send data equal to the . This must be preceded by an OrderBy query. + /// Instructs firebase to send data equal to the . This must be preceded by an OrderBy query. /// /// Current node. /// Value to start at. - /// The . + /// The . public static FilterQuery EqualTo(this ParameterQuery child, string value) { return child.EqualTo(() => value); } /// - /// Instructs firebase to send data greater or equal to the . This must be preceded by an OrderBy query. + /// Instructs firebase to send data greater or equal to the . This must be preceded by an OrderBy + /// query. /// /// Current node. /// Value to start at. - /// The . + /// The . public static FilterQuery StartAt(this ParameterQuery child, double value) { return child.StartAt(() => value); } /// - /// Instructs firebase to send data lower or equal to the . This must be preceded by an OrderBy query. + /// Instructs firebase to send data lower or equal to the . This must be preceded by an OrderBy + /// query. /// /// Current node. /// Value to start at. - /// The . + /// The . public static FilterQuery EndAt(this ParameterQuery child, double value) { return child.EndAt(() => value); } /// - /// Instructs firebase to send data equal to the . This must be preceded by an OrderBy query. + /// Instructs firebase to send data equal to the . This must be preceded by an OrderBy query. /// /// Current node. /// Value to start at. - /// The . + /// The . public static FilterQuery EqualTo(this ParameterQuery child, double value) { return child.EqualTo(() => value); } /// - /// Instructs firebase to send data equal to the . This must be preceded by an OrderBy query. + /// Instructs firebase to send data equal to the . This must be preceded by an OrderBy query. /// /// Current node. /// Value to start at. - /// The . + /// The . public static FilterQuery EqualTo(this ParameterQuery child, bool value) { return child.EqualTo(() => value); } /// - /// Instructs firebase to send data equal to null. This must be preceded by an OrderBy query. + /// Instructs firebase to send data equal to null. This must be preceded by an OrderBy query. /// /// Current node. - /// The . + /// The . public static FilterQuery EqualTo(this ParameterQuery child) { return child.EqualTo(() => null); } /// - /// Limits the result to first items. + /// Limits the result to first items. /// /// Current node. /// Number of elements. - /// The . + /// The . public static FilterQuery LimitToFirst(this ParameterQuery child, int count) { return child.LimitToFirst(() => count); } /// - /// Limits the result to last items. + /// Limits the result to last items. /// /// Current node. /// Number of elements. - /// The . + /// The . public static FilterQuery LimitToLast(this ParameterQuery child, int count) { return child.LimitToLast(() => count); @@ -184,7 +189,8 @@ namespace Firebase.Database.Query } /// - /// Fan out given item to multiple locations at once. See https://firebase.googleblog.com/2015/10/client-side-fan-out-for-data-consistency_73.html for details. + /// Fan out given item to multiple locations at once. See + /// https://firebase.googleblog.com/2015/10/client-side-fan-out-for-data-consistency_73.html for details. /// /// Type of object to fan out. /// Current node. diff --git a/FireBase/Query/QueryFactoryExtensions.cs b/FireBase/Query/QueryFactoryExtensions.cs index b54c315..71dae5c 100644 --- a/FireBase/Query/QueryFactoryExtensions.cs +++ b/FireBase/Query/QueryFactoryExtensions.cs @@ -1,173 +1,184 @@ +using System; + namespace Firebase.Database.Query { - using System; - /// - /// Query extensions providing linq like syntax for firebase server methods. + /// Query extensions providing linq like syntax for firebase server methods. /// public static class QueryFactoryExtensions { /// - /// Adds an auth parameter to the query. + /// Adds an auth parameter to the query. /// /// The child. /// The auth token. - /// The . + /// The . internal static AuthQuery WithAuth(this FirebaseQuery node, Func tokenFactory) { return new AuthQuery(node, tokenFactory, node.Client); } /// - /// References a sub child of the existing node. + /// References a sub child of the existing node. /// /// The child. /// The path of sub child. - /// The . + /// The . public static ChildQuery Child(this ChildQuery node, Func pathFactory) { return new ChildQuery(node, pathFactory, node.Client); } /// - /// Order data by given . Note that this is used mainly for following filtering queries and due to firebase implementation - /// the data may actually not be ordered. + /// Order data by given . Note that this is used mainly for following filtering + /// queries and due to firebase implementation + /// the data may actually not be ordered. /// /// The child. /// The property name. - /// The . + /// The . public static OrderQuery OrderBy(this ChildQuery child, Func propertyNameFactory) { return new OrderQuery(child, propertyNameFactory, child.Client); } /// - /// Order data by $key. Note that this is used mainly for following filtering queries and due to firebase implementation - /// the data may actually not be ordered. + /// Order data by $key. Note that this is used mainly for following filtering queries and due to firebase + /// implementation + /// the data may actually not be ordered. /// /// The child. - /// The . + /// The . public static OrderQuery OrderByKey(this ChildQuery child) { return child.OrderBy("$key"); } /// - /// Order data by $value. Note that this is used mainly for following filtering queries and due to firebase implementation - /// the data may actually not be ordered. + /// Order data by $value. Note that this is used mainly for following filtering queries and due to firebase + /// implementation + /// the data may actually not be ordered. /// /// The child. - /// The . + /// The . public static OrderQuery OrderByValue(this ChildQuery child) { return child.OrderBy("$value"); } /// - /// Order data by $priority. Note that this is used mainly for following filtering queries and due to firebase implementation - /// the data may actually not be ordered. + /// Order data by $priority. Note that this is used mainly for following filtering queries and due to firebase + /// implementation + /// the data may actually not be ordered. /// /// The child. - /// The . + /// The . public static OrderQuery OrderByPriority(this ChildQuery child) { return child.OrderBy("$priority"); } /// - /// Instructs firebase to send data greater or equal to the . This must be preceded by an OrderBy query. + /// Instructs firebase to send data greater or equal to the . This must be preceded by an + /// OrderBy query. /// /// Current node. /// Value to start at. - /// The . + /// The . public static FilterQuery StartAt(this ParameterQuery child, Func valueFactory) { return new FilterQuery(child, () => "startAt", valueFactory, child.Client); } /// - /// Instructs firebase to send data lower or equal to the . This must be preceded by an OrderBy query. + /// Instructs firebase to send data lower or equal to the . This must be preceded by an + /// OrderBy query. /// /// Current node. /// Value to start at. - /// The . + /// The . public static FilterQuery EndAt(this ParameterQuery child, Func valueFactory) { return new FilterQuery(child, () => "endAt", valueFactory, child.Client); } /// - /// Instructs firebase to send data equal to the . This must be preceded by an OrderBy query. + /// Instructs firebase to send data equal to the . This must be preceded by an OrderBy + /// query. /// /// Current node. /// Value to start at. - /// The . + /// The . public static FilterQuery EqualTo(this ParameterQuery child, Func valueFactory) { return new FilterQuery(child, () => "equalTo", valueFactory, child.Client); } /// - /// Instructs firebase to send data greater or equal to the . This must be preceded by an OrderBy query. + /// Instructs firebase to send data greater or equal to the . This must be preceded by an + /// OrderBy query. /// /// Current node. /// Value to start at. - /// The . + /// The . public static FilterQuery StartAt(this ParameterQuery child, Func valueFactory) { return new FilterQuery(child, () => "startAt", valueFactory, child.Client); } /// - /// Instructs firebase to send data lower or equal to the . This must be preceded by an OrderBy query. + /// Instructs firebase to send data lower or equal to the . This must be preceded by an + /// OrderBy query. /// /// Current node. /// Value to start at. - /// The . + /// The . public static FilterQuery EndAt(this ParameterQuery child, Func valueFactory) { return new FilterQuery(child, () => "endAt", valueFactory, child.Client); } /// - /// Instructs firebase to send data equal to the . This must be preceded by an OrderBy query. + /// Instructs firebase to send data equal to the . This must be preceded by an OrderBy + /// query. /// /// Current node. /// Value to start at. - /// The . + /// The . public static FilterQuery EqualTo(this ParameterQuery child, Func valueFactory) { return new FilterQuery(child, () => "equalTo", valueFactory, child.Client); } /// - /// Instructs firebase to send data equal to the . This must be preceded by an OrderBy query. + /// Instructs firebase to send data equal to the . This must be preceded by an OrderBy + /// query. /// /// Current node. /// Value to start at. - /// The . + /// The . public static FilterQuery EqualTo(this ParameterQuery child, Func valueFactory) { return new FilterQuery(child, () => "equalTo", valueFactory, child.Client); } /// - /// Limits the result to first items. + /// Limits the result to first items. /// /// Current node. /// Number of elements. - /// The . + /// The . public static FilterQuery LimitToFirst(this ParameterQuery child, Func countFactory) { return new FilterQuery(child, () => "limitToFirst", () => countFactory(), child.Client); } /// - /// Limits the result to last items. + /// Limits the result to last items. /// /// Current node. /// Number of elements. - /// The . + /// The . public static FilterQuery LimitToLast(this ParameterQuery child, Func countFactory) { return new FilterQuery(child, () => "limitToLast", () => countFactory(), child.Client); diff --git a/FireBase/Query/SilentQuery.cs b/FireBase/Query/SilentQuery.cs index 1960426..d09d38b 100644 --- a/FireBase/Query/SilentQuery.cs +++ b/FireBase/Query/SilentQuery.cs @@ -1,7 +1,7 @@ namespace Firebase.Database.Query { /// - /// Appends print=silent to the url. + /// Appends print=silent to the url. /// public class SilentQuery : ParameterQuery { diff --git a/FireBase/Streaming/FirebaseCache.cs b/FireBase/Streaming/FirebaseCache.cs index 77fc622..66241e0 100644 --- a/FireBase/Streaming/FirebaseCache.cs +++ b/FireBase/Streaming/FirebaseCache.cs @@ -1,15 +1,15 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using Firebase.Database.Http; +using Newtonsoft.Json; + namespace Firebase.Database.Streaming { - using System; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Reflection; - using Http; - using Newtonsoft.Json; - /// - /// The firebase cache. + /// The firebase cache. /// /// Type of top-level entities in the cache. public class FirebaseCache : IEnumerable> @@ -17,13 +17,13 @@ namespace Firebase.Database.Streaming private readonly IDictionary dictionary; private readonly bool isDictionaryType; - private readonly JsonSerializerSettings serializerSettings = new JsonSerializerSettings() + private readonly JsonSerializerSettings serializerSettings = new JsonSerializerSettings { ObjectCreationHandling = ObjectCreationHandling.Replace }; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// public FirebaseCache() : this(new Dictionary()) @@ -31,7 +31,7 @@ namespace Firebase.Database.Streaming } /// - /// Initializes a new instance of the class and populates it with existing data. + /// Initializes a new instance of the class and populates it with existing data. /// /// The existing items. public FirebaseCache(IDictionary existingItems) @@ -41,10 +41,10 @@ namespace Firebase.Database.Streaming } /// - /// The push data. + /// The push data. /// - /// The path of incoming data, separated by slash. - /// The data in json format as returned by firebase. + /// The path of incoming data, separated by slash. + /// The data in json format as returned by firebase. /// Collection of top-level entities which were affected by the push. public IEnumerable> PushData(string path, string data, bool removeEmptyEntries = true) { @@ -63,7 +63,7 @@ namespace Firebase.Database.Streaming var dictionary = obj as IDictionary; var valueType = obj.GetType().GenericTypeArguments[1]; - primitiveObjSetter = (d) => dictionary[element] = d; + primitiveObjSetter = d => dictionary[element] = d; objDeleter = () => dictionary.Remove(element); if (dictionary.Contains(element)) @@ -87,7 +87,7 @@ namespace Firebase.Database.Streaming element == p.GetCustomAttribute()?.PropertyName); objDeleter = () => property.SetValue(objParent, null); - primitiveObjSetter = (d) => property.SetValue(objParent, d); + primitiveObjSetter = d => property.SetValue(objParent, d); obj = property.GetValue(obj); if (obj == null) { @@ -138,7 +138,7 @@ namespace Firebase.Database.Streaming // firebase sends strings without double quotes var targetObject = valueType == typeof(string) - ? data.ToString() + ? data : JsonConvert.DeserializeObject(data, valueType); if ((valueType.GetTypeInfo().IsPrimitive || valueType == typeof(string)) && primitiveObjSetter != null) @@ -161,8 +161,7 @@ namespace Firebase.Database.Streaming { if (type == typeof(string)) return string.Empty; - else - return Activator.CreateInstance(type); + return Activator.CreateInstance(type); } #region IEnumerable diff --git a/FireBase/Streaming/FirebaseEvent.cs b/FireBase/Streaming/FirebaseEvent.cs index e4fd238..1761a72 100644 --- a/FireBase/Streaming/FirebaseEvent.cs +++ b/FireBase/Streaming/FirebaseEvent.cs @@ -1,13 +1,13 @@ namespace Firebase.Database.Streaming { /// - /// Firebase event which hold and the object affected by the event. + /// Firebase event which hold and the object affected by the event. /// /// Type of object affected by the event. public class FirebaseEvent : FirebaseObject { /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// The key of the object. /// The object. @@ -20,12 +20,12 @@ namespace Firebase.Database.Streaming } /// - /// Gets the source of the event. + /// Gets the source of the event. /// public FirebaseEventSource EventSource { get; } /// - /// Gets the event type. + /// Gets the event type. /// public FirebaseEventType EventType { get; } diff --git a/FireBase/Streaming/FirebaseEventSource.cs b/FireBase/Streaming/FirebaseEventSource.cs index 0a397ad..b1385ca 100644 --- a/FireBase/Streaming/FirebaseEventSource.cs +++ b/FireBase/Streaming/FirebaseEventSource.cs @@ -1,37 +1,37 @@ namespace Firebase.Database.Streaming { /// - /// Specifies the origin of given + /// Specifies the origin of given /// public enum FirebaseEventSource { /// - /// Event comes from an offline source. + /// Event comes from an offline source. /// Offline, /// - /// Event comes from online source fetched during initial pull (valid only for RealtimeDatabase). + /// Event comes from online source fetched during initial pull (valid only for RealtimeDatabase). /// OnlineInitial, /// - /// Event comes from online source received thru active stream. + /// Event comes from online source received thru active stream. /// OnlineStream, /// - /// Event comes from online source being fetched manually. + /// Event comes from online source being fetched manually. /// OnlinePull, /// - /// Event raised after successful online push (valid only for RealtimeDatabase which isn't streaming). + /// Event raised after successful online push (valid only for RealtimeDatabase which isn't streaming). /// OnlinePush, /// - /// Event comes from an online source. + /// Event comes from an online source. /// Online = OnlineInitial | OnlinePull | OnlinePush | OnlineStream } diff --git a/FireBase/Streaming/FirebaseEventType.cs b/FireBase/Streaming/FirebaseEventType.cs index d8c65b3..7606331 100644 --- a/FireBase/Streaming/FirebaseEventType.cs +++ b/FireBase/Streaming/FirebaseEventType.cs @@ -1,17 +1,17 @@ namespace Firebase.Database.Streaming { /// - /// The type of event. + /// The type of event. /// public enum FirebaseEventType { /// - /// Item was inserted or updated. + /// Item was inserted or updated. /// InsertOrUpdate, /// - /// Item was deleted. + /// Item was deleted. /// Delete } diff --git a/FireBase/Streaming/FirebaseSubscription.cs b/FireBase/Streaming/FirebaseSubscription.cs index acdc76c..fb0f403 100644 --- a/FireBase/Streaming/FirebaseSubscription.cs +++ b/FireBase/Streaming/FirebaseSubscription.cs @@ -1,30 +1,28 @@ +using System; +using System.Linq; +using System.Net; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Threading; +using System.Threading.Tasks; +using Firebase.Database.Query; +using Newtonsoft.Json.Linq; + namespace Firebase.Database.Streaming { - using System; - using System.Diagnostics; - using System.Linq; - using System.Net.Http; - using System.Net.Http.Headers; - using System.Threading; - using System.Threading.Tasks; - using Query; - using Newtonsoft.Json.Linq; - using System.Net; - /// - /// The firebase subscription. + /// The firebase subscription. /// /// Type of object to be streaming back to the called. internal class FirebaseSubscription : IDisposable { + private static readonly HttpClient http; + private readonly FirebaseCache cache; private readonly CancellationTokenSource cancel; + private readonly FirebaseClient client; + private readonly string elementRoot; private readonly IObserver> observer; private readonly IFirebaseQuery query; - private readonly FirebaseCache cache; - private readonly string elementRoot; - private readonly FirebaseClient client; - - private static HttpClient http; static FirebaseSubscription() { @@ -43,7 +41,7 @@ namespace Firebase.Database.Streaming } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// The observer. /// The query. @@ -59,13 +57,13 @@ namespace Firebase.Database.Streaming client = query.Client; } - public event EventHandler> ExceptionThrown; - public void Dispose() { cancel.Cancel(); } + public event EventHandler> ExceptionThrown; + public IDisposable Run() { Task.Run(() => ReceiveThread()); diff --git a/FireBase/Streaming/NonBlockingStreamReader.cs b/FireBase/Streaming/NonBlockingStreamReader.cs index ab01510..8228e32 100644 --- a/FireBase/Streaming/NonBlockingStreamReader.cs +++ b/FireBase/Streaming/NonBlockingStreamReader.cs @@ -1,21 +1,24 @@ -namespace Firebase.Database.Streaming -{ - using System.IO; - using System.Text; +using System.IO; +using System.Text; +namespace Firebase.Database.Streaming +{ /// - /// When a regular is used in a UWP app its method tends to take a long - /// time for data larger then 2 KB. This extremly simple implementation of can be used instead to boost performance - /// in your UWP app. Use to inject an instance of this class into your . + /// When a regular is used in a UWP app its method + /// tends to take a long + /// time for data larger then 2 KB. This extremly simple implementation of can be used + /// instead to boost performance + /// in your UWP app. Use to inject an instance of this class into your + /// . /// public class NonBlockingStreamReader : TextReader { private const int DefaultBufferSize = 16000; - - private readonly Stream stream; private readonly byte[] buffer; private readonly int bufferSize; + private readonly Stream stream; + private string cachedData; public NonBlockingStreamReader(Stream stream, int bufferSize = DefaultBufferSize) diff --git a/ZooBOTanica/CritCreate.cs b/ZooBOTanica/CritCreate.cs index c26f323..e79cff4 100644 --- a/ZooBOTanica/CritCreate.cs +++ b/ZooBOTanica/CritCreate.cs @@ -1,18 +1,11 @@ using System; using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Windows.Forms; +using DSALib; +using DSALib.Characters; namespace ZooBOTanica { - using DSALib; - using DSALib.Characters; - public partial class CritCreateForm : Form { public Critter critter; diff --git a/ZooBOTanica/Program.cs b/ZooBOTanica/Program.cs index 0c1123e..59c7434 100644 --- a/ZooBOTanica/Program.cs +++ b/ZooBOTanica/Program.cs @@ -1,7 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; using System.Windows.Forms; namespace ZooBOTanica @@ -9,7 +6,7 @@ namespace ZooBOTanica internal static class Program { /// - /// Der Haupteinstiegspunkt für die Anwendung. + /// Der Haupteinstiegspunkt für die Anwendung. /// [STAThread] private static void Main() diff --git a/ZooBOTanica/Properties/AssemblyInfo.cs b/ZooBOTanica/Properties/AssemblyInfo.cs index 8bba4bc..b2b516e 100644 --- a/ZooBOTanica/Properties/AssemblyInfo.cs +++ b/ZooBOTanica/Properties/AssemblyInfo.cs @@ -1,5 +1,4 @@ using System.Reflection; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // Allgemeine Informationen über eine Assembly werden über die folgenden -- cgit v1.2.3-54-g00ecf From ed26623e17e8dfcc036f88cca6de10d5a35697ec Mon Sep 17 00:00:00 2001 From: uzvkl Date: Mon, 20 May 2019 00:54:14 +0200 Subject: Reorganize Code delete ZoBotanica --- DSACore/Controllers/CommandsController.cs | 4 +- DSACore/Controllers/LobbyController.cs | 4 +- DSACore/DSACore.csproj | 2 +- DSACore/Hubs/Login.cs | 28 +- DSACore/Program.cs | 4 +- DSACore/Startup.cs | 18 +- DSALib/Audio/Sound.cs | 18 - DSALib/Auxiliary/Calculator/Argument.cs | 2 +- DSALib/Auxiliary/Calculator/ISolvable.cs | 2 +- DSALib/Auxiliary/Calculator/Operator.cs | 4 +- DSALib/Auxiliary/Calculator/Ops.cs | 2 +- DSALib/Auxiliary/Calculator/StringSolver.cs | 4 +- DSALib/Auxiliary/CommandInfo.cs | 2 +- DSALib/Auxiliary/Dice.cs | 2 +- DSALib/Auxiliary/Extensions.cs | 2 +- DSALib/Auxiliary/IDataObjectEnumerableExtension.cs | 25 + DSALib/Auxiliary/RandomMisc.cs | 2 +- DSALib/Auxiliary/SpellCorrect.cs | 105 +- DSALib/Auxiliary/TalentEnumerableExtension.cs | 27 +- DSALib/Auxiliary/WeaponImporter.cs | 6 +- DSALib/Characters/Critter.cs | 1 + DSALib/Commands/CommandHandler.cs | 11 +- DSALib/Commands/CommandTypes.cs | 2 +- DSALib/Commands/FileHandler.cs | 7 +- DSALib/Commands/Gm.cs | 2 +- DSALib/Commands/HeldList.cs | 8 +- DSALib/Commands/Help.cs | 8 +- DSALib/Commands/LebenUndAstral.cs | 6 +- DSALib/Commands/List.cs | 11 +- DSALib/Commands/MiscCommands.cs | 4 +- DSALib/Commands/NpcCommands.cs | 18 +- DSALib/Commands/ProbenTest.cs | 2 +- DSALib/CritterAttack.cs | 21 - DSALib/DSALib.csproj | 8 +- DSALib/DSA_Game/Characters/Character.cs | 22 +- DSALib/DSA_Game/Characters/NPC.cs | 4 +- DSALib/DSA_Game/Characters/SaveChar.cs | 2 +- DSALib/DSA_Game/Dsa.cs | 11 +- DSALib/DSA_Game/Save/Properties.cs | 10 +- DSALib/DSA_Game/Save/SaveCommand.cs | 2 +- DSALib/DSA_Game/Save/Session.cs | 4 +- DSALib/FireBase/Database.cs | 94 +- DSALib/KampfTalent.cs | 18 - DSALib/Models/Database/DSA/Advantage.cs | 2 +- DSALib/Models/Database/DSA/CharSpell.cs | 2 +- DSALib/Models/Database/DSA/DatabaseChar.cs | 4 +- DSALib/Models/Database/DSA/Field.cs | 2 +- DSALib/Models/Database/DSA/GeneralSpell.cs | 2 +- DSALib/Models/Database/DSA/GroupChar.cs | 2 +- DSALib/Models/Database/DSA/Inventory.cs | 2 +- DSALib/Models/Database/DSA/Talent.cs | 6 +- DSALib/Models/Database/DSA/Weapon.cs | 2 +- DSALib/Models/Database/DSA/WeaponTalent.cs | 2 +- DSALib/Models/Database/DataObject.cs | 13 + DSALib/Models/Database/Groups/DSAGroup.cs | 4 +- DSALib/Models/Database/Groups/Group.cs | 3 +- DSALib/Models/Database/IDataObject.cs | 7 + DSALib/Models/Dsa/CritterAttack.cs | 19 + DSALib/Models/Dsa/KampfTalent.cs | 16 + DSALib/Models/Dsa/Talent.cs | 43 + DSALib/Models/Dsa/Vorteil.cs | 16 + DSALib/Models/Dsa/Zauber.cs | 16 + DSALib/Models/Network/Command.cs | 2 +- DSALib/Models/Network/CommandResponse.cs | 2 +- DSALib/Models/Network/Group.cs | 2 +- DSALib/Models/Network/Token.cs | 2 +- DSALib/Models/Network/User.cs | 2 +- .../PropertiesNewtonsoft-Json-Linq-JProperty.json | 2 +- DSALib/Talent.cs | 45 - DSALib/Vorteil.cs | 18 - DSALib/Zauber.cs | 16 - DSALib/helden/Felis.xml | 4 - DSALib/helden/Gardist.xml | 4 - DSALib/helden/HartmutReiher.xml | 4 - .../helden/Helga_vom_Drachenei_Tausendsasserin.xml | 4 - DSALib/helden/Krenko.xml | 4 - DSALib/helden/Ledur Torfinson.xml | 4 - DSALib/helden/Morla.xml | 4 - DSALib/helden/Numeri.xml | 4 - DSALib/helden/Potus.xml | 4 - DSALib/helden/PumpausderGosse.xml | 4 - DSALib/helden/Rhoktar4.xml | 4 - DSALib/helden/Volant.xml | 4 - DiscoBot.sln | 59 +- DiscoBot/App.config | 4 +- DiscoBot/Audio/AudioModule.cs | 65 - DiscoBot/Audio/AudioService.cs | 95 - DiscoBot/Audio/Sound.cs | 18 - DiscoBot/Audio/Voice.cs | 94 - DiscoBot/Commands/FileHandler.cs | 2 +- DiscoBot/Commands/MiscCommands.cs | 2 +- DiscoBot/DiscoBot.csproj | 71 +- DiscoBot/Program.cs | 4 +- DiscoBot/Properties/Settings.Designer.cs | 2 +- DiscoBot/Token | 1 + DiscoBot/packages.config | 50 +- DiscordBot/Auxiliary/CommandExtension.cs | 98 + DiscordBot/Auxiliary/Dice.cs | 31 + DiscordBot/Auxiliary/Permissions.cs | 32 + DiscordBot/Auxiliary/RandomMisc.cs | 36 + DiscordBot/Auxiliary/SpellCorrect.cs | 105 + DiscordBot/CommandHandler.cs | 112 + DiscordBot/Commands/CommandHelper.cs | 119 + DiscordBot/Commands/FileHandler.cs | 24 + DiscordBot/Commands/MiscCommands.cs | 190 + DiscordBot/DiscordBot.csproj | 12 + DiscordBot/Program.cs | 58 + DiscordBot/Rework/Permissions.cs | 38 + FireBase/FireBase.csproj | 4 +- ZooBOTanica/App.config | 6 - ZooBOTanica/CritCreate.Designer.cs | 428 --- ZooBOTanica/CritCreate.cs | 92 - ZooBOTanica/CritCreate.resx | 1122 ------ "ZooBOTanica/Critters/B\303\244r.json" | 25 - ZooBOTanica/Critters/Gegner.json | 18 - ZooBOTanica/Critters/Goblin.json | 37 - ZooBOTanica/Program.cs | 19 - ZooBOTanica/Properties/AssemblyInfo.cs | 35 - ZooBOTanica/Properties/Resources.Designer.cs | 63 - ZooBOTanica/Properties/Resources.resx | 117 - ZooBOTanica/Properties/Settings.Designer.cs | 26 - ZooBOTanica/Properties/Settings.settings | 7 - ZooBOTanica/ZooBOTanica.csproj | 91 - functions/index.js | 8 - functions/package-lock.json | 3896 -------------------- functions/package.json | 16 - 126 files changed, 1307 insertions(+), 6866 deletions(-) delete mode 100644 DSALib/Audio/Sound.cs create mode 100644 DSALib/Auxiliary/IDataObjectEnumerableExtension.cs delete mode 100644 DSALib/CritterAttack.cs delete mode 100644 DSALib/KampfTalent.cs create mode 100644 DSALib/Models/Database/DataObject.cs create mode 100644 DSALib/Models/Database/IDataObject.cs create mode 100644 DSALib/Models/Dsa/CritterAttack.cs create mode 100644 DSALib/Models/Dsa/KampfTalent.cs create mode 100644 DSALib/Models/Dsa/Talent.cs create mode 100644 DSALib/Models/Dsa/Vorteil.cs create mode 100644 DSALib/Models/Dsa/Zauber.cs delete mode 100644 DSALib/Talent.cs delete mode 100644 DSALib/Vorteil.cs delete mode 100644 DSALib/Zauber.cs delete mode 100644 DSALib/helden/Felis.xml delete mode 100644 DSALib/helden/Gardist.xml delete mode 100644 DSALib/helden/HartmutReiher.xml delete mode 100644 DSALib/helden/Helga_vom_Drachenei_Tausendsasserin.xml delete mode 100644 DSALib/helden/Krenko.xml delete mode 100644 DSALib/helden/Ledur Torfinson.xml delete mode 100644 DSALib/helden/Morla.xml delete mode 100644 DSALib/helden/Numeri.xml delete mode 100644 DSALib/helden/Potus.xml delete mode 100644 DSALib/helden/PumpausderGosse.xml delete mode 100644 DSALib/helden/Rhoktar4.xml delete mode 100644 DSALib/helden/Volant.xml delete mode 100644 DiscoBot/Audio/AudioModule.cs delete mode 100644 DiscoBot/Audio/AudioService.cs delete mode 100644 DiscoBot/Audio/Sound.cs delete mode 100644 DiscoBot/Audio/Voice.cs create mode 100644 DiscoBot/Token create mode 100644 DiscordBot/Auxiliary/CommandExtension.cs create mode 100644 DiscordBot/Auxiliary/Dice.cs create mode 100644 DiscordBot/Auxiliary/Permissions.cs create mode 100644 DiscordBot/Auxiliary/RandomMisc.cs create mode 100644 DiscordBot/Auxiliary/SpellCorrect.cs create mode 100644 DiscordBot/CommandHandler.cs create mode 100644 DiscordBot/Commands/CommandHelper.cs create mode 100644 DiscordBot/Commands/FileHandler.cs create mode 100644 DiscordBot/Commands/MiscCommands.cs create mode 100644 DiscordBot/DiscordBot.csproj create mode 100644 DiscordBot/Program.cs create mode 100644 DiscordBot/Rework/Permissions.cs delete mode 100644 ZooBOTanica/App.config delete mode 100644 ZooBOTanica/CritCreate.Designer.cs delete mode 100644 ZooBOTanica/CritCreate.cs delete mode 100644 ZooBOTanica/CritCreate.resx delete mode 100644 "ZooBOTanica/Critters/B\303\244r.json" delete mode 100644 ZooBOTanica/Critters/Gegner.json delete mode 100644 ZooBOTanica/Critters/Goblin.json delete mode 100644 ZooBOTanica/Program.cs delete mode 100644 ZooBOTanica/Properties/AssemblyInfo.cs delete mode 100644 ZooBOTanica/Properties/Resources.Designer.cs delete mode 100644 ZooBOTanica/Properties/Resources.resx delete mode 100644 ZooBOTanica/Properties/Settings.Designer.cs delete mode 100644 ZooBOTanica/Properties/Settings.settings delete mode 100644 ZooBOTanica/ZooBOTanica.csproj delete mode 100644 functions/index.js delete mode 100644 functions/package-lock.json delete mode 100644 functions/package.json (limited to 'FireBase') diff --git a/DSACore/Controllers/CommandsController.cs b/DSACore/Controllers/CommandsController.cs index 5addf82..2ab9c96 100644 --- a/DSACore/Controllers/CommandsController.cs +++ b/DSACore/Controllers/CommandsController.cs @@ -1,6 +1,6 @@ using System; -using DSACore.Commands; -using DSACore.Models.Network; +using DSALib.Commands; +using DSALib.Models.Network; using Microsoft.AspNetCore.Mvc; // For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860 diff --git a/DSACore/Controllers/LobbyController.cs b/DSACore/Controllers/LobbyController.cs index df22607..c861eac 100644 --- a/DSACore/Controllers/LobbyController.cs +++ b/DSACore/Controllers/LobbyController.cs @@ -1,6 +1,6 @@ using System; -using DSACore.Commands; -using DSACore.Models.Network; +using DSALib.Models.Network; +using DSALib.Commands; using Microsoft.AspNetCore.Mvc; namespace DSACore.Controllers diff --git a/DSACore/DSACore.csproj b/DSACore/DSACore.csproj index 3d928e1..d730ea4 100644 --- a/DSACore/DSACore.csproj +++ b/DSACore/DSACore.csproj @@ -1,7 +1,7 @@  - netcoreapp2.1 + netcoreapp2.2 DSACore.Program diff --git a/DSACore/Hubs/Login.cs b/DSACore/Hubs/Login.cs index 1f6ca39..ebe0bae 100644 --- a/DSACore/Hubs/Login.cs +++ b/DSACore/Hubs/Login.cs @@ -4,11 +4,12 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using DSACore.Commands; -using DSACore.DSA_Game.Characters; -using DSACore.FireBase; -using DSACore.Models.Network; +using DSALib.Commands; +using DSALib.DSA_Game.Characters; +using DSALib.Models.Network; +using DSALib.FireBase; using Microsoft.AspNetCore.SignalR; +using Group = DSALib.Models.Network.Group; namespace DSACore.Hubs { @@ -30,25 +31,16 @@ namespace DSACore.Hubs public static List Tokens { get; } = new List(); - [Obsolete] - private static async void AddGroups() - { - await Database.AddGroup(new Models.Database.Groups.Group {Name = "HalloWelt", Password = "valid"}); - await Database.AddGroup(new Models.Database.Groups.Group {Name = "Die Krassen Gamer", Password = "valid"}); - await Database.AddGroup(new Models.Database.Groups.Group {Name = "DSA", Password = "valid"}); - await Database.AddGroup(new Models.Database.Groups.Group {Name = "Die Überhelden", Password = "valid"}); - } - public async Task SendMessage(string user, string message) { try { var group = getGroup(Context.ConnectionId).Name; } - catch (InvalidOperationException e) + catch (InvalidOperationException) { - //await Clients.Caller.SendCoreAsync(receiveMethod, - // new object[] { "Nutzer ist in keiner Gruppe. Erst joinen!" }); + await Clients.Caller.SendCoreAsync(ReceiveMethod, + new object[] { "Nutzer ist in keiner Gruppe. Erst joinen!" }); } if (message[0] == '/') @@ -93,7 +85,7 @@ namespace DSACore.Hubs return Clients.Group(group).SendCoreAsync(ReceiveMethod, new object[] {getUser(Context.ConnectionId).Name, message}); } - catch (InvalidOperationException e) + catch (InvalidOperationException) { return Clients.Caller.SendCoreAsync(ReceiveMethod, new object[] {"Nutzer ist in keiner Gruppe. Erst joinen!"}); @@ -126,7 +118,7 @@ namespace DSACore.Hubs public async Task AddGroup(string group, string password) { DsaGroups.Add(new Group(group, password)); - var Dgroup = new Models.Database.Groups.Group {Name = group, Id = DsaGroups.Count - 1}; + var Dgroup = new DSALib.Models.Database.Groups.Group {Name = group, Id = DsaGroups.Count - 1}; //Database.AddGroup(Dgroup); await Clients.Caller.SendCoreAsync(ReceiveMethod, new[] {$"group {group} sucessfully added"}); //throw new NotImplementedException("add database call to add groups"); diff --git a/DSACore/Program.cs b/DSACore/Program.cs index 46baf2d..8af0a74 100644 --- a/DSACore/Program.cs +++ b/DSACore/Program.cs @@ -1,5 +1,5 @@ -using DSACore.DSA_Game; -using DSACore.FireBase; +using DSALib.DSA_Game; +using DSALib.FireBase; using Microsoft.AspNetCore; using Microsoft.AspNetCore.Hosting; diff --git a/DSACore/Startup.cs b/DSACore/Startup.cs index 372caca..ef22802 100644 --- a/DSACore/Startup.cs +++ b/DSACore/Startup.cs @@ -19,23 +19,7 @@ namespace DSACore // This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { - /*services.AddCors(options => options.AddPolicy("CorsPolicy", - builder => - { - builder.AllowAnyOrigin()//.WithOrigins("https://dsa.truekuehli.de", "127.0.0.1") - .WithHeaders("Access-Control-Allow-Origin") - .AllowAnyHeader() - .AllowAnyMethod() - .AllowCredentials(); - })); - /* - services.AddCors(options => - { - options.AddPolicy("AllowSpecificOrigin", - builder => builder.AllowAnyMethod().AllowAnyHeader().AllowAnyOrigin().AllowCredentials()/*WithOrigins("https://dsa.truekuehli.de")#1#); - }); - -*/ + services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1); services.AddSignalR(); diff --git a/DSALib/Audio/Sound.cs b/DSALib/Audio/Sound.cs deleted file mode 100644 index aee3060..0000000 --- a/DSALib/Audio/Sound.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace DSACore.Audio -{ - public class Sound - { - public Sound(string name, string url, int volume) - { - Name = name; - Url = url; - Volume = volume; - } - - public string Name { get; } - - public string Url { get; } - - public int Volume { get; } - } -} \ No newline at end of file diff --git a/DSALib/Auxiliary/Calculator/Argument.cs b/DSALib/Auxiliary/Calculator/Argument.cs index 5ed9ee3..e681377 100644 --- a/DSALib/Auxiliary/Calculator/Argument.cs +++ b/DSALib/Auxiliary/Calculator/Argument.cs @@ -1,6 +1,6 @@ using System; -namespace DSACore.Auxiliary.Calculator +namespace DSALib.Auxiliary.Calculator { /// /// Provides an ISolvable class to save numbers. The class handles Argument checking and conversion from string to int. diff --git a/DSALib/Auxiliary/Calculator/ISolvable.cs b/DSALib/Auxiliary/Calculator/ISolvable.cs index 7be4d19..844e9b3 100644 --- a/DSALib/Auxiliary/Calculator/ISolvable.cs +++ b/DSALib/Auxiliary/Calculator/ISolvable.cs @@ -1,4 +1,4 @@ -namespace DSACore.Auxiliary.Calculator +namespace DSALib.Auxiliary.Calculator { /// /// Object has to be able to return an integer as it's value diff --git a/DSALib/Auxiliary/Calculator/Operator.cs b/DSALib/Auxiliary/Calculator/Operator.cs index 31b2a9b..e6aeec6 100644 --- a/DSALib/Auxiliary/Calculator/Operator.cs +++ b/DSALib/Auxiliary/Calculator/Operator.cs @@ -1,7 +1,7 @@ using System; -using DSACorev.Auxiliary.Calculator; +using DSALibv.Auxiliary.Calculator; -namespace DSACore.Auxiliary.Calculator +namespace DSALib.Auxiliary.Calculator { /// /// The Operator Class represents a binary operator with tow Arguments and an Operation type diff --git a/DSALib/Auxiliary/Calculator/Ops.cs b/DSALib/Auxiliary/Calculator/Ops.cs index a5c9a2d..93046d0 100644 --- a/DSALib/Auxiliary/Calculator/Ops.cs +++ b/DSALib/Auxiliary/Calculator/Ops.cs @@ -1,4 +1,4 @@ -namespace DSACorev.Auxiliary.Calculator +namespace DSALibv.Auxiliary.Calculator { /// /// The Different Operations, witch can be performed in execution-order diff --git a/DSALib/Auxiliary/Calculator/StringSolver.cs b/DSALib/Auxiliary/Calculator/StringSolver.cs index b2a7d83..bf903da 100644 --- a/DSALib/Auxiliary/Calculator/StringSolver.cs +++ b/DSALib/Auxiliary/Calculator/StringSolver.cs @@ -1,9 +1,9 @@ using System; using System.Collections.Generic; using System.Linq; -using DSACorev.Auxiliary.Calculator; +using DSALibv.Auxiliary.Calculator; -namespace DSACore.Auxiliary.Calculator +namespace DSALib.Auxiliary.Calculator { /// /// The StringSolver divides the calculation string into operations and SubStringSolvers if the string contains diff --git a/DSALib/Auxiliary/CommandInfo.cs b/DSALib/Auxiliary/CommandInfo.cs index 1472587..d8e2188 100644 --- a/DSALib/Auxiliary/CommandInfo.cs +++ b/DSALib/Auxiliary/CommandInfo.cs @@ -1,6 +1,6 @@ using System.Linq; -namespace DSACore.Auxiliary +namespace DSALib.Auxiliary { public struct CommandInfo { diff --git a/DSALib/Auxiliary/Dice.cs b/DSALib/Auxiliary/Dice.cs index 3dd6562..b07d47f 100644 --- a/DSALib/Auxiliary/Dice.cs +++ b/DSALib/Auxiliary/Dice.cs @@ -1,7 +1,7 @@ using System; using System.Linq; -namespace DSACore.Auxiliary +namespace DSALib.Auxiliary { public static class Dice // roll it! { diff --git a/DSALib/Auxiliary/Extensions.cs b/DSALib/Auxiliary/Extensions.cs index f8e9d8e..7d367a5 100644 --- a/DSALib/Auxiliary/Extensions.cs +++ b/DSALib/Auxiliary/Extensions.cs @@ -1,4 +1,4 @@ -namespace DSACore.Auxiliary +namespace DSALib.Auxiliary { public static class StringExtension { diff --git a/DSALib/Auxiliary/IDataObjectEnumerableExtension.cs b/DSALib/Auxiliary/IDataObjectEnumerableExtension.cs new file mode 100644 index 0000000..b8a6067 --- /dev/null +++ b/DSALib/Auxiliary/IDataObjectEnumerableExtension.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text.RegularExpressions; +using System.Threading.Tasks; +using DSALib.Auxiliary; +using DSALib.Models.Database; + +namespace DSACore.Auxiliary +{ + public static class DataObjectEnumerableExtension + { + public static IDataObject Match(this IEnumerable dataObjects, string name) + { + return (dataObjects as IOrderedEnumerable ?? throw new InvalidOperationException()).OrderBy(x => SpellCorrect.Compare(name,x.Name)).Last(); + } + + public static bool TryMatch(this IEnumerable dataObjects,out IDataObject data, string name) + { + data = (dataObjects as IOrderedEnumerable ?? throw new InvalidOperationException()).OrderBy(x => SpellCorrect.Compare(name,x.Name)).Last(); + + return SpellCorrect.IsMatch(name, data.Name); + } + } +} diff --git a/DSALib/Auxiliary/RandomMisc.cs b/DSALib/Auxiliary/RandomMisc.cs index 72c2234..2723930 100644 --- a/DSALib/Auxiliary/RandomMisc.cs +++ b/DSALib/Auxiliary/RandomMisc.cs @@ -2,7 +2,7 @@ using System.Linq; using System.Text; -namespace DSACore.Auxiliary +namespace DSALib.Auxiliary { public static class RandomMisc { diff --git a/DSALib/Auxiliary/SpellCorrect.cs b/DSALib/Auxiliary/SpellCorrect.cs index 77d1cf3..79908c4 100644 --- a/DSALib/Auxiliary/SpellCorrect.cs +++ b/DSALib/Auxiliary/SpellCorrect.cs @@ -1,106 +1,61 @@ using System; -using System.Diagnostics; -using System.Linq; -namespace DSACore.Auxiliary +namespace DSALib.Auxiliary { - public class SpellCorrect : StringComparer + public class SpellCorrect { - public const int ErrorThreshold = 94100; + public const double ErrorThreshold = 1 / 3.0; + private const double Match = 3.0; + private const double Gap = -1.5; + private const double Mismatch = -2.0; - public override int Compare(string x, string y) - { - return CompareEasy(x, y); - } - - public static int CompareEasy(string x, string y) - { - if (string.IsNullOrEmpty(x)) throw new ArgumentException("message", nameof(x)); - - if (string.IsNullOrEmpty(y)) throw new ArgumentException("message", nameof(y)); - - if (x.Equals(y)) return 0; - - x = x.ToLower(); - y = y.ToLower(); - if (x.Equals(y)) return 1; - - var subs = y.Split(' ', '/'); - var score = subs.Count(); - foreach (var s in subs) - if (s.Equals(x)) - score--; - - if (score < subs.Count()) return score + 1; - - return 100000 - (int) (CompareExact(x, y) * 1000.0); - /*if (y.Contains(x)) - return 6;*/ - } - - public override bool Equals(string x, string y) - { - Debug.Assert(x != null, nameof(x) + " != null"); - return x.Equals(y); - } - - public override int GetHashCode(string obj) - { - throw new NotImplementedException(); - } - - public static double CompareExact(string s, string q) + public static double Compare(string s, string q) { s = s.ToLower(); q = q.ToLower(); int i, j; - const double Match = 3.0; - const double Gap = -2.0; - const double Mismatch = -2.0; - - double decay; - + var matrix = new double[s.Length + 1, q.Length + 1]; var max = 0.0; matrix[0, 0] = 0.0; for (i = 1; i < s.Length; i++) - // matrix[i, 0] = 0.0; matrix[i, 0] = i * Gap; for (i = 1; i < q.Length; i++) matrix[0, i] = 0.0; for (i = 1; i <= s.Length; i++) - for (j = 1; j <= q.Length; j++) - { - decay = j / (double) (s.Length * 1000); - var add = s[i - 1] == q[j - 1] ? Match - decay : Mismatch; - var score = matrix[i - 1, j - 1] + add; - - if (score < matrix[i - 1, j] + Gap) score = matrix[i - 1, j] + Gap; + for (j = 1; j <= q.Length; j++) + { + double decay = j / (s.Length * 1000.0); + var add = s[i - 1] == q[j - 1] ? Match - decay : Mismatch; + var score = matrix[i - 1, j - 1] + add; - if (score < matrix[i, j - 1] + Gap) score = matrix[i, j - 1] + Gap; + if (score < matrix[i - 1, j] + Gap) score = matrix[i - 1, j] + Gap; - if (i > 1 && j > 1) - if (s[i - 1] == q[j - 2] && s[i - 2] == q[j - 1]) - { - add = 3 / 2.0 * Match - decay; - if (score < matrix[i - 2, j - 2] + add) score = matrix[i - 2, j - 2] + add; - } + if (score < matrix[i, j - 1] + Gap) score = matrix[i, j - 1] + Gap; - // if (score < 0) - // { - // score = 0; - // } + if (i > 1 && j > 1) + if (s[i - 1] == q[j - 2] && s[i - 2] == q[j - 1]) + { + add = 3 / 2.0 * Match - decay; + if (score < matrix[i - 2, j - 2] + add) score = matrix[i - 2, j - 2] + add; + } - if (max < score && i == s.Length) max = score; + if (max < score && i == s.Length) max = score; - matrix[i, j] = score; - } + matrix[i, j] = score; + } return max; } + + public static bool IsMatch(string s1, string s2) + { + var score = Compare(s1, s2); + return score > ErrorThreshold * s1.Length; + } } } \ No newline at end of file diff --git a/DSALib/Auxiliary/TalentEnumerableExtension.cs b/DSALib/Auxiliary/TalentEnumerableExtension.cs index d83114c..6ec7fcc 100644 --- a/DSALib/Auxiliary/TalentEnumerableExtension.cs +++ b/DSALib/Auxiliary/TalentEnumerableExtension.cs @@ -1,33 +1,34 @@ using System.Collections.Generic; using System.Linq; using System.Text; -using DSACore.DSA_Game.Characters; -using DSALib; +using DSACore.Auxiliary; +using DSALib.DSA_Game.Characters; +using DSALib.Models.Dsa; -namespace DSACore.Auxiliary +namespace DSALib.Auxiliary { public static class TalentEnumerableExtension { - public static string ProbenTest(this IEnumerable List, Character c, string talent, int erschwernis = 0) + public static string ProbenTest(this IEnumerable List, Character c, string talentName, int erschwernis = 0) { var output = new StringBuilder(); var sc = new SpellCorrect(); - var tTalent = List.OrderBy(x => sc.Compare(talent, x.Name)).First(); - if (sc.Compare(talent, tTalent.Name) > SpellCorrect.ErrorThreshold) - return $"{c.Name} kann nicht {talent}..."; + if (!List.TryMatch(out var iTalent, talentName)) + return $"{c.Name} kann nicht {talentName}..."; - var props = tTalent.GetEigenschaften(); // get the required properties - var tap = tTalent.Value; // get taw - var werte = props.Select(p => c.Eigenschaften[c.PropTable[p]]).ToList(); + var talent = (Talent) iTalent; + var props = talent.GetEigenschaften(); // get the required properties + var tap = talent.Value; // get taw + var werte = props.Select(p => c.Eigenschaften[c.PropTable[p]]).ToArray(); output.AppendFormat( "{0} würfelt: {1} \n{2} - {3} taw:{4} {5} \n", c.Name, - tTalent.Name, - tTalent.Probe, + talent.Name, + talent.Probe, string.Join("/", werte), - tTalent.Value, + talent.Value, erschwernis.Equals(0) ? string.Empty : "Erschwernis: " + erschwernis); output.Append(" "); diff --git a/DSALib/Auxiliary/WeaponImporter.cs b/DSALib/Auxiliary/WeaponImporter.cs index 3375236..12d243f 100644 --- a/DSALib/Auxiliary/WeaponImporter.cs +++ b/DSALib/Auxiliary/WeaponImporter.cs @@ -4,10 +4,10 @@ using System.Linq; using System.Net.Http; using System.Text.RegularExpressions; using System.Threading.Tasks; -using DSACore.FireBase; -using DSACore.Models.Database.DSA; +using DSALib.Models.Database.DSA; +using DSALib.FireBase; -namespace DSACore.Auxiliary +namespace DSALib.Auxiliary { public class WeaponImporter { diff --git a/DSALib/Characters/Critter.cs b/DSALib/Characters/Critter.cs index d9f8b53..dcedccb 100644 --- a/DSALib/Characters/Critter.cs +++ b/DSALib/Characters/Critter.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.IO; using DiscoBot.DSA_Game.Characters; +using DSALib.Models.Dsa; using Newtonsoft.Json; namespace DSALib.Characters diff --git a/DSALib/Commands/CommandHandler.cs b/DSALib/Commands/CommandHandler.cs index f74f87f..e63d7b8 100644 --- a/DSALib/Commands/CommandHandler.cs +++ b/DSALib/Commands/CommandHandler.cs @@ -1,10 +1,11 @@ using System; -using DSACore.Auxiliary; -using DSACore.Auxiliary.Calculator; -using DSACore.DSA_Game; -using DSACore.Models.Network; +using DSALib.Auxiliary; +using DSALib.Auxiliary.Calculator; +using DSALib.Commands; +using DSALib.DSA_Game; +using DSALib.Models.Network; -namespace DSACore.Commands +namespace DSALib.Commands { public class CommandHandler { diff --git a/DSALib/Commands/CommandTypes.cs b/DSALib/Commands/CommandTypes.cs index 6838ac2..62b8b0f 100644 --- a/DSALib/Commands/CommandTypes.cs +++ b/DSALib/Commands/CommandTypes.cs @@ -1,4 +1,4 @@ -namespace DSACore.Commands +namespace DSALib.Commands { public enum CommandTypes { diff --git a/DSALib/Commands/FileHandler.cs b/DSALib/Commands/FileHandler.cs index bce7c54..d117040 100644 --- a/DSALib/Commands/FileHandler.cs +++ b/DSALib/Commands/FileHandler.cs @@ -1,11 +1,12 @@ using System; using System.Linq; using System.Net; -using DSACore.DSA_Game; -using DSACore.DSA_Game.Characters; +using DSALib.DSA_Game; +using DSALib.DSA_Game.Characters; using DSALib; +using DSALib.Models.Dsa; -namespace DSACore.Commands +namespace DSALib.Commands { public class FileHandler { diff --git a/DSALib/Commands/Gm.cs b/DSALib/Commands/Gm.cs index 98b62db..74fd673 100644 --- a/DSALib/Commands/Gm.cs +++ b/DSALib/Commands/Gm.cs @@ -1,4 +1,4 @@ -namespace DSACore.Commands +namespace DSALib.Commands { /*public class Iam { diff --git a/DSALib/Commands/HeldList.cs b/DSALib/Commands/HeldList.cs index 370af34..ef29a14 100644 --- a/DSALib/Commands/HeldList.cs +++ b/DSALib/Commands/HeldList.cs @@ -1,11 +1,11 @@ using System.Collections.Generic; using System.Linq; using System.Text; -using DSACore.Auxiliary; -using DSACore.DSA_Game; -using DSACore.DSA_Game.Characters; +using DSALib.Auxiliary; +using DSALib.DSA_Game; +using DSALib.DSA_Game.Characters; -namespace DSACore.Commands +namespace DSALib.Commands { public class HeldList { diff --git a/DSALib/Commands/Help.cs b/DSALib/Commands/Help.cs index 974c44c..4506821 100644 --- a/DSALib/Commands/Help.cs +++ b/DSALib/Commands/Help.cs @@ -1,8 +1,8 @@ using System.Linq; -using DSACore.Auxiliary; -using DSACore.DSA_Game.Save; +using DSALib.Auxiliary; +using DSALib.DSA_Game.Save; -namespace DSACore.Commands +namespace DSALib.Commands { public class Help { @@ -13,7 +13,7 @@ namespace DSACore.Commands { // return command specific help var com = Properties.CommandInfos - .OrderBy(x => SpellCorrect.CompareEasy(x.Name, command.ToLower())).First(); // get best fit command + .OrderBy(x => SpellCorrect.Compare(x.Name, command.ToLower())).Last(); // get best fit command return com.GetDescription(); } diff --git a/DSALib/Commands/LebenUndAstral.cs b/DSALib/Commands/LebenUndAstral.cs index a671296..ac11c91 100644 --- a/DSALib/Commands/LebenUndAstral.cs +++ b/DSALib/Commands/LebenUndAstral.cs @@ -1,9 +1,9 @@ using System; -using DSACore.Auxiliary; -using DSACore.DSA_Game; +using DSALib.Auxiliary; +using DSALib.DSA_Game; using DSALib.Characters; -namespace DSACore.Commands +namespace DSALib.Commands { public class LE { diff --git a/DSALib/Commands/List.cs b/DSALib/Commands/List.cs index 7fc682f..1213f85 100644 --- a/DSALib/Commands/List.cs +++ b/DSALib/Commands/List.cs @@ -1,10 +1,9 @@ using System; using System.Collections.Generic; using System.Linq; -using DSACore.Audio; -using DSACore.DSA_Game; +using DSALib.DSA_Game; -namespace DSACore.Commands +namespace DSALib.Commands { public class List { @@ -27,12 +26,6 @@ namespace DSACore.Commands // res.AddRange(Help.Commands.Select(x => x.Name)); res.Add(Help.Get_Generic_Help()); break; - case "play": - case "sound": - case "sounds": - res.AddRange( - Enum.GetNames(typeof(Sound))); - break; default: res.Add($"Kommando {prop} nicht gefunden"); diff --git a/DSALib/Commands/MiscCommands.cs b/DSALib/Commands/MiscCommands.cs index ebd1598..69b2ffe 100644 --- a/DSALib/Commands/MiscCommands.cs +++ b/DSALib/Commands/MiscCommands.cs @@ -1,4 +1,4 @@ -namespace DSACore.Commands +namespace DSALib.Commands { public class MiscCommands { @@ -13,7 +13,7 @@ [Command("rd"), Summary("Würfel Dennis ")] public Task RollDennisAsync([Remainder, Summary("Weapon")] string roll) { - return this.ReplyAsync("```xl\n" + new DSACore.Auxiliary.Calculator.StringSolver(roll).Solve() + "\n```"); + return this.ReplyAsync("```xl\n" + new DSALib.Auxiliary.Calculator.StringSolver(roll).Solve() + "\n```"); }*/ /* diff --git a/DSALib/Commands/NpcCommands.cs b/DSALib/Commands/NpcCommands.cs index 95243ca..510b78b 100644 --- a/DSALib/Commands/NpcCommands.cs +++ b/DSALib/Commands/NpcCommands.cs @@ -1,11 +1,11 @@ using System; using System.Collections.Generic; using System.Linq; -using DSACore.Characters; -using DSACore.DSA_Game; -using DSACore.DSA_Game.Characters; +using DSALib.Characters; +using DSALib.DSA_Game; +using DSALib.DSA_Game.Characters; -namespace DSACore.Commands +namespace DSALib.Commands { public class NpcCommands { @@ -19,17 +19,17 @@ namespace DSACore.Commands private static string Random(ulong id, string npcName, int mean = 9, int stDv = 1) { throw new NotImplementedException(); - Dsa.Chars.Add(new Npc(npcName, mean, stDv)); - return $"{npcName} wurde zufällig generiert"; + //Dsa.Chars.Add(new Npc(npcName, mean, stDv)); + //return $"{npcName} wurde zufällig generiert"; } private static string Copy(ulong id, string npcName, string source, int stDv = 1) { if (Dsa.Chars.Exists(x => x.Name.Equals(npcName))) throw new Exception("Char gibt es schon"); throw new NotImplementedException(); - var chr = Dsa.GetCharacter(id); - Dsa.Chars.Add(new Character(chr as Character, npcName, stDv)); - return $"{npcName} wurde als variierte Kopie von {source} erstellt"; + //var chr = Dsa.GetCharacter(id); + //Dsa.Chars.Add(new Character(chr as Character, npcName, stDv)); + //return $"{npcName} wurde als variierte Kopie von {source} erstellt"; } } } \ No newline at end of file diff --git a/DSALib/Commands/ProbenTest.cs b/DSALib/Commands/ProbenTest.cs index d0800d6..7c88480 100644 --- a/DSALib/Commands/ProbenTest.cs +++ b/DSALib/Commands/ProbenTest.cs @@ -1,4 +1,4 @@ -namespace DSACore.Commands +namespace DSALib.Commands { public class ProbenTest { diff --git a/DSALib/CritterAttack.cs b/DSALib/CritterAttack.cs deleted file mode 100644 index 3b0a11d..0000000 --- a/DSALib/CritterAttack.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace DSALib -{ - public class CritterAttack - { - public CritterAttack(string name, int at, string tp, string comment = "") - { - Name = name; - At = at; - Tp = tp; - Comment = comment; - } - - public string Name { get; set; } - - public int At { get; set; } - - public string Tp { get; set; } - - public string Comment { get; set; } - } -} \ No newline at end of file diff --git a/DSALib/DSALib.csproj b/DSALib/DSALib.csproj index afada82..2281bd6 100644 --- a/DSALib/DSALib.csproj +++ b/DSALib/DSALib.csproj @@ -1,11 +1,11 @@ - + - netstandard2.0 + netcoreapp2.2 - + - + diff --git a/DSALib/DSA_Game/Characters/Character.cs b/DSALib/DSA_Game/Characters/Character.cs index ac890cb..aea5671 100644 --- a/DSALib/DSA_Game/Characters/Character.cs +++ b/DSALib/DSA_Game/Characters/Character.cs @@ -5,10 +5,11 @@ using System.Linq; using System.Text; using System.Xml; using DSACore.Auxiliary; -using DSALib; +using DSALib.Auxiliary; using DSALib.Characters; +using DSALib.Models.Dsa; -namespace DSACore.DSA_Game.Characters +namespace DSALib.DSA_Game.Characters { public class Character : Being, ICharacter { @@ -99,11 +100,9 @@ namespace DSACore.DSA_Game.Characters public string Angriff(string talent, int erschwernis = 0) // pretty self explanatory { var output = new StringBuilder(); - var sc = new SpellCorrect(); - var attack = Kampftalente.OrderBy(x => sc.Compare(talent, x.Name)).First(); - if (sc.Compare(talent, attack.Name) > SpellCorrect.ErrorThreshold) + if (!Kampftalente.TryMatch(out var iattack, talent)) return $"{Name} kann nicht mit der Waffenart {talent} umgehen..."; - + var attack = (KampfTalent) iattack; var tap = attack.At; output.AppendFormat( "{0}-Angriff taw:{1} {2} \n", @@ -119,12 +118,12 @@ namespace DSACore.DSA_Game.Characters public string Parade(string talent, int erschwernis = 0) { var output = new StringBuilder(); - var sc = new SpellCorrect(); - var attack = Kampftalente.OrderBy(x => sc.Compare(talent, x.Name)).First(); - if (sc.Compare(talent, attack.Name) > SpellCorrect.ErrorThreshold) + if (Kampftalente.TryMatch(out var iAttack , talent)) return $"{Name} kann nicht mit der Waffenart {talent} umgehen..."; + + var attack = (KampfTalent) iAttack; var tap = attack.Pa; output.AppendFormat( "{0}-Parade taw:{1} {2}\n", @@ -140,12 +139,11 @@ namespace DSACore.DSA_Game.Characters public string Fernkampf(string talent, int erschwernis = 0) { var output = new StringBuilder(); - var sc = new SpellCorrect(); var fk = Eigenschaften["fk"]; - var attack = Talente.OrderBy(x => sc.Compare(talent, x.Name)).First(); - if (sc.Compare(talent, attack.Name) > SpellCorrect.ErrorThreshold) + if (! Talente.TryMatch(out var iAttack, talent)) return $"{Name} kann nicht mit der Waffenart {talent} umgehen..."; + var attack = (Talent) iAttack; var tap = attack.Value; output.AppendFormat( "{0} taw:{1} {2} \n", diff --git a/DSALib/DSA_Game/Characters/NPC.cs b/DSALib/DSA_Game/Characters/NPC.cs index 75c3fe9..105adda 100644 --- a/DSALib/DSA_Game/Characters/NPC.cs +++ b/DSALib/DSA_Game/Characters/NPC.cs @@ -1,8 +1,8 @@ using System; -using DSACore.Auxiliary; +using DSALib.Auxiliary; using DSALib.Characters; -namespace DSACore.Characters +namespace DSALib.Characters { public class Npc : Being, ICharacter { diff --git a/DSALib/DSA_Game/Characters/SaveChar.cs b/DSALib/DSA_Game/Characters/SaveChar.cs index 7b29b4e..00e2f86 100644 --- a/DSALib/DSA_Game/Characters/SaveChar.cs +++ b/DSALib/DSA_Game/Characters/SaveChar.cs @@ -1,6 +1,6 @@ using DSALib.Characters; -namespace DSACore.DSA_Game.Characters +namespace DSALib.DSA_Game.Characters { public class SaveChar { diff --git a/DSALib/DSA_Game/Dsa.cs b/DSALib/DSA_Game/Dsa.cs index 18d0b81..bcd8951 100644 --- a/DSALib/DSA_Game/Dsa.cs +++ b/DSALib/DSA_Game/Dsa.cs @@ -1,20 +1,21 @@ using System; using System.Collections.Generic; using System.Linq; -using DSACore.DSA_Game.Characters; -using DSACore.DSA_Game.Save; +using DSALib.DSA_Game.Characters; +using DSALib.DSA_Game.Save; using DSALib; using DSALib.Characters; +using DSALib.Models.Dsa; -namespace DSACore.DSA_Game +namespace DSALib.DSA_Game { public static class Dsa { #if DEBUG public const string - rootPath = ""; //"C:\\Users\\Dennis\\Source\\Repos\\DiscoBot\\DSACore\\";//"DiscoBot\\DSACore\\"; + rootPath = ""; //"C:\\Users\\Dennis\\Source\\Repos\\DiscoBot\\DSALib\\";//"DiscoBot\\DSALib\\"; #else - public const string rootPath = "";//"DiscoBot\\DSACore\\"; + public const string rootPath = "";//"DiscoBot\\DSALib\\"; #endif private static Session s_session; diff --git a/DSALib/DSA_Game/Save/Properties.cs b/DSALib/DSA_Game/Save/Properties.cs index 7eba911..2312af0 100644 --- a/DSALib/DSA_Game/Save/Properties.cs +++ b/DSALib/DSA_Game/Save/Properties.cs @@ -3,11 +3,10 @@ using System.Collections; using System.Collections.Generic; using System.IO; using System.Linq; -using DSACore.Audio; -using DSACore.Auxiliary; +using DSALib.Auxiliary; using Newtonsoft.Json; -namespace DSACore.DSA_Game.Save +namespace DSALib.DSA_Game.Save { public static class Properties { @@ -26,11 +25,6 @@ namespace DSACore.DSA_Game.Save set => objects["CommandInfo"] = value; } // use Properties.Commandinfos to access the abstract Object array - public static List Sounds - { - get => objects["Sound"] as List; - set => objects["Sound"] = value; - } public static void Deserialize(string path = @"Properties") { diff --git a/DSALib/DSA_Game/Save/SaveCommand.cs b/DSALib/DSA_Game/Save/SaveCommand.cs index f358047..c5a1bb4 100644 --- a/DSALib/DSA_Game/Save/SaveCommand.cs +++ b/DSALib/DSA_Game/Save/SaveCommand.cs @@ -2,7 +2,7 @@ using System.IO; using System.Linq; -namespace DSACore.DSA_Game.Save +namespace DSALib.DSA_Game.Save { public class SaveCommand { diff --git a/DSALib/DSA_Game/Save/Session.cs b/DSALib/DSA_Game/Save/Session.cs index 6944fb1..62aa8f6 100644 --- a/DSALib/DSA_Game/Save/Session.cs +++ b/DSALib/DSA_Game/Save/Session.cs @@ -1,10 +1,10 @@ using System; using System.Collections.Generic; using System.IO; -using DSACore.DSA_Game.Characters; +using DSALib.DSA_Game.Characters; using Newtonsoft.Json; -namespace DSACore.DSA_Game.Save +namespace DSALib.DSA_Game.Save { public class Session { diff --git a/DSALib/FireBase/Database.cs b/DSALib/FireBase/Database.cs index 8946cf0..2debd27 100644 --- a/DSALib/FireBase/Database.cs +++ b/DSALib/FireBase/Database.cs @@ -2,18 +2,18 @@ using System.IO; using System.Linq; using System.Threading.Tasks; -using DSACore.DSA_Game; -using DSACore.DSA_Game.Characters; -using DSACore.Models.Database.DSA; -using DSACore.Models.Network; +using DSALib.DSA_Game; +using DSALib.DSA_Game.Characters; +using DSALib.Models.Database.DSA; +using DSALib.Models.Network; using Firebase.Database; using Firebase.Database.Query; -namespace DSACore.FireBase +namespace DSALib.FireBase { public static class Database { - public static FirebaseClient firebase; + public static FirebaseClient Firebase; public static Dictionary Chars = new Dictionary(); @@ -21,7 +21,7 @@ namespace DSACore.FireBase public static Dictionary RangedWeapons = new Dictionary(); - public static Dictionary Talents = new Dictionary(); + public static Dictionary Talents = new Dictionary(); public static Dictionary Spells = new Dictionary(); @@ -29,7 +29,7 @@ namespace DSACore.FireBase { var auth = File.ReadAllText(Dsa.rootPath + "Token"); ; // your app secret - firebase = new FirebaseClient( + Firebase = new FirebaseClient( "https://heldenonline-4d828.firebaseio.com/", new FirebaseOptions { @@ -39,18 +39,18 @@ namespace DSACore.FireBase Initialize(); } - private static async Task Initialize() + private static void Initialize() { - IntializeCollection("Chars", Chars); - IntializeCollection("MeleeWeapons", MeleeList); - IntializeCollection("RangedWeapons", RangedWeapons); - IntializeCollection("Talents", Talents); - IntializeCollection("Spells", Spells); + IntializeCollection("Chars", Chars).Start(); + IntializeCollection("MeleeWeapons", MeleeList).Start(); + IntializeCollection("RangedWeapons", RangedWeapons).Start(); + IntializeCollection("Talents", Talents).Start(); + IntializeCollection("Spells", Spells).Start(); } private static async Task IntializeCollection(string path, Dictionary list) { - var temp = await firebase + var temp = await Firebase .Child(path) .OrderByKey() .OnceAsync(); @@ -62,26 +62,26 @@ namespace DSACore.FireBase { DatabaseChar.LoadChar(file, out var groupChar, out var data); - var lastChar = await firebase + var lastChar = await Firebase .Child("Chars") .OrderByKey() .LimitToLast(1) .OnceAsync(); var id = groupChar.Id = data.Id = lastChar.First().Object.Id + 1; - await firebase //TODO Reomve await Operators + await Firebase //TODO Reomve await Operators .Child("Groups") .Child("Char" + id) .PutAsync(groupChar); - await firebase + await Firebase .Child("Chars") .Child("Char" + id) .PutAsync(data); Chars["Char" + id] = data; - await firebase + await Firebase .Child("Inventories") .Child("Inventory" + id) .PutAsync(new Inventory()); @@ -91,25 +91,25 @@ namespace DSACore.FireBase public static async Task RemoveChar(int id) { - await firebase + await Firebase .Child("Groups") .Child("Char" + id) .DeleteAsync(); - await firebase + await Firebase .Child("Chars") .Child("Char" + id) .DeleteAsync(); Chars.Remove("Char" + id); - await firebase + await Firebase .Child("Inventories") .Child("Inventory" + id) .DeleteAsync(); } - public static async Task GetChar(int id) + public static DatabaseChar GetChar(int id) { /*var chr = await firebase .Child("Chars") @@ -121,7 +121,7 @@ namespace DSACore.FireBase public static async Task GetInventory(int id) { - var inv = await firebase + var inv = await Firebase .Child("Inventories") .Child("Inventory" + id) .OnceSingleAsync(); @@ -130,15 +130,15 @@ namespace DSACore.FireBase public static async Task SetInventory(int id, Inventory inv) { - await firebase + await Firebase .Child("Inventories") .Child("Inventory" + id) .PutAsync(inv); } - public static async Task AddTalent(Talent tal) + public static async Task AddTalent(DSALib.Models.Database.DSA.Talent tal) { - await firebase + await Firebase .Child("Talents") .Child(tal.Name) .PutAsync(tal); @@ -146,13 +146,13 @@ namespace DSACore.FireBase public static async Task RemoveTalent(string talent) { - await firebase + await Firebase .Child("Talents") .Child(talent) .DeleteAsync(); } - public static async Task GetTalent(string talent) + public static DSALib.Models.Database.DSA.Talent GetTalent(string talent) { /* return await firebase @@ -164,7 +164,7 @@ namespace DSACore.FireBase public static async Task AddSpell(GeneralSpell tal) { - await firebase + await Firebase .Child("Spells") .Child(tal.Name) .PutAsync(tal); @@ -172,13 +172,13 @@ namespace DSACore.FireBase public static async Task RemoveSpell(string spell) { - await firebase + await Firebase .Child("Spells") .Child(spell) .DeleteAsync(); } - public static async Task GetSpell(string spell) + public static GeneralSpell GetSpell(string spell) { /*return await firebase .Child("Spells") @@ -191,7 +191,7 @@ namespace DSACore.FireBase public static async Task AddWeapon(Weapon wep) { var collection = wep.GetType() == typeof(MeleeWeapon) ? "MeleeWeapons" : "RangedWeapons"; - await firebase + await Firebase .Child(collection) .Child(wep.Name) .PutAsync(wep); @@ -200,7 +200,7 @@ namespace DSACore.FireBase public static async Task RemoveWeapon(string weapon, bool ranged = false) { var collection = ranged ? "RangedWeapons" : "MeleeWeapons"; - await firebase + await Firebase .Child(collection) .Child(weapon) .DeleteAsync(); @@ -209,7 +209,7 @@ namespace DSACore.FireBase public static async Task GetWeapon(string weapon, bool ranged = false) { var collection = ranged ? "RangedWeapons" : "MeleeWeapons"; - return await firebase + return await Firebase .Child(collection) .Child(weapon) .OnceSingleAsync(); @@ -217,10 +217,10 @@ namespace DSACore.FireBase public static async Task> GetGroups() { - var groups = await firebase + var groups = await Firebase .Child("Groups") .OrderByKey() - .OnceAsync(); + .OnceAsync(); var ret = new List(); foreach (var firebaseObject in groups) @@ -229,33 +229,33 @@ namespace DSACore.FireBase return ret; } - public static async Task GetGroup(int id) + public static async Task GetGroup(int id) { - var group = await firebase + var group = await Firebase .Child("Groups") .Child("Group" + id) - .OnceSingleAsync(); + .OnceSingleAsync(); return group; } - public static async Task AddGroup(Models.Database.Groups.Group group) + public static async Task AddGroup(DSALib.Models.Database.Groups.Group group) { - var lastChar = await firebase + var lastChar = await Firebase .Child("Groups") .OrderByKey() .LimitToLast(1) - .OnceAsync(); + .OnceAsync(); var id = group.Id = lastChar.First().Object.Id + 1; - await firebase + await Firebase .Child("Groups") .Child("Group" + id) .PutAsync(group); } - public static async void SetGroup(Models.Database.Groups.Group group) + public static async void SetGroup(DSALib.Models.Database.Groups.Group group) { - await firebase + await Firebase .Child("Groups") .Child("Group" + group.Id) .PutAsync(group); @@ -263,7 +263,7 @@ namespace DSACore.FireBase public static async void DeleteGroup(int id) { - await firebase + await Firebase .Child("Groups") .Child("Group" + id) .DeleteAsync(); diff --git a/DSALib/KampfTalent.cs b/DSALib/KampfTalent.cs deleted file mode 100644 index 7c7eed4..0000000 --- a/DSALib/KampfTalent.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace DSALib -{ - public class KampfTalent - { - public KampfTalent(string name, int at, int pa) - { - Name = name; - At = at; - Pa = pa; - } - - public string Name { get; set; } - - public int At { get; set; } - - public int Pa { get; set; } - } -} \ No newline at end of file diff --git a/DSALib/Models/Database/DSA/Advantage.cs b/DSALib/Models/Database/DSA/Advantage.cs index cc8f5cc..500cf6d 100644 --- a/DSALib/Models/Database/DSA/Advantage.cs +++ b/DSALib/Models/Database/DSA/Advantage.cs @@ -1,6 +1,6 @@ using System; -namespace DSACore.Models.Database.DSA +namespace DSALib.Models.Database.DSA { public class Advantage { diff --git a/DSALib/Models/Database/DSA/CharSpell.cs b/DSALib/Models/Database/DSA/CharSpell.cs index fabd456..77a8dc8 100644 --- a/DSALib/Models/Database/DSA/CharSpell.cs +++ b/DSALib/Models/Database/DSA/CharSpell.cs @@ -1,6 +1,6 @@ using System; -namespace DSACore.Models.Database.DSA +namespace DSALib.Models.Database.DSA { public class CharSpell { diff --git a/DSALib/Models/Database/DSA/DatabaseChar.cs b/DSALib/Models/Database/DSA/DatabaseChar.cs index 872b82e..cfd7174 100644 --- a/DSALib/Models/Database/DSA/DatabaseChar.cs +++ b/DSALib/Models/Database/DSA/DatabaseChar.cs @@ -1,9 +1,9 @@ using System; using System.Collections.Generic; using System.Linq; -using DSACore.DSA_Game.Characters; +using DSALib.DSA_Game.Characters; -namespace DSACore.Models.Database.DSA +namespace DSALib.Models.Database.DSA { public class DatabaseChar { diff --git a/DSALib/Models/Database/DSA/Field.cs b/DSALib/Models/Database/DSA/Field.cs index e63aeb4..1b10232 100644 --- a/DSALib/Models/Database/DSA/Field.cs +++ b/DSALib/Models/Database/DSA/Field.cs @@ -1,6 +1,6 @@ using System; -namespace DSACore.Models.Database.DSA +namespace DSALib.Models.Database.DSA { public class Field { diff --git a/DSALib/Models/Database/DSA/GeneralSpell.cs b/DSALib/Models/Database/DSA/GeneralSpell.cs index b4dbc0b..6fe6a78 100644 --- a/DSALib/Models/Database/DSA/GeneralSpell.cs +++ b/DSALib/Models/Database/DSA/GeneralSpell.cs @@ -1,4 +1,4 @@ -namespace DSACore.Models.Database.DSA +namespace DSALib.Models.Database.DSA { public class GeneralSpell : Talent { diff --git a/DSALib/Models/Database/DSA/GroupChar.cs b/DSALib/Models/Database/DSA/GroupChar.cs index 31fc583..0c1ecf1 100644 --- a/DSALib/Models/Database/DSA/GroupChar.cs +++ b/DSALib/Models/Database/DSA/GroupChar.cs @@ -1,4 +1,4 @@ -namespace DSACore.Models.Database.DSA +namespace DSALib.Models.Database.DSA { public class GroupChar { diff --git a/DSALib/Models/Database/DSA/Inventory.cs b/DSALib/Models/Database/DSA/Inventory.cs index 9a025d4..086564c 100644 --- a/DSALib/Models/Database/DSA/Inventory.cs +++ b/DSALib/Models/Database/DSA/Inventory.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; -namespace DSACore.Models.Database.DSA +namespace DSALib.Models.Database.DSA { public class Inventory { diff --git a/DSALib/Models/Database/DSA/Talent.cs b/DSALib/Models/Database/DSA/Talent.cs index 59ff4bc..578d93c 100644 --- a/DSALib/Models/Database/DSA/Talent.cs +++ b/DSALib/Models/Database/DSA/Talent.cs @@ -1,8 +1,8 @@ using System; -namespace DSACore.Models.Database.DSA +namespace DSALib.Models.Database.DSA { - public class Talent + public class Talent : DSALib.Models.Database.DataObject { public Talent() { @@ -19,8 +19,6 @@ namespace DSACore.Models.Database.DSA Roll = roll.Split('/'); } - public string Name { get; set; } - public string[] Roll { get; set; } = new string[3]; } } \ No newline at end of file diff --git a/DSALib/Models/Database/DSA/Weapon.cs b/DSALib/Models/Database/DSA/Weapon.cs index 58a44cd..8ed63d7 100644 --- a/DSALib/Models/Database/DSA/Weapon.cs +++ b/DSALib/Models/Database/DSA/Weapon.cs @@ -1,6 +1,6 @@ using System; -namespace DSACore.Models.Database.DSA +namespace DSALib.Models.Database.DSA { public class Weapon { diff --git a/DSALib/Models/Database/DSA/WeaponTalent.cs b/DSALib/Models/Database/DSA/WeaponTalent.cs index 98eb38d..f65fb3f 100644 --- a/DSALib/Models/Database/DSA/WeaponTalent.cs +++ b/DSALib/Models/Database/DSA/WeaponTalent.cs @@ -1,6 +1,6 @@ using System; -namespace DSACore.Models.Database.DSA +namespace DSALib.Models.Database.DSA { public class WeaponTalent { diff --git a/DSALib/Models/Database/DataObject.cs b/DSALib/Models/Database/DataObject.cs new file mode 100644 index 0000000..59cfdf2 --- /dev/null +++ b/DSALib/Models/Database/DataObject.cs @@ -0,0 +1,13 @@ +namespace DSALib.Models.Database +{ + public class DataObject : IDataObject + { + + public override string ToString() + { + return Name; + } + + public string Name { get; set; } + } +} diff --git a/DSALib/Models/Database/Groups/DSAGroup.cs b/DSALib/Models/Database/Groups/DSAGroup.cs index 89fac2f..377376e 100644 --- a/DSALib/Models/Database/Groups/DSAGroup.cs +++ b/DSALib/Models/Database/Groups/DSAGroup.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; -using DSACore.Models.Database.DSA; +using DSALib.Models.Database.DSA; -namespace DSACore.Models.Database.Groups +namespace DSALib.Models.Database.Groups { public class DSAGroup : Group { diff --git a/DSALib/Models/Database/Groups/Group.cs b/DSALib/Models/Database/Groups/Group.cs index 77d3a64..096f2be 100644 --- a/DSALib/Models/Database/Groups/Group.cs +++ b/DSALib/Models/Database/Groups/Group.cs @@ -1,9 +1,8 @@ -namespace DSACore.Models.Database.Groups +namespace DSALib.Models.Database.Groups { public class Group { public string Name { get; set; } - public string Discord { get; set; } public string Password { get; set; } public int Id { get; set; } } diff --git a/DSALib/Models/Database/IDataObject.cs b/DSALib/Models/Database/IDataObject.cs new file mode 100644 index 0000000..bdc88b7 --- /dev/null +++ b/DSALib/Models/Database/IDataObject.cs @@ -0,0 +1,7 @@ +namespace DSALib.Models.Database +{ + public interface IDataObject + { + string Name { get; set; } + } +} \ No newline at end of file diff --git a/DSALib/Models/Dsa/CritterAttack.cs b/DSALib/Models/Dsa/CritterAttack.cs new file mode 100644 index 0000000..8cd8b09 --- /dev/null +++ b/DSALib/Models/Dsa/CritterAttack.cs @@ -0,0 +1,19 @@ +namespace DSALib.Models.Dsa +{ + public class CritterAttack : Database.DataObject + { + public CritterAttack(string name, int at, string tp, string comment = "") + { + Name = name; + At = at; + Tp = tp; + Comment = comment; + } + + public int At { get; set; } + + public string Tp { get; set; } + + public string Comment { get; set; } + } +} \ No newline at end of file diff --git a/DSALib/Models/Dsa/KampfTalent.cs b/DSALib/Models/Dsa/KampfTalent.cs new file mode 100644 index 0000000..51ad255 --- /dev/null +++ b/DSALib/Models/Dsa/KampfTalent.cs @@ -0,0 +1,16 @@ +namespace DSALib.Models.Dsa +{ + public class KampfTalent : Database.DataObject + { + public KampfTalent(string name, int at, int pa) + { + Name = name; + At = at; + Pa = pa; + } + + public int At { get; set; } + + public int Pa { get; set; } + } +} \ No newline at end of file diff --git a/DSALib/Models/Dsa/Talent.cs b/DSALib/Models/Dsa/Talent.cs new file mode 100644 index 0000000..5771a74 --- /dev/null +++ b/DSALib/Models/Dsa/Talent.cs @@ -0,0 +1,43 @@ +namespace DSALib.Models.Dsa +{ + public class Talent : Database.DataObject // talent objekt + { + public Talent(string name, string probe, int value) + { + Name = name; + Probe = probe; + Value = value; + } + + public string Probe { get; set; } + + public int Value { get; set; } + + public string[] GetEigenschaften() // turn XX/XX/XX into string[]{XX,XX,XX} + { + var temp = Probe.Split('/'); + for (var index = 0; index < temp.Length; index++) temp[index] = temp[index].Replace("/", string.Empty); + + return temp; + } + + public bool IstFernkampftalent() + { + switch (Name) + { + case "Armbrust": + case "Belagerungswaffen": + case "Blasrohr": + case "Bogen": + case "Diskus": + case "Schleuder": + case "Wurfbeile": + case "Wurfmesser": + case "Wurfspeere": + return true; + default: + return false; + } + } + } +} \ No newline at end of file diff --git a/DSALib/Models/Dsa/Vorteil.cs b/DSALib/Models/Dsa/Vorteil.cs new file mode 100644 index 0000000..e37af20 --- /dev/null +++ b/DSALib/Models/Dsa/Vorteil.cs @@ -0,0 +1,16 @@ +namespace DSALib.Models.Dsa +{ + public class Vorteil : Database.DataObject // talent objekt + { + public Vorteil(string name, string value = "") + { + Name = name; + Value = value; + // this.Choice = choice; + } + + public string Value { get; set; } + + //public string Choice { get; set; } + } +} \ No newline at end of file diff --git a/DSALib/Models/Dsa/Zauber.cs b/DSALib/Models/Dsa/Zauber.cs new file mode 100644 index 0000000..e4387bf --- /dev/null +++ b/DSALib/Models/Dsa/Zauber.cs @@ -0,0 +1,16 @@ +namespace DSALib.Models.Dsa +{ + public class Zauber : Talent + { + public Zauber(string name, string probe, int value, char complexity = 'A', string representation = "Magier") + : base(name, probe, value) + { + Complexity = complexity; + Representation = Representation; + } + + public char Complexity { get; } + + public string Representation { get; } + } +} \ No newline at end of file diff --git a/DSALib/Models/Network/Command.cs b/DSALib/Models/Network/Command.cs index 00b00a6..5a97e88 100644 --- a/DSALib/Models/Network/Command.cs +++ b/DSALib/Models/Network/Command.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using System.Linq; -namespace DSACore.Models.Network +namespace DSALib.Models.Network { public class Command { diff --git a/DSALib/Models/Network/CommandResponse.cs b/DSALib/Models/Network/CommandResponse.cs index c7a410a..0816e4a 100644 --- a/DSALib/Models/Network/CommandResponse.cs +++ b/DSALib/Models/Network/CommandResponse.cs @@ -1,6 +1,6 @@ using System; -namespace DSACore.Models.Network +namespace DSALib.Models.Network { public class CommandResponse { diff --git a/DSALib/Models/Network/Group.cs b/DSALib/Models/Network/Group.cs index efe12ee..608e5ea 100644 --- a/DSALib/Models/Network/Group.cs +++ b/DSALib/Models/Network/Group.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; -namespace DSACore.Models.Network +namespace DSALib.Models.Network { public class Group { diff --git a/DSALib/Models/Network/Token.cs b/DSALib/Models/Network/Token.cs index 451cafc..2310607 100644 --- a/DSALib/Models/Network/Token.cs +++ b/DSALib/Models/Network/Token.cs @@ -1,6 +1,6 @@ using System; -namespace DSACore.Models.Network +namespace DSALib.Models.Network { public class Token { diff --git a/DSALib/Models/Network/User.cs b/DSALib/Models/Network/User.cs index 8b8008c..314a0bf 100644 --- a/DSALib/Models/Network/User.cs +++ b/DSALib/Models/Network/User.cs @@ -1,4 +1,4 @@ -namespace DSACore.Models.Network +namespace DSALib.Models.Network { public class User { diff --git a/DSALib/PropertiesNewtonsoft-Json-Linq-JProperty.json b/DSALib/PropertiesNewtonsoft-Json-Linq-JProperty.json index 0ed0f48..2544397 100644 --- a/DSALib/PropertiesNewtonsoft-Json-Linq-JProperty.json +++ b/DSALib/PropertiesNewtonsoft-Json-Linq-JProperty.json @@ -17,7 +17,7 @@ "ASPNETCORE_ENVIRONMENT": "Development" } }, - "DSACore": { + "DSALib": { "commandName": "Project", "launchBrowser": true, "launchUrl": "api/commands", diff --git a/DSALib/Talent.cs b/DSALib/Talent.cs deleted file mode 100644 index a39709c..0000000 --- a/DSALib/Talent.cs +++ /dev/null @@ -1,45 +0,0 @@ -namespace DSALib -{ - public class Talent // talent objekt - { - public Talent(string name, string probe, int value) - { - Name = name; - Probe = probe; - Value = value; - } - - public string Name { get; set; } - - public string Probe { get; set; } - - public int Value { get; set; } - - public string[] GetEigenschaften() // turn XX/XX/XX into string[]{XX,XX,XX} - { - var temp = Probe.Split('/'); - for (var index = 0; index < temp.Length; index++) temp[index] = temp[index].Replace("/", string.Empty); - - return temp; - } - - public bool IstFernkampftalent() - { - switch (Name) - { - case "Armbrust": - case "Belagerungswaffen": - case "Blasrohr": - case "Bogen": - case "Diskus": - case "Schleuder": - case "Wurfbeile": - case "Wurfmesser": - case "Wurfspeere": - return true; - default: - return false; - } - } - } -} \ No newline at end of file diff --git a/DSALib/Vorteil.cs b/DSALib/Vorteil.cs deleted file mode 100644 index c239676..0000000 --- a/DSALib/Vorteil.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace DSALib -{ - public class Vorteil // talent objekt - { - public Vorteil(string name, string value = "") - { - Name = name; - Value = value; - // this.Choice = choice; - } - - public string Name { get; set; } - - public string Value { get; set; } - - //public string Choice { get; set; } - } -} \ No newline at end of file diff --git a/DSALib/Zauber.cs b/DSALib/Zauber.cs deleted file mode 100644 index 0f460a1..0000000 --- a/DSALib/Zauber.cs +++ /dev/null @@ -1,16 +0,0 @@ -namespace DSALib -{ - public class Zauber : Talent - { - public Zauber(string name, string probe, int value, char complexity = 'A', string representation = "Magier") - : base(name, probe, value) - { - Complexity = complexity; - Representation = Representation; - } - - public char Complexity { get; } - - public string Representation { get; } - } -} \ No newline at end of file diff --git a/DSALib/helden/Felis.xml b/DSALib/helden/Felis.xml deleted file mode 100644 index 7440aaf..0000000 --- a/DSALib/helden/Felis.xml +++ /dev/null @@ -1,4 +0,0 @@ -pA70izIxomtGcRb/16T9inwwXw8=VJwVRJxgJH4HZS+IjrA6Xwv5BHNXoEDLNFGY0OJX0t1jR6laSNhNsw==

/KaCzo4Syrom78z3EQ5SbbB4sF7ey80etKII864WF64B81uRpH5t9jQTxeEu0ImbzRMqzVDZkVG9 -xD7nN1kuFw==

li7dzDacuo67Jg7mtqEm2TRuOMU=Z4Rxsnqc9E7pGknFFH2xqaryRPBaQ01khpMdLRQnG541Awtx/XPaF5Bpsy4pNWMOHCBiNU0Nogps -QW5QvnlMpA==uVrvWkzIbUdL7E80AiD0PJDX3Ck0beY5StXp1wDAA1/ePpemd6rTBNd8YoCzOovNrX016YMcTSiO -iExM4RWtJA==
\ No newline at end of file diff --git a/DSALib/helden/Gardist.xml b/DSALib/helden/Gardist.xml deleted file mode 100644 index c97c607..0000000 --- a/DSALib/helden/Gardist.xml +++ /dev/null @@ -1,4 +0,0 @@ -1SsAf+YaDGZWDsYew0x45jON/J4=Qx8xnAFVnlqg5baXpuYlluB0/As90tox235IqoOR77xyQXeGUBC/og==

/KaCzo4Syrom78z3EQ5SbbB4sF7ey80etKII864WF64B81uRpH5t9jQTxeEu0ImbzRMqzVDZkVG9 -xD7nN1kuFw==

li7dzDacuo67Jg7mtqEm2TRuOMU=Z4Rxsnqc9E7pGknFFH2xqaryRPBaQ01khpMdLRQnG541Awtx/XPaF5Bpsy4pNWMOHCBiNU0Nogps -QW5QvnlMpA==uVrvWkzIbUdL7E80AiD0PJDX3Ck0beY5StXp1wDAA1/ePpemd6rTBNd8YoCzOovNrX016YMcTSiO -iExM4RWtJA==
\ No newline at end of file diff --git a/DSALib/helden/HartmutReiher.xml b/DSALib/helden/HartmutReiher.xml deleted file mode 100644 index 114a5c9..0000000 --- a/DSALib/helden/HartmutReiher.xml +++ /dev/null @@ -1,4 +0,0 @@ -aJ0llXd+H5R2PCWNIxq2nQGUcls=Brx39LfbpQRgCi75Yc6tx9hl8O5Jg4CPbwkaFBRunag4UXIjQv9sqQ==

/KaCzo4Syrom78z3EQ5SbbB4sF7ey80etKII864WF64B81uRpH5t9jQTxeEu0ImbzRMqzVDZkVG9 -xD7nN1kuFw==

li7dzDacuo67Jg7mtqEm2TRuOMU=Z4Rxsnqc9E7pGknFFH2xqaryRPBaQ01khpMdLRQnG541Awtx/XPaF5Bpsy4pNWMOHCBiNU0Nogps -QW5QvnlMpA==uVrvWkzIbUdL7E80AiD0PJDX3Ck0beY5StXp1wDAA1/ePpemd6rTBNd8YoCzOovNrX016YMcTSiO -iExM4RWtJA==
\ No newline at end of file diff --git a/DSALib/helden/Helga_vom_Drachenei_Tausendsasserin.xml b/DSALib/helden/Helga_vom_Drachenei_Tausendsasserin.xml deleted file mode 100644 index b0f3930..0000000 --- a/DSALib/helden/Helga_vom_Drachenei_Tausendsasserin.xml +++ /dev/null @@ -1,4 +0,0 @@ -vMcyanAncITxP9wTw9/1L9KzWWw=Enznpogl943QhgW3XnOs6Tc1RoeGaF4C/DHVS7+yB9fTdYhVvYge+Q==

/KaCzo4Syrom78z3EQ5SbbB4sF7ey80etKII864WF64B81uRpH5t9jQTxeEu0ImbzRMqzVDZkVG9 -xD7nN1kuFw==

li7dzDacuo67Jg7mtqEm2TRuOMU=Z4Rxsnqc9E7pGknFFH2xqaryRPBaQ01khpMdLRQnG541Awtx/XPaF5Bpsy4pNWMOHCBiNU0Nogps -QW5QvnlMpA==uVrvWkzIbUdL7E80AiD0PJDX3Ck0beY5StXp1wDAA1/ePpemd6rTBNd8YoCzOovNrX016YMcTSiO -iExM4RWtJA==
\ No newline at end of file diff --git a/DSALib/helden/Krenko.xml b/DSALib/helden/Krenko.xml deleted file mode 100644 index 620deae..0000000 --- a/DSALib/helden/Krenko.xml +++ /dev/null @@ -1,4 +0,0 @@ -9rk+qJMY4v0RmLNh88Itq6VXLIg=GlTXU1OtSEcmoziBrTxBe0f0XFCOmzsCcTBjMeqQfA8KvC84N1AYbQ==

/KaCzo4Syrom78z3EQ5SbbB4sF7ey80etKII864WF64B81uRpH5t9jQTxeEu0ImbzRMqzVDZkVG9 -xD7nN1kuFw==

li7dzDacuo67Jg7mtqEm2TRuOMU=Z4Rxsnqc9E7pGknFFH2xqaryRPBaQ01khpMdLRQnG541Awtx/XPaF5Bpsy4pNWMOHCBiNU0Nogps -QW5QvnlMpA==uVrvWkzIbUdL7E80AiD0PJDX3Ck0beY5StXp1wDAA1/ePpemd6rTBNd8YoCzOovNrX016YMcTSiO -iExM4RWtJA==
\ No newline at end of file diff --git a/DSALib/helden/Ledur Torfinson.xml b/DSALib/helden/Ledur Torfinson.xml deleted file mode 100644 index a2bf8cb..0000000 --- a/DSALib/helden/Ledur Torfinson.xml +++ /dev/null @@ -1,4 +0,0 @@ -kwjCKNgoekrV8U2sOc1tmHX96Zw=FNYdF3Pwx3vu+tV+1fIbeNMb6r0k5KYsSPOR0MmM8BevaZb0hPws4g==

/KaCzo4Syrom78z3EQ5SbbB4sF7ey80etKII864WF64B81uRpH5t9jQTxeEu0ImbzRMqzVDZkVG9 -xD7nN1kuFw==

li7dzDacuo67Jg7mtqEm2TRuOMU=Z4Rxsnqc9E7pGknFFH2xqaryRPBaQ01khpMdLRQnG541Awtx/XPaF5Bpsy4pNWMOHCBiNU0Nogps -QW5QvnlMpA==uVrvWkzIbUdL7E80AiD0PJDX3Ck0beY5StXp1wDAA1/ePpemd6rTBNd8YoCzOovNrX016YMcTSiO -iExM4RWtJA==
\ No newline at end of file diff --git a/DSALib/helden/Morla.xml b/DSALib/helden/Morla.xml deleted file mode 100644 index 5dd39d4..0000000 --- a/DSALib/helden/Morla.xml +++ /dev/null @@ -1,4 +0,0 @@ -J0Qxa803dVWpDpWef6bwYS1dkbA=JMNNANEdxh4uTF9dr5Trjm0oxW1WhII4n2udLqB7ULX4Pw6URbN0lA==

/KaCzo4Syrom78z3EQ5SbbB4sF7ey80etKII864WF64B81uRpH5t9jQTxeEu0ImbzRMqzVDZkVG9 -xD7nN1kuFw==

li7dzDacuo67Jg7mtqEm2TRuOMU=Z4Rxsnqc9E7pGknFFH2xqaryRPBaQ01khpMdLRQnG541Awtx/XPaF5Bpsy4pNWMOHCBiNU0Nogps -QW5QvnlMpA==uVrvWkzIbUdL7E80AiD0PJDX3Ck0beY5StXp1wDAA1/ePpemd6rTBNd8YoCzOovNrX016YMcTSiO -iExM4RWtJA==
\ No newline at end of file diff --git a/DSALib/helden/Numeri.xml b/DSALib/helden/Numeri.xml deleted file mode 100644 index b907d8d..0000000 --- a/DSALib/helden/Numeri.xml +++ /dev/null @@ -1,4 +0,0 @@ -AmaaAfieEHvF5Ub8YB+OQD2D+6s=Div+yr0UvnraVfHhejvu1NDe2NU4iaZ935d1Bv3KLmYktGZcKG/jVQ==

/KaCzo4Syrom78z3EQ5SbbB4sF7ey80etKII864WF64B81uRpH5t9jQTxeEu0ImbzRMqzVDZkVG9 -xD7nN1kuFw==

li7dzDacuo67Jg7mtqEm2TRuOMU=Z4Rxsnqc9E7pGknFFH2xqaryRPBaQ01khpMdLRQnG541Awtx/XPaF5Bpsy4pNWMOHCBiNU0Nogps -QW5QvnlMpA==uVrvWkzIbUdL7E80AiD0PJDX3Ck0beY5StXp1wDAA1/ePpemd6rTBNd8YoCzOovNrX016YMcTSiO -iExM4RWtJA==
\ No newline at end of file diff --git a/DSALib/helden/Potus.xml b/DSALib/helden/Potus.xml deleted file mode 100644 index c1c04fa..0000000 --- a/DSALib/helden/Potus.xml +++ /dev/null @@ -1,4 +0,0 @@ -F7OrYyirJlEv52YqskViItN47ms=FyqxL9I3EtXVrj/SY6NLFw6F7hdqzBdNiV8rgccdkWWtvZEAGfOPtQ==

/KaCzo4Syrom78z3EQ5SbbB4sF7ey80etKII864WF64B81uRpH5t9jQTxeEu0ImbzRMqzVDZkVG9 -xD7nN1kuFw==

li7dzDacuo67Jg7mtqEm2TRuOMU=Z4Rxsnqc9E7pGknFFH2xqaryRPBaQ01khpMdLRQnG541Awtx/XPaF5Bpsy4pNWMOHCBiNU0Nogps -QW5QvnlMpA==uVrvWkzIbUdL7E80AiD0PJDX3Ck0beY5StXp1wDAA1/ePpemd6rTBNd8YoCzOovNrX016YMcTSiO -iExM4RWtJA==
\ No newline at end of file diff --git a/DSALib/helden/PumpausderGosse.xml b/DSALib/helden/PumpausderGosse.xml deleted file mode 100644 index d67ddf8..0000000 --- a/DSALib/helden/PumpausderGosse.xml +++ /dev/null @@ -1,4 +0,0 @@ -oQXQFL8j6dy53bBPLAHJsrCvDFs=UY3KHtwStSmd2pFDgHIThNF3OfFY7iasQImMyHxa+9dRGlaTEDDNug==

/KaCzo4Syrom78z3EQ5SbbB4sF7ey80etKII864WF64B81uRpH5t9jQTxeEu0ImbzRMqzVDZkVG9 -xD7nN1kuFw==

li7dzDacuo67Jg7mtqEm2TRuOMU=Z4Rxsnqc9E7pGknFFH2xqaryRPBaQ01khpMdLRQnG541Awtx/XPaF5Bpsy4pNWMOHCBiNU0Nogps -QW5QvnlMpA==uVrvWkzIbUdL7E80AiD0PJDX3Ck0beY5StXp1wDAA1/ePpemd6rTBNd8YoCzOovNrX016YMcTSiO -iExM4RWtJA==
\ No newline at end of file diff --git a/DSALib/helden/Rhoktar4.xml b/DSALib/helden/Rhoktar4.xml deleted file mode 100644 index be9b2ae..0000000 --- a/DSALib/helden/Rhoktar4.xml +++ /dev/null @@ -1,4 +0,0 @@ -btq5PhE94OQZjxRHb7Hxq539JUM=Q3g3k/lQX2jsJCxyHpcATHs1TY0aPOlnruNdqJGMgIfucIgwsdmU6A==

/KaCzo4Syrom78z3EQ5SbbB4sF7ey80etKII864WF64B81uRpH5t9jQTxeEu0ImbzRMqzVDZkVG9 -xD7nN1kuFw==

li7dzDacuo67Jg7mtqEm2TRuOMU=Z4Rxsnqc9E7pGknFFH2xqaryRPBaQ01khpMdLRQnG541Awtx/XPaF5Bpsy4pNWMOHCBiNU0Nogps -QW5QvnlMpA==uVrvWkzIbUdL7E80AiD0PJDX3Ck0beY5StXp1wDAA1/ePpemd6rTBNd8YoCzOovNrX016YMcTSiO -iExM4RWtJA==
\ No newline at end of file diff --git a/DSALib/helden/Volant.xml b/DSALib/helden/Volant.xml deleted file mode 100644 index 4fd0c8c..0000000 --- a/DSALib/helden/Volant.xml +++ /dev/null @@ -1,4 +0,0 @@ -1SwyFEXG5zhwYMHNYtyeHv4ZgF0=B03LcgbDPOAkiu9tsiLkAXmTW9mVoZipUw/T1FZrQUfouAM2rtskIg==

/KaCzo4Syrom78z3EQ5SbbB4sF7ey80etKII864WF64B81uRpH5t9jQTxeEu0ImbzRMqzVDZkVG9 -xD7nN1kuFw==

li7dzDacuo67Jg7mtqEm2TRuOMU=Z4Rxsnqc9E7pGknFFH2xqaryRPBaQ01khpMdLRQnG541Awtx/XPaF5Bpsy4pNWMOHCBiNU0Nogps -QW5QvnlMpA==uVrvWkzIbUdL7E80AiD0PJDX3Ck0beY5StXp1wDAA1/ePpemd6rTBNd8YoCzOovNrX016YMcTSiO -iExM4RWtJA==
\ No newline at end of file diff --git a/DiscoBot.sln b/DiscoBot.sln index 93659a9..ffc5896 100644 --- a/DiscoBot.sln +++ b/DiscoBot.sln @@ -1,69 +1,38 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.27130.2003 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.28803.452 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DiscoBot", "DiscoBot\DiscoBot.csproj", "{1186AF1C-BC46-4B3D-BEE0-CE478B8AEAC7}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ZooBOTanica", "ZooBOTanica\ZooBOTanica.csproj", "{58917D99-DC94-4CDD-AD2B-C6E0BAFFCF47}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DSALib", "DSALib\DSALib.csproj", "{388DD4ED-29C4-4127-AC8F-34DD3FE9F9B0}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DSACore", "DSACore\DSACore.csproj", "{35A5E2CC-0FD4-4BC0-ACBF-38599CAED1C4}" EndProject -Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "dist", "WebInterface\NodeJSServer\dist\", "{3FEC1233-072D-4031-BBEB-B9804C58BD15}" - ProjectSection(WebsiteProperties) = preProject - TargetFrameworkMoniker = ".NETFramework,Version%3Dv4.5" - Debug.AspNetCompiler.VirtualPath = "/localhost_1915" - Debug.AspNetCompiler.PhysicalPath = "WebInterface\NodeJSServer\dist\" - Debug.AspNetCompiler.TargetPath = "PrecompiledWeb\localhost_1915\" - Debug.AspNetCompiler.Updateable = "true" - Debug.AspNetCompiler.ForceOverwrite = "true" - Debug.AspNetCompiler.FixedNames = "false" - Debug.AspNetCompiler.Debug = "True" - Release.AspNetCompiler.VirtualPath = "/localhost_1915" - Release.AspNetCompiler.PhysicalPath = "WebInterface\NodeJSServer\dist\" - Release.AspNetCompiler.TargetPath = "PrecompiledWeb\localhost_1915\" - Release.AspNetCompiler.Updateable = "true" - Release.AspNetCompiler.ForceOverwrite = "true" - Release.AspNetCompiler.FixedNames = "false" - Release.AspNetCompiler.Debug = "False" - VWDPort = "1915" - SlnRelativePath = "WebInterface\NodeJSServer\dist\" - EndProjectSection -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FireBase", "FireBase\FireBase.csproj", "{87CC30E6-CBEA-4282-A3CC-FD5119A1993B}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DSALib", "DSALib\DSALib.csproj", "{C5D9AFDF-70E2-4A47-96FF-1EC47C1DE38D}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DiscordBot", "DiscordBot\DiscordBot.csproj", "{F1418B62-F043-4761-9BDD-AE078B6A99FB}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {1186AF1C-BC46-4B3D-BEE0-CE478B8AEAC7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1186AF1C-BC46-4B3D-BEE0-CE478B8AEAC7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1186AF1C-BC46-4B3D-BEE0-CE478B8AEAC7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1186AF1C-BC46-4B3D-BEE0-CE478B8AEAC7}.Release|Any CPU.Build.0 = Release|Any CPU - {58917D99-DC94-4CDD-AD2B-C6E0BAFFCF47}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {58917D99-DC94-4CDD-AD2B-C6E0BAFFCF47}.Debug|Any CPU.Build.0 = Debug|Any CPU - {58917D99-DC94-4CDD-AD2B-C6E0BAFFCF47}.Release|Any CPU.ActiveCfg = Release|Any CPU - {58917D99-DC94-4CDD-AD2B-C6E0BAFFCF47}.Release|Any CPU.Build.0 = Release|Any CPU - {388DD4ED-29C4-4127-AC8F-34DD3FE9F9B0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {388DD4ED-29C4-4127-AC8F-34DD3FE9F9B0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {388DD4ED-29C4-4127-AC8F-34DD3FE9F9B0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {388DD4ED-29C4-4127-AC8F-34DD3FE9F9B0}.Release|Any CPU.Build.0 = Release|Any CPU {35A5E2CC-0FD4-4BC0-ACBF-38599CAED1C4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {35A5E2CC-0FD4-4BC0-ACBF-38599CAED1C4}.Debug|Any CPU.Build.0 = Debug|Any CPU {35A5E2CC-0FD4-4BC0-ACBF-38599CAED1C4}.Release|Any CPU.ActiveCfg = Release|Any CPU {35A5E2CC-0FD4-4BC0-ACBF-38599CAED1C4}.Release|Any CPU.Build.0 = Release|Any CPU - {3FEC1233-072D-4031-BBEB-B9804C58BD15}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3FEC1233-072D-4031-BBEB-B9804C58BD15}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3FEC1233-072D-4031-BBEB-B9804C58BD15}.Release|Any CPU.ActiveCfg = Debug|Any CPU - {3FEC1233-072D-4031-BBEB-B9804C58BD15}.Release|Any CPU.Build.0 = Debug|Any CPU {87CC30E6-CBEA-4282-A3CC-FD5119A1993B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {87CC30E6-CBEA-4282-A3CC-FD5119A1993B}.Debug|Any CPU.Build.0 = Debug|Any CPU {87CC30E6-CBEA-4282-A3CC-FD5119A1993B}.Release|Any CPU.ActiveCfg = Release|Any CPU {87CC30E6-CBEA-4282-A3CC-FD5119A1993B}.Release|Any CPU.Build.0 = Release|Any CPU + {C5D9AFDF-70E2-4A47-96FF-1EC47C1DE38D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C5D9AFDF-70E2-4A47-96FF-1EC47C1DE38D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C5D9AFDF-70E2-4A47-96FF-1EC47C1DE38D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C5D9AFDF-70E2-4A47-96FF-1EC47C1DE38D}.Release|Any CPU.Build.0 = Release|Any CPU + {F1418B62-F043-4761-9BDD-AE078B6A99FB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F1418B62-F043-4761-9BDD-AE078B6A99FB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F1418B62-F043-4761-9BDD-AE078B6A99FB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F1418B62-F043-4761-9BDD-AE078B6A99FB}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/DiscoBot/App.config b/DiscoBot/App.config index e99cd82..c862b4e 100644 --- a/DiscoBot/App.config +++ b/DiscoBot/App.config @@ -6,7 +6,7 @@ - + @@ -28,7 +28,7 @@ - + diff --git a/DiscoBot/Audio/AudioModule.cs b/DiscoBot/Audio/AudioModule.cs deleted file mode 100644 index add4bf0..0000000 --- a/DiscoBot/Audio/AudioModule.cs +++ /dev/null @@ -1,65 +0,0 @@ -using System.Threading.Tasks; -using Discord; -using Discord.Commands; - -namespace DiscoBot.Audio -{ - public class AudioModule : ModuleBase - { - // Scroll down further for the AudioService. - // Like, way down - private readonly AudioService service; - - // Remember to add an instance of the AudioService - // to your IServiceCollection when you initialize your bot - public AudioModule(AudioService service) - { - this.service = service; - //Dsa.Service = service; - } - - // You *MUST* mark these commands with 'RunMode.Async' - // otherwise the bot will not respond until the Task times out. - [Command("_join", RunMode = RunMode.Async)] - public async Task JoinCmd() - { - await service.JoinAudio(Context.Guild, (Context.User as IVoiceState).VoiceChannel); - } - - // Remember to add preconditions to your commands, - // this is merely the minimal amount necessary. - // Adding more commands of your own is also encouraged. - [Command("_leave", RunMode = RunMode.Async)] - public async Task LeaveCmd() - { - await service.LeaveAudio(Context.Guild); - } - - [Command("_play", RunMode = RunMode.Async)] - public async Task PlayCmd([Remainder] string song) - { - /*if (Dsa.GeneralContext == null) - { - Dsa.GeneralContext = this.Context; - } - - var sounds = Enum.GetValues(typeof(Sound)); - var soundList = new List(); - foreach (var sound in sounds) - { - soundList.Add((Sound)sound); - } - - var sc = new SpellCorrect(); - - var tSound = soundList.OrderBy(x => sc.Compare(song, x.ToString())).First(); - - if (sc.Compare(song, tSound.ToString()) > SpellCorrect.ErrorThreshold) - { - await _service.SendAudioAsync(Context.Guild, Context.Channel, song); - } - - SoundEffects.Play(song);*/ - } - } -} \ No newline at end of file diff --git a/DiscoBot/Audio/AudioService.cs b/DiscoBot/Audio/AudioService.cs deleted file mode 100644 index a198eb2..0000000 --- a/DiscoBot/Audio/AudioService.cs +++ /dev/null @@ -1,95 +0,0 @@ -using System; -using System.Collections.Concurrent; -using System.Diagnostics; -using System.IO; -using System.Threading.Tasks; -using Discord; -using Discord.Audio; - -namespace DiscoBot.Audio -{ - public class AudioService - { - private readonly ConcurrentDictionary connectedChannels = - new ConcurrentDictionary(); - - public async Task JoinAudio(IGuild guild, IVoiceChannel target) - { - if (connectedChannels.TryGetValue(guild.Id, out var client)) return; - - if (target.Guild.Id != guild.Id) return; - - var audioClient = await target.ConnectAsync(); - - if (connectedChannels.TryAdd(guild.Id, audioClient)) - { - // If you add a method to log happenings from this service, - // you can uncomment these commented lines to make use of that. - //await Log(LogSeverity.Info, $"Connected to voice on {guild.Name}."); - } - } - - public async Task LeaveAudio(IGuild guild) - { - if (connectedChannels.TryRemove(guild.Id, out var client)) - await client.StopAsync(); - //await Log(LogSeverity.Info, $"Disconnected from voice on {guild.Name}."); - } - - public async Task SendAudioAsync(IGuild guild, IMessageChannel channel, string path) - { - // Your task: Get a full path to the file if the value of 'path' is only a filename. - if (!File.Exists(path) && false) - { - await channel.SendMessageAsync("File does not exist."); - return; - } - - if (connectedChannels.TryGetValue(guild.Id, out var client)) - //await Log(LogSeverity.Debug, $"Starting playback of {path} in {guild.Name}"); - using (var ffmpeg = CreateStream(path)) - using (var stream = client.CreatePCMStream(AudioApplication.Music)) - { - try - { - await ffmpeg.StandardOutput.BaseStream.CopyToAsync(stream); - } - finally - { - await stream.FlushAsync(); - } - } - } - - public async Task SendAudioAsync(string path, int volume) - { - // Your task: Get a full path to the file if the value of 'path' is only a filename. - if (!File.Exists(path) && false) - //await channel.SendMessageAsync("File does not exist."); - return; - - throw new NotImplementedException("get channel data from server"); - /*if (this.connectedChannels.TryGetValue()) - { - //await Log(LogSeverity.Debug, $"Starting playback of {path} in {guild.Name}"); - using (var ffmpeg = this.CreateStream(path)) - using (var stream = client.CreatePCMStream(AudioApplication.Voice)) - { - try { await ffmpeg.StandardOutput.BaseStream.CopyToAsync(stream); } - finally { await stream.FlushAsync(); } - } - }*/ - } - - private static Process CreateStream(string path) - { - return Process.Start(new ProcessStartInfo - { - FileName = "ffmpeg.exe", - Arguments = $"-hide_banner -loglevel panic -i \"{path}\" -ac 2 -f s16le -ar 48000 pipe:1", - UseShellExecute = false, - RedirectStandardOutput = true - }); - } - } -} \ No newline at end of file diff --git a/DiscoBot/Audio/Sound.cs b/DiscoBot/Audio/Sound.cs deleted file mode 100644 index 85023c8..0000000 --- a/DiscoBot/Audio/Sound.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace DiscoBot.Audio -{ - public class Sound - { - public Sound(string name, string url, int volume) - { - Name = name; - Url = url; - Volume = volume; - } - - public string Name { get; } - - public string Url { get; } - - public int Volume { get; } - } -} \ No newline at end of file diff --git a/DiscoBot/Audio/Voice.cs b/DiscoBot/Audio/Voice.cs deleted file mode 100644 index c2a3097..0000000 --- a/DiscoBot/Audio/Voice.cs +++ /dev/null @@ -1,94 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Diagnostics; -using System.Threading.Tasks; -using DiscoBot.Auxiliary; -using Discord; -using Discord.Audio; -using Discord.Commands; - -namespace DiscoBot.Audio -{ - public class Voice : ModuleBase - { - public static IAudioClient Client { get; set; } - - public static void Send(string path, int volume = 256) - { - if (Client == null) throw new NullReferenceException("Bot befindet sich nicht in einem Sprachchannel"); - - // Create FFmpeg using the previous example - var ffmpeg = CreateStream(path, volume); - var output = ffmpeg.StandardOutput.BaseStream; - var barInvoker = new BackgroundWorker(); - barInvoker.DoWork += delegate - { - var discord = Client.CreatePCMStream(AudioApplication.Music); - output.CopyToAsync(discord); - - discord.FlushAsync(); - }; - - barInvoker.RunWorkerAsync(); - } - - [Command("join", RunMode = RunMode.Async)] - public async Task JoinChannelAsync(IVoiceChannel channel = null) - { - var msg = Context.Message; - - // Get the audio channel - channel = channel ?? (msg.Author as IGuildUser)?.VoiceChannel; - if (channel == null) - { - await msg.Channel.SendMessageAsync( - "User must be in a voice channel, or a voice channel must be passed as an argument."); - return; - } - - // For the next step with transmitting audio, you would want to pass this Audio Client in to a service. - var audioClient = await channel.ConnectAsync(); - Client = audioClient; - } - - [Command("leave", RunMode = RunMode.Async)] - public async Task LeaveChannelAsync(IVoiceChannel channel = null) - { -// Permissions.Test(this.Context, "Meister"); - - if (Client != null) - { - await Client.StopAsync(); - Client = null; - } - } - - - [Command("play", RunMode = RunMode.Async)] - public async Task PlayAudioAsync(string path) - { - if (Client == null) await Context.Channel.SendMessageAsync("Erst Joinen!"); - - //SoundEffects.Play(path); - - var sounds = Enum.GetValues(typeof(Sound)); - var soundList = new List(); - foreach (var sound in sounds) soundList.Add((Sound) sound); - - var sc = new SpellCorrect(); - } - - private static Process CreateStream(string path, int vol = 256) - { - var ffmpeg = new ProcessStartInfo - { - FileName = "ffmpeg", - Arguments = $"-i {path} -ac 2 -f s16le -ar 48000 -ab 620000 -vol {vol} pipe:1", - UseShellExecute = false, - RedirectStandardOutput = true - }; - return Process.Start(ffmpeg); - } - } -} \ No newline at end of file diff --git a/DiscoBot/Commands/FileHandler.cs b/DiscoBot/Commands/FileHandler.cs index 17928c8..4f8a785 100644 --- a/DiscoBot/Commands/FileHandler.cs +++ b/DiscoBot/Commands/FileHandler.cs @@ -8,7 +8,7 @@ namespace DiscoBot.Commands public class FileHandler : ModuleBase { //[Command("send"), Summary("fügt Helden hinzu")] - public async Task AddChar() + public void AddChar() { var msg = Context.Message; if (msg.Attachments == null) throw new ArgumentException("Es wurde keine Datei angehängt"); diff --git a/DiscoBot/Commands/MiscCommands.cs b/DiscoBot/Commands/MiscCommands.cs index 2bc2fad..738796c 100644 --- a/DiscoBot/Commands/MiscCommands.cs +++ b/DiscoBot/Commands/MiscCommands.cs @@ -124,7 +124,7 @@ namespace DiscoBot.Commands [Command("clear")] [Summary("Cleans up messages.")] - public async Task DeleteAsync(int count) + public void DeleteAsync(int count) { var messagesAsync = Context.Channel.GetMessagesAsync(count); if (messagesAsync != null) diff --git a/DiscoBot/DiscoBot.csproj b/DiscoBot/DiscoBot.csproj index 28f81a8..09f4cfd 100644 --- a/DiscoBot/DiscoBot.csproj +++ b/DiscoBot/DiscoBot.csproj @@ -8,7 +8,7 @@ Exe DiscoBot DiscoBot - v4.6.1 + v4.7.2 512 true @@ -35,43 +35,44 @@ 4 - - ..\packages\Discord.Net.Commands.2.0.0-beta\lib\netstandard1.1\Discord.Net.Commands.dll + + ..\packages\Discord.Net.Commands.2.1.0\lib\net46\Discord.Net.Commands.dll - - ..\packages\Discord.Net.Core.2.0.0-beta\lib\net45\Discord.Net.Core.dll + + ..\packages\Discord.Net.Core.2.1.0\lib\net46\Discord.Net.Core.dll - - ..\packages\Discord.Net.Rest.2.0.0-beta\lib\net45\Discord.Net.Rest.dll + + ..\packages\Discord.Net.Rest.2.1.0\lib\net46\Discord.Net.Rest.dll ..\packages\Discord.Net.Rpc.1.0.2\lib\net45\Discord.Net.Rpc.dll - - ..\packages\Discord.Net.Webhook.2.0.0-beta\lib\netstandard1.1\Discord.Net.Webhook.dll + + ..\packages\Discord.Net.Webhook.2.1.0\lib\netstandard1.3\Discord.Net.Webhook.dll - - ..\packages\Discord.Net.WebSocket.2.0.0-beta\lib\net45\Discord.Net.WebSocket.dll + + ..\packages\Discord.Net.WebSocket.2.1.0\lib\net46\Discord.Net.WebSocket.dll - - ..\packages\FSharp.Core.4.5.2\lib\net45\FSharp.Core.dll + + ..\packages\FSharp.Core.4.6.2\lib\net45\FSharp.Core.dll - ..\packages\Microsoft.Extensions.DependencyInjection.2.2.0-preview2-35157\lib\net461\Microsoft.Extensions.DependencyInjection.dll + ..\packages\Microsoft.Extensions.DependencyInjection.2.2.0\lib\net461\Microsoft.Extensions.DependencyInjection.dll - ..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.2.2.0-preview2-35157\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll + ..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.2.2.0\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll - - ..\packages\Newtonsoft.Json.11.0.2\lib\net45\Newtonsoft.Json.dll + + ..\packages\Newtonsoft.Json.12.0.2\lib\net45\Newtonsoft.Json.dll ..\packages\System.Collections.Immutable.1.5.0\lib\netstandard2.0\System.Collections.Immutable.dll + - - ..\packages\System.Diagnostics.DiagnosticSource.4.5.0\lib\net46\System.Diagnostics.DiagnosticSource.dll + + ..\packages\System.Diagnostics.DiagnosticSource.4.5.1\lib\net46\System.Diagnostics.DiagnosticSource.dll ..\packages\System.Interactive.Async.3.2.0\lib\net46\System.Interactive.Async.dll @@ -79,31 +80,43 @@ ..\packages\System.IO.Compression.4.3.0\lib\net46\System.IO.Compression.dll - - ..\packages\System.Net.Http.4.3.3\lib\net46\System.Net.Http.dll + + ..\packages\System.Net.Http.4.3.4\lib\net46\System.Net.Http.dll + True True ..\packages\System.Net.Sockets.4.3.0\lib\net46\System.Net.Sockets.dll + + ..\packages\System.Runtime.4.3.1\lib\net462\System.Runtime.dll + True + True + + + ..\packages\System.Runtime.Extensions.4.3.1\lib\net462\System.Runtime.Extensions.dll + True + True + False ..\packages\System.Security.Cryptography.Algorithms.4.3.1\lib\net461\System.Security.Cryptography.Algorithms.dll True + + ..\packages\System.Text.RegularExpressions.4.3.1\lib\net463\System.Text.RegularExpressions.dll + True + True + - - - - @@ -123,13 +136,7 @@ - - {388dd4ed-29c4-4127-ac8f-34dd3fe9f9b0} - DSALib - - - - + diff --git a/DiscoBot/Program.cs b/DiscoBot/Program.cs index 6ddac5d..4314a8d 100644 --- a/DiscoBot/Program.cs +++ b/DiscoBot/Program.cs @@ -4,7 +4,6 @@ using System.Linq; using System.Net; using System.Reflection; using System.Threading.Tasks; -using DiscoBot.Audio; using Discord; using Discord.Commands; using Discord.WebSocket; @@ -15,7 +14,7 @@ namespace DiscoBot { private DiscordSocketClient client; private CommandService commands; - private IServiceProvider services; + private IServiceProvider services = null; public static void Main(string[] args) { @@ -109,7 +108,6 @@ namespace DiscoBot private static void OnProcessExit(object sender, EventArgs e) { Console.WriteLine("I'm out of here"); - Voice.Client.StopAsync(); } } } \ No newline at end of file diff --git a/DiscoBot/Properties/Settings.Designer.cs b/DiscoBot/Properties/Settings.Designer.cs index 9813b8a..f80dfa5 100644 --- a/DiscoBot/Properties/Settings.Designer.cs +++ b/DiscoBot/Properties/Settings.Designer.cs @@ -12,7 +12,7 @@ namespace DiscoBot.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.6.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.0.0.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); diff --git a/DiscoBot/Token b/DiscoBot/Token new file mode 100644 index 0000000..4b78e50 --- /dev/null +++ b/DiscoBot/Token @@ -0,0 +1 @@ +Mjk0NTU0MDU4Nzg4NzAwMTYx.DgAvuw.amZ0Ep7-FKjToTf_wnY3h5Ep4Ow \ No newline at end of file diff --git a/DiscoBot/packages.config b/DiscoBot/packages.config index 4aa29aa..75a1f83 100644 --- a/DiscoBot/packages.config +++ b/DiscoBot/packages.config @@ -1,60 +1,60 @@  - - - - + + + + - - - - - - + + + + + + - - + + - + - + - + - - - - + + + + - + - - + + - + - + - + diff --git a/DiscordBot/Auxiliary/CommandExtension.cs b/DiscordBot/Auxiliary/CommandExtension.cs new file mode 100644 index 0000000..690f352 --- /dev/null +++ b/DiscordBot/Auxiliary/CommandExtension.cs @@ -0,0 +1,98 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Net; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using Discord; +using Discord.Commands; + +namespace DiscordBot.Auxiliary +{ + public static class CommandExtension + { + private static WebClient _client; + + public static async Task ReplyTimedAsync(this ModuleBase m, string message, TimeSpan time) + { + var token = message.GetHashCode(); + var send = m.Context.Channel.SendMessageAsync($"#{token}\n```xl\n{message}```"); + + var barInvoker = new BackgroundWorker(); + barInvoker.DoWork += delegate + { + Thread.Sleep(time); + Delete(token, m); + }; + + await send; + barInvoker.RunWorkerAsync(); + } + + private static void Delete(int token, ModuleBase m) + { + var messagesAsync = m.Context.Channel.GetMessagesAsync(); + Task.WaitAll(messagesAsync.ToArray()); + var list = messagesAsync.ToEnumerable().ToList(); + var messages = new List(); + foreach (var task in list) messages.AddRange(task.ToList()); + + var test = messages.Where(x => x.Content.StartsWith($"#{token}\n") && x.Author.IsBot).Select(c => c); + Task.WaitAll(test.Select(message => (message as IUserMessage)?.DeleteAsync()).ToArray()); + } + + public static async Task ReplyAsync(this ModuleBase m, IEnumerable message, bool directMessage = false) + { + var sb = new StringBuilder(); + foreach (var re in message) + { + if (sb.Length + re.Length > 1798) + { + if (directMessage) + await m.Context.User.SendMessageAsync("```xl\n" + sb + "\n```"); + else + await m.Context.Channel.SendMessageAsync("```xl\n" + sb + "\n```"); + + sb.Clear(); + } + + sb.AppendLine(re); + } + + if (directMessage) + await m.Context.User.SendMessageAsync("```xl\n" + sb + "\n```"); + else + await m.Context.Channel.SendMessageAsync("```xl\n" + sb + "\n```"); + } + + public static async Task ReplyAsync(this ModuleBase m, IEnumerable message, TimeSpan time) + { + var sb = new StringBuilder(); + foreach (var re in message) + { + if (sb.Length + re.Length > 1798) + { + await m.ReplyTimedAsync(sb.ToString(), time); + + + sb.Clear(); + } + + sb.AppendLine(re); + } + + await m.ReplyTimedAsync(sb.ToString(), TimeSpan.FromSeconds(90)); + } + + public static async Task SendWebFile(this IMessageChannel channel, + string url = "https://i.imgur.com/0iHEycJ.png") + { + if (_client == null) _client = new WebClient(); + + var stream = _client.OpenRead(url); + await channel.SendFileAsync(stream, url.Split('/').Last()); + } + } +} \ No newline at end of file diff --git a/DiscordBot/Auxiliary/Dice.cs b/DiscordBot/Auxiliary/Dice.cs new file mode 100644 index 0000000..c44e87e --- /dev/null +++ b/DiscordBot/Auxiliary/Dice.cs @@ -0,0 +1,31 @@ +using System; + +namespace DiscordBot.Auxiliary +{ + public static class Dice // roll it! + { + private static readonly Random Rnd = new Random(); + + public static int Roll(int d = 20) + { + return Rnd.Next(d) + 1; + } + + + public static int Roll(int count, int d) + { + if (d <= 0) return 0; + + var sum = 0; + for (var i = 0; i < Math.Abs(count); i++) + { + var roll = Roll(d); + sum += roll; + } + + sum *= Math.Abs(count) / count; + + return sum; + } + } +} \ No newline at end of file diff --git a/DiscordBot/Auxiliary/Permissions.cs b/DiscordBot/Auxiliary/Permissions.cs new file mode 100644 index 0000000..c2cb058 --- /dev/null +++ b/DiscordBot/Auxiliary/Permissions.cs @@ -0,0 +1,32 @@ +using System.Collections.Generic; +using System.Linq; +using Discord.Commands; +using Discord.WebSocket; + +namespace DiscordBot.Auxiliary +{ + public static class Permissions + { + public static bool Check(ICommandContext c, string role) + { + return ((SocketGuildUser) c.User).Roles.ToList().Exists(v => v.Name.Equals(role)); + } + + public static bool Check(ICommandContext c, IEnumerable roles) + { + return roles.Any(role => ((SocketGuildUser) c.User).Roles.ToList().Exists(v => v.Name.Equals(role))); + } + + public static bool Test(ICommandContext c, string role) + { + if (Check(c, role)) return true; + c.Channel.SendMessageAsync("```xl\n Keine ausreichenden Berechtigungen\n```").Wait(); + return false; + } + + public static void Test(ICommandContext c, string[] roles) + { + if (!Check(c, roles)) c.Channel.SendMessageAsync("```xl\n Keine ausreichenden Berechtigungen\n```").Wait(); + } + } +} \ No newline at end of file diff --git a/DiscordBot/Auxiliary/RandomMisc.cs b/DiscordBot/Auxiliary/RandomMisc.cs new file mode 100644 index 0000000..f7c5186 --- /dev/null +++ b/DiscordBot/Auxiliary/RandomMisc.cs @@ -0,0 +1,36 @@ +using System; +using System.Linq; +using System.Text; + +namespace DiscordBot.Auxiliary +{ + public static class RandomMisc + { + public static string Roll(string input) + { + var output = new StringBuilder(); + var strings = input.Split('w', 'd').ToList(); + var count = Convert.ToInt32(strings[0]); + strings = strings[1].Split(' ').ToList(); + var d = Convert.ToInt32(strings[0]); + + if (strings.Count > 0) + { + } + + var sum = 0; + for (var i = 0; i < count; i++) + { + var roll = Dice.Roll(d); + sum += roll; + output.Append("[" + roll + "] "); + } + + if (strings.Count <= 1) return output.ToString(); + sum += Convert.ToInt32(strings[1]); + output.Append("sum: " + sum); + + return output.ToString(); + } + } +} \ No newline at end of file diff --git a/DiscordBot/Auxiliary/SpellCorrect.cs b/DiscordBot/Auxiliary/SpellCorrect.cs new file mode 100644 index 0000000..a2ba91a --- /dev/null +++ b/DiscordBot/Auxiliary/SpellCorrect.cs @@ -0,0 +1,105 @@ +using System; +using System.Diagnostics; + +namespace DiscordBot.Auxiliary +{ + public class SpellCorrect : StringComparer + { + public const int ErrorThreshold = 94100; + + public override int Compare(string x, string y) + { + return CompareEasy(x, y); + } + + public static int CompareEasy(string x, string y) + { + if (string.IsNullOrEmpty(x)) throw new ArgumentException("message", nameof(x)); + + if (string.IsNullOrEmpty(y)) throw new ArgumentException("message", nameof(y)); + + if (x.Equals(y)) return 0; + + x = x.ToLower(); + y = y.ToLower(); + if (x.Equals(y)) return 1; + + var subs = y.Split(' ', '/'); + var score = subs.Length; + foreach (var s in subs) + if (s.Equals(x)) + score--; + + if (score < subs.Length) return score + 1; + + return 100000 - (int) (CompareExact(x, y) * 1000.0); + /*if (y.Contains(x)) + return 6;*/ + } + + public override bool Equals(string x, string y) + { + Debug.Assert(x != null, nameof(x) + " != null"); + return x.Equals(y); + } + + public override int GetHashCode(string obj) + { + throw new NotImplementedException(); + } + + public static double CompareExact(string s, string q) + { + s = s.ToLower(); + q = q.ToLower(); + + int i, j; + const double match = 3.0; + const double gap = -2.0; + const double mismatch = -2.0; + + double decay; + + var matrix = new double[s.Length + 1, q.Length + 1]; + var max = 0.0; + matrix[0, 0] = 0.0; + + for (i = 1; i < s.Length; i++) + // matrix[i, 0] = 0.0; + matrix[i, 0] = i * gap; + + for (i = 1; i < q.Length; i++) matrix[0, i] = 0.0; + + + for (i = 1; i <= s.Length; i++) + for (j = 1; j <= q.Length; j++) + { + decay = j / (double) (s.Length * 1000); + var add = s[i - 1] == q[j - 1] ? match - decay : mismatch; + var score = matrix[i - 1, j - 1] + add; + + if (score < matrix[i - 1, j] + gap) score = matrix[i - 1, j] + gap; + + if (score < matrix[i, j - 1] + gap) score = matrix[i, j - 1] + gap; + + if (i > 1 && j > 1) + if (s[i - 1] == q[j - 2] && s[i - 2] == q[j - 1]) + { + add = 3 / 2.0 * match - decay; + if (score < matrix[i - 2, j - 2] + add) score = matrix[i - 2, j - 2] + add; + } + + // if (score < 0) + // { + // score = 0; + // } + + if (max < score && i == s.Length) max = score; + + matrix[i, j] = score; + } + + return max; + } + } +} \ No newline at end of file diff --git a/DiscordBot/CommandHandler.cs b/DiscordBot/CommandHandler.cs new file mode 100644 index 0000000..0f6aa7e --- /dev/null +++ b/DiscordBot/CommandHandler.cs @@ -0,0 +1,112 @@ + +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Net; +using System.Net.Http; +using System.Reflection; +using System.Threading.Tasks; +using Discord; +using Discord.Commands; +using Discord.WebSocket; + +namespace DiscordBot +{ + public class CommandHandler + { + private readonly DiscordSocketClient _client; + private readonly CommandService _commands; + private static readonly HttpClient _HttpClient = new HttpClient(); + + public CommandHandler(DiscordSocketClient client, CommandService commands) + { + _commands = commands; + _client = client; + } + + public async Task InstallCommandsAsync() + { + // Hook the MessageReceived event into our command handler + _client.MessageReceived += HandleCommandAsync; + + // Here we discover all of the command modules in the entry + // assembly and load them. Starting from Discord.NET 2.0, a + // service provider is required to be passed into the + // module registration method to inject the + // required dependencies. + // + // If you do not use Dependency Injection, pass null. + // See Dependency Injection guide for more information. + await _commands.AddModulesAsync(assembly: Assembly.GetEntryAssembly(), + services: null); + } + + private async Task HandleCommandAsync(SocketMessage messageParam) + { + // Don't process the command if it was a system message + var message = messageParam as SocketUserMessage; + if (message == null) return; + + // Create a number to track where the prefix ends and the command begins + int argPos = 0; + + // Determine if the message is a command based on the prefix and make sure no bots trigger commands + if (!(message.HasCharPrefix('!', ref argPos) || + message.HasMentionPrefix(_client.CurrentUser, ref argPos)) || + message.Author.IsBot) + return; + + // Create a WebSocket-based command context based on the message + var context = new SocketCommandContext(_client, message); + + // Execute the command with the command context we just + // created, along with the service provider for precondition checks. + + // Keep in mind that result does not indicate a return value + // rather an object stating if the command executed successfully. + var result = await _commands.ExecuteAsync( + context: context, + argPos: argPos, + services: null); + + // Optionally, we may inform the user if the command fails + // to be executed; however, this may not always be desired, + // as it may clog up the request queue should a user spam a + // command. + + if (result.Error == CommandError.UnknownCommand) + { + var response = await SendCommand(message.Author.Username, message.Content,"https://kobert.dev/api/dsa/commands"); + //var response = "invalid"; + await context.Channel.SendMessageAsync(response); + } + else if (!result.IsSuccess) await context.Channel.SendMessageAsync(result.ErrorReason); + } + + + + private static async Task SendCommand(string name, string command, string url) + { + command = command.Remove(0, 1); + var args = command.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); + + var cmdContent = string.Empty; + if (args.Length > 1) cmdContent = "\"" + args.Skip(1).Aggregate((s, n) => s + "\", \"" + n) + "\""; + + var values = new Dictionary + { + { "Name", name }, + { "CmdIdentifier", args.First()}, + { "CmdTexts", "[" + cmdContent + "]"} + }; + + var content = new FormUrlEncodedContent(values); + + var response = await _HttpClient.PostAsync(url, content); + + return await response.Content.ReadAsStringAsync(); + } + + } +} diff --git a/DiscordBot/Commands/CommandHelper.cs b/DiscordBot/Commands/CommandHelper.cs new file mode 100644 index 0000000..162c65d --- /dev/null +++ b/DiscordBot/Commands/CommandHelper.cs @@ -0,0 +1,119 @@ +namespace DiscoBot.Auxiliary +{ + using System; + using System.Collections.Generic; + using System.ComponentModel; + using System.IO; + using System.Linq; + using System.Net; + using System.Text; + using System.Threading; + using System.Threading.Tasks; + + using Discord; + using Discord.Commands; + + public static class CommandHelper + { + private static WebClient client; + + public static async Task ReplyTimedAsync(this ModuleBase m, string message, TimeSpan time) + { + var token = message.GetHashCode(); + var send = m.Context.Channel.SendMessageAsync($"#{token}\n```xl\n{message}```", false); + + var barInvoker = new BackgroundWorker(); + barInvoker.DoWork += delegate + { + Thread.Sleep(time); + Delete(token, m); + }; + + await send; + barInvoker.RunWorkerAsync(); + } + + private static void Delete(int token, ModuleBase m) + { + var messagesAsync = m.Context.Channel.GetMessagesAsync(); + Task.WaitAll(messagesAsync.ToArray()); + var list = messagesAsync.ToEnumerable().ToList(); + var messages = new List(); + foreach (var task in list) + { + messages.AddRange(task.ToList()); + } + + var test = messages.Where(x => x.Content.StartsWith($"#{token}\n") && x.Author.IsBot).Select(c=>c ); + var waiters = new List(); + foreach (var message in test) + { + waiters.Add((message as IUserMessage).DeleteAsync()); + } + Task.WaitAll(waiters.ToArray()); + } + + public static async Task ReplyAsync(this ModuleBase m, IEnumerable message, bool directMessage = false) + { + var sb = new StringBuilder(); + foreach (string re in message) + { + if (sb.Length + re.Length > 1798) + { + if (directMessage) + { + await m.Context.User.SendMessageAsync("```xl\n" + sb + "\n```"); + } + else + { + await m.Context.Channel.SendMessageAsync("```xl\n" + sb + "\n```"); + } + + sb.Clear(); + } + + sb.AppendLine(re); + } + + if (directMessage) + { + await m.Context.User.SendMessageAsync("```xl\n" + sb + "\n```"); + } + else + { + await m.Context.Channel.SendMessageAsync("```xl\n" + sb + "\n```"); + } + } + + public static async Task ReplyAsync(this ModuleBase m, IEnumerable message, TimeSpan time) + { + var sb = new StringBuilder(); + foreach (string re in message) + { + if (sb.Length + re.Length > 1798) + { + + await m.ReplyTimedAsync(sb.ToString(), time); + + + sb.Clear(); + } + + sb.AppendLine(re); + } + + await m.ReplyTimedAsync(sb.ToString(), TimeSpan.FromSeconds(90)); + } + + public static async Task SendWebFile(this IMessageChannel channel, string url = "https://i.imgur.com/0iHEycJ.png") + { + if (client == null) + { + client = new WebClient(); + } + + Stream stream = client.OpenRead(url); + await channel.SendFileAsync(stream, url.Split('/').Last()); + } + } +} diff --git a/DiscordBot/Commands/FileHandler.cs b/DiscordBot/Commands/FileHandler.cs new file mode 100644 index 0000000..e3cd82d --- /dev/null +++ b/DiscordBot/Commands/FileHandler.cs @@ -0,0 +1,24 @@ +using System; +using System.Linq; +using Discord.Commands; + +namespace DiscordBot.Commands +{ + public class FileHandler : ModuleBase + { + //[Command("send"), Summary("fügt Helden hinzu")] + public void AddChar() + { + var msg = Context.Message; + if (msg.Attachments == null) throw new ArgumentException("Es wurde keine Datei angehängt"); + + var attachments = msg.Attachments.ToList(); + + if (!attachments.Any(x => x.Filename.EndsWith(".xml"))) + throw new ArgumentException("Es wurde kein xml Held mitgeschickt"); + + foreach (var attachment in attachments.Where(x => x.Filename.EndsWith(".xml"))) + throw new NotImplementedException("send File to Server"); + } + } +} \ No newline at end of file diff --git a/DiscordBot/Commands/MiscCommands.cs b/DiscordBot/Commands/MiscCommands.cs new file mode 100644 index 0000000..5707de7 --- /dev/null +++ b/DiscordBot/Commands/MiscCommands.cs @@ -0,0 +1,190 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using DiscoBot.Auxiliary; +using Discord; +using Discord.Commands; +using DiscordBot.Auxiliary; + +namespace DiscordBot.Commands +{ + public class MiscCommands : ModuleBase + { + [Command("r")] + [Summary("Würfelt ")] + [Alias("R", "Roll", "roll", "Würfle")] + public Task RollAsync([Remainder] [Summary("Weapon")] string roll) + { + //return this.ReplyAsync("```xl\n" + new Auxiliary.Calculator.StringSolver(roll).Solve() + "\n```"); + return ReplyAsync("```xl\n" + RandomMisc.Roll(roll) + "\n```"); + } + + + [Command("say")] + [Summary("Echos a message.")] + [Alias("s")] + public Task SayAsync([Remainder] [Summary("The text to echo")] + string echo) + { + return ReplyAsync(echo); + } + + [Command("liebe")] + [Summary("Echos a message.")] + [Alias("Liebe", "<3", "love")] + public async Task LoveAsync() + { + var rand = new Random(); + var user = Context.Channel.GetUsersAsync().ToList().Result.ToList().First() + .Where(x => x.Status != UserStatus.Offline).OrderBy(x => rand.Next()).First(); + await ReplyAsync( + ":heart: :heart: :heart: Verteilt die Liebe! :heart: :heart: :heart: \n Besondere Liebe geht an " + + user.Username); + //await this.ReplyAsync("!liebe"); + } + + [Command("maul")] + [Summary("Echos a message.")] + public Task MaulAsync() + { + return ReplyAsync( + "Maul...? Du meintest doch sicher Maulwürfe oder? \n:heart: :heart: :heart: \nGanz viel Liebe für Maulwürfe !\n:heart: :heart: :heart:"); + } + + + [Command("match")] + [Summary("Tinder.")] + [Alias("mach", "pass", "passt")] + public Task TinderAsync(string s1, string s2) + { + var rand = new Random((s1 + s2).GetHashCode()); + + var wert = Math.Log10(Math.Floor(1000.0 * (SpellCorrect.CompareExact(s1, s2) + rand.NextDouble() * 10.0)) / + 1000.0); + wert = wert * 100.0 < 100.0 ? wert * 100.0 : 100.0 - wert; + wert = wert < 0 ? -wert : wert; + return ReplyAsync($"Ihr passt zu {Math.Floor(100.0 * wert) / 100.0}% zusammen"); + } + + [Command("reddit")] + [Summary("Reddit.")] + public Task RedditAsync() + { + return ReplyAsync( + "Ein Archiv der Vergangenen Aktionen findet man hier: https://www.reddit.com/r/ReconquistaInternet/"); + } + + [Command("compare")] + [Summary("Echos a message.")] + public async Task KickAsync() + { + //await this.Context.Guild.DownloadUsersAsync(); + var users = Context.Guild.GetUsersAsync(); + var test = File.ReadAllLines("RG.txt"); + await users; + var us = users.Result.Select(x => x.Username); + + var lines = test.Where(x => !x.Equals(string.Empty)).ToList(); + + + var sc = new SpellCorrect(); + + var res = new List(); + + foreach (var line in lines) + { + var best = us.OrderBy(user => sc.Compare(user, line)).First(); + + double fit = sc.Compare(best, line); + + if (!(fit < SpellCorrect.ErrorThreshold - 20000)) continue; + res.Add(fit.Equals(0) ? $"@\t{best} !!! => {line}" : $"-\t{best} hat Ähnlichkeit mit: {line}"); + } + + var sb = new StringBuilder(); + foreach (var re in res) + { + if (sb.Length + re.Length > 1798) + { + await CommandHelper.ReplyTimedAsync(this, sb.ToString(), TimeSpan.FromSeconds(90)); + sb.Clear(); + } + + sb.AppendLine(re); + } + + if (Permissions.Check(Context, new[] {"Admin", "Mod"})) + await CommandHelper.ReplyTimedAsync(this, sb.ToString(), TimeSpan.FromSeconds(90)); + + //await this.ReplyAsync($"{count} Duplikate gefunden"); + } + + + [Command("clear")] + [Summary("Cleans up messages.")] + public void DeleteAsync(int count) + { + var messagesAsync = Context.Channel.GetMessagesAsync(count); + if (messagesAsync != null) + { + Task.WaitAll(messagesAsync.ToArray()); + var list = messagesAsync.ToEnumerable().ToList(); + var messages = new List(); + foreach (var task in list) messages.AddRange(task.ToList()); + + if (Permissions.Check(Context, new[] {"Admin", "Mod", "Meister"})) + { + var waiters = new List(); + foreach (var message in messages) waiters.Add(((IUserMessage) message).DeleteAsync()); + + Task.WaitAll(waiters.ToArray()); + } + } + } + + [Command("check")] + [Summary("Echos a message.")] + [Alias("Check")] + public async Task CheckAsync(string quarry) + { + var perm = new List {"Admin", "Mod", "Privatpolizei"}; + + Permissions.Test(Context, perm.ToArray()); + + var test = File.ReadAllLines("RG.txt"); + + var lines = test.Where(x => !x.Equals(string.Empty)).ToList(); + + + var sc = new SpellCorrect(); + var count = lines.OrderBy(line => sc.Compare(quarry, line)).First(); + + var fit = sc.Compare(count, quarry); + + string antwort; + + antwort = fit < SpellCorrect.ErrorThreshold - 20000 + ? $"```xl\nAuf anderem Server Match gefunden: {count}" + : $"```xl\nAuf anderem Server Kein Match gefunden: {quarry}"; + + + var users = Context.Guild.GetUsersAsync(); + await users; + var us = users.Result.Select(x => x.Username); + + sc = new SpellCorrect(); + count = us.OrderBy(line => sc.Compare(quarry, line)).First(); + + fit = sc.Compare(count, quarry); + + antwort = fit < SpellCorrect.ErrorThreshold - 20000 + ? $"{antwort}\nAuf unserem Server Match gefunden: {count}\n```" + : $"{antwort}\nAuf unserem Server Kein Match gefunden: {quarry} \n```"; + + await ReplyAsync(antwort); + } + } +} \ No newline at end of file diff --git a/DiscordBot/DiscordBot.csproj b/DiscordBot/DiscordBot.csproj new file mode 100644 index 0000000..620a3a6 --- /dev/null +++ b/DiscordBot/DiscordBot.csproj @@ -0,0 +1,12 @@ + + + + Exe + netcoreapp2.2 + + + + + + + diff --git a/DiscordBot/Program.cs b/DiscordBot/Program.cs new file mode 100644 index 0000000..60febcd --- /dev/null +++ b/DiscordBot/Program.cs @@ -0,0 +1,58 @@ +using System; +using System.IO; +using System.Linq; +using System.Net; +using System.Threading.Tasks; +using Discord; +using Discord.Commands; +using Discord.WebSocket; + +namespace DiscordBot +{ + class Program + { + public static void Main(string[] args) + => new Program().MainAsync().GetAwaiter().GetResult(); + + private DiscordSocketClient _client; + private CommandHandler cHandler; + + public async Task MainAsync() + { + _client = new DiscordSocketClient(); + + _client.Log += Log; + + + cHandler = new CommandHandler(_client, new CommandService()); + // Remember to keep token private or to read it from an + // external source! In this case, we are reading the token + // from an environment variable. If you do not know how to set-up + // environment variables, you may find more information on the + // Internet or by using other methods such as reading from + // a configuration. + await cHandler.InstallCommandsAsync(); + + try + { + await _client.LoginAsync(TokenType.Bot, + Environment.GetEnvironmentVariable("DiscordToken")); + } + catch + { + await _client.LoginAsync(TokenType.Bot, File.ReadAllText("Token")); + } + + await _client.StartAsync(); + + // Block this task until the program is closed. + await Task.Delay(-1); + } + + private Task Log(LogMessage msg) + { + Console.WriteLine(msg.ToString()); + return Task.CompletedTask; + } + } +} diff --git a/DiscordBot/Rework/Permissions.cs b/DiscordBot/Rework/Permissions.cs new file mode 100644 index 0000000..119e628 --- /dev/null +++ b/DiscordBot/Rework/Permissions.cs @@ -0,0 +1,38 @@ +using System.Linq; +using Discord.Commands; +using Discord.WebSocket; + +namespace DiscordBot.Rework +{ + public static class Permissions + { + public static bool Check(ICommandContext c, string role) + { + return ((SocketGuildUser)c.User).Roles.ToList().Exists(v => v.Name.Equals(role)); + } + + public static bool Check(ICommandContext c, string[] roles) + { + return roles.Any(role => ((SocketGuildUser)c.User).Roles.ToList().Exists(v => v.Name.Equals(role))); + } + + public static bool Test(ICommandContext c, string role) + { + if (!Check(c, role)) + { + c.Channel.SendMessageAsync("```xl\n Keine ausreichenden Berechtigungen\n```").Wait(); + return false; + } + + return true; + } + + public static void Test(ICommandContext c, string[] roles) + { + if (!Check(c, roles)) + { + c.Channel.SendMessageAsync("```xl\n Keine ausreichenden Berechtigungen\n```").Wait(); + } + } + } +} diff --git a/FireBase/FireBase.csproj b/FireBase/FireBase.csproj index 889c32f..2a47b27 100644 --- a/FireBase/FireBase.csproj +++ b/FireBase/FireBase.csproj @@ -1,7 +1,7 @@ - + - netcoreapp2.1 + netcoreapp2.2 diff --git a/ZooBOTanica/App.config b/ZooBOTanica/App.config deleted file mode 100644 index ecdcf8a..0000000 --- a/ZooBOTanica/App.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/ZooBOTanica/CritCreate.Designer.cs b/ZooBOTanica/CritCreate.Designer.cs deleted file mode 100644 index d64aaa3..0000000 --- a/ZooBOTanica/CritCreate.Designer.cs +++ /dev/null @@ -1,428 +0,0 @@ -namespace ZooBOTanica -{ - partial class CritCreateForm - { - /// - /// Erforderliche Designervariable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Verwendete Ressourcen bereinigen. - /// - /// True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Vom Windows Form-Designer generierter Code - - /// - /// Erforderliche Methode für die Designerunterstützung. - /// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden. - /// - private void InitializeComponent() - { - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CritCreateForm)); - this.NameLabel = new System.Windows.Forms.Label(); - this.NameEdit = new System.Windows.Forms.TextBox(); - this.LeLabel = new System.Windows.Forms.Label(); - this.LeEdit = new System.Windows.Forms.NumericUpDown(); - this.GrundwerteGroup = new System.Windows.Forms.GroupBox(); - this.KoLabel = new System.Windows.Forms.Label(); - this.KoEdit = new System.Windows.Forms.NumericUpDown(); - this.AeLabel = new System.Windows.Forms.Label(); - this.AeEdit = new System.Windows.Forms.NumericUpDown(); - this.AuLabel = new System.Windows.Forms.Label(); - this.AuEdit = new System.Windows.Forms.NumericUpDown(); - this.VerteidugungGroup = new System.Windows.Forms.GroupBox(); - this.PaEdit = new System.Windows.Forms.NumericUpDown(); - this.PaLabel = new System.Windows.Forms.Label(); - this.MRLabel = new System.Windows.Forms.Label(); - this.MREdit = new System.Windows.Forms.NumericUpDown(); - this.RSLAbel = new System.Windows.Forms.Label(); - this.RSEdit = new System.Windows.Forms.NumericUpDown(); - this.SecondGroup = new System.Windows.Forms.GroupBox(); - this.INIEdit = new System.Windows.Forms.TextBox(); - this.GWLabel = new System.Windows.Forms.Label(); - this.GWEdit = new System.Windows.Forms.NumericUpDown(); - this.INILabel = new System.Windows.Forms.Label(); - this.GsLabel = new System.Windows.Forms.Label(); - this.GsEdit = new System.Windows.Forms.NumericUpDown(); - this.AttackGroup = new System.Windows.Forms.GroupBox(); - this.AttackList = new System.Windows.Forms.DataGridView(); - this.NameCollum = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.ATCollum = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.TPCollum = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.KommentarCollum = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.MeisterkommentarEdit = new System.Windows.Forms.TextBox(); - this.MeisterkommentarLabel = new System.Windows.Forms.Label(); - this.SaveButton = new System.Windows.Forms.Button(); - this.LoadButton = new System.Windows.Forms.Button(); - ((System.ComponentModel.ISupportInitialize)(this.LeEdit)).BeginInit(); - this.GrundwerteGroup.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.KoEdit)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.AeEdit)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.AuEdit)).BeginInit(); - this.VerteidugungGroup.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.PaEdit)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.MREdit)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.RSEdit)).BeginInit(); - this.SecondGroup.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.GWEdit)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.GsEdit)).BeginInit(); - this.AttackGroup.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.AttackList)).BeginInit(); - this.SuspendLayout(); - // - // NameLabel - // - resources.ApplyResources(this.NameLabel, "NameLabel"); - this.NameLabel.Name = "NameLabel"; - // - // NameEdit - // - this.NameEdit.ForeColor = System.Drawing.SystemColors.WindowText; - resources.ApplyResources(this.NameEdit, "NameEdit"); - this.NameEdit.Name = "NameEdit"; - // - // LeLabel - // - resources.ApplyResources(this.LeLabel, "LeLabel"); - this.LeLabel.Name = "LeLabel"; - // - // LeEdit - // - resources.ApplyResources(this.LeEdit, "LeEdit"); - this.LeEdit.Maximum = new decimal(new int[] { - 999, - 0, - 0, - 0}); - this.LeEdit.Name = "LeEdit"; - this.LeEdit.Value = new decimal(new int[] { - 30, - 0, - 0, - 0}); - // - // GrundwerteGroup - // - this.GrundwerteGroup.Controls.Add(this.KoLabel); - this.GrundwerteGroup.Controls.Add(this.KoEdit); - this.GrundwerteGroup.Controls.Add(this.AeLabel); - this.GrundwerteGroup.Controls.Add(this.AeEdit); - this.GrundwerteGroup.Controls.Add(this.AuLabel); - this.GrundwerteGroup.Controls.Add(this.AuEdit); - resources.ApplyResources(this.GrundwerteGroup, "GrundwerteGroup"); - this.GrundwerteGroup.Name = "GrundwerteGroup"; - this.GrundwerteGroup.TabStop = false; - // - // KoLabel - // - resources.ApplyResources(this.KoLabel, "KoLabel"); - this.KoLabel.Name = "KoLabel"; - // - // KoEdit - // - resources.ApplyResources(this.KoEdit, "KoEdit"); - this.KoEdit.Name = "KoEdit"; - this.KoEdit.Value = new decimal(new int[] { - 10, - 0, - 0, - 0}); - // - // AeLabel - // - resources.ApplyResources(this.AeLabel, "AeLabel"); - this.AeLabel.Name = "AeLabel"; - // - // AeEdit - // - resources.ApplyResources(this.AeEdit, "AeEdit"); - this.AeEdit.Name = "AeEdit"; - // - // AuLabel - // - resources.ApplyResources(this.AuLabel, "AuLabel"); - this.AuLabel.Name = "AuLabel"; - // - // AuEdit - // - resources.ApplyResources(this.AuEdit, "AuEdit"); - this.AuEdit.Name = "AuEdit"; - this.AuEdit.Value = new decimal(new int[] { - 30, - 0, - 0, - 0}); - // - // VerteidugungGroup - // - this.VerteidugungGroup.Controls.Add(this.PaEdit); - this.VerteidugungGroup.Controls.Add(this.PaLabel); - this.VerteidugungGroup.Controls.Add(this.MRLabel); - this.VerteidugungGroup.Controls.Add(this.MREdit); - this.VerteidugungGroup.Controls.Add(this.RSLAbel); - this.VerteidugungGroup.Controls.Add(this.RSEdit); - resources.ApplyResources(this.VerteidugungGroup, "VerteidugungGroup"); - this.VerteidugungGroup.Name = "VerteidugungGroup"; - this.VerteidugungGroup.TabStop = false; - // - // PaEdit - // - resources.ApplyResources(this.PaEdit, "PaEdit"); - this.PaEdit.Name = "PaEdit"; - this.PaEdit.Value = new decimal(new int[] { - 6, - 0, - 0, - 0}); - // - // PaLabel - // - resources.ApplyResources(this.PaLabel, "PaLabel"); - this.PaLabel.Name = "PaLabel"; - // - // MRLabel - // - resources.ApplyResources(this.MRLabel, "MRLabel"); - this.MRLabel.Name = "MRLabel"; - // - // MREdit - // - resources.ApplyResources(this.MREdit, "MREdit"); - this.MREdit.Minimum = new decimal(new int[] { - 100, - 0, - 0, - -2147483648}); - this.MREdit.Name = "MREdit"; - this.MREdit.Value = new decimal(new int[] { - 5, - 0, - 0, - 0}); - // - // RSLAbel - // - resources.ApplyResources(this.RSLAbel, "RSLAbel"); - this.RSLAbel.Name = "RSLAbel"; - // - // RSEdit - // - resources.ApplyResources(this.RSEdit, "RSEdit"); - this.RSEdit.Name = "RSEdit"; - // - // SecondGroup - // - this.SecondGroup.Controls.Add(this.INIEdit); - this.SecondGroup.Controls.Add(this.GWLabel); - this.SecondGroup.Controls.Add(this.GWEdit); - this.SecondGroup.Controls.Add(this.INILabel); - this.SecondGroup.Controls.Add(this.GsLabel); - this.SecondGroup.Controls.Add(this.GsEdit); - resources.ApplyResources(this.SecondGroup, "SecondGroup"); - this.SecondGroup.Name = "SecondGroup"; - this.SecondGroup.TabStop = false; - // - // INIEdit - // - this.INIEdit.CharacterCasing = System.Windows.Forms.CharacterCasing.Lower; - resources.ApplyResources(this.INIEdit, "INIEdit"); - this.INIEdit.Name = "INIEdit"; - // - // GWLabel - // - resources.ApplyResources(this.GWLabel, "GWLabel"); - this.GWLabel.Name = "GWLabel"; - // - // GWEdit - // - resources.ApplyResources(this.GWEdit, "GWEdit"); - this.GWEdit.Name = "GWEdit"; - this.GWEdit.Value = new decimal(new int[] { - 3, - 0, - 0, - 0}); - // - // INILabel - // - resources.ApplyResources(this.INILabel, "INILabel"); - this.INILabel.Name = "INILabel"; - // - // GsLabel - // - resources.ApplyResources(this.GsLabel, "GsLabel"); - this.GsLabel.Name = "GsLabel"; - // - // GsEdit - // - resources.ApplyResources(this.GsEdit, "GsEdit"); - this.GsEdit.Name = "GsEdit"; - this.GsEdit.Value = new decimal(new int[] { - 8, - 0, - 0, - 0}); - // - // AttackGroup - // - this.AttackGroup.Controls.Add(this.AttackList); - resources.ApplyResources(this.AttackGroup, "AttackGroup"); - this.AttackGroup.Name = "AttackGroup"; - this.AttackGroup.TabStop = false; - // - // AttackList - // - this.AttackList.AllowDrop = true; - this.AttackList.AllowUserToResizeRows = false; - this.AttackList.BackgroundColor = System.Drawing.Color.PeachPuff; - this.AttackList.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; - this.AttackList.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { - this.NameCollum, - this.ATCollum, - this.TPCollum, - this.KommentarCollum}); - resources.ApplyResources(this.AttackList, "AttackList"); - this.AttackList.Name = "AttackList"; - // - // NameCollum - // - resources.ApplyResources(this.NameCollum, "NameCollum"); - this.NameCollum.Name = "NameCollum"; - // - // ATCollum - // - this.ATCollum.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader; - resources.ApplyResources(this.ATCollum, "ATCollum"); - this.ATCollum.Name = "ATCollum"; - // - // TPCollum - // - this.TPCollum.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader; - resources.ApplyResources(this.TPCollum, "TPCollum"); - this.TPCollum.Name = "TPCollum"; - // - // KommentarCollum - // - resources.ApplyResources(this.KommentarCollum, "KommentarCollum"); - this.KommentarCollum.Name = "KommentarCollum"; - // - // MeisterkommentarEdit - // - resources.ApplyResources(this.MeisterkommentarEdit, "MeisterkommentarEdit"); - this.MeisterkommentarEdit.Name = "MeisterkommentarEdit"; - // - // MeisterkommentarLabel - // - resources.ApplyResources(this.MeisterkommentarLabel, "MeisterkommentarLabel"); - this.MeisterkommentarLabel.Name = "MeisterkommentarLabel"; - // - // SaveButton - // - resources.ApplyResources(this.SaveButton, "SaveButton"); - this.SaveButton.Name = "SaveButton"; - this.SaveButton.UseVisualStyleBackColor = true; - this.SaveButton.Click += new System.EventHandler(this.SaveButton_Click); - // - // LoadButton - // - resources.ApplyResources(this.LoadButton, "LoadButton"); - this.LoadButton.Name = "LoadButton"; - this.LoadButton.TabStop = false; - this.LoadButton.UseVisualStyleBackColor = true; - this.LoadButton.Click += new System.EventHandler(this.LoadButton_Click); - // - // CritCreateForm - // - this.AllowDrop = true; - resources.ApplyResources(this, "$this"); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.BackColor = System.Drawing.Color.SandyBrown; - this.Controls.Add(this.LoadButton); - this.Controls.Add(this.SaveButton); - this.Controls.Add(this.MeisterkommentarLabel); - this.Controls.Add(this.MeisterkommentarEdit); - this.Controls.Add(this.AttackGroup); - this.Controls.Add(this.LeLabel); - this.Controls.Add(this.LeEdit); - this.Controls.Add(this.SecondGroup); - this.Controls.Add(this.VerteidugungGroup); - this.Controls.Add(this.GrundwerteGroup); - this.Controls.Add(this.NameEdit); - this.Controls.Add(this.NameLabel); - this.MaximizeBox = false; - this.Name = "CritCreateForm"; - this.ShowIcon = false; - this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; - this.DragDrop += new System.Windows.Forms.DragEventHandler(this.CritCreateForm_DragDrop); - ((System.ComponentModel.ISupportInitialize)(this.LeEdit)).EndInit(); - this.GrundwerteGroup.ResumeLayout(false); - this.GrundwerteGroup.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.KoEdit)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.AeEdit)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.AuEdit)).EndInit(); - this.VerteidugungGroup.ResumeLayout(false); - this.VerteidugungGroup.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.PaEdit)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.MREdit)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.RSEdit)).EndInit(); - this.SecondGroup.ResumeLayout(false); - this.SecondGroup.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.GWEdit)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.GsEdit)).EndInit(); - this.AttackGroup.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.AttackList)).EndInit(); - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.Label NameLabel; - private System.Windows.Forms.TextBox NameEdit; - private System.Windows.Forms.Label LeLabel; - private System.Windows.Forms.NumericUpDown LeEdit; - private System.Windows.Forms.GroupBox GrundwerteGroup; - private System.Windows.Forms.Label AeLabel; - private System.Windows.Forms.NumericUpDown AeEdit; - private System.Windows.Forms.Label AuLabel; - private System.Windows.Forms.NumericUpDown AuEdit; - private System.Windows.Forms.GroupBox VerteidugungGroup; - private System.Windows.Forms.Label MRLabel; - private System.Windows.Forms.NumericUpDown MREdit; - private System.Windows.Forms.Label RSLAbel; - private System.Windows.Forms.NumericUpDown RSEdit; - private System.Windows.Forms.Label KoLabel; - private System.Windows.Forms.NumericUpDown KoEdit; - private System.Windows.Forms.GroupBox SecondGroup; - private System.Windows.Forms.Label GWLabel; - private System.Windows.Forms.NumericUpDown GWEdit; - private System.Windows.Forms.Label INILabel; - private System.Windows.Forms.Label GsLabel; - private System.Windows.Forms.NumericUpDown GsEdit; - private System.Windows.Forms.TextBox INIEdit; - private System.Windows.Forms.GroupBox AttackGroup; - private System.Windows.Forms.DataGridView AttackList; - private System.Windows.Forms.DataGridViewTextBoxColumn NameCollum; - private System.Windows.Forms.DataGridViewTextBoxColumn ATCollum; - private System.Windows.Forms.DataGridViewTextBoxColumn TPCollum; - private System.Windows.Forms.DataGridViewTextBoxColumn KommentarCollum; - private System.Windows.Forms.TextBox MeisterkommentarEdit; - private System.Windows.Forms.Label MeisterkommentarLabel; - private System.Windows.Forms.Button SaveButton; - private System.Windows.Forms.Button LoadButton; - private System.Windows.Forms.Label PaLabel; - private System.Windows.Forms.NumericUpDown PaEdit; - } -} - diff --git a/ZooBOTanica/CritCreate.cs b/ZooBOTanica/CritCreate.cs deleted file mode 100644 index e79cff4..0000000 --- a/ZooBOTanica/CritCreate.cs +++ /dev/null @@ -1,92 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Windows.Forms; -using DSALib; -using DSALib.Characters; - -namespace ZooBOTanica -{ - public partial class CritCreateForm : Form - { - public Critter critter; - - public CritCreateForm() - { - InitializeComponent(); - AllowDrop = true; - } - - public new void Load(string path) - { - critter = Critter.Load(path); - - AeEdit.Value = critter.Astralpunkte_Basis; - AuEdit.Value = critter.Ausdauer_Basis; - GWEdit.Value = critter.Gw; - GsEdit.Value = critter.Gs; - KoEdit.Value = critter.Ko; - LeEdit.Value = critter.Lebenspunkte_Basis; - MREdit.Value = critter.Mr; - NameEdit.Text = critter.Name; - //this.PAEdit.Value = this.critter.Pa; - RSEdit.Value = critter.Rs; - INIEdit.Text = critter.Ini; - MeisterkommentarEdit.Text = critter.Comment; - - AttackList.Rows.Clear(); - - foreach (var critterAttack in critter.CritterAttacks) - AttackList.Rows.Add(critterAttack.Name, critterAttack.At, critterAttack.Tp, critterAttack.Comment); - } - - public void CritCreateForm_DragDrop(object sender, DragEventArgs e) - { - Load(e.Data.GetData(DataFormats.Text).ToString()); - } - - public void LoadButton_Click(object sender, EventArgs e) - { - var dig = new OpenFileDialog - { - CheckFileExists = true, - Multiselect = false, - Title = "Gespeicherten Gegner laden", - Filter = "*Json Dateien (*.json)|*.json" - }; - - if (dig.ShowDialog() == DialogResult.OK) Load(dig.FileName); - } - - public void SaveButton_Click(object sender, EventArgs e) - { - critter = new Critter(); - critter.Astralpunkte_Basis = (int) AeEdit.Value; - critter.Ausdauer_Basis = (int) AuEdit.Value; - critter.Gw = (int) GWEdit.Value; - critter.Gs = (int) GsEdit.Value; - critter.Ko = (int) KoEdit.Value; - critter.Lebenspunkte_Basis = (int) LeEdit.Value; - critter.Mr = (int) MREdit.Value; - critter.Name = NameEdit.Text; - //this.critter.Pa = (int)this.PAEdit.Value; - critter.Rs = (int) RSEdit.Value; - critter.Ini = INIEdit.Text; - critter.Comment = MeisterkommentarEdit.Text; - - critter.CritterAttacks = new List(); - - for (var index = 0; index < AttackList.Rows.Count - 1; index++) - { - var Row = AttackList.Rows[index]; - critter.CritterAttacks.Add( - new CritterAttack( - (Row.Cells[0].Value ?? "").ToString(), - Convert.ToInt32(Row.Cells[1].Value ?? 0), - (Row.Cells[2].Value ?? "").ToString(), - (Row.Cells[3].Value ?? "").ToString())); - } - - critter.Save(); - } - } -} \ No newline at end of file diff --git a/ZooBOTanica/CritCreate.resx b/ZooBOTanica/CritCreate.resx deleted file mode 100644 index aac2d43..0000000 --- a/ZooBOTanica/CritCreate.resx +++ /dev/null @@ -1,1122 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - - True - - - - 333, 31 - - - 38, 13 - - - 0 - - - Name: - - - NameLabel - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 11 - - - 391, 28 - - - 100, 20 - - - 1 - - - Gegner - - - NameEdit - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 10 - - - True - - - 510, 31 - - - 22, 13 - - - 2 - - - Le: - - - LeLabel - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 5 - - - 538, 29 - - - 45, 20 - - - 3 - - - LeEdit - - - System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 6 - - - KoLabel - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - GrundwerteGroup - - - 0 - - - KoEdit - - - System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - GrundwerteGroup - - - 1 - - - AeLabel - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - GrundwerteGroup - - - 2 - - - AeEdit - - - System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - GrundwerteGroup - - - 3 - - - AuLabel - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - GrundwerteGroup - - - 4 - - - AuEdit - - - System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - GrundwerteGroup - - - 5 - - - 325, 117 - - - 277, 53 - - - 5 - - - Grundwerte - - - GrundwerteGroup - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 9 - - - True - - - 189, 26 - - - 25, 13 - - - 4 - - - KO: - - - KoLabel - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - GrundwerteGroup - - - 0 - - - 217, 24 - - - 45, 20 - - - 5 - - - KoEdit - - - System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - GrundwerteGroup - - - 1 - - - True - - - 93, 26 - - - 23, 13 - - - 2 - - - Ae: - - - AeLabel - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - GrundwerteGroup - - - 2 - - - 121, 24 - - - 45, 20 - - - 3 - - - AeEdit - - - System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - GrundwerteGroup - - - 3 - - - True - - - 13, 26 - - - 23, 13 - - - 0 - - - Au: - - - AuLabel - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - GrundwerteGroup - - - 4 - - - 36, 24 - - - 45, 20 - - - 1 - - - AuEdit - - - System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - GrundwerteGroup - - - 5 - - - 36, 23 - - - 45, 20 - - - 1 - - - PaEdit - - - System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - VerteidugungGroup - - - 0 - - - True - - - - NoControl - - - 11, 29 - - - 24, 13 - - - 0 - - - PA: - - - PaLabel - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - VerteidugungGroup - - - 1 - - - True - - - 185, 25 - - - 27, 13 - - - 4 - - - MR: - - - MRLabel - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - VerteidugungGroup - - - 2 - - - 213, 23 - - - 45, 20 - - - 5 - - - MREdit - - - System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - VerteidugungGroup - - - 3 - - - True - - - 93, 25 - - - 25, 13 - - - 2 - - - RS: - - - RSLAbel - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - VerteidugungGroup - - - 4 - - - 121, 23 - - - 45, 20 - - - 3 - - - RSEdit - - - System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - VerteidugungGroup - - - 5 - - - 325, 58 - - - 277, 53 - - - 4 - - - Verteidigung - - - VerteidugungGroup - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 8 - - - INIEdit - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - SecondGroup - - - 0 - - - GWLabel - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - SecondGroup - - - 1 - - - GWEdit - - - System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - SecondGroup - - - 2 - - - INILabel - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - SecondGroup - - - 3 - - - GsLabel - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - SecondGroup - - - 4 - - - GsEdit - - - System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - SecondGroup - - - 5 - - - 325, 182 - - - 277, 53 - - - 6 - - - Sekundäre Werte - - - SecondGroup - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 7 - - - 121, 18 - - - 55, 20 - - - 3 - - - 1w6 - - - INIEdit - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - SecondGroup - - - 0 - - - True - - - 185, 21 - - - 29, 13 - - - 4 - - - GW: - - - GWLabel - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - SecondGroup - - - 1 - - - 213, 19 - - - 45, 20 - - - 5 - - - GWEdit - - - System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - SecondGroup - - - 2 - - - True - - - 93, 21 - - - 24, 13 - - - 2 - - - INI: - - - INILabel - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - SecondGroup - - - 3 - - - True - - - 8, 21 - - - 25, 13 - - - 0 - - - GS: - - - GsLabel - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - SecondGroup - - - 4 - - - 36, 19 - - - 45, 20 - - - 1 - - - GsEdit - - - System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - SecondGroup - - - 5 - - - AttackList - - - System.Windows.Forms.DataGridView, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - AttackGroup - - - 0 - - - 11, 21 - - - 296, 181 - - - 7 - - - Attacke(n) - - - AttackGroup - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 4 - - - True - - - True - - - True - - - True - - - 11, 19 - - - 279, 150 - - - 0 - - - AttackList - - - System.Windows.Forms.DataGridView, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - AttackGroup - - - 0 - - - True - - - Name - - - True - - - At - - - 42 - - - True - - - TP - - - 46 - - - True - - - Kommentar - - - 22, 227 - - - True - - - 279, 60 - - - 9 - - - MeisterkommentarEdit - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 3 - - - True - - - 22, 205 - - - 96, 13 - - - 8 - - - Meisterkommentar: - - - MeisterkommentarLabel - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 2 - - - 468, 251 - - - 119, 36 - - - 10 - - - Speichern - - - SaveButton - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 1 - - - NoControl - - - 336, 251 - - - 119, 36 - - - 11 - - - Laden - - - LoadButton - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 0 - - - True - - - True - - - 6, 13 - - - 606, 304 - - - CritCreate - - - NameCollum - - - System.Windows.Forms.DataGridViewTextBoxColumn, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - ATCollum - - - System.Windows.Forms.DataGridViewTextBoxColumn, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - TPCollum - - - System.Windows.Forms.DataGridViewTextBoxColumn, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - KommentarCollum - - - System.Windows.Forms.DataGridViewTextBoxColumn, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - CritCreateForm - - - System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git "a/ZooBOTanica/Critters/B\303\244r.json" "b/ZooBOTanica/Critters/B\303\244r.json" deleted file mode 100644 index ffa5ce2..0000000 --- "a/ZooBOTanica/Critters/B\303\244r.json" +++ /dev/null @@ -1,25 +0,0 @@ -{ - "Rs": 0, - "Mr": 5, - "Ko": 10, - "Pa": 0, - "Gs": 8, - "Gw": 3, - "Ini": "2w6+5", - "Comment": "", - "CritterAttacks": [ - { - "Name": "Biss", - "At": 12, - "Tp": "12", - "Comment": "" - } - ], - "Lebenspunkte_Basis": 30, - "Lebenspunkte_Aktuell": 30, - "Ausdauer_Basis": 30, - "Ausdauer_Aktuell": 30, - "Astralpunkte_Basis": 0, - "Astralpunkte_Aktuell": 0, - "Name": "Bär" -} \ No newline at end of file diff --git a/ZooBOTanica/Critters/Gegner.json b/ZooBOTanica/Critters/Gegner.json deleted file mode 100644 index cdf8563..0000000 --- a/ZooBOTanica/Critters/Gegner.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "Rs": 0, - "Mr": 5, - "Ko": 10, - "Pa": 0, - "Gs": 8, - "Gw": 3, - "Ini": "2w6+5", - "Comment": "", - "CritterAttacks": [], - "Lebenspunkte_Basis": 30, - "Lebenspunkte_Aktuell": 30, - "Ausdauer_Basis": 30, - "Ausdauer_Aktuell": 30, - "Astralpunkte_Basis": 0, - "Astralpunkte_Aktuell": 0, - "Name": "Gegner" -} \ No newline at end of file diff --git a/ZooBOTanica/Critters/Goblin.json b/ZooBOTanica/Critters/Goblin.json deleted file mode 100644 index ad763f5..0000000 --- a/ZooBOTanica/Critters/Goblin.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "Rs": 1, - "Mr": 3, - "Ko": 8, - "Pa": 0, - "Gs": 8, - "Gw": 3, - "Ini": "2w6+5", - "Comment": "", - "CritterAttacks": [ - { - "Name": "Biss", - "At": 10, - "Tp": "1W+1", - "Comment": "" - }, - { - "Name": "Schwert", - "At": 10, - "Tp": "1W+4", - "Comment": "" - }, - { - "Name": "Schleuder", - "At": 6, - "Tp": "1W+2", - "Comment": "" - } - ], - "Lebenspunkte_Basis": 22, - "Lebenspunkte_Aktuell": 30, - "Ausdauer_Basis": 30, - "Ausdauer_Aktuell": 30, - "Astralpunkte_Basis": 0, - "Astralpunkte_Aktuell": 0, - "Name": "Goblin" -} \ No newline at end of file diff --git a/ZooBOTanica/Program.cs b/ZooBOTanica/Program.cs deleted file mode 100644 index 59c7434..0000000 --- a/ZooBOTanica/Program.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; -using System.Windows.Forms; - -namespace ZooBOTanica -{ - internal static class Program - { - /// - /// Der Haupteinstiegspunkt für die Anwendung. - /// - [STAThread] - private static void Main() - { - Application.EnableVisualStyles(); - Application.SetCompatibleTextRenderingDefault(false); - Application.Run(new CritCreateForm()); - } - } -} \ No newline at end of file diff --git a/ZooBOTanica/Properties/AssemblyInfo.cs b/ZooBOTanica/Properties/AssemblyInfo.cs deleted file mode 100644 index b2b516e..0000000 --- a/ZooBOTanica/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Reflection; -using System.Runtime.InteropServices; - -// Allgemeine Informationen über eine Assembly werden über die folgenden -// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, -// die einer Assembly zugeordnet sind. -[assembly: AssemblyTitle("ZooBOTanica")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("ZooBOTanica")] -[assembly: AssemblyCopyright("Copyright © 2018")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Durch Festlegen von ComVisible auf FALSE werden die Typen in dieser Assembly -// für COM-Komponenten unsichtbar. Wenn Sie auf einen Typ in dieser Assembly von -// COM aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen. -[assembly: ComVisible(false)] - -// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird -[assembly: Guid("58917d99-dc94-4cdd-ad2b-c6e0baffcf47")] - -// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten: -// -// Hauptversion -// Nebenversion -// Buildnummer -// Revision -// -// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden, -// übernehmen, indem Sie "*" eingeben: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] \ No newline at end of file diff --git a/ZooBOTanica/Properties/Resources.Designer.cs b/ZooBOTanica/Properties/Resources.Designer.cs deleted file mode 100644 index 806f71d..0000000 --- a/ZooBOTanica/Properties/Resources.Designer.cs +++ /dev/null @@ -1,63 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Dieser Code wurde von einem Tool generiert. -// Laufzeitversion:4.0.30319.42000 -// -// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn -// der Code erneut generiert wird. -// -//------------------------------------------------------------------------------ - -namespace ZooBOTanica.Properties { - using System; - - - /// - /// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw. - /// - // Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert - // -Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert. - // Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen - // mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() { - } - - /// - /// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ZooBOTanica.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle - /// Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - } -} diff --git a/ZooBOTanica/Properties/Resources.resx b/ZooBOTanica/Properties/Resources.resx deleted file mode 100644 index af7dbeb..0000000 --- a/ZooBOTanica/Properties/Resources.resx +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/ZooBOTanica/Properties/Settings.Designer.cs b/ZooBOTanica/Properties/Settings.Designer.cs deleted file mode 100644 index 9211d5f..0000000 --- a/ZooBOTanica/Properties/Settings.Designer.cs +++ /dev/null @@ -1,26 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Dieser Code wurde von einem Tool generiert. -// Laufzeitversion:4.0.30319.42000 -// -// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn -// der Code erneut generiert wird. -// -//------------------------------------------------------------------------------ - -namespace ZooBOTanica.Properties { - - - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.8.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { - - private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default { - get { - return defaultInstance; - } - } - } -} diff --git a/ZooBOTanica/Properties/Settings.settings b/ZooBOTanica/Properties/Settings.settings deleted file mode 100644 index 3964565..0000000 --- a/ZooBOTanica/Properties/Settings.settings +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/ZooBOTanica/ZooBOTanica.csproj b/ZooBOTanica/ZooBOTanica.csproj deleted file mode 100644 index 086eb64..0000000 --- a/ZooBOTanica/ZooBOTanica.csproj +++ /dev/null @@ -1,91 +0,0 @@ - - - - - Debug - AnyCPU - {58917D99-DC94-4CDD-AD2B-C6E0BAFFCF47} - WinExe - ZooBOTanica - ZooBOTanica - v4.7.2 - 512 - true - - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - Form - - - CritCreate.cs - - - - - CritCreate.cs - Designer - - - ResXFileCodeGenerator - Resources.Designer.cs - Designer - - - True - Resources.resx - True - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - True - Settings.settings - True - - - - - - - - {388dd4ed-29c4-4127-ac8f-34dd3fe9f9b0} - DSALib - - - - \ No newline at end of file diff --git a/functions/index.js b/functions/index.js deleted file mode 100644 index bd698a2..0000000 --- a/functions/index.js +++ /dev/null @@ -1,8 +0,0 @@ -const functions = require('firebase-functions'); - -// // Create and Deploy Your First Cloud Functions -// // https://firebase.google.com/docs/functions/write-firebase-functions -// -// exports.helloWorld = functions.https.onRequest((request, response) => { -// response.send("Hello from Firebase!"); -// }); diff --git a/functions/package-lock.json b/functions/package-lock.json deleted file mode 100644 index 7d8f0dc..0000000 --- a/functions/package-lock.json +++ /dev/null @@ -1,3896 +0,0 @@ -{ - "name": "functions", - "requires": true, - "lockfileVersion": 1, - "dependencies": { - "@firebase/app": { - "version": "0.3.4", - "resolved": "https://registry.npmjs.org/@firebase/app/-/app-0.3.4.tgz", - "integrity": "sha512-Q6sNpWZ3x+FeuBkLCCRrsOraGJOKVLUCc9Amj8zu2vAC1v2uWifRR6kZ60TrpaIxtY4N6pcPTaG0YIUT5lgeSA==", - "requires": { - "@firebase/app-types": "0.3.2", - "@firebase/util": "0.2.2", - "dom-storage": "2.1.0", - "tslib": "1.9.0", - "xmlhttprequest": "1.8.0" - } - }, - "@firebase/app-types": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@firebase/app-types/-/app-types-0.3.2.tgz", - "integrity": "sha512-ZD8lTgW07NGgo75bTyBJA8Lt9+NweNzot7lrsBtIvfciwUzaFJLsv2EShqjBeuhF7RpG6YFucJ6m67w5buCtzw==" - }, - "@firebase/database": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/@firebase/database/-/database-0.3.6.tgz", - "integrity": "sha512-r02JOqTLcd2/qn7QkkJvIAxMiMxmeyd5B76kl9hHAs+3cil5mUzHnI3svtb4h0VIJYDHFKJMlVl/bE3GfcTR3A==", - "requires": { - "@firebase/database-types": "0.3.2", - "@firebase/logger": "0.1.1", - "@firebase/util": "0.2.2", - "faye-websocket": "0.11.1", - "tslib": "1.9.0" - } - }, - "@firebase/database-types": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@firebase/database-types/-/database-types-0.3.2.tgz", - "integrity": "sha512-9ZYdvYQ6r3aaHJarhUM5Hf6lQWu3ZJme+RR0o8qfBb9L04TL3uNjt+AJFku1ysVPntTn+9GqJjiIB2/OC3JtwA==" - }, - "@firebase/logger": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/@firebase/logger/-/logger-0.1.1.tgz", - "integrity": "sha512-5jn3HHbEfdOwychyIEIkP1cik+MW/vvoOavTOzwDkH+fv6Bx+HBUOzh09M7sCYzXFtKzjbUax9+g39mJNBLklQ==" - }, - "@firebase/util": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/@firebase/util/-/util-0.2.2.tgz", - "integrity": "sha512-vfRjmCWuxtJx3txHocaNlDwCDwwv6KLL5YtlSNi73wBdvF3UfnpLGrth7G3X6gn5rDhOKamRg2+9L8cfsjSS1A==", - "requires": { - "tslib": "1.9.0" - } - }, - "@google-cloud/common": { - "version": "0.17.0", - "resolved": "http://registry.npmjs.org/@google-cloud/common/-/common-0.17.0.tgz", - "integrity": "sha512-HRZLSU762E6HaKoGfJGa8W95yRjb9rY7LePhjaHK9ILAnFacMuUGVamDbTHu1csZomm1g3tZTtXfX/aAhtie/Q==", - "optional": true, - "requires": { - "array-uniq": "1.0.3", - "arrify": "1.0.1", - "concat-stream": "1.6.2", - "create-error-class": "3.0.2", - "duplexify": "3.6.0", - "ent": "2.2.0", - "extend": "3.0.2", - "google-auto-auth": "0.10.1", - "is": "3.2.1", - "log-driver": "1.2.7", - "methmeth": "1.1.0", - "modelo": "4.2.3", - "request": "2.88.0", - "retry-request": "3.3.2", - "split-array-stream": "1.0.3", - "stream-events": "1.0.4", - "string-format-obj": "1.1.1", - "through2": "2.0.3" - }, - "dependencies": { - "retry-request": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/retry-request/-/retry-request-3.3.2.tgz", - "integrity": "sha512-WIiGp37XXDC6e7ku3LFoi7LCL/Gs9luGeeqvbPRb+Zl6OQMw4RCRfSaW+aLfE6lhz1R941UavE6Svl3Dm5xGIQ==", - "optional": true, - "requires": { - "request": "2.88.0", - "through2": "2.0.3" - } - } - } - }, - "@google-cloud/firestore": { - "version": "0.16.1", - "resolved": "https://registry.npmjs.org/@google-cloud/firestore/-/firestore-0.16.1.tgz", - "integrity": "sha512-xHb4OdRb0OP0x/8w58WJERtCi9Pr+CsloiUlVAq6fFjSyEcmxgL0V+swE8A/2rI5NGQGwtrN57xwDcis5UM/cQ==", - "optional": true, - "requires": { - "@google-cloud/projectify": "0.3.0", - "bun": "0.0.12", - "deep-equal": "1.0.1", - "extend": "3.0.2", - "functional-red-black-tree": "1.0.1", - "google-gax": "0.18.0", - "google-proto-files": "0.16.1", - "is": "3.2.1", - "lodash.merge": "4.6.1", - "protobufjs": "6.8.8", - "through2": "2.0.3" - } - }, - "@google-cloud/projectify": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/@google-cloud/projectify/-/projectify-0.3.0.tgz", - "integrity": "sha512-ic3vU+rBLlQ9rU6vyMcQ/GoYQX9hP0P56jdbnSkGvXrVnO1DtYrkPV3Qg/NUrpAfKnmNC4hb0O/v2hCj8uGnbQ==", - "optional": true - }, - "@google-cloud/storage": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/@google-cloud/storage/-/storage-1.7.0.tgz", - "integrity": "sha512-QaAxzCkbhspwajoaEnT0GcnQcpjPRcBrHYuQsXtD05BtOJgVnHCLXSsfUiRdU0nVpK+Thp7+sTkQ0fvk5PanKg==", - "optional": true, - "requires": { - "@google-cloud/common": "0.17.0", - "arrify": "1.0.1", - "async": "2.6.1", - "compressible": "2.0.15", - "concat-stream": "1.6.2", - "create-error-class": "3.0.2", - "duplexify": "3.6.0", - "extend": "3.0.2", - "gcs-resumable-upload": "0.10.2", - "hash-stream-validation": "0.2.1", - "is": "3.2.1", - "mime": "2.3.1", - "mime-types": "2.1.20", - "once": "1.4.0", - "pumpify": "1.5.1", - "request": "2.88.0", - "safe-buffer": "5.1.2", - "snakeize": "0.1.0", - "stream-events": "1.0.4", - "through2": "2.0.3", - "xdg-basedir": "3.0.0" - } - }, - "@grpc/proto-loader": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.3.0.tgz", - "integrity": "sha512-9b8S/V+3W4Gv7G/JKSZ48zApgyYbfIR7mAC9XNnaSWme3zj57MIESu0ELzm9j5oxNIpFG8DgO00iJMIUZ5luqw==", - "optional": true, - "requires": { - "@types/lodash": "4.14.116", - "@types/node": "9.6.32", - "lodash": "4.17.11", - "protobufjs": "6.8.8" - }, - "dependencies": { - "@types/node": { - "version": "9.6.32", - "resolved": "https://registry.npmjs.org/@types/node/-/node-9.6.32.tgz", - "integrity": "sha512-5+L3wQ+FHoQ589EaH6rYICleuj8gnunq+1CJkM9fxklirErIOv+kxm3s/vecYnpJOYnFowE5uUizcb3hgjHUug==", - "optional": true - } - } - }, - "@mrmlnc/readdir-enhanced": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz", - "integrity": "sha512-bPHp6Ji8b41szTOcaP63VlnbbO5Ny6dwAATtY6JTjh5N2OLrb5Qk/Th5cRkRQhkWCt+EJsYrNB0MiL+Gpn6e3g==", - "requires": { - "call-me-maybe": "1.0.1", - "glob-to-regexp": "0.3.0" - } - }, - "@nodelib/fs.stat": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-1.1.2.tgz", - "integrity": "sha512-yprFYuno9FtNsSHVlSWd+nRlmGoAbqbeCwOryP6sC/zoCjhpArcRMYp19EvpSUSizJAlsXEwJv+wcWS9XaXdMw==" - }, - "@protobufjs/aspromise": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", - "integrity": "sha1-m4sMxmPWaafY9vXQiToU00jzD78=" - }, - "@protobufjs/base64": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", - "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==" - }, - "@protobufjs/codegen": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", - "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==" - }, - "@protobufjs/eventemitter": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", - "integrity": "sha1-NVy8mLr61ZePntCV85diHx0Ga3A=" - }, - "@protobufjs/fetch": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", - "integrity": "sha1-upn7WYYUr2VwDBYZ/wbUVLDYTEU=", - "requires": { - "@protobufjs/aspromise": "1.1.2", - "@protobufjs/inquire": "1.1.0" - } - }, - "@protobufjs/float": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", - "integrity": "sha1-Xp4avctz/Ap8uLKR33jIy9l7h9E=" - }, - "@protobufjs/inquire": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", - "integrity": "sha1-/yAOPnzyQp4tyvwRQIKOjMY48Ik=" - }, - "@protobufjs/path": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", - "integrity": "sha1-bMKyDFya1q0NzP0hynZz2Nf79o0=" - }, - "@protobufjs/pool": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", - "integrity": "sha1-Cf0V8tbTq/qbZbw2ZQbWrXhG/1Q=" - }, - "@protobufjs/utf8": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", - "integrity": "sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA=" - }, - "@types/body-parser": { - "version": "1.17.0", - "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.17.0.tgz", - "integrity": "sha512-a2+YeUjPkztKJu5aIF2yArYFQQp8d51wZ7DavSHjFuY1mqVgidGyzEQ41JIVNy82fXj8yPgy2vJmfIywgESW6w==", - "requires": { - "@types/connect": "3.4.32", - "@types/node": "8.10.30" - } - }, - "@types/caseless": { - "version": "0.12.1", - "resolved": "https://registry.npmjs.org/@types/caseless/-/caseless-0.12.1.tgz", - "integrity": "sha512-FhlMa34NHp9K5MY1Uz8yb+ZvuX0pnvn3jScRSNAb75KHGB8d3rEU6hqMs3Z2vjuytcMfRg6c5CHMc3wtYyD2/A==", - "optional": true - }, - "@types/connect": { - "version": "3.4.32", - "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.32.tgz", - "integrity": "sha512-4r8qa0quOvh7lGD0pre62CAb1oni1OO6ecJLGCezTmhQ8Fz50Arx9RUszryR8KlgK6avuSXvviL6yWyViQABOg==", - "requires": { - "@types/node": "8.10.30" - } - }, - "@types/cors": { - "version": "2.8.4", - "resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.4.tgz", - "integrity": "sha512-ipZjBVsm2tF/n8qFGOuGBkUij9X9ZswVi9G3bx/6dz7POpVa6gVHcj1wsX/LVEn9MMF41fxK/PnZPPoTD1UFPw==", - "requires": { - "@types/express": "4.16.0" - } - }, - "@types/events": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@types/events/-/events-1.2.0.tgz", - "integrity": "sha512-KEIlhXnIutzKwRbQkGWb/I4HFqBuUykAdHgDED6xqwXJfONCjF5VoE0cXEiurh3XauygxzeDzgtXUqvLkxFzzA==" - }, - "@types/express": { - "version": "4.16.0", - "resolved": "https://registry.npmjs.org/@types/express/-/express-4.16.0.tgz", - "integrity": "sha512-TtPEYumsmSTtTetAPXlJVf3kEqb6wZK0bZojpJQrnD/djV4q1oB6QQ8aKvKqwNPACoe02GNiy5zDzcYivR5Z2w==", - "requires": { - "@types/body-parser": "1.17.0", - "@types/express-serve-static-core": "4.16.0", - "@types/serve-static": "1.13.2" - } - }, - "@types/express-serve-static-core": { - "version": "4.16.0", - "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.16.0.tgz", - "integrity": "sha512-lTeoCu5NxJU4OD9moCgm0ESZzweAx0YqsAcab6OB0EB3+As1OaHtKnaGJvcngQxYsi9UNv0abn4/DRavrRxt4w==", - "requires": { - "@types/events": "1.2.0", - "@types/node": "8.10.30", - "@types/range-parser": "1.2.2" - } - }, - "@types/form-data": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/@types/form-data/-/form-data-2.2.1.tgz", - "integrity": "sha512-JAMFhOaHIciYVh8fb5/83nmuO/AHwmto+Hq7a9y8FzLDcC1KCU344XDOMEmahnrTFlHjgh4L0WJFczNIX2GxnQ==", - "optional": true, - "requires": { - "@types/node": "8.10.30" - } - }, - "@types/google-cloud__storage": { - "version": "1.7.2", - "resolved": "https://registry.npmjs.org/@types/google-cloud__storage/-/google-cloud__storage-1.7.2.tgz", - "integrity": "sha512-RaQJ7+Ht20MRYJu7mgKBpbVNZIPneztKIl/DUKacRC6A8mXRsJfgDdPA7indHmJGIgm+hzUTj44+A3RyuuYZhg==", - "optional": true, - "requires": { - "@types/node": "8.10.30", - "@types/request": "2.47.1" - } - }, - "@types/jsonwebtoken": { - "version": "7.2.8", - "resolved": "https://registry.npmjs.org/@types/jsonwebtoken/-/jsonwebtoken-7.2.8.tgz", - "integrity": "sha512-XENN3YzEB8D6TiUww0O8SRznzy1v+77lH7UmuN54xq/IHIsyWjWOzZuFFTtoiRuaE782uAoRwBe/wwow+vQXZw==", - "requires": { - "@types/node": "8.10.30" - } - }, - "@types/lodash": { - "version": "4.14.116", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.116.tgz", - "integrity": "sha512-lRnAtKnxMXcYYXqOiotTmJd74uawNWuPnsnPrrO7HiFuE3npE2iQhfABatbYDyxTNqZNuXzcKGhw37R7RjBFLg==" - }, - "@types/long": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.0.tgz", - "integrity": "sha512-1w52Nyx4Gq47uuu0EVcsHBxZFJgurQ+rTKS3qMHxR1GY2T8c2AJYd6vZoZ9q1rupaDjU0yT+Jc2XTyXkjeMA+Q==" - }, - "@types/mime": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@types/mime/-/mime-2.0.0.tgz", - "integrity": "sha512-A2TAGbTFdBw9azHbpVd+/FkdW2T6msN1uct1O9bH3vTerEHKZhTXJUQXy+hNq1B0RagfU8U+KBdqiZpxjhOUQA==" - }, - "@types/node": { - "version": "8.10.30", - "resolved": "https://registry.npmjs.org/@types/node/-/node-8.10.30.tgz", - "integrity": "sha512-Le8HGMI5gjFSBqcCuKP/wfHC19oURzkU2D+ERIescUoJd+CmNEMYBib9LQ4zj1HHEZOJQWhw2ZTnbD8weASh/Q==" - }, - "@types/range-parser": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.2.tgz", - "integrity": "sha512-HtKGu+qG1NPvYe1z7ezLsyIaXYyi8SoAVqWDZgDQ8dLrsZvSzUNCwZyfX33uhWxL/SU0ZDQZ3nwZ0nimt507Kw==" - }, - "@types/request": { - "version": "2.47.1", - "resolved": "https://registry.npmjs.org/@types/request/-/request-2.47.1.tgz", - "integrity": "sha512-TV3XLvDjQbIeVxJ1Z3oCTDk/KuYwwcNKVwz2YaT0F5u86Prgc4syDAp6P96rkTQQ4bIdh+VswQIC9zS6NjY7/g==", - "optional": true, - "requires": { - "@types/caseless": "0.12.1", - "@types/form-data": "2.2.1", - "@types/node": "8.10.30", - "@types/tough-cookie": "2.3.3" - } - }, - "@types/serve-static": { - "version": "1.13.2", - "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.13.2.tgz", - "integrity": "sha512-/BZ4QRLpH/bNYgZgwhKEh+5AsboDBcUdlBYgzoLX0fpj3Y2gp6EApyOlM3bK53wQS/OE1SrdSYBAbux2D1528Q==", - "requires": { - "@types/express-serve-static-core": "4.16.0", - "@types/mime": "2.0.0" - } - }, - "@types/tough-cookie": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-2.3.3.tgz", - "integrity": "sha512-MDQLxNFRLasqS4UlkWMSACMKeSm1x4Q3TxzUC7KQUsh6RK1ZrQ0VEyE3yzXcBu+K8ejVj4wuX32eUG02yNp+YQ==", - "optional": true - }, - "accepts": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.5.tgz", - "integrity": "sha1-63d99gEXI6OxTopywIBcjoZ0a9I=", - "requires": { - "mime-types": "2.1.20", - "negotiator": "0.6.1" - } - }, - "acorn": { - "version": "5.7.3", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.3.tgz", - "integrity": "sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw==" - }, - "acorn-es7-plugin": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/acorn-es7-plugin/-/acorn-es7-plugin-1.1.7.tgz", - "integrity": "sha1-8u4fMiipDurRJF+asZIusucdM2s=" - }, - "ajv": { - "version": "5.5.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", - "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", - "requires": { - "co": "4.6.0", - "fast-deep-equal": "1.1.0", - "fast-json-stable-stringify": "2.0.0", - "json-schema-traverse": "0.3.1" - } - }, - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" - }, - "arr-diff": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", - "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=" - }, - "arr-flatten": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", - "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==" - }, - "arr-union": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", - "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=" - }, - "array-filter": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/array-filter/-/array-filter-1.0.0.tgz", - "integrity": "sha1-uveeYubvTCpMC4MSMtr/7CUfnYM=" - }, - "array-flatten": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", - "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" - }, - "array-union": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", - "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", - "requires": { - "array-uniq": "1.0.3" - } - }, - "array-uniq": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", - "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=" - }, - "array-unique": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", - "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=" - }, - "arrify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", - "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=" - }, - "ascli": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/ascli/-/ascli-1.0.1.tgz", - "integrity": "sha1-vPpZdKYvGOgcq660lzKrSoj5Brw=", - "optional": true, - "requires": { - "colour": "0.7.1", - "optjs": "3.2.2" - } - }, - "asn1": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", - "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", - "requires": { - "safer-buffer": "2.1.2" - } - }, - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" - }, - "assign-symbols": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", - "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=" - }, - "async": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.1.tgz", - "integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==", - "requires": { - "lodash": "4.17.11" - } - }, - "asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" - }, - "atob": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", - "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==" - }, - "aws-sign2": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" - }, - "aws4": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", - "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==" - }, - "axios": { - "version": "0.18.0", - "resolved": "http://registry.npmjs.org/axios/-/axios-0.18.0.tgz", - "integrity": "sha1-MtU+SFHv3AoRmTts0AB4nXDAUQI=", - "requires": { - "follow-redirects": "1.5.8", - "is-buffer": "1.1.6" - } - }, - "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" - }, - "base": { - "version": "0.11.2", - "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", - "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", - "requires": { - "cache-base": "1.0.1", - "class-utils": "0.3.6", - "component-emitter": "1.2.1", - "define-property": "1.0.0", - "isobject": "3.0.1", - "mixin-deep": "1.3.1", - "pascalcase": "0.1.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "requires": { - "is-descriptor": "1.0.2" - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "requires": { - "kind-of": "6.0.2" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "requires": { - "kind-of": "6.0.2" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "requires": { - "is-accessor-descriptor": "1.0.0", - "is-data-descriptor": "1.0.0", - "kind-of": "6.0.2" - } - } - } - }, - "bcrypt-pbkdf": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", - "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", - "optional": true, - "requires": { - "tweetnacl": "0.14.5" - } - }, - "body-parser": { - "version": "1.18.2", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.18.2.tgz", - "integrity": "sha1-h2eKGdhLR9hZuDGZvVm84iKxBFQ=", - "requires": { - "bytes": "3.0.0", - "content-type": "1.0.4", - "debug": "2.6.9", - "depd": "1.1.2", - "http-errors": "1.6.3", - "iconv-lite": "0.4.19", - "on-finished": "2.3.0", - "qs": "6.5.1", - "raw-body": "2.3.2", - "type-is": "1.6.16" - }, - "dependencies": { - "qs": { - "version": "6.5.1", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.1.tgz", - "integrity": "sha512-eRzhrN1WSINYCDCbrz796z37LOe3m5tmW7RQf6oBntukAG1nmovJvhnwHHRMAfeoItc1m2Hk02WER2aQ/iqs+A==" - } - } - }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "requires": { - "balanced-match": "1.0.0", - "concat-map": "0.0.1" - } - }, - "braces": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", - "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", - "requires": { - "arr-flatten": "1.1.0", - "array-unique": "0.3.2", - "extend-shallow": "2.0.1", - "fill-range": "4.0.0", - "isobject": "3.0.1", - "repeat-element": "1.1.3", - "snapdragon": "0.8.2", - "snapdragon-node": "2.1.1", - "split-string": "3.1.0", - "to-regex": "3.0.2" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "requires": { - "is-extendable": "0.1.1" - } - } - } - }, - "buffer-equal-constant-time": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", - "integrity": "sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk=" - }, - "buffer-from": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", - "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==" - }, - "bun": { - "version": "0.0.12", - "resolved": "https://registry.npmjs.org/bun/-/bun-0.0.12.tgz", - "integrity": "sha512-Toms18J9DqnT+IfWkwxVTB2EaBprHvjlMWrTIsfX4xbu3ZBqVBwrERU0em1IgtRe04wT+wJxMlKHZok24hrcSQ==", - "optional": true, - "requires": { - "readable-stream": "1.0.34" - } - }, - "bytebuffer": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/bytebuffer/-/bytebuffer-5.0.1.tgz", - "integrity": "sha1-WC7qSxqHO20CCkjVjfhfC7ps/d0=", - "optional": true, - "requires": { - "long": "3.2.0" - }, - "dependencies": { - "long": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/long/-/long-3.2.0.tgz", - "integrity": "sha1-2CG3E4yhy1gcFymQ7xTbIAtcR0s=", - "optional": true - } - } - }, - "bytes": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz", - "integrity": "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg=" - }, - "cache-base": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", - "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", - "requires": { - "collection-visit": "1.0.0", - "component-emitter": "1.2.1", - "get-value": "2.0.6", - "has-value": "1.0.0", - "isobject": "3.0.1", - "set-value": "2.0.0", - "to-object-path": "0.3.0", - "union-value": "1.0.0", - "unset-value": "1.0.0" - } - }, - "call-me-maybe": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.1.tgz", - "integrity": "sha1-JtII6onje1y95gJQoV8DHBak1ms=" - }, - "call-signature": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/call-signature/-/call-signature-0.0.2.tgz", - "integrity": "sha1-qEq8glpV70yysCi9dOIFpluaSZY=" - }, - "camelcase": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz", - "integrity": "sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8=", - "optional": true - }, - "capture-stack-trace": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/capture-stack-trace/-/capture-stack-trace-1.0.1.tgz", - "integrity": "sha512-mYQLZnx5Qt1JgB1WEiMCf2647plpGeQ2NMR/5L0HNZzGQo4fuSPnK+wjfPnKZV0aiJDgzmWqqkV/g7JD+DW0qw==" - }, - "caseless": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" - }, - "class-utils": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", - "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", - "requires": { - "arr-union": "3.1.0", - "define-property": "0.2.5", - "isobject": "3.0.1", - "static-extend": "0.1.2" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "requires": { - "is-descriptor": "0.1.6" - } - } - } - }, - "cliui": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", - "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", - "optional": true, - "requires": { - "string-width": "1.0.2", - "strip-ansi": "3.0.1", - "wrap-ansi": "2.1.0" - } - }, - "co": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", - "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=" - }, - "code-point-at": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" - }, - "collection-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", - "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", - "requires": { - "map-visit": "1.0.0", - "object-visit": "1.0.1" - } - }, - "colour": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/colour/-/colour-0.7.1.tgz", - "integrity": "sha1-nLFpkX7F0SwHNtPoaFdG3xyt93g=", - "optional": true - }, - "combined-stream": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.7.tgz", - "integrity": "sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w==", - "requires": { - "delayed-stream": "1.0.0" - } - }, - "component-emitter": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", - "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=" - }, - "compressible": { - "version": "2.0.15", - "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.15.tgz", - "integrity": "sha512-4aE67DL33dSW9gw4CI2H/yTxqHLNcxp0yS6jB+4h+wr3e43+1z7vm0HU9qXOH8j+qjKuL8+UtkOxYQSMq60Ylw==", - "optional": true, - "requires": { - "mime-db": "1.36.0" - } - }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" - }, - "concat-stream": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", - "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", - "requires": { - "buffer-from": "1.1.1", - "inherits": "2.0.3", - "readable-stream": "2.3.6", - "typedarray": "0.0.6" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" - }, - "readable-stream": { - "version": "2.3.6", - "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "1.0.0", - "process-nextick-args": "2.0.0", - "safe-buffer": "5.1.2", - "string_decoder": "1.1.1", - "util-deprecate": "1.0.2" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "requires": { - "safe-buffer": "5.1.2" - } - } - } - }, - "configstore": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/configstore/-/configstore-3.1.2.tgz", - "integrity": "sha512-vtv5HtGjcYUgFrXc6Kx747B83MRRVS5R1VTEQoXvuP+kMI+if6uywV0nDGoiydJRy4yk7h9od5Og0kxx4zUXmw==", - "optional": true, - "requires": { - "dot-prop": "4.2.0", - "graceful-fs": "4.1.11", - "make-dir": "1.3.0", - "unique-string": "1.0.0", - "write-file-atomic": "2.3.0", - "xdg-basedir": "3.0.0" - } - }, - "content-disposition": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz", - "integrity": "sha1-DPaLud318r55YcOoUXjLhdunjLQ=" - }, - "content-type": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", - "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==" - }, - "cookie": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz", - "integrity": "sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s=" - }, - "cookie-signature": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", - "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" - }, - "copy-descriptor": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", - "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=" - }, - "core-js": { - "version": "2.5.7", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.7.tgz", - "integrity": "sha512-RszJCAxg/PP6uzXVXL6BsxSXx/B05oJAQ2vkJRjyjrEcNVycaqOmNb5OTxZPE3xa5gwZduqza6L9JOCenh/Ecw==" - }, - "core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" - }, - "cors": { - "version": "2.8.4", - "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.4.tgz", - "integrity": "sha1-K9OB8usgECAQXNUOpZ2mMJBpRoY=", - "requires": { - "object-assign": "4.1.1", - "vary": "1.1.2" - } - }, - "create-error-class": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/create-error-class/-/create-error-class-3.0.2.tgz", - "integrity": "sha1-Br56vvlHo/FKMP1hBnHUAbyot7Y=", - "requires": { - "capture-stack-trace": "1.0.1" - } - }, - "crypto-random-string": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-1.0.0.tgz", - "integrity": "sha1-ojD2T1aDEOFJgAmUB5DsmVRbyn4=", - "optional": true - }, - "dashdash": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", - "requires": { - "assert-plus": "1.0.0" - } - }, - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "requires": { - "ms": "2.0.0" - } - }, - "decamelize": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", - "optional": true - }, - "decode-uri-component": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", - "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=" - }, - "deep-equal": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.0.1.tgz", - "integrity": "sha1-9dJgKStmDghO/0zbyfCK0yR0SLU=", - "optional": true - }, - "define-properties": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", - "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", - "requires": { - "object-keys": "1.0.12" - } - }, - "define-property": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", - "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", - "requires": { - "is-descriptor": "1.0.2", - "isobject": "3.0.1" - }, - "dependencies": { - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "requires": { - "kind-of": "6.0.2" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "requires": { - "kind-of": "6.0.2" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "requires": { - "is-accessor-descriptor": "1.0.0", - "is-data-descriptor": "1.0.0", - "kind-of": "6.0.2" - } - } - } - }, - "delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" - }, - "depd": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", - "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=" - }, - "destroy": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", - "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" - }, - "diff-match-patch": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/diff-match-patch/-/diff-match-patch-1.0.4.tgz", - "integrity": "sha512-Uv3SW8bmH9nAtHKaKSanOQmj2DnlH65fUpcrMdfdaOxUG02QQ4YGZ8AE7kKOMisF7UqvOlGKVYWRvezdncW9lg==" - }, - "dir-glob": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-2.0.0.tgz", - "integrity": "sha512-37qirFDz8cA5fimp9feo43fSuRo2gHwaIn6dXL8Ber1dGwUosDrGZeCCXq57WnIqE4aQ+u3eQZzsk1yOzhdwag==", - "requires": { - "arrify": "1.0.1", - "path-type": "3.0.0" - } - }, - "dom-storage": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/dom-storage/-/dom-storage-2.1.0.tgz", - "integrity": "sha512-g6RpyWXzl0RR6OTElHKBl7nwnK87GUyZMYC7JWsB/IA73vpqK2K6LT39x4VepLxlSsWBFrPVLnsSR5Jyty0+2Q==" - }, - "dot-prop": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-4.2.0.tgz", - "integrity": "sha512-tUMXrxlExSW6U2EXiiKGSBVdYgtV8qlHL+C10TsW4PURY/ic+eaysnSkwB4kA/mBlCyy/IKDJ+Lc3wbWeaXtuQ==", - "optional": true, - "requires": { - "is-obj": "1.0.1" - } - }, - "duplexify": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.6.0.tgz", - "integrity": "sha512-fO3Di4tBKJpYTFHAxTU00BcfWMY9w24r/x21a6rZRbsD/ToUgGxsMbiGRmB7uVAXeGKXD9MwiLZa5E97EVgIRQ==", - "requires": { - "end-of-stream": "1.4.1", - "inherits": "2.0.3", - "readable-stream": "2.3.6", - "stream-shift": "1.0.0" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" - }, - "readable-stream": { - "version": "2.3.6", - "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "1.0.0", - "process-nextick-args": "2.0.0", - "safe-buffer": "5.1.2", - "string_decoder": "1.1.1", - "util-deprecate": "1.0.2" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "requires": { - "safe-buffer": "5.1.2" - } - } - } - }, - "eastasianwidth": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", - "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==" - }, - "ecc-jsbn": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", - "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", - "optional": true, - "requires": { - "jsbn": "0.1.1", - "safer-buffer": "2.1.2" - } - }, - "ecdsa-sig-formatter": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.10.tgz", - "integrity": "sha1-HFlQAPBKiJffuFAAiSoPTDOvhsM=", - "requires": { - "safe-buffer": "5.1.2" - } - }, - "ee-first": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", - "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" - }, - "empower": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/empower/-/empower-1.3.1.tgz", - "integrity": "sha512-uB6/ViBaawOO/uujFADTK3SqdYlxYNn+N4usK9MRKZ4Hbn/1QSy8k2PezxCA2/+JGbF8vd/eOfghZ90oOSDZCA==", - "requires": { - "core-js": "2.5.7", - "empower-core": "1.2.0" - } - }, - "empower-core": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/empower-core/-/empower-core-1.2.0.tgz", - "integrity": "sha512-g6+K6Geyc1o6FdXs9HwrXleCFan7d66G5xSCfSF7x1mJDCes6t0om9lFQG3zOrzh3Bkb/45N0cZ5Gqsf7YrzGQ==", - "requires": { - "call-signature": "0.0.2", - "core-js": "2.5.7" - } - }, - "encodeurl": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", - "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=" - }, - "end-of-stream": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", - "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", - "requires": { - "once": "1.4.0" - } - }, - "ent": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/ent/-/ent-2.2.0.tgz", - "integrity": "sha1-6WQhkyWiHQX0RGai9obtbOX13R0=", - "optional": true - }, - "escape-html": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", - "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=" - }, - "espurify": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/espurify/-/espurify-1.8.1.tgz", - "integrity": "sha512-ZDko6eY/o+D/gHCWyHTU85mKDgYcS4FJj7S+YD6WIInm7GQ6AnOjmcL4+buFV/JOztVLELi/7MmuGU5NHta0Mg==", - "requires": { - "core-js": "2.5.7" - } - }, - "estraverse": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", - "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=" - }, - "etag": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", - "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=" - }, - "expand-brackets": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", - "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", - "requires": { - "debug": "2.6.9", - "define-property": "0.2.5", - "extend-shallow": "2.0.1", - "posix-character-classes": "0.1.1", - "regex-not": "1.0.2", - "snapdragon": "0.8.2", - "to-regex": "3.0.2" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "requires": { - "is-descriptor": "0.1.6" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "requires": { - "is-extendable": "0.1.1" - } - } - } - }, - "express": { - "version": "4.16.3", - "resolved": "http://registry.npmjs.org/express/-/express-4.16.3.tgz", - "integrity": "sha1-avilAjUNsyRuzEvs9rWjTSL37VM=", - "requires": { - "accepts": "1.3.5", - "array-flatten": "1.1.1", - "body-parser": "1.18.2", - "content-disposition": "0.5.2", - "content-type": "1.0.4", - "cookie": "0.3.1", - "cookie-signature": "1.0.6", - "debug": "2.6.9", - "depd": "1.1.2", - "encodeurl": "1.0.2", - "escape-html": "1.0.3", - "etag": "1.8.1", - "finalhandler": "1.1.1", - "fresh": "0.5.2", - "merge-descriptors": "1.0.1", - "methods": "1.1.2", - "on-finished": "2.3.0", - "parseurl": "1.3.2", - "path-to-regexp": "0.1.7", - "proxy-addr": "2.0.4", - "qs": "6.5.1", - "range-parser": "1.2.0", - "safe-buffer": "5.1.1", - "send": "0.16.2", - "serve-static": "1.13.2", - "setprototypeof": "1.1.0", - "statuses": "1.4.0", - "type-is": "1.6.16", - "utils-merge": "1.0.1", - "vary": "1.1.2" - }, - "dependencies": { - "qs": { - "version": "6.5.1", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.1.tgz", - "integrity": "sha512-eRzhrN1WSINYCDCbrz796z37LOe3m5tmW7RQf6oBntukAG1nmovJvhnwHHRMAfeoItc1m2Hk02WER2aQ/iqs+A==" - }, - "safe-buffer": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", - "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==" - } - } - }, - "extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" - }, - "extend-shallow": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", - "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", - "requires": { - "assign-symbols": "1.0.0", - "is-extendable": "1.0.1" - }, - "dependencies": { - "is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "requires": { - "is-plain-object": "2.0.4" - } - } - } - }, - "extglob": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", - "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", - "requires": { - "array-unique": "0.3.2", - "define-property": "1.0.0", - "expand-brackets": "2.1.4", - "extend-shallow": "2.0.1", - "fragment-cache": "0.2.1", - "regex-not": "1.0.2", - "snapdragon": "0.8.2", - "to-regex": "3.0.2" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "requires": { - "is-descriptor": "1.0.2" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "requires": { - "is-extendable": "0.1.1" - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "requires": { - "kind-of": "6.0.2" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "requires": { - "kind-of": "6.0.2" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "requires": { - "is-accessor-descriptor": "1.0.0", - "is-data-descriptor": "1.0.0", - "kind-of": "6.0.2" - } - } - } - }, - "extsprintf": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" - }, - "fast-deep-equal": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", - "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=" - }, - "fast-glob": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-2.2.2.tgz", - "integrity": "sha512-TR6zxCKftDQnUAPvkrCWdBgDq/gbqx8A3ApnBrR5rMvpp6+KMJI0Igw7fkWPgeVK0uhRXTXdvO3O+YP0CaUX2g==", - "requires": { - "@mrmlnc/readdir-enhanced": "2.2.1", - "@nodelib/fs.stat": "1.1.2", - "glob-parent": "3.1.0", - "is-glob": "4.0.0", - "merge2": "1.2.2", - "micromatch": "3.1.10" - } - }, - "fast-json-stable-stringify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", - "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=" - }, - "faye-websocket": { - "version": "0.11.1", - "resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.11.1.tgz", - "integrity": "sha1-8O/hjE9W5PQK/H4Gxxn9XuYYjzg=", - "requires": { - "websocket-driver": "0.7.0" - } - }, - "fill-range": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", - "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", - "requires": { - "extend-shallow": "2.0.1", - "is-number": "3.0.0", - "repeat-string": "1.6.1", - "to-regex-range": "2.1.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "requires": { - "is-extendable": "0.1.1" - } - } - } - }, - "finalhandler": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.1.tgz", - "integrity": "sha512-Y1GUDo39ez4aHAw7MysnUD5JzYX+WaIj8I57kO3aEPT1fFRL4sr7mjei97FgnwhAyyzRYmQZaTHb2+9uZ1dPtg==", - "requires": { - "debug": "2.6.9", - "encodeurl": "1.0.2", - "escape-html": "1.0.3", - "on-finished": "2.3.0", - "parseurl": "1.3.2", - "statuses": "1.4.0", - "unpipe": "1.0.0" - } - }, - "firebase-admin": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/firebase-admin/-/firebase-admin-6.0.0.tgz", - "integrity": "sha512-ai7ensTAZx9iF6z/lMn7JzFJYSl6+uXYm53GGhWlph+npnQli10FF9YB97OjcVUghapDEWzmb6J0VMtB965nsw==", - "requires": { - "@firebase/app": "0.3.4", - "@firebase/database": "0.3.6", - "@google-cloud/firestore": "0.16.1", - "@google-cloud/storage": "1.7.0", - "@types/google-cloud__storage": "1.7.2", - "@types/node": "8.10.30", - "jsonwebtoken": "8.1.0", - "node-forge": "0.7.4" - } - }, - "firebase-functions": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/firebase-functions/-/firebase-functions-2.0.5.tgz", - "integrity": "sha512-XedOTdaej68I/AmJyeDIKL2Cw6MwI7Ugov5QoEsOU9bh25iAseZmFKFQeqimW5Wb9wKLAli2Wq8ld+FtdOwdvQ==", - "requires": { - "@types/cors": "2.8.4", - "@types/express": "4.16.0", - "@types/jsonwebtoken": "7.2.8", - "@types/lodash": "4.14.116", - "cors": "2.8.4", - "express": "4.16.3", - "jsonwebtoken": "8.3.0", - "lodash": "4.17.11" - }, - "dependencies": { - "jsonwebtoken": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-8.3.0.tgz", - "integrity": "sha512-oge/hvlmeJCH+iIz1DwcO7vKPkNGJHhgkspk8OH3VKlw+mbi42WtD4ig1+VXRln765vxptAv+xT26Fd3cteqag==", - "requires": { - "jws": "3.1.5", - "lodash.includes": "4.3.0", - "lodash.isboolean": "3.0.3", - "lodash.isinteger": "4.0.4", - "lodash.isnumber": "3.0.3", - "lodash.isplainobject": "4.0.6", - "lodash.isstring": "4.0.1", - "lodash.once": "4.1.1", - "ms": "2.1.1" - } - }, - "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" - } - } - }, - "follow-redirects": { - "version": "1.5.8", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.5.8.tgz", - "integrity": "sha512-sy1mXPmv7kLAMKW/8XofG7o9T+6gAjzdZK4AJF6ryqQYUa/hnzgiypoeUecZ53x7XiqKNEpNqLtS97MshW2nxg==", - "requires": { - "debug": "3.1.0" - }, - "dependencies": { - "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", - "requires": { - "ms": "2.0.0" - } - } - } - }, - "for-in": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", - "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=" - }, - "forever-agent": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" - }, - "form-data": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.2.tgz", - "integrity": "sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=", - "requires": { - "asynckit": "0.4.0", - "combined-stream": "1.0.6", - "mime-types": "2.1.20" - }, - "dependencies": { - "combined-stream": { - "version": "1.0.6", - "resolved": "http://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz", - "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=", - "requires": { - "delayed-stream": "1.0.0" - } - } - } - }, - "forwarded": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", - "integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=" - }, - "fragment-cache": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", - "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", - "requires": { - "map-cache": "0.2.2" - } - }, - "fresh": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", - "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=" - }, - "fs.realpath": { - "version": "1.0.0", - "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=", - "optional": true - }, - "gcp-metadata": { - "version": "0.6.3", - "resolved": "http://registry.npmjs.org/gcp-metadata/-/gcp-metadata-0.6.3.tgz", - "integrity": "sha512-MSmczZctbz91AxCvqp9GHBoZOSbJKAICV7Ow/AIWSJZRrRchUd5NL1b2P4OfP+4m490BEUPhhARfpHdqCxuCvg==", - "requires": { - "axios": "0.18.0", - "extend": "3.0.2", - "retry-axios": "0.3.2" - } - }, - "gcs-resumable-upload": { - "version": "0.10.2", - "resolved": "https://registry.npmjs.org/gcs-resumable-upload/-/gcs-resumable-upload-0.10.2.tgz", - "integrity": "sha1-fymz7iPc7EFwNnwHEUGCScZgVF8=", - "optional": true, - "requires": { - "configstore": "3.1.2", - "google-auto-auth": "0.10.1", - "pumpify": "1.5.1", - "request": "2.88.0", - "stream-events": "1.0.4" - } - }, - "get-value": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", - "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=" - }, - "getpass": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", - "requires": { - "assert-plus": "1.0.0" - } - }, - "glob": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", - "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", - "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" - } - }, - "glob-parent": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", - "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", - "requires": { - "is-glob": "3.1.0", - "path-dirname": "1.0.2" - }, - "dependencies": { - "is-glob": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", - "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", - "requires": { - "is-extglob": "2.1.1" - } - } - } - }, - "glob-to-regexp": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.3.0.tgz", - "integrity": "sha1-jFoUlNIGbFcMw7/kSWF1rMTVAqs=" - }, - "globby": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/globby/-/globby-8.0.1.tgz", - "integrity": "sha512-oMrYrJERnKBLXNLVTqhm3vPEdJ/b2ZE28xN4YARiix1NOIOBPEpOUnm844K1iu/BkphCaf2WNFwMszv8Soi1pw==", - "requires": { - "array-union": "1.0.2", - "dir-glob": "2.0.0", - "fast-glob": "2.2.2", - "glob": "7.1.3", - "ignore": "3.3.10", - "pify": "3.0.0", - "slash": "1.0.0" - } - }, - "google-auth-library": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-1.6.1.tgz", - "integrity": "sha512-jYiWC8NA9n9OtQM7ANn0Tk464do9yhKEtaJ72pKcaBiEwn4LwcGYIYOfwtfsSm3aur/ed3tlSxbmg24IAT6gAg==", - "requires": { - "axios": "0.18.0", - "gcp-metadata": "0.6.3", - "gtoken": "2.3.0", - "jws": "3.1.5", - "lodash.isstring": "4.0.1", - "lru-cache": "4.1.3", - "retry-axios": "0.3.2" - } - }, - "google-auto-auth": { - "version": "0.10.1", - "resolved": "https://registry.npmjs.org/google-auto-auth/-/google-auto-auth-0.10.1.tgz", - "integrity": "sha512-iIqSbY7Ypd32mnHGbYctp80vZzXoDlvI9gEfvtl3kmyy5HzOcrZCIGCBdSlIzRsg7nHpQiHE3Zl6Ycur6TSodQ==", - "requires": { - "async": "2.6.1", - "gcp-metadata": "0.6.3", - "google-auth-library": "1.6.1", - "request": "2.88.0" - } - }, - "google-gax": { - "version": "0.18.0", - "resolved": "https://registry.npmjs.org/google-gax/-/google-gax-0.18.0.tgz", - "integrity": "sha512-cF2s3aTw1cWDHsjaYfIizJZT0KJF0FSM3laiCX4O/K0ZcdmeE9PitG2bxRH+dY+Sz094//m+JoH1hBtSyOf67A==", - "optional": true, - "requires": { - "@grpc/proto-loader": "0.3.0", - "duplexify": "3.6.0", - "extend": "3.0.2", - "globby": "8.0.1", - "google-auth-library": "1.6.1", - "google-proto-files": "0.16.1", - "grpc": "1.15.1", - "is-stream-ended": "0.1.4", - "lodash": "4.17.11", - "protobufjs": "6.8.8", - "retry-request": "4.0.0", - "through2": "2.0.3" - } - }, - "google-p12-pem": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/google-p12-pem/-/google-p12-pem-1.0.2.tgz", - "integrity": "sha512-+EuKr4CLlGsnXx4XIJIVkcKYrsa2xkAmCvxRhX2HsazJzUBAJ35wARGeApHUn4nNfPD03Vl057FskNr20VaCyg==", - "requires": { - "node-forge": "0.7.4", - "pify": "3.0.0" - } - }, - "google-proto-files": { - "version": "0.16.1", - "resolved": "https://registry.npmjs.org/google-proto-files/-/google-proto-files-0.16.1.tgz", - "integrity": "sha512-ykdhaYDiU/jlyrkzZDPemraKwVIgLT31XMHVNSJW//R9VED56hqSDRMx1Jlxbf0O4iDZnBWQ0JQLHbM2r5+wuA==", - "requires": { - "globby": "8.0.1", - "power-assert": "1.6.1", - "protobufjs": "6.8.8" - } - }, - "graceful-fs": { - "version": "4.1.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", - "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=" - }, - "grpc": { - "version": "1.15.1", - "resolved": "https://registry.npmjs.org/grpc/-/grpc-1.15.1.tgz", - "integrity": "sha512-BfJ6BpFE93xQW69oYfgVQDxSb7LqdQbnddvhFq4tUsj7s0NAIRrrN3fmN2Bi3qpGFRemsKsWPIchw3YNNq2Xjg==", - "optional": true, - "requires": { - "lodash": "4.17.11", - "nan": "2.11.0", - "node-pre-gyp": "0.10.3", - "protobufjs": "5.0.3" - }, - "dependencies": { - "abbrev": { - "version": "1.1.1", - "bundled": true, - "optional": true - }, - "ansi-regex": { - "version": "2.1.1", - "bundled": true - }, - "aproba": { - "version": "1.2.0", - "bundled": true, - "optional": true - }, - "are-we-there-yet": { - "version": "1.1.5", - "bundled": true, - "optional": true, - "requires": { - "delegates": "1.0.0", - "readable-stream": "2.3.6" - } - }, - "balanced-match": { - "version": "1.0.0", - "bundled": true - }, - "brace-expansion": { - "version": "1.1.11", - "bundled": true, - "requires": { - "balanced-match": "1.0.0", - "concat-map": "0.0.1" - } - }, - "chownr": { - "version": "1.0.1", - "bundled": true, - "optional": true - }, - "code-point-at": { - "version": "1.1.0", - "bundled": true - }, - "concat-map": { - "version": "0.0.1", - "bundled": true - }, - "console-control-strings": { - "version": "1.1.0", - "bundled": true - }, - "core-util-is": { - "version": "1.0.2", - "bundled": true, - "optional": true - }, - "debug": { - "version": "2.6.9", - "bundled": true, - "optional": true, - "requires": { - "ms": "2.0.0" - } - }, - "deep-extend": { - "version": "0.6.0", - "bundled": true, - "optional": true - }, - "delegates": { - "version": "1.0.0", - "bundled": true, - "optional": true - }, - "detect-libc": { - "version": "1.0.3", - "bundled": true, - "optional": true - }, - "fs-minipass": { - "version": "1.2.5", - "bundled": true, - "optional": true, - "requires": { - "minipass": "2.3.3" - } - }, - "fs.realpath": { - "version": "1.0.0", - "bundled": true - }, - "gauge": { - "version": "2.7.4", - "bundled": true, - "optional": true, - "requires": { - "aproba": "1.2.0", - "console-control-strings": "1.1.0", - "has-unicode": "2.0.1", - "object-assign": "4.1.1", - "signal-exit": "3.0.2", - "string-width": "1.0.2", - "strip-ansi": "3.0.1", - "wide-align": "1.1.3" - } - }, - "glob": { - "version": "7.1.2", - "bundled": true, - "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" - } - }, - "has-unicode": { - "version": "2.0.1", - "bundled": true, - "optional": true - }, - "iconv-lite": { - "version": "0.4.23", - "bundled": true, - "optional": true, - "requires": { - "safer-buffer": "2.1.2" - } - }, - "ignore-walk": { - "version": "3.0.1", - "bundled": true, - "optional": true, - "requires": { - "minimatch": "3.0.4" - } - }, - "inflight": { - "version": "1.0.6", - "bundled": true, - "requires": { - "once": "1.4.0", - "wrappy": "1.0.2" - } - }, - "inherits": { - "version": "2.0.3", - "bundled": true - }, - "ini": { - "version": "1.3.5", - "bundled": true, - "optional": true - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "bundled": true, - "requires": { - "number-is-nan": "1.0.1" - } - }, - "isarray": { - "version": "1.0.0", - "bundled": true, - "optional": true - }, - "minimatch": { - "version": "3.0.4", - "bundled": true, - "requires": { - "brace-expansion": "1.1.11" - } - }, - "minimist": { - "version": "1.2.0", - "bundled": true, - "optional": true - }, - "minipass": { - "version": "2.3.3", - "bundled": true, - "requires": { - "safe-buffer": "5.1.2", - "yallist": "3.0.2" - } - }, - "minizlib": { - "version": "1.1.0", - "bundled": true, - "optional": true, - "requires": { - "minipass": "2.3.3" - } - }, - "mkdirp": { - "version": "0.5.1", - "bundled": true, - "requires": { - "minimist": "0.0.8" - }, - "dependencies": { - "minimist": { - "version": "0.0.8", - "bundled": true - } - } - }, - "ms": { - "version": "2.0.0", - "bundled": true, - "optional": true - }, - "needle": { - "version": "2.2.2", - "bundled": true, - "optional": true, - "requires": { - "debug": "2.6.9", - "iconv-lite": "0.4.23", - "sax": "1.2.4" - } - }, - "node-pre-gyp": { - "version": "0.10.3", - "bundled": true, - "optional": true, - "requires": { - "detect-libc": "1.0.3", - "mkdirp": "0.5.1", - "needle": "2.2.2", - "nopt": "4.0.1", - "npm-packlist": "1.1.11", - "npmlog": "4.1.2", - "rc": "1.2.8", - "rimraf": "2.6.2", - "semver": "5.5.0", - "tar": "4.4.6" - } - }, - "nopt": { - "version": "4.0.1", - "bundled": true, - "optional": true, - "requires": { - "abbrev": "1.1.1", - "osenv": "0.1.5" - } - }, - "npm-bundled": { - "version": "1.0.3", - "bundled": true, - "optional": true - }, - "npm-packlist": { - "version": "1.1.11", - "bundled": true, - "optional": true, - "requires": { - "ignore-walk": "3.0.1", - "npm-bundled": "1.0.3" - } - }, - "npmlog": { - "version": "4.1.2", - "bundled": true, - "optional": true, - "requires": { - "are-we-there-yet": "1.1.5", - "console-control-strings": "1.1.0", - "gauge": "2.7.4", - "set-blocking": "2.0.0" - } - }, - "number-is-nan": { - "version": "1.0.1", - "bundled": true - }, - "object-assign": { - "version": "4.1.1", - "bundled": true, - "optional": true - }, - "once": { - "version": "1.4.0", - "bundled": true, - "requires": { - "wrappy": "1.0.2" - } - }, - "os-homedir": { - "version": "1.0.2", - "bundled": true, - "optional": true - }, - "os-tmpdir": { - "version": "1.0.2", - "bundled": true, - "optional": true - }, - "osenv": { - "version": "0.1.5", - "bundled": true, - "optional": true, - "requires": { - "os-homedir": "1.0.2", - "os-tmpdir": "1.0.2" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "bundled": true - }, - "process-nextick-args": { - "version": "2.0.0", - "bundled": true, - "optional": true - }, - "protobufjs": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-5.0.3.tgz", - "integrity": "sha512-55Kcx1MhPZX0zTbVosMQEO5R6/rikNXd9b6RQK4KSPcrSIIwoXTtebIczUrXlwaSrbz4x8XUVThGPob1n8I4QA==", - "optional": true, - "requires": { - "ascli": "1.0.1", - "bytebuffer": "5.0.1", - "glob": "7.1.2", - "yargs": "3.32.0" - } - }, - "rc": { - "version": "1.2.8", - "bundled": true, - "optional": true, - "requires": { - "deep-extend": "0.6.0", - "ini": "1.3.5", - "minimist": "1.2.0", - "strip-json-comments": "2.0.1" - } - }, - "readable-stream": { - "version": "2.3.6", - "bundled": true, - "optional": true, - "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "1.0.0", - "process-nextick-args": "2.0.0", - "safe-buffer": "5.1.2", - "string_decoder": "1.1.1", - "util-deprecate": "1.0.2" - } - }, - "rimraf": { - "version": "2.6.2", - "bundled": true, - "optional": true, - "requires": { - "glob": "7.1.2" - } - }, - "safe-buffer": { - "version": "5.1.2", - "bundled": true - }, - "safer-buffer": { - "version": "2.1.2", - "bundled": true, - "optional": true - }, - "sax": { - "version": "1.2.4", - "bundled": true, - "optional": true - }, - "semver": { - "version": "5.5.0", - "bundled": true, - "optional": true - }, - "set-blocking": { - "version": "2.0.0", - "bundled": true, - "optional": true - }, - "signal-exit": { - "version": "3.0.2", - "bundled": true, - "optional": true - }, - "string-width": { - "version": "1.0.2", - "bundled": true, - "requires": { - "code-point-at": "1.1.0", - "is-fullwidth-code-point": "1.0.0", - "strip-ansi": "3.0.1" - } - }, - "string_decoder": { - "version": "1.1.1", - "bundled": true, - "optional": true, - "requires": { - "safe-buffer": "5.1.2" - } - }, - "strip-ansi": { - "version": "3.0.1", - "bundled": true, - "requires": { - "ansi-regex": "2.1.1" - } - }, - "strip-json-comments": { - "version": "2.0.1", - "bundled": true, - "optional": true - }, - "tar": { - "version": "4.4.6", - "bundled": true, - "optional": true, - "requires": { - "chownr": "1.0.1", - "fs-minipass": "1.2.5", - "minipass": "2.3.3", - "minizlib": "1.1.0", - "mkdirp": "0.5.1", - "safe-buffer": "5.1.2", - "yallist": "3.0.2" - } - }, - "util-deprecate": { - "version": "1.0.2", - "bundled": true, - "optional": true - }, - "wide-align": { - "version": "1.1.3", - "bundled": true, - "optional": true, - "requires": { - "string-width": "1.0.2" - } - }, - "wrappy": { - "version": "1.0.2", - "bundled": true - }, - "yallist": { - "version": "3.0.2", - "bundled": true - } - } - }, - "gtoken": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-2.3.0.tgz", - "integrity": "sha512-Jc9/8mV630cZE9FC5tIlJCZNdUjwunvlwOtCz6IDlaiB4Sz68ki29a1+q97sWTnTYroiuF9B135rod9zrQdHLw==", - "requires": { - "axios": "0.18.0", - "google-p12-pem": "1.0.2", - "jws": "3.1.5", - "mime": "2.3.1", - "pify": "3.0.0" - } - }, - "har-schema": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=" - }, - "har-validator": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.0.tgz", - "integrity": "sha512-+qnmNjI4OfH2ipQ9VQOw23bBd/ibtfbVdK2fYbY4acTDqKTW/YDp9McimZdDbG8iV9fZizUqQMD5xvriB146TA==", - "requires": { - "ajv": "5.5.2", - "har-schema": "2.0.0" - } - }, - "has-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", - "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", - "requires": { - "get-value": "2.0.6", - "has-values": "1.0.0", - "isobject": "3.0.1" - } - }, - "has-values": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", - "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", - "requires": { - "is-number": "3.0.0", - "kind-of": "4.0.0" - }, - "dependencies": { - "kind-of": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", - "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", - "requires": { - "is-buffer": "1.1.6" - } - } - } - }, - "hash-stream-validation": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/hash-stream-validation/-/hash-stream-validation-0.2.1.tgz", - "integrity": "sha1-7Mm5l7IYvluzEphii7gHhptz3NE=", - "optional": true, - "requires": { - "through2": "2.0.3" - } - }, - "http-errors": { - "version": "1.6.3", - "resolved": "http://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", - "integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=", - "requires": { - "depd": "1.1.2", - "inherits": "2.0.3", - "setprototypeof": "1.1.0", - "statuses": "1.4.0" - } - }, - "http-parser-js": { - "version": "0.4.13", - "resolved": "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.4.13.tgz", - "integrity": "sha1-O9bW/ebjFyyTNMOzO2wZPYD+ETc=" - }, - "http-signature": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", - "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", - "requires": { - "assert-plus": "1.0.0", - "jsprim": "1.4.1", - "sshpk": "1.14.2" - } - }, - "iconv-lite": { - "version": "0.4.19", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz", - "integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ==" - }, - "ignore": { - "version": "3.3.10", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.10.tgz", - "integrity": "sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug==" - }, - "imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", - "optional": true - }, - "indexof": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz", - "integrity": "sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10=" - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "requires": { - "once": "1.4.0", - "wrappy": "1.0.2" - } - }, - "inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" - }, - "invert-kv": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", - "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=", - "optional": true - }, - "ipaddr.js": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.8.0.tgz", - "integrity": "sha1-6qM9bd16zo9/b+DJygRA5wZzix4=" - }, - "is": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/is/-/is-3.2.1.tgz", - "integrity": "sha1-0Kwq1V63sL7JJqUmb2xmKqqD3KU=" - }, - "is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", - "requires": { - "kind-of": "3.2.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "requires": { - "is-buffer": "1.1.6" - } - } - } - }, - "is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" - }, - "is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", - "requires": { - "kind-of": "3.2.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "requires": { - "is-buffer": "1.1.6" - } - } - } - }, - "is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", - "requires": { - "is-accessor-descriptor": "0.1.6", - "is-data-descriptor": "0.1.4", - "kind-of": "5.1.0" - }, - "dependencies": { - "kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==" - } - } - }, - "is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=" - }, - "is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=" - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", - "requires": { - "number-is-nan": "1.0.1" - } - }, - "is-glob": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.0.tgz", - "integrity": "sha1-lSHHaEXMJhCoUgPd8ICpWML/q8A=", - "requires": { - "is-extglob": "2.1.1" - } - }, - "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "requires": { - "kind-of": "3.2.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "requires": { - "is-buffer": "1.1.6" - } - } - } - }, - "is-obj": { - "version": "1.0.1", - "resolved": "http://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", - "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=", - "optional": true - }, - "is-plain-object": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", - "requires": { - "isobject": "3.0.1" - } - }, - "is-stream-ended": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-stream-ended/-/is-stream-ended-0.1.4.tgz", - "integrity": "sha512-xj0XPvmr7bQFTvirqnFr50o0hQIh6ZItDqloxt5aJrR4NQsYeSsyFQERYGCAzfindAcnKjINnwEEgLx4IqVzQw==", - "optional": true - }, - "is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" - }, - "is-windows": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", - "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==" - }, - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", - "optional": true - }, - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=" - }, - "isstream": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" - }, - "jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", - "optional": true - }, - "json-schema": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", - "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" - }, - "json-schema-traverse": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", - "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=" - }, - "json-stringify-safe": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" - }, - "jsonwebtoken": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-8.1.0.tgz", - "integrity": "sha1-xjl80uX9WD1lwAeoPce7eOaYK4M=", - "requires": { - "jws": "3.1.5", - "lodash.includes": "4.3.0", - "lodash.isboolean": "3.0.3", - "lodash.isinteger": "4.0.4", - "lodash.isnumber": "3.0.3", - "lodash.isplainobject": "4.0.6", - "lodash.isstring": "4.0.1", - "lodash.once": "4.1.1", - "ms": "2.0.0", - "xtend": "4.0.1" - } - }, - "jsprim": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", - "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", - "requires": { - "assert-plus": "1.0.0", - "extsprintf": "1.3.0", - "json-schema": "0.2.3", - "verror": "1.10.0" - } - }, - "jwa": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.1.6.tgz", - "integrity": "sha512-tBO/cf++BUsJkYql/kBbJroKOgHWEigTKBAjjBEmrMGYd1QMBC74Hr4Wo2zCZw6ZrVhlJPvoMrkcOnlWR/DJfw==", - "requires": { - "buffer-equal-constant-time": "1.0.1", - "ecdsa-sig-formatter": "1.0.10", - "safe-buffer": "5.1.2" - } - }, - "jws": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/jws/-/jws-3.1.5.tgz", - "integrity": "sha512-GsCSexFADNQUr8T5HPJvayTjvPIfoyJPtLQBwn5a4WZQchcrPMPMAWcC1AzJVRDKyD6ZPROPAxgv6rfHViO4uQ==", - "requires": { - "jwa": "1.1.6", - "safe-buffer": "5.1.2" - } - }, - "kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==" - }, - "lcid": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", - "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", - "optional": true, - "requires": { - "invert-kv": "1.0.0" - } - }, - "lodash": { - "version": "4.17.11", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", - "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==" - }, - "lodash.includes": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", - "integrity": "sha1-YLuYqHy5I8aMoeUTJUgzFISfVT8=" - }, - "lodash.isboolean": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz", - "integrity": "sha1-bC4XHbKiV82WgC/UOwGyDV9YcPY=" - }, - "lodash.isinteger": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz", - "integrity": "sha1-YZwK89A/iwTDH1iChAt3sRzWg0M=" - }, - "lodash.isnumber": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz", - "integrity": "sha1-POdoEMWSjQM1IwGsKHMX8RwLH/w=" - }, - "lodash.isplainobject": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", - "integrity": "sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs=" - }, - "lodash.isstring": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", - "integrity": "sha1-1SfftUVuynzJu5XV2ur4i6VKVFE=" - }, - "lodash.merge": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.1.tgz", - "integrity": "sha512-AOYza4+Hf5z1/0Hztxpm2/xiPZgi/cjMqdnKTUWTBSKchJlxXXuUSxCCl8rJlf4g6yww/j6mA8nC8Hw/EZWxKQ==", - "optional": true - }, - "lodash.once": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", - "integrity": "sha1-DdOXEhPHxW34gJd9UEyI+0cal6w=" - }, - "log-driver": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/log-driver/-/log-driver-1.2.7.tgz", - "integrity": "sha512-U7KCmLdqsGHBLeWqYlFA0V0Sl6P08EE1ZrmA9cxjUE0WVqT9qnyVDPz1kzpFEP0jdJuFnasWIfSd7fsaNXkpbg==", - "optional": true - }, - "long": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", - "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" - }, - "lru-cache": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.3.tgz", - "integrity": "sha512-fFEhvcgzuIoJVUF8fYr5KR0YqxD238zgObTps31YdADwPPAp82a4M8TrckkWyx7ekNlf9aBcVn81cFwwXngrJA==", - "requires": { - "pseudomap": "1.0.2", - "yallist": "2.1.2" - } - }, - "make-dir": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz", - "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==", - "optional": true, - "requires": { - "pify": "3.0.0" - } - }, - "map-cache": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", - "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=" - }, - "map-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", - "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", - "requires": { - "object-visit": "1.0.1" - } - }, - "media-typer": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", - "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=" - }, - "merge-descriptors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", - "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=" - }, - "merge2": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.2.2.tgz", - "integrity": "sha512-bgM8twH86rWni21thii6WCMQMRMmwqqdW3sGWi9IipnVAszdLXRjwDwAnyrVXo6DuP3AjRMMttZKUB48QWIFGg==" - }, - "methmeth": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/methmeth/-/methmeth-1.1.0.tgz", - "integrity": "sha1-6AomYY5S9cQiKGG7dIUQvRDikIk=", - "optional": true - }, - "methods": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", - "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" - }, - "micromatch": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", - "requires": { - "arr-diff": "4.0.0", - "array-unique": "0.3.2", - "braces": "2.3.2", - "define-property": "2.0.2", - "extend-shallow": "3.0.2", - "extglob": "2.0.4", - "fragment-cache": "0.2.1", - "kind-of": "6.0.2", - "nanomatch": "1.2.13", - "object.pick": "1.3.0", - "regex-not": "1.0.2", - "snapdragon": "0.8.2", - "to-regex": "3.0.2" - } - }, - "mime": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/mime/-/mime-2.3.1.tgz", - "integrity": "sha512-OEUllcVoydBHGN1z84yfQDimn58pZNNNXgZlHXSboxMlFvgI6MXSWpWKpFRra7H1HxpVhHTkrghfRW49k6yjeg==" - }, - "mime-db": { - "version": "1.36.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.36.0.tgz", - "integrity": "sha512-L+xvyD9MkoYMXb1jAmzI/lWYAxAMCPvIBSWur0PZ5nOf5euahRLVqH//FKW9mWp2lkqUgYiXPgkzfMUFi4zVDw==" - }, - "mime-types": { - "version": "2.1.20", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.20.tgz", - "integrity": "sha512-HrkrPaP9vGuWbLK1B1FfgAkbqNjIuy4eHlIYnFi7kamZyLLrGlo2mpcx0bBmNpKqBtYtAfGbodDddIgddSJC2A==", - "requires": { - "mime-db": "1.36.0" - } - }, - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "requires": { - "brace-expansion": "1.1.11" - } - }, - "mixin-deep": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.1.tgz", - "integrity": "sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ==", - "requires": { - "for-in": "1.0.2", - "is-extendable": "1.0.1" - }, - "dependencies": { - "is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "requires": { - "is-plain-object": "2.0.4" - } - } - } - }, - "modelo": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/modelo/-/modelo-4.2.3.tgz", - "integrity": "sha512-9DITV2YEMcw7XojdfvGl3gDD8J9QjZTJ7ZOUuSAkP+F3T6rDbzMJuPktxptsdHYEvZcmXrCD3LMOhdSAEq6zKA==", - "optional": true - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" - }, - "nan": { - "version": "2.11.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.11.0.tgz", - "integrity": "sha512-F4miItu2rGnV2ySkXOQoA8FKz/SR2Q2sWP0sbTxNxz/tuokeC8WxOhPMcwi0qIyGtVn/rrSeLbvVkznqCdwYnw==", - "optional": true - }, - "nanomatch": { - "version": "1.2.13", - "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", - "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", - "requires": { - "arr-diff": "4.0.0", - "array-unique": "0.3.2", - "define-property": "2.0.2", - "extend-shallow": "3.0.2", - "fragment-cache": "0.2.1", - "is-windows": "1.0.2", - "kind-of": "6.0.2", - "object.pick": "1.3.0", - "regex-not": "1.0.2", - "snapdragon": "0.8.2", - "to-regex": "3.0.2" - } - }, - "negotiator": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz", - "integrity": "sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk=" - }, - "node-forge": { - "version": "0.7.4", - "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.7.4.tgz", - "integrity": "sha512-8Df0906+tq/omxuCZD6PqhPaQDYuyJ1d+VITgxoIA8zvQd1ru+nMJcDChHH324MWitIgbVkAkQoGEEVJNpn/PA==" - }, - "number-is-nan": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" - }, - "oauth-sign": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", - "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==" - }, - "object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" - }, - "object-copy": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", - "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", - "requires": { - "copy-descriptor": "0.1.1", - "define-property": "0.2.5", - "kind-of": "3.2.2" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "requires": { - "is-descriptor": "0.1.6" - } - }, - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "requires": { - "is-buffer": "1.1.6" - } - } - } - }, - "object-keys": { - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.12.tgz", - "integrity": "sha512-FTMyFUm2wBcGHnH2eXmz7tC6IwlqQZ6mVZ+6dm6vZ4IQIHjs6FdNsQBuKGPuUUUY6NfJw2PshC08Tn6LzLDOag==" - }, - "object-visit": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", - "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", - "requires": { - "isobject": "3.0.1" - } - }, - "object.pick": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", - "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", - "requires": { - "isobject": "3.0.1" - } - }, - "on-finished": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", - "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", - "requires": { - "ee-first": "1.1.1" - } - }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "requires": { - "wrappy": "1.0.2" - } - }, - "optjs": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/optjs/-/optjs-3.2.2.tgz", - "integrity": "sha1-aabOicRCpEQDFBrS+bNwvVu29O4=", - "optional": true - }, - "os-locale": { - "version": "1.4.0", - "resolved": "http://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", - "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", - "optional": true, - "requires": { - "lcid": "1.0.0" - } - }, - "parseurl": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.2.tgz", - "integrity": "sha1-/CidTtiZMRlGDBViUyYs3I3mW/M=" - }, - "pascalcase": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", - "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=" - }, - "path-dirname": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", - "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=" - }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" - }, - "path-to-regexp": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", - "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=" - }, - "path-type": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", - "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", - "requires": { - "pify": "3.0.0" - } - }, - "performance-now": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" - }, - "pify": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=" - }, - "posix-character-classes": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", - "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=" - }, - "power-assert": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/power-assert/-/power-assert-1.6.1.tgz", - "integrity": "sha512-VWkkZV6Y+W8qLX/PtJu2Ur2jDPIs0a5vbP0TpKeybNcIXmT4vcKoVkyTp5lnQvTpY/DxacAZ4RZisHRHLJcAZQ==", - "requires": { - "define-properties": "1.1.3", - "empower": "1.3.1", - "power-assert-formatter": "1.4.1", - "universal-deep-strict-equal": "1.2.2", - "xtend": "4.0.1" - } - }, - "power-assert-context-formatter": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/power-assert-context-formatter/-/power-assert-context-formatter-1.2.0.tgz", - "integrity": "sha512-HLNEW8Bin+BFCpk/zbyKwkEu9W8/zThIStxGo7weYcFkKgMuGCHUJhvJeBGXDZf0Qm2xis4pbnnciGZiX0EpSg==", - "requires": { - "core-js": "2.5.7", - "power-assert-context-traversal": "1.2.0" - } - }, - "power-assert-context-reducer-ast": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/power-assert-context-reducer-ast/-/power-assert-context-reducer-ast-1.2.0.tgz", - "integrity": "sha512-EgOxmZ/Lb7tw4EwSKX7ZnfC0P/qRZFEG28dx/690qvhmOJ6hgThYFm5TUWANDLK5NiNKlPBi5WekVGd2+5wPrw==", - "requires": { - "acorn": "5.7.3", - "acorn-es7-plugin": "1.1.7", - "core-js": "2.5.7", - "espurify": "1.8.1", - "estraverse": "4.2.0" - } - }, - "power-assert-context-traversal": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/power-assert-context-traversal/-/power-assert-context-traversal-1.2.0.tgz", - "integrity": "sha512-NFoHU6g2umNajiP2l4qb0BRWD773Aw9uWdWYH9EQsVwIZnog5bd2YYLFCVvaxWpwNzWeEfZIon2xtyc63026pQ==", - "requires": { - "core-js": "2.5.7", - "estraverse": "4.2.0" - } - }, - "power-assert-formatter": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/power-assert-formatter/-/power-assert-formatter-1.4.1.tgz", - "integrity": "sha1-XcEl7VCj37HdomwZNH879Y7CiEo=", - "requires": { - "core-js": "2.5.7", - "power-assert-context-formatter": "1.2.0", - "power-assert-context-reducer-ast": "1.2.0", - "power-assert-renderer-assertion": "1.2.0", - "power-assert-renderer-comparison": "1.2.0", - "power-assert-renderer-diagram": "1.2.0", - "power-assert-renderer-file": "1.2.0" - } - }, - "power-assert-renderer-assertion": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/power-assert-renderer-assertion/-/power-assert-renderer-assertion-1.2.0.tgz", - "integrity": "sha512-3F7Q1ZLmV2ZCQv7aV7NJLNK9G7QsostrhOU7U0RhEQS/0vhEqrRg2jEJl1jtUL4ZyL2dXUlaaqrmPv5r9kRvIg==", - "requires": { - "power-assert-renderer-base": "1.1.1", - "power-assert-util-string-width": "1.2.0" - } - }, - "power-assert-renderer-base": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/power-assert-renderer-base/-/power-assert-renderer-base-1.1.1.tgz", - "integrity": "sha1-lqZQxv0F7hvB9mtUrWFELIs/Y+s=" - }, - "power-assert-renderer-comparison": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/power-assert-renderer-comparison/-/power-assert-renderer-comparison-1.2.0.tgz", - "integrity": "sha512-7c3RKPDBKK4E3JqdPtYRE9cM8AyX4LC4yfTvvTYyx8zSqmT5kJnXwzR0yWQLOavACllZfwrAGQzFiXPc5sWa+g==", - "requires": { - "core-js": "2.5.7", - "diff-match-patch": "1.0.4", - "power-assert-renderer-base": "1.1.1", - "stringifier": "1.4.0", - "type-name": "2.0.2" - } - }, - "power-assert-renderer-diagram": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/power-assert-renderer-diagram/-/power-assert-renderer-diagram-1.2.0.tgz", - "integrity": "sha512-JZ6PC+DJPQqfU6dwSmpcoD7gNnb/5U77bU5KgNwPPa+i1Pxiz6UuDeM3EUBlhZ1HvH9tMjI60anqVyi5l2oNdg==", - "requires": { - "core-js": "2.5.7", - "power-assert-renderer-base": "1.1.1", - "power-assert-util-string-width": "1.2.0", - "stringifier": "1.4.0" - } - }, - "power-assert-renderer-file": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/power-assert-renderer-file/-/power-assert-renderer-file-1.2.0.tgz", - "integrity": "sha512-/oaVrRbeOtGoyyd7e4IdLP/jIIUFJdqJtsYzP9/88R39CMnfF/S/rUc8ZQalENfUfQ/wQHu+XZYRMaCEZmEesg==", - "requires": { - "power-assert-renderer-base": "1.1.1" - } - }, - "power-assert-util-string-width": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/power-assert-util-string-width/-/power-assert-util-string-width-1.2.0.tgz", - "integrity": "sha512-lX90G0igAW0iyORTILZ/QjZWsa1MZ6VVY3L0K86e2eKun3S4LKPH4xZIl8fdeMYLfOjkaszbNSzf1uugLeAm2A==", - "requires": { - "eastasianwidth": "0.2.0" - } - }, - "process-nextick-args": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", - "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==" - }, - "protobufjs": { - "version": "6.8.8", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.8.8.tgz", - "integrity": "sha512-AAmHtD5pXgZfi7GMpllpO3q1Xw1OYldr+dMUlAnffGTAhqkg72WdmSY71uKBF/JuyiKs8psYbtKrhi0ASCD8qw==", - "requires": { - "@protobufjs/aspromise": "1.1.2", - "@protobufjs/base64": "1.1.2", - "@protobufjs/codegen": "2.0.4", - "@protobufjs/eventemitter": "1.1.0", - "@protobufjs/fetch": "1.1.0", - "@protobufjs/float": "1.0.2", - "@protobufjs/inquire": "1.1.0", - "@protobufjs/path": "1.1.2", - "@protobufjs/pool": "1.1.0", - "@protobufjs/utf8": "1.1.0", - "@types/long": "4.0.0", - "@types/node": "10.11.0", - "long": "4.0.0" - }, - "dependencies": { - "@types/node": { - "version": "10.11.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.11.0.tgz", - "integrity": "sha512-R4Dvw6KjSYn/SpvjRchBOwXr14vVVcFXCtnM3f0aLvlJS8a599rrcEoihcP2/+Z/f75E5GNPd4aWM7j1yei9og==" - } - } - }, - "proxy-addr": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.4.tgz", - "integrity": "sha512-5erio2h9jp5CHGwcybmxmVqHmnCBZeewlfJ0pex+UW7Qny7OOZXTtH56TGNyBizkgiOwhJtMKrVzDTeKcySZwA==", - "requires": { - "forwarded": "0.1.2", - "ipaddr.js": "1.8.0" - } - }, - "pseudomap": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", - "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=" - }, - "psl": { - "version": "1.1.29", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.29.tgz", - "integrity": "sha512-AeUmQ0oLN02flVHXWh9sSJF7mcdFq0ppid/JkErufc3hGIV/AMa8Fo9VgDo/cT2jFdOWoFvHp90qqBH54W+gjQ==" - }, - "pump": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", - "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", - "requires": { - "end-of-stream": "1.4.1", - "once": "1.4.0" - } - }, - "pumpify": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/pumpify/-/pumpify-1.5.1.tgz", - "integrity": "sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ==", - "requires": { - "duplexify": "3.6.0", - "inherits": "2.0.3", - "pump": "2.0.1" - } - }, - "punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" - }, - "qs": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", - "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" - }, - "range-parser": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.0.tgz", - "integrity": "sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4=" - }, - "raw-body": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.3.2.tgz", - "integrity": "sha1-vNYMd9Prk83gBQKVw/N5OJvIj4k=", - "requires": { - "bytes": "3.0.0", - "http-errors": "1.6.2", - "iconv-lite": "0.4.19", - "unpipe": "1.0.0" - }, - "dependencies": { - "depd": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.1.tgz", - "integrity": "sha1-V4O04cRZ8G+lyif5kfPQbnoxA1k=" - }, - "http-errors": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.2.tgz", - "integrity": "sha1-CgAsyFcHGSp+eUbO7cERVfYOxzY=", - "requires": { - "depd": "1.1.1", - "inherits": "2.0.3", - "setprototypeof": "1.0.3", - "statuses": "1.4.0" - } - }, - "setprototypeof": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.0.3.tgz", - "integrity": "sha1-ZlZ+NwQ+608E2RvWWMDL77VbjgQ=" - } - } - }, - "readable-stream": { - "version": "1.0.34", - "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", - "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", - "optional": true, - "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "0.0.1", - "string_decoder": "0.10.31" - } - }, - "regex-not": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", - "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", - "requires": { - "extend-shallow": "3.0.2", - "safe-regex": "1.1.0" - } - }, - "repeat-element": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", - "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==" - }, - "repeat-string": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", - "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=" - }, - "request": { - "version": "2.88.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", - "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", - "requires": { - "aws-sign2": "0.7.0", - "aws4": "1.8.0", - "caseless": "0.12.0", - "combined-stream": "1.0.7", - "extend": "3.0.2", - "forever-agent": "0.6.1", - "form-data": "2.3.2", - "har-validator": "5.1.0", - "http-signature": "1.2.0", - "is-typedarray": "1.0.0", - "isstream": "0.1.2", - "json-stringify-safe": "5.0.1", - "mime-types": "2.1.20", - "oauth-sign": "0.9.0", - "performance-now": "2.1.0", - "qs": "6.5.2", - "safe-buffer": "5.1.2", - "tough-cookie": "2.4.3", - "tunnel-agent": "0.6.0", - "uuid": "3.3.2" - } - }, - "resolve-url": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", - "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=" - }, - "ret": { - "version": "0.1.15", - "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", - "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==" - }, - "retry-axios": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/retry-axios/-/retry-axios-0.3.2.tgz", - "integrity": "sha512-jp4YlI0qyDFfXiXGhkCOliBN1G7fRH03Nqy8YdShzGqbY5/9S2x/IR6C88ls2DFkbWuL3ASkP7QD3pVrNpPgwQ==" - }, - "retry-request": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/retry-request/-/retry-request-4.0.0.tgz", - "integrity": "sha512-S4HNLaWcMP6r8E4TMH52Y7/pM8uNayOcTDDQNBwsCccL1uI+Ol2TljxRDPzaNfbhOB30+XWP5NnZkB3LiJxi1w==", - "optional": true, - "requires": { - "through2": "2.0.3" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "safe-regex": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", - "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", - "requires": { - "ret": "0.1.15" - } - }, - "safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" - }, - "send": { - "version": "0.16.2", - "resolved": "https://registry.npmjs.org/send/-/send-0.16.2.tgz", - "integrity": "sha512-E64YFPUssFHEFBvpbbjr44NCLtI1AohxQ8ZSiJjQLskAdKuriYEP6VyGEsRDH8ScozGpkaX1BGvhanqCwkcEZw==", - "requires": { - "debug": "2.6.9", - "depd": "1.1.2", - "destroy": "1.0.4", - "encodeurl": "1.0.2", - "escape-html": "1.0.3", - "etag": "1.8.1", - "fresh": "0.5.2", - "http-errors": "1.6.3", - "mime": "1.4.1", - "ms": "2.0.0", - "on-finished": "2.3.0", - "range-parser": "1.2.0", - "statuses": "1.4.0" - }, - "dependencies": { - "mime": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.4.1.tgz", - "integrity": "sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ==" - } - } - }, - "serve-static": { - "version": "1.13.2", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.13.2.tgz", - "integrity": "sha512-p/tdJrO4U387R9oMjb1oj7qSMaMfmOyd4j9hOFoxZe2baQszgHcSWjuya/CiT5kgZZKRudHNOA0pYXOl8rQ5nw==", - "requires": { - "encodeurl": "1.0.2", - "escape-html": "1.0.3", - "parseurl": "1.3.2", - "send": "0.16.2" - } - }, - "set-value": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz", - "integrity": "sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg==", - "requires": { - "extend-shallow": "2.0.1", - "is-extendable": "0.1.1", - "is-plain-object": "2.0.4", - "split-string": "3.1.0" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "requires": { - "is-extendable": "0.1.1" - } - } - } - }, - "setprototypeof": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz", - "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==" - }, - "signal-exit": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", - "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", - "optional": true - }, - "slash": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz", - "integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU=" - }, - "snakeize": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/snakeize/-/snakeize-0.1.0.tgz", - "integrity": "sha1-EMCI2LWOsHazIpu1oE4jLOEmQi0=", - "optional": true - }, - "snapdragon": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", - "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", - "requires": { - "base": "0.11.2", - "debug": "2.6.9", - "define-property": "0.2.5", - "extend-shallow": "2.0.1", - "map-cache": "0.2.2", - "source-map": "0.5.7", - "source-map-resolve": "0.5.2", - "use": "3.1.1" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "requires": { - "is-descriptor": "0.1.6" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "requires": { - "is-extendable": "0.1.1" - } - } - } - }, - "snapdragon-node": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", - "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", - "requires": { - "define-property": "1.0.0", - "isobject": "3.0.1", - "snapdragon-util": "3.0.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "requires": { - "is-descriptor": "1.0.2" - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "requires": { - "kind-of": "6.0.2" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "requires": { - "kind-of": "6.0.2" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "requires": { - "is-accessor-descriptor": "1.0.0", - "is-data-descriptor": "1.0.0", - "kind-of": "6.0.2" - } - } - } - }, - "snapdragon-util": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", - "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", - "requires": { - "kind-of": "3.2.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "requires": { - "is-buffer": "1.1.6" - } - } - } - }, - "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" - }, - "source-map-resolve": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.2.tgz", - "integrity": "sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA==", - "requires": { - "atob": "2.1.2", - "decode-uri-component": "0.2.0", - "resolve-url": "0.2.1", - "source-map-url": "0.4.0", - "urix": "0.1.0" - } - }, - "source-map-url": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", - "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=" - }, - "split-array-stream": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/split-array-stream/-/split-array-stream-1.0.3.tgz", - "integrity": "sha1-0rdajl4Ngk1S/eyLgiWDncLjXfo=", - "optional": true, - "requires": { - "async": "2.6.1", - "is-stream-ended": "0.1.4" - } - }, - "split-string": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", - "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", - "requires": { - "extend-shallow": "3.0.2" - } - }, - "sshpk": { - "version": "1.14.2", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.14.2.tgz", - "integrity": "sha1-xvxhZIo9nE52T9P8306hBeSSupg=", - "requires": { - "asn1": "0.2.4", - "assert-plus": "1.0.0", - "bcrypt-pbkdf": "1.0.2", - "dashdash": "1.14.1", - "ecc-jsbn": "0.1.2", - "getpass": "0.1.7", - "jsbn": "0.1.1", - "safer-buffer": "2.1.2", - "tweetnacl": "0.14.5" - } - }, - "static-extend": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", - "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", - "requires": { - "define-property": "0.2.5", - "object-copy": "0.1.0" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "requires": { - "is-descriptor": "0.1.6" - } - } - } - }, - "statuses": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz", - "integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew==" - }, - "stream-events": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/stream-events/-/stream-events-1.0.4.tgz", - "integrity": "sha512-D243NJaYs/xBN2QnoiMDY7IesJFIK7gEhnvAYqJa5JvDdnh2dC4qDBwlCf0ohPpX2QRlA/4gnbnPd3rs3KxVcA==", - "requires": { - "stubs": "3.0.0" - } - }, - "stream-shift": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.0.tgz", - "integrity": "sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI=" - }, - "string-format-obj": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string-format-obj/-/string-format-obj-1.1.1.tgz", - "integrity": "sha512-Mm+sROy+pHJmx0P/0Bs1uxIX6UhGJGj6xDGQZ5zh9v/SZRmLGevp+p0VJxV7lirrkAmQ2mvva/gHKpnF/pTb+Q==", - "optional": true - }, - "string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", - "requires": { - "code-point-at": "1.1.0", - "is-fullwidth-code-point": "1.0.0", - "strip-ansi": "3.0.1" - } - }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", - "optional": true - }, - "stringifier": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/stringifier/-/stringifier-1.4.0.tgz", - "integrity": "sha512-cNsMOqqrcbLcHTXEVmkw9y0fwDwkdgtZwlfyolzpQDoAE1xdNGhQhxBUfiDvvZIKl1hnUEgMv66nHwtMz3OjPw==", - "requires": { - "core-js": "2.5.7", - "traverse": "0.6.6", - "type-name": "2.0.2" - } - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "requires": { - "ansi-regex": "2.1.1" - } - }, - "stubs": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/stubs/-/stubs-3.0.0.tgz", - "integrity": "sha1-6NK6H6nJBXAwPAMLaQD31fiavls=" - }, - "through2": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", - "integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=", - "requires": { - "readable-stream": "2.3.6", - "xtend": "4.0.1" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" - }, - "readable-stream": { - "version": "2.3.6", - "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "1.0.0", - "process-nextick-args": "2.0.0", - "safe-buffer": "5.1.2", - "string_decoder": "1.1.1", - "util-deprecate": "1.0.2" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "requires": { - "safe-buffer": "5.1.2" - } - } - } - }, - "to-object-path": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", - "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", - "requires": { - "kind-of": "3.2.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "requires": { - "is-buffer": "1.1.6" - } - } - } - }, - "to-regex": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", - "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", - "requires": { - "define-property": "2.0.2", - "extend-shallow": "3.0.2", - "regex-not": "1.0.2", - "safe-regex": "1.1.0" - } - }, - "to-regex-range": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", - "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", - "requires": { - "is-number": "3.0.0", - "repeat-string": "1.6.1" - } - }, - "tough-cookie": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", - "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", - "requires": { - "psl": "1.1.29", - "punycode": "1.4.1" - } - }, - "traverse": { - "version": "0.6.6", - "resolved": "https://registry.npmjs.org/traverse/-/traverse-0.6.6.tgz", - "integrity": "sha1-y99WD9e5r2MlAv7UD5GMFX6pcTc=" - }, - "tslib": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.0.tgz", - "integrity": "sha512-f/qGG2tUkrISBlQZEjEqoZ3B2+npJjIf04H1wuAv9iA8i04Icp+61KRXxFdha22670NJopsZCIjhC3SnjPRKrQ==" - }, - "tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", - "requires": { - "safe-buffer": "5.1.2" - } - }, - "tweetnacl": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", - "optional": true - }, - "type-is": { - "version": "1.6.16", - "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.16.tgz", - "integrity": "sha512-HRkVv/5qY2G6I8iab9cI7v1bOIdhm94dVjQCPFElW9W+3GeDOSHmy2EBYe4VTApuzolPcmgFTN3ftVJRKR2J9Q==", - "requires": { - "media-typer": "0.3.0", - "mime-types": "2.1.20" - } - }, - "type-name": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/type-name/-/type-name-2.0.2.tgz", - "integrity": "sha1-7+fUEj2KxSr/9/QMfk3sUmYAj7Q=" - }, - "typedarray": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", - "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=" - }, - "union-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.0.tgz", - "integrity": "sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ=", - "requires": { - "arr-union": "3.1.0", - "get-value": "2.0.6", - "is-extendable": "0.1.1", - "set-value": "0.4.3" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "requires": { - "is-extendable": "0.1.1" - } - }, - "set-value": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-0.4.3.tgz", - "integrity": "sha1-fbCPnT0i3H945Trzw79GZuzfzPE=", - "requires": { - "extend-shallow": "2.0.1", - "is-extendable": "0.1.1", - "is-plain-object": "2.0.4", - "to-object-path": "0.3.0" - } - } - } - }, - "unique-string": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-1.0.0.tgz", - "integrity": "sha1-nhBXzKhRq7kzmPizOuGHuZyuwRo=", - "optional": true, - "requires": { - "crypto-random-string": "1.0.0" - } - }, - "universal-deep-strict-equal": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/universal-deep-strict-equal/-/universal-deep-strict-equal-1.2.2.tgz", - "integrity": "sha1-DaSsL3PP95JMgfpN4BjKViyisKc=", - "requires": { - "array-filter": "1.0.0", - "indexof": "0.0.1", - "object-keys": "1.0.12" - } - }, - "unpipe": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", - "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=" - }, - "unset-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", - "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", - "requires": { - "has-value": "0.3.1", - "isobject": "3.0.1" - }, - "dependencies": { - "has-value": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", - "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", - "requires": { - "get-value": "2.0.6", - "has-values": "0.1.4", - "isobject": "2.1.0" - }, - "dependencies": { - "isobject": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", - "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", - "requires": { - "isarray": "1.0.0" - } - } - } - }, - "has-values": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", - "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=" - }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" - } - } - }, - "urix": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", - "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=" - }, - "use": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", - "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==" - }, - "util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" - }, - "utils-merge": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", - "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=" - }, - "uuid": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", - "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==" - }, - "vary": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", - "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=" - }, - "verror": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", - "requires": { - "assert-plus": "1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "1.3.0" - } - }, - "websocket-driver": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.7.0.tgz", - "integrity": "sha1-DK+dLXVdk67gSdS90NP+LMoqJOs=", - "requires": { - "http-parser-js": "0.4.13", - "websocket-extensions": "0.1.3" - } - }, - "websocket-extensions": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/websocket-extensions/-/websocket-extensions-0.1.3.tgz", - "integrity": "sha512-nqHUnMXmBzT0w570r2JpJxfiSD1IzoI+HGVdd3aZ0yNi3ngvQ4jv1dtHt5VGxfI2yj5yqImPhOK4vmIh2xMbGg==" - }, - "window-size": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.4.tgz", - "integrity": "sha1-+OGqHuWlPsW/FR/6CXQqatdpeHY=", - "optional": true - }, - "wrap-ansi": { - "version": "2.1.0", - "resolved": "http://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", - "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", - "optional": true, - "requires": { - "string-width": "1.0.2", - "strip-ansi": "3.0.1" - } - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" - }, - "write-file-atomic": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.3.0.tgz", - "integrity": "sha512-xuPeK4OdjWqtfi59ylvVL0Yn35SF3zgcAcv7rBPFHVaEapaDr4GdGgm3j7ckTwH9wHL7fGmgfAnb0+THrHb8tA==", - "optional": true, - "requires": { - "graceful-fs": "4.1.11", - "imurmurhash": "0.1.4", - "signal-exit": "3.0.2" - } - }, - "xdg-basedir": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-3.0.0.tgz", - "integrity": "sha1-SWsswQnsqNus/i3HK2A8F8WHCtQ=" - }, - "xmlhttprequest": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/xmlhttprequest/-/xmlhttprequest-1.8.0.tgz", - "integrity": "sha1-Z/4HXFwk/vOfnWX197f+dRcZaPw=" - }, - "xtend": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", - "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=" - }, - "y18n": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", - "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=", - "optional": true - }, - "yallist": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", - "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=" - }, - "yargs": { - "version": "3.32.0", - "resolved": "http://registry.npmjs.org/yargs/-/yargs-3.32.0.tgz", - "integrity": "sha1-AwiOnr+edWtpdRYR0qXvWRSCyZU=", - "optional": true, - "requires": { - "camelcase": "2.1.1", - "cliui": "3.2.0", - "decamelize": "1.2.0", - "os-locale": "1.4.0", - "string-width": "1.0.2", - "window-size": "0.1.4", - "y18n": "3.2.1" - } - } - } -} diff --git a/functions/package.json b/functions/package.json deleted file mode 100644 index 44f1fc7..0000000 --- a/functions/package.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "name": "functions", - "description": "Cloud Functions for Firebase", - "scripts": { - "serve": "firebase serve --only functions", - "shell": "firebase functions:shell", - "start": "npm run shell", - "deploy": "firebase deploy --only functions", - "logs": "firebase functions:log" - }, - "dependencies": { - "firebase-admin": "~6.0.0", - "firebase-functions": "^2.0.3" - }, - "private": true -} -- cgit v1.2.3-54-g00ecf From e6181c24124d97f2fbc932b8a68311e625463156 Mon Sep 17 00:00:00 2001 From: uzvkl Date: Tue, 11 Jun 2019 23:05:52 +0200 Subject: Move dsa related stuff to subfolder --- DSACore/Controllers/CommandsController.cs | 56 --- DSACore/Controllers/LobbyController.cs | 32 -- DSACore/Controllers/TokensController.cs | 25 -- DSACore/Controllers/ValuesController.cs | 45 -- DSACore/DSACore.csproj | 28 -- DSACore/Hubs/Login.cs | 205 --------- DSACore/Models/Network/Group.cs | 43 -- DSACore/Models/Network/Token.cs | 21 - DSACore/Models/Network/User.cs | 9 - DSACore/Program.cs | 24 -- .../Properties/DSALib-Auxiliary-CommandInfo.json | 101 ----- .../DSALib-DSA_Game-Characters-Character.json | 290 ------------- .../PublishProfiles/FolderProfile.pubxml | 23 - .../PublishProfiles/FolderProfile1.pubxml | 23 - DSACore/Properties/launchSettings.json | 30 -- DSACore/Startup.cs | 47 -- DSACore/appsettings.Development.json | 9 - DSACore/appsettings.json | 10 - DSALib/Auxiliary/Calculator/Argument.cs | 35 -- DSALib/Auxiliary/Calculator/ISolvable.cs | 10 - DSALib/Auxiliary/Calculator/Operator.cs | 51 --- DSALib/Auxiliary/Calculator/Ops.cs | 13 - DSALib/Auxiliary/Calculator/StringSolver.cs | 183 -------- DSALib/Auxiliary/CommandInfo.cs | 28 -- DSALib/Auxiliary/Dice.cs | 45 -- DSALib/Auxiliary/Extensions.cs | 25 -- DSALib/Auxiliary/IDataObjectEnumerableExtension.cs | 25 -- DSALib/Auxiliary/RandomMisc.cs | 52 --- DSALib/Auxiliary/SpellCorrect.cs | 61 --- DSALib/Auxiliary/TalentEnumerableExtension.cs | 74 ---- DSALib/Auxiliary/WeaponImporter.cs | 175 -------- DSALib/Characters/Being.cs | 17 - DSALib/Characters/Critter.cs | 88 ---- DSALib/Characters/Entity.cs | 12 - DSALib/Characters/ICharacter.cs | 15 - DSALib/Characters/ICombatant.cs | 20 - DSALib/Commands/CommandHandler.cs | 135 ------ DSALib/Commands/CommandTypes.cs | 13 - DSALib/Commands/FileHandler.cs | 32 -- DSALib/Commands/Gm.cs | 176 -------- DSALib/Commands/HeldList.cs | 174 -------- DSALib/Commands/Help.cs | 54 --- DSALib/Commands/LebenUndAstral.cs | 172 -------- DSALib/Commands/List.cs | 39 -- DSALib/Commands/MiscCommands.cs | 219 ---------- DSALib/Commands/NpcCommands.cs | 35 -- DSALib/Commands/ProbenTest.cs | 85 ---- DSALib/DSALib.csproj | 11 - DSALib/DSA_Game/Characters/Character.cs | 269 ------------ DSALib/DSA_Game/Characters/NPC.cs | 83 ---- DSALib/DSA_Game/Characters/SaveChar.cs | 38 -- DSALib/DSA_Game/Dsa.cs | 95 ---- DSALib/DSA_Game/Save/Properties.cs | 74 ---- DSALib/DSA_Game/Save/SaveCommand.cs | 66 --- DSALib/DSA_Game/Save/Session.cs | 51 --- DSALib/FireBase/Database.cs | 270 ------------ DSALib/Models/Database/DSA/Advantage.cs | 16 - DSALib/Models/Database/DSA/CharSpell.cs | 16 - DSALib/Models/Database/DSA/DatabaseChar.cs | 63 --- DSALib/Models/Database/DSA/Field.cs | 16 - DSALib/Models/Database/DSA/GeneralSpell.cs | 20 - DSALib/Models/Database/DSA/GroupChar.cs | 13 - DSALib/Models/Database/DSA/Inventory.cs | 12 - DSALib/Models/Database/DSA/Talent.cs | 24 -- DSALib/Models/Database/DSA/Weapon.cs | 52 --- DSALib/Models/Database/DSA/WeaponTalent.cs | 18 - DSALib/Models/Database/DataObject.cs | 13 - DSALib/Models/Database/Groups/DSAGroup.cs | 10 - DSALib/Models/Database/Groups/Group.cs | 9 - DSALib/Models/Database/IDataObject.cs | 7 - DSALib/Models/Dsa/CritterAttack.cs | 19 - DSALib/Models/Dsa/KampfTalent.cs | 16 - DSALib/Models/Dsa/Talent.cs | 43 -- DSALib/Models/Dsa/Vorteil.cs | 16 - DSALib/Models/Dsa/Zauber.cs | 16 - DSALib/Models/Network/Command.cs | 18 - DSALib/Models/Network/CommandResponse.cs | 28 -- .../Properties-DSACore-Auxiliary-CommandInfo.json | 101 ----- ...ties-DSACore-DSA_Game-Characters-Character.json | 290 ------------- .../PropertiesNewtonsoft-Json-Linq-JProperty.json | 30 -- DiscoBot.sln | 23 +- DiscoBot/App.config | 42 -- DiscoBot/Auxiliary/CommandExtension.cs | 98 ----- DiscoBot/Auxiliary/Dice.cs | 31 -- DiscoBot/Auxiliary/Permissions.cs | 32 -- DiscoBot/Auxiliary/RandomMisc.cs | 36 -- DiscoBot/Auxiliary/SpellCorrect.cs | 105 ----- DiscoBot/Commands/CommandExtension.cs | 119 ----- DiscoBot/Commands/FileHandler.cs | 25 -- DiscoBot/Commands/MiscCommands.cs | 189 -------- DiscoBot/DiscoBot.csproj | 149 ------- DiscoBot/Help.json | 120 ------ DiscoBot/Program.cs | 113 ----- DiscoBot/Properties.json | 129 ------ DiscoBot/Properties/AssemblyInfo.cs | 35 -- DiscoBot/Properties/DiscoBot-Audio-Sound.json | 7 - .../Properties/DiscoBot-Auxiliary-CommandInfo.json | 101 ----- .../DiscoBot-DSA_Game-Characters-Character.json | 290 ------------- DiscoBot/Properties/Settings.Designer.cs | 38 -- DiscoBot/Properties/Settings.settings | 9 - DiscoBot/Rework/Permissions.cs | 43 -- DiscoBot/Token | 1 - DiscoBot/packages.config | 63 --- DiscoBot/session.json | 6 - DiscoBot/sessions/TheCrew/TheCrew-0.json | 83 ---- DiscoBot/sessions/copy/copy-0.json | 79 ---- DiscoBot/sessions/test/test-0.json | 79 ---- DiscoBot/sessions/test/test-1.json | 79 ---- DiscoBot/sessions/test/test-2.json | 81 ---- DiscoBot/sessions/test/test-3.json | 81 ---- DiscoBot/sessions/test/test-4.json | 81 ---- FireBase/ExceptionEventArgs.cs | 28 -- FireBase/Extensions/ObservableExtensions.cs | 41 -- FireBase/Extensions/TaskExtensions.cs | 23 - FireBase/FireBase.csproj | 13 - FireBase/FirebaseClient.cs | 49 --- FireBase/FirebaseException.cs | 53 --- FireBase/FirebaseKeyGenerator.cs | 79 ---- FireBase/FirebaseObject.cs | 27 -- FireBase/FirebaseOptions.cs | 52 --- FireBase/Http/HttpClientExtensions.cs | 123 ------ FireBase/Http/PostResult.cs | 13 - FireBase/ObservableExtensions.cs | 40 -- FireBase/Offline/ConcurrentOfflineDatabase.cs | 233 ---------- FireBase/Offline/DatabaseExtensions.cs | 257 ----------- FireBase/Offline/ISetHandler.cs | 10 - FireBase/Offline/InitialPullStrategy.cs | 23 - FireBase/Offline/Internals/MemberAccessVisitor.cs | 46 -- FireBase/Offline/OfflineCacheAdapter.cs | 152 ------- FireBase/Offline/OfflineDatabase.cs | 228 ---------- FireBase/Offline/OfflineEntry.cs | 99 ----- FireBase/Offline/RealtimeDatabase.cs | 479 --------------------- FireBase/Offline/SetHandler.cs | 19 - FireBase/Offline/StreamingOptions.cs | 23 - FireBase/Offline/SyncOptions.cs | 28 -- FireBase/Query/AuthQuery.cs | 34 -- FireBase/Query/ChildQuery.cs | 50 --- FireBase/Query/FilterQuery.cs | 77 ---- FireBase/Query/FirebaseQuery.cs | 314 -------------- FireBase/Query/IFirebaseQuery.cs | 40 -- FireBase/Query/OrderQuery.cs | 34 -- FireBase/Query/ParameterQuery.cs | 43 -- FireBase/Query/QueryExtensions.cs | 210 --------- FireBase/Query/QueryFactoryExtensions.cs | 187 -------- FireBase/Query/SilentQuery.cs | 18 - FireBase/Settings.StyleCop | 77 ---- FireBase/Streaming/FirebaseCache.cs | 181 -------- FireBase/Streaming/FirebaseEvent.cs | 37 -- FireBase/Streaming/FirebaseEventSource.cs | 38 -- FireBase/Streaming/FirebaseEventType.cs | 18 - FireBase/Streaming/FirebaseServerEventType.cs | 15 - FireBase/Streaming/FirebaseSubscription.cs | 217 ---------- FireBase/Streaming/NonBlockingStreamReader.cs | 63 --- .../Auxiliary/Calculator/ArgumentTests.cs | 59 --- .../Auxiliary/Calculator/StringSolverTests.cs | 105 ----- NUnitTestProject1/Auxiliary/DiceTests.cs | 71 --- NUnitTestProject1/NUnitTest.csproj | 20 - dsa/DSACore/Controllers/CommandsController.cs | 56 +++ dsa/DSACore/Controllers/LobbyController.cs | 32 ++ dsa/DSACore/Controllers/TokensController.cs | 25 ++ dsa/DSACore/Controllers/ValuesController.cs | 45 ++ dsa/DSACore/DSACore.csproj | 28 ++ dsa/DSACore/Hubs/Login.cs | 205 +++++++++ dsa/DSACore/Models/Network/Group.cs | 43 ++ dsa/DSACore/Models/Network/Token.cs | 21 + dsa/DSACore/Models/Network/User.cs | 9 + dsa/DSACore/Program.cs | 24 ++ .../Properties/DSALib-Auxiliary-CommandInfo.json | 101 +++++ .../DSALib-DSA_Game-Characters-Character.json | 290 +++++++++++++ .../PublishProfiles/FolderProfile.pubxml | 23 + .../PublishProfiles/FolderProfile1.pubxml | 23 + dsa/DSACore/Properties/launchSettings.json | 30 ++ .../PropertiesDSALib-Auxiliary-CommandInfo.json | 101 +++++ ...ertiesDSALib-DSA_Game-Characters-Character.json | 290 +++++++++++++ .../PropertiesNewtonsoft-Json-Linq-JProperty.json | 30 ++ dsa/DSACore/Startup.cs | 47 ++ dsa/DSACore/Token | 1 + dsa/DSACore/appsettings.Development.json | 9 + dsa/DSACore/appsettings.json | 10 + dsa/DSALib/Auxiliary/Calculator/Argument.cs | 35 ++ dsa/DSALib/Auxiliary/Calculator/ISolvable.cs | 10 + dsa/DSALib/Auxiliary/Calculator/Operator.cs | 51 +++ dsa/DSALib/Auxiliary/Calculator/Ops.cs | 13 + dsa/DSALib/Auxiliary/Calculator/StringSolver.cs | 183 ++++++++ dsa/DSALib/Auxiliary/CommandInfo.cs | 28 ++ dsa/DSALib/Auxiliary/Dice.cs | 45 ++ dsa/DSALib/Auxiliary/Extensions.cs | 25 ++ .../Auxiliary/IDataObjectEnumerableExtension.cs | 25 ++ dsa/DSALib/Auxiliary/RandomMisc.cs | 52 +++ dsa/DSALib/Auxiliary/SpellCorrect.cs | 61 +++ dsa/DSALib/Auxiliary/TalentEnumerableExtension.cs | 74 ++++ dsa/DSALib/Auxiliary/WeaponImporter.cs | 175 ++++++++ dsa/DSALib/Characters/Being.cs | 17 + dsa/DSALib/Characters/Critter.cs | 88 ++++ dsa/DSALib/Characters/Entity.cs | 12 + dsa/DSALib/Characters/ICharacter.cs | 15 + dsa/DSALib/Characters/ICombatant.cs | 20 + dsa/DSALib/Commands/CommandHandler.cs | 135 ++++++ dsa/DSALib/Commands/CommandTypes.cs | 13 + dsa/DSALib/Commands/FileHandler.cs | 32 ++ dsa/DSALib/Commands/Gm.cs | 176 ++++++++ dsa/DSALib/Commands/HeldList.cs | 174 ++++++++ dsa/DSALib/Commands/Help.cs | 54 +++ dsa/DSALib/Commands/LebenUndAstral.cs | 172 ++++++++ dsa/DSALib/Commands/List.cs | 39 ++ dsa/DSALib/Commands/MiscCommands.cs | 219 ++++++++++ dsa/DSALib/Commands/NpcCommands.cs | 35 ++ dsa/DSALib/Commands/ProbenTest.cs | 85 ++++ dsa/DSALib/DSALib.csproj | 11 + dsa/DSALib/DSA_Game/Characters/Character.cs | 269 ++++++++++++ dsa/DSALib/DSA_Game/Characters/NPC.cs | 83 ++++ dsa/DSALib/DSA_Game/Characters/SaveChar.cs | 38 ++ dsa/DSALib/DSA_Game/Dsa.cs | 95 ++++ dsa/DSALib/DSA_Game/Save/Properties.cs | 74 ++++ dsa/DSALib/DSA_Game/Save/SaveCommand.cs | 66 +++ dsa/DSALib/DSA_Game/Save/Session.cs | 51 +++ dsa/DSALib/FireBase/Database.cs | 270 ++++++++++++ dsa/DSALib/Models/Database/DataObject.cs | 13 + dsa/DSALib/Models/Database/Dsa/Advantage.cs | 16 + dsa/DSALib/Models/Database/Dsa/CharSpell.cs | 16 + dsa/DSALib/Models/Database/Dsa/DatabaseChar.cs | 63 +++ dsa/DSALib/Models/Database/Dsa/Field.cs | 16 + dsa/DSALib/Models/Database/Dsa/GeneralSpell.cs | 20 + dsa/DSALib/Models/Database/Dsa/GroupChar.cs | 13 + dsa/DSALib/Models/Database/Dsa/Inventory.cs | 12 + dsa/DSALib/Models/Database/Dsa/Talent.cs | 24 ++ dsa/DSALib/Models/Database/Dsa/Weapon.cs | 52 +++ dsa/DSALib/Models/Database/Dsa/WeaponTalent.cs | 18 + dsa/DSALib/Models/Database/Groups/DSAGroup.cs | 10 + dsa/DSALib/Models/Database/Groups/Group.cs | 9 + dsa/DSALib/Models/Database/IDataObject.cs | 7 + dsa/DSALib/Models/Dsa/CritterAttack.cs | 19 + dsa/DSALib/Models/Dsa/KampfTalent.cs | 16 + dsa/DSALib/Models/Dsa/Talent.cs | 43 ++ dsa/DSALib/Models/Dsa/Vorteil.cs | 16 + dsa/DSALib/Models/Dsa/Zauber.cs | 16 + dsa/DSALib/Models/Network/Command.cs | 18 + dsa/DSALib/Models/Network/CommandResponse.cs | 28 ++ .../Properties-DSACore-Auxiliary-CommandInfo.json | 101 +++++ ...ties-DSACore-DSA_Game-Characters-Character.json | 290 +++++++++++++ .../PropertiesNewtonsoft-Json-Linq-JProperty.json | 30 ++ dsa/DiscoBot/App.config | 42 ++ dsa/DiscoBot/Auxiliary/CommandExtension.cs | 98 +++++ dsa/DiscoBot/Auxiliary/Dice.cs | 31 ++ dsa/DiscoBot/Auxiliary/Permissions.cs | 32 ++ dsa/DiscoBot/Auxiliary/RandomMisc.cs | 36 ++ dsa/DiscoBot/Auxiliary/SpellCorrect.cs | 105 +++++ dsa/DiscoBot/Commands/CommandExtension.cs | 119 +++++ dsa/DiscoBot/Commands/FileHandler.cs | 25 ++ dsa/DiscoBot/Commands/MiscCommands.cs | 189 ++++++++ dsa/DiscoBot/DiscoBot.csproj | 149 +++++++ dsa/DiscoBot/Help.json | 120 ++++++ dsa/DiscoBot/Program.cs | 113 +++++ dsa/DiscoBot/Properties.json | 129 ++++++ dsa/DiscoBot/Properties/AssemblyInfo.cs | 35 ++ dsa/DiscoBot/Properties/DiscoBot-Audio-Sound.json | 7 + .../Properties/DiscoBot-Auxiliary-CommandInfo.json | 101 +++++ .../DiscoBot-DSA_Game-Characters-Character.json | 290 +++++++++++++ dsa/DiscoBot/Properties/Settings.Designer.cs | 38 ++ dsa/DiscoBot/Properties/Settings.settings | 9 + dsa/DiscoBot/Rework/Permissions.cs | 43 ++ dsa/DiscoBot/Token | 1 + dsa/DiscoBot/packages.config | 63 +++ dsa/DiscoBot/session.json | 6 + dsa/DiscoBot/sessions/TheCrew/TheCrew-0.json | 83 ++++ dsa/DiscoBot/sessions/copy/copy-0.json | 79 ++++ dsa/DiscoBot/sessions/test/test-0.json | 79 ++++ dsa/DiscoBot/sessions/test/test-1.json | 79 ++++ dsa/DiscoBot/sessions/test/test-2.json | 81 ++++ dsa/DiscoBot/sessions/test/test-3.json | 81 ++++ dsa/DiscoBot/sessions/test/test-4.json | 81 ++++ dsa/FireBase/ExceptionEventArgs.cs | 28 ++ dsa/FireBase/Extensions/ObservableExtensions.cs | 41 ++ dsa/FireBase/Extensions/TaskExtensions.cs | 23 + dsa/FireBase/FireBase.csproj | 13 + dsa/FireBase/FirebaseClient.cs | 49 +++ dsa/FireBase/FirebaseException.cs | 53 +++ dsa/FireBase/FirebaseKeyGenerator.cs | 79 ++++ dsa/FireBase/FirebaseObject.cs | 27 ++ dsa/FireBase/FirebaseOptions.cs | 52 +++ dsa/FireBase/Http/HttpClientExtensions.cs | 123 ++++++ dsa/FireBase/Http/PostResult.cs | 13 + dsa/FireBase/ObservableExtensions.cs | 40 ++ dsa/FireBase/Offline/ConcurrentOfflineDatabase.cs | 233 ++++++++++ dsa/FireBase/Offline/DatabaseExtensions.cs | 257 +++++++++++ dsa/FireBase/Offline/ISetHandler.cs | 10 + dsa/FireBase/Offline/InitialPullStrategy.cs | 23 + .../Offline/Internals/MemberAccessVisitor.cs | 46 ++ dsa/FireBase/Offline/OfflineCacheAdapter.cs | 152 +++++++ dsa/FireBase/Offline/OfflineDatabase.cs | 228 ++++++++++ dsa/FireBase/Offline/OfflineEntry.cs | 99 +++++ dsa/FireBase/Offline/RealtimeDatabase.cs | 479 +++++++++++++++++++++ dsa/FireBase/Offline/SetHandler.cs | 19 + dsa/FireBase/Offline/StreamingOptions.cs | 23 + dsa/FireBase/Offline/SyncOptions.cs | 28 ++ dsa/FireBase/Query/AuthQuery.cs | 34 ++ dsa/FireBase/Query/ChildQuery.cs | 50 +++ dsa/FireBase/Query/FilterQuery.cs | 77 ++++ dsa/FireBase/Query/FirebaseQuery.cs | 314 ++++++++++++++ dsa/FireBase/Query/IFirebaseQuery.cs | 40 ++ dsa/FireBase/Query/OrderQuery.cs | 34 ++ dsa/FireBase/Query/ParameterQuery.cs | 43 ++ dsa/FireBase/Query/QueryExtensions.cs | 210 +++++++++ dsa/FireBase/Query/QueryFactoryExtensions.cs | 187 ++++++++ dsa/FireBase/Query/SilentQuery.cs | 18 + dsa/FireBase/Settings.StyleCop | 77 ++++ dsa/FireBase/Streaming/FirebaseCache.cs | 181 ++++++++ dsa/FireBase/Streaming/FirebaseEvent.cs | 37 ++ dsa/FireBase/Streaming/FirebaseEventSource.cs | 38 ++ dsa/FireBase/Streaming/FirebaseEventType.cs | 18 + dsa/FireBase/Streaming/FirebaseServerEventType.cs | 15 + dsa/FireBase/Streaming/FirebaseSubscription.cs | 217 ++++++++++ dsa/FireBase/Streaming/NonBlockingStreamReader.cs | 63 +++ .../Auxiliary/Calculator/ArgumentTests.cs | 59 +++ .../Auxiliary/Calculator/StringSolverTests.cs | 105 +++++ dsa/NUnitTestProject1/Auxiliary/DiceTests.cs | 71 +++ dsa/NUnitTestProject1/NUnitTest.csproj | 20 + 317 files changed, 11723 insertions(+), 11316 deletions(-) delete mode 100644 DSACore/Controllers/CommandsController.cs delete mode 100644 DSACore/Controllers/LobbyController.cs delete mode 100644 DSACore/Controllers/TokensController.cs delete mode 100644 DSACore/Controllers/ValuesController.cs delete mode 100644 DSACore/DSACore.csproj delete mode 100644 DSACore/Hubs/Login.cs delete mode 100644 DSACore/Models/Network/Group.cs delete mode 100644 DSACore/Models/Network/Token.cs delete mode 100644 DSACore/Models/Network/User.cs delete mode 100644 DSACore/Program.cs delete mode 100644 DSACore/Properties/DSALib-Auxiliary-CommandInfo.json delete mode 100644 DSACore/Properties/DSALib-DSA_Game-Characters-Character.json delete mode 100644 DSACore/Properties/PublishProfiles/FolderProfile.pubxml delete mode 100644 DSACore/Properties/PublishProfiles/FolderProfile1.pubxml delete mode 100644 DSACore/Properties/launchSettings.json delete mode 100644 DSACore/Startup.cs delete mode 100644 DSACore/appsettings.Development.json delete mode 100644 DSACore/appsettings.json delete mode 100644 DSALib/Auxiliary/Calculator/Argument.cs delete mode 100644 DSALib/Auxiliary/Calculator/ISolvable.cs delete mode 100644 DSALib/Auxiliary/Calculator/Operator.cs delete mode 100644 DSALib/Auxiliary/Calculator/Ops.cs delete mode 100644 DSALib/Auxiliary/Calculator/StringSolver.cs delete mode 100644 DSALib/Auxiliary/CommandInfo.cs delete mode 100644 DSALib/Auxiliary/Dice.cs delete mode 100644 DSALib/Auxiliary/Extensions.cs delete mode 100644 DSALib/Auxiliary/IDataObjectEnumerableExtension.cs delete mode 100644 DSALib/Auxiliary/RandomMisc.cs delete mode 100644 DSALib/Auxiliary/SpellCorrect.cs delete mode 100644 DSALib/Auxiliary/TalentEnumerableExtension.cs delete mode 100644 DSALib/Auxiliary/WeaponImporter.cs delete mode 100644 DSALib/Characters/Being.cs delete mode 100644 DSALib/Characters/Critter.cs delete mode 100644 DSALib/Characters/Entity.cs delete mode 100644 DSALib/Characters/ICharacter.cs delete mode 100644 DSALib/Characters/ICombatant.cs delete mode 100644 DSALib/Commands/CommandHandler.cs delete mode 100644 DSALib/Commands/CommandTypes.cs delete mode 100644 DSALib/Commands/FileHandler.cs delete mode 100644 DSALib/Commands/Gm.cs delete mode 100644 DSALib/Commands/HeldList.cs delete mode 100644 DSALib/Commands/Help.cs delete mode 100644 DSALib/Commands/LebenUndAstral.cs delete mode 100644 DSALib/Commands/List.cs delete mode 100644 DSALib/Commands/MiscCommands.cs delete mode 100644 DSALib/Commands/NpcCommands.cs delete mode 100644 DSALib/Commands/ProbenTest.cs delete mode 100644 DSALib/DSALib.csproj delete mode 100644 DSALib/DSA_Game/Characters/Character.cs delete mode 100644 DSALib/DSA_Game/Characters/NPC.cs delete mode 100644 DSALib/DSA_Game/Characters/SaveChar.cs delete mode 100644 DSALib/DSA_Game/Dsa.cs delete mode 100644 DSALib/DSA_Game/Save/Properties.cs delete mode 100644 DSALib/DSA_Game/Save/SaveCommand.cs delete mode 100644 DSALib/DSA_Game/Save/Session.cs delete mode 100644 DSALib/FireBase/Database.cs delete mode 100644 DSALib/Models/Database/DSA/Advantage.cs delete mode 100644 DSALib/Models/Database/DSA/CharSpell.cs delete mode 100644 DSALib/Models/Database/DSA/DatabaseChar.cs delete mode 100644 DSALib/Models/Database/DSA/Field.cs delete mode 100644 DSALib/Models/Database/DSA/GeneralSpell.cs delete mode 100644 DSALib/Models/Database/DSA/GroupChar.cs delete mode 100644 DSALib/Models/Database/DSA/Inventory.cs delete mode 100644 DSALib/Models/Database/DSA/Talent.cs delete mode 100644 DSALib/Models/Database/DSA/Weapon.cs delete mode 100644 DSALib/Models/Database/DSA/WeaponTalent.cs delete mode 100644 DSALib/Models/Database/DataObject.cs delete mode 100644 DSALib/Models/Database/Groups/DSAGroup.cs delete mode 100644 DSALib/Models/Database/Groups/Group.cs delete mode 100644 DSALib/Models/Database/IDataObject.cs delete mode 100644 DSALib/Models/Dsa/CritterAttack.cs delete mode 100644 DSALib/Models/Dsa/KampfTalent.cs delete mode 100644 DSALib/Models/Dsa/Talent.cs delete mode 100644 DSALib/Models/Dsa/Vorteil.cs delete mode 100644 DSALib/Models/Dsa/Zauber.cs delete mode 100644 DSALib/Models/Network/Command.cs delete mode 100644 DSALib/Models/Network/CommandResponse.cs delete mode 100644 DSALib/Properties-DSACore-Auxiliary-CommandInfo.json delete mode 100644 DSALib/Properties-DSACore-DSA_Game-Characters-Character.json delete mode 100644 DSALib/PropertiesNewtonsoft-Json-Linq-JProperty.json delete mode 100644 DiscoBot/App.config delete mode 100644 DiscoBot/Auxiliary/CommandExtension.cs delete mode 100644 DiscoBot/Auxiliary/Dice.cs delete mode 100644 DiscoBot/Auxiliary/Permissions.cs delete mode 100644 DiscoBot/Auxiliary/RandomMisc.cs delete mode 100644 DiscoBot/Auxiliary/SpellCorrect.cs delete mode 100644 DiscoBot/Commands/CommandExtension.cs delete mode 100644 DiscoBot/Commands/FileHandler.cs delete mode 100644 DiscoBot/Commands/MiscCommands.cs delete mode 100644 DiscoBot/DiscoBot.csproj delete mode 100644 DiscoBot/Help.json delete mode 100644 DiscoBot/Program.cs delete mode 100644 DiscoBot/Properties.json delete mode 100644 DiscoBot/Properties/AssemblyInfo.cs delete mode 100644 DiscoBot/Properties/DiscoBot-Audio-Sound.json delete mode 100644 DiscoBot/Properties/DiscoBot-Auxiliary-CommandInfo.json delete mode 100644 DiscoBot/Properties/DiscoBot-DSA_Game-Characters-Character.json delete mode 100644 DiscoBot/Properties/Settings.Designer.cs delete mode 100644 DiscoBot/Properties/Settings.settings delete mode 100644 DiscoBot/Rework/Permissions.cs delete mode 100644 DiscoBot/Token delete mode 100644 DiscoBot/packages.config delete mode 100644 DiscoBot/session.json delete mode 100644 DiscoBot/sessions/TheCrew/TheCrew-0.json delete mode 100644 DiscoBot/sessions/copy/copy-0.json delete mode 100644 DiscoBot/sessions/test/test-0.json delete mode 100644 DiscoBot/sessions/test/test-1.json delete mode 100644 DiscoBot/sessions/test/test-2.json delete mode 100644 DiscoBot/sessions/test/test-3.json delete mode 100644 DiscoBot/sessions/test/test-4.json delete mode 100644 FireBase/ExceptionEventArgs.cs delete mode 100644 FireBase/Extensions/ObservableExtensions.cs delete mode 100644 FireBase/Extensions/TaskExtensions.cs delete mode 100644 FireBase/FireBase.csproj delete mode 100644 FireBase/FirebaseClient.cs delete mode 100644 FireBase/FirebaseException.cs delete mode 100644 FireBase/FirebaseKeyGenerator.cs delete mode 100644 FireBase/FirebaseObject.cs delete mode 100644 FireBase/FirebaseOptions.cs delete mode 100644 FireBase/Http/HttpClientExtensions.cs delete mode 100644 FireBase/Http/PostResult.cs delete mode 100644 FireBase/ObservableExtensions.cs delete mode 100644 FireBase/Offline/ConcurrentOfflineDatabase.cs delete mode 100644 FireBase/Offline/DatabaseExtensions.cs delete mode 100644 FireBase/Offline/ISetHandler.cs delete mode 100644 FireBase/Offline/InitialPullStrategy.cs delete mode 100644 FireBase/Offline/Internals/MemberAccessVisitor.cs delete mode 100644 FireBase/Offline/OfflineCacheAdapter.cs delete mode 100644 FireBase/Offline/OfflineDatabase.cs delete mode 100644 FireBase/Offline/OfflineEntry.cs delete mode 100644 FireBase/Offline/RealtimeDatabase.cs delete mode 100644 FireBase/Offline/SetHandler.cs delete mode 100644 FireBase/Offline/StreamingOptions.cs delete mode 100644 FireBase/Offline/SyncOptions.cs delete mode 100644 FireBase/Query/AuthQuery.cs delete mode 100644 FireBase/Query/ChildQuery.cs delete mode 100644 FireBase/Query/FilterQuery.cs delete mode 100644 FireBase/Query/FirebaseQuery.cs delete mode 100644 FireBase/Query/IFirebaseQuery.cs delete mode 100644 FireBase/Query/OrderQuery.cs delete mode 100644 FireBase/Query/ParameterQuery.cs delete mode 100644 FireBase/Query/QueryExtensions.cs delete mode 100644 FireBase/Query/QueryFactoryExtensions.cs delete mode 100644 FireBase/Query/SilentQuery.cs delete mode 100644 FireBase/Settings.StyleCop delete mode 100644 FireBase/Streaming/FirebaseCache.cs delete mode 100644 FireBase/Streaming/FirebaseEvent.cs delete mode 100644 FireBase/Streaming/FirebaseEventSource.cs delete mode 100644 FireBase/Streaming/FirebaseEventType.cs delete mode 100644 FireBase/Streaming/FirebaseServerEventType.cs delete mode 100644 FireBase/Streaming/FirebaseSubscription.cs delete mode 100644 FireBase/Streaming/NonBlockingStreamReader.cs delete mode 100644 NUnitTestProject1/Auxiliary/Calculator/ArgumentTests.cs delete mode 100644 NUnitTestProject1/Auxiliary/Calculator/StringSolverTests.cs delete mode 100644 NUnitTestProject1/Auxiliary/DiceTests.cs delete mode 100644 NUnitTestProject1/NUnitTest.csproj create mode 100644 dsa/DSACore/Controllers/CommandsController.cs create mode 100644 dsa/DSACore/Controllers/LobbyController.cs create mode 100644 dsa/DSACore/Controllers/TokensController.cs create mode 100644 dsa/DSACore/Controllers/ValuesController.cs create mode 100644 dsa/DSACore/DSACore.csproj create mode 100644 dsa/DSACore/Hubs/Login.cs create mode 100644 dsa/DSACore/Models/Network/Group.cs create mode 100644 dsa/DSACore/Models/Network/Token.cs create mode 100644 dsa/DSACore/Models/Network/User.cs create mode 100644 dsa/DSACore/Program.cs create mode 100644 dsa/DSACore/Properties/DSALib-Auxiliary-CommandInfo.json create mode 100644 dsa/DSACore/Properties/DSALib-DSA_Game-Characters-Character.json create mode 100644 dsa/DSACore/Properties/PublishProfiles/FolderProfile.pubxml create mode 100644 dsa/DSACore/Properties/PublishProfiles/FolderProfile1.pubxml create mode 100644 dsa/DSACore/Properties/launchSettings.json create mode 100644 dsa/DSACore/PropertiesDSALib-Auxiliary-CommandInfo.json create mode 100644 dsa/DSACore/PropertiesDSALib-DSA_Game-Characters-Character.json create mode 100644 dsa/DSACore/PropertiesNewtonsoft-Json-Linq-JProperty.json create mode 100644 dsa/DSACore/Startup.cs create mode 100644 dsa/DSACore/Token create mode 100644 dsa/DSACore/appsettings.Development.json create mode 100644 dsa/DSACore/appsettings.json create mode 100644 dsa/DSALib/Auxiliary/Calculator/Argument.cs create mode 100644 dsa/DSALib/Auxiliary/Calculator/ISolvable.cs create mode 100644 dsa/DSALib/Auxiliary/Calculator/Operator.cs create mode 100644 dsa/DSALib/Auxiliary/Calculator/Ops.cs create mode 100644 dsa/DSALib/Auxiliary/Calculator/StringSolver.cs create mode 100644 dsa/DSALib/Auxiliary/CommandInfo.cs create mode 100644 dsa/DSALib/Auxiliary/Dice.cs create mode 100644 dsa/DSALib/Auxiliary/Extensions.cs create mode 100644 dsa/DSALib/Auxiliary/IDataObjectEnumerableExtension.cs create mode 100644 dsa/DSALib/Auxiliary/RandomMisc.cs create mode 100644 dsa/DSALib/Auxiliary/SpellCorrect.cs create mode 100644 dsa/DSALib/Auxiliary/TalentEnumerableExtension.cs create mode 100644 dsa/DSALib/Auxiliary/WeaponImporter.cs create mode 100644 dsa/DSALib/Characters/Being.cs create mode 100644 dsa/DSALib/Characters/Critter.cs create mode 100644 dsa/DSALib/Characters/Entity.cs create mode 100644 dsa/DSALib/Characters/ICharacter.cs create mode 100644 dsa/DSALib/Characters/ICombatant.cs create mode 100644 dsa/DSALib/Commands/CommandHandler.cs create mode 100644 dsa/DSALib/Commands/CommandTypes.cs create mode 100644 dsa/DSALib/Commands/FileHandler.cs create mode 100644 dsa/DSALib/Commands/Gm.cs create mode 100644 dsa/DSALib/Commands/HeldList.cs create mode 100644 dsa/DSALib/Commands/Help.cs create mode 100644 dsa/DSALib/Commands/LebenUndAstral.cs create mode 100644 dsa/DSALib/Commands/List.cs create mode 100644 dsa/DSALib/Commands/MiscCommands.cs create mode 100644 dsa/DSALib/Commands/NpcCommands.cs create mode 100644 dsa/DSALib/Commands/ProbenTest.cs create mode 100644 dsa/DSALib/DSALib.csproj create mode 100644 dsa/DSALib/DSA_Game/Characters/Character.cs create mode 100644 dsa/DSALib/DSA_Game/Characters/NPC.cs create mode 100644 dsa/DSALib/DSA_Game/Characters/SaveChar.cs create mode 100644 dsa/DSALib/DSA_Game/Dsa.cs create mode 100644 dsa/DSALib/DSA_Game/Save/Properties.cs create mode 100644 dsa/DSALib/DSA_Game/Save/SaveCommand.cs create mode 100644 dsa/DSALib/DSA_Game/Save/Session.cs create mode 100644 dsa/DSALib/FireBase/Database.cs create mode 100644 dsa/DSALib/Models/Database/DataObject.cs create mode 100644 dsa/DSALib/Models/Database/Dsa/Advantage.cs create mode 100644 dsa/DSALib/Models/Database/Dsa/CharSpell.cs create mode 100644 dsa/DSALib/Models/Database/Dsa/DatabaseChar.cs create mode 100644 dsa/DSALib/Models/Database/Dsa/Field.cs create mode 100644 dsa/DSALib/Models/Database/Dsa/GeneralSpell.cs create mode 100644 dsa/DSALib/Models/Database/Dsa/GroupChar.cs create mode 100644 dsa/DSALib/Models/Database/Dsa/Inventory.cs create mode 100644 dsa/DSALib/Models/Database/Dsa/Talent.cs create mode 100644 dsa/DSALib/Models/Database/Dsa/Weapon.cs create mode 100644 dsa/DSALib/Models/Database/Dsa/WeaponTalent.cs create mode 100644 dsa/DSALib/Models/Database/Groups/DSAGroup.cs create mode 100644 dsa/DSALib/Models/Database/Groups/Group.cs create mode 100644 dsa/DSALib/Models/Database/IDataObject.cs create mode 100644 dsa/DSALib/Models/Dsa/CritterAttack.cs create mode 100644 dsa/DSALib/Models/Dsa/KampfTalent.cs create mode 100644 dsa/DSALib/Models/Dsa/Talent.cs create mode 100644 dsa/DSALib/Models/Dsa/Vorteil.cs create mode 100644 dsa/DSALib/Models/Dsa/Zauber.cs create mode 100644 dsa/DSALib/Models/Network/Command.cs create mode 100644 dsa/DSALib/Models/Network/CommandResponse.cs create mode 100644 dsa/DSALib/Properties-DSACore-Auxiliary-CommandInfo.json create mode 100644 dsa/DSALib/Properties-DSACore-DSA_Game-Characters-Character.json create mode 100644 dsa/DSALib/PropertiesNewtonsoft-Json-Linq-JProperty.json create mode 100644 dsa/DiscoBot/App.config create mode 100644 dsa/DiscoBot/Auxiliary/CommandExtension.cs create mode 100644 dsa/DiscoBot/Auxiliary/Dice.cs create mode 100644 dsa/DiscoBot/Auxiliary/Permissions.cs create mode 100644 dsa/DiscoBot/Auxiliary/RandomMisc.cs create mode 100644 dsa/DiscoBot/Auxiliary/SpellCorrect.cs create mode 100644 dsa/DiscoBot/Commands/CommandExtension.cs create mode 100644 dsa/DiscoBot/Commands/FileHandler.cs create mode 100644 dsa/DiscoBot/Commands/MiscCommands.cs create mode 100644 dsa/DiscoBot/DiscoBot.csproj create mode 100644 dsa/DiscoBot/Help.json create mode 100644 dsa/DiscoBot/Program.cs create mode 100644 dsa/DiscoBot/Properties.json create mode 100644 dsa/DiscoBot/Properties/AssemblyInfo.cs create mode 100644 dsa/DiscoBot/Properties/DiscoBot-Audio-Sound.json create mode 100644 dsa/DiscoBot/Properties/DiscoBot-Auxiliary-CommandInfo.json create mode 100644 dsa/DiscoBot/Properties/DiscoBot-DSA_Game-Characters-Character.json create mode 100644 dsa/DiscoBot/Properties/Settings.Designer.cs create mode 100644 dsa/DiscoBot/Properties/Settings.settings create mode 100644 dsa/DiscoBot/Rework/Permissions.cs create mode 100644 dsa/DiscoBot/Token create mode 100644 dsa/DiscoBot/packages.config create mode 100644 dsa/DiscoBot/session.json create mode 100644 dsa/DiscoBot/sessions/TheCrew/TheCrew-0.json create mode 100644 dsa/DiscoBot/sessions/copy/copy-0.json create mode 100644 dsa/DiscoBot/sessions/test/test-0.json create mode 100644 dsa/DiscoBot/sessions/test/test-1.json create mode 100644 dsa/DiscoBot/sessions/test/test-2.json create mode 100644 dsa/DiscoBot/sessions/test/test-3.json create mode 100644 dsa/DiscoBot/sessions/test/test-4.json create mode 100644 dsa/FireBase/ExceptionEventArgs.cs create mode 100644 dsa/FireBase/Extensions/ObservableExtensions.cs create mode 100644 dsa/FireBase/Extensions/TaskExtensions.cs create mode 100644 dsa/FireBase/FireBase.csproj create mode 100644 dsa/FireBase/FirebaseClient.cs create mode 100644 dsa/FireBase/FirebaseException.cs create mode 100644 dsa/FireBase/FirebaseKeyGenerator.cs create mode 100644 dsa/FireBase/FirebaseObject.cs create mode 100644 dsa/FireBase/FirebaseOptions.cs create mode 100644 dsa/FireBase/Http/HttpClientExtensions.cs create mode 100644 dsa/FireBase/Http/PostResult.cs create mode 100644 dsa/FireBase/ObservableExtensions.cs create mode 100644 dsa/FireBase/Offline/ConcurrentOfflineDatabase.cs create mode 100644 dsa/FireBase/Offline/DatabaseExtensions.cs create mode 100644 dsa/FireBase/Offline/ISetHandler.cs create mode 100644 dsa/FireBase/Offline/InitialPullStrategy.cs create mode 100644 dsa/FireBase/Offline/Internals/MemberAccessVisitor.cs create mode 100644 dsa/FireBase/Offline/OfflineCacheAdapter.cs create mode 100644 dsa/FireBase/Offline/OfflineDatabase.cs create mode 100644 dsa/FireBase/Offline/OfflineEntry.cs create mode 100644 dsa/FireBase/Offline/RealtimeDatabase.cs create mode 100644 dsa/FireBase/Offline/SetHandler.cs create mode 100644 dsa/FireBase/Offline/StreamingOptions.cs create mode 100644 dsa/FireBase/Offline/SyncOptions.cs create mode 100644 dsa/FireBase/Query/AuthQuery.cs create mode 100644 dsa/FireBase/Query/ChildQuery.cs create mode 100644 dsa/FireBase/Query/FilterQuery.cs create mode 100644 dsa/FireBase/Query/FirebaseQuery.cs create mode 100644 dsa/FireBase/Query/IFirebaseQuery.cs create mode 100644 dsa/FireBase/Query/OrderQuery.cs create mode 100644 dsa/FireBase/Query/ParameterQuery.cs create mode 100644 dsa/FireBase/Query/QueryExtensions.cs create mode 100644 dsa/FireBase/Query/QueryFactoryExtensions.cs create mode 100644 dsa/FireBase/Query/SilentQuery.cs create mode 100644 dsa/FireBase/Settings.StyleCop create mode 100644 dsa/FireBase/Streaming/FirebaseCache.cs create mode 100644 dsa/FireBase/Streaming/FirebaseEvent.cs create mode 100644 dsa/FireBase/Streaming/FirebaseEventSource.cs create mode 100644 dsa/FireBase/Streaming/FirebaseEventType.cs create mode 100644 dsa/FireBase/Streaming/FirebaseServerEventType.cs create mode 100644 dsa/FireBase/Streaming/FirebaseSubscription.cs create mode 100644 dsa/FireBase/Streaming/NonBlockingStreamReader.cs create mode 100644 dsa/NUnitTestProject1/Auxiliary/Calculator/ArgumentTests.cs create mode 100644 dsa/NUnitTestProject1/Auxiliary/Calculator/StringSolverTests.cs create mode 100644 dsa/NUnitTestProject1/Auxiliary/DiceTests.cs create mode 100644 dsa/NUnitTestProject1/NUnitTest.csproj (limited to 'FireBase') diff --git a/DSACore/Controllers/CommandsController.cs b/DSACore/Controllers/CommandsController.cs deleted file mode 100644 index b6e0be2..0000000 --- a/DSACore/Controllers/CommandsController.cs +++ /dev/null @@ -1,56 +0,0 @@ -using System; -using DSACore.Models.Network; -using DSALib.Commands; -using DSALib.Models.Network; -using Microsoft.AspNetCore.Mvc; - -// For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860 - -namespace DSACore.Controllers -{ - [Route("dsa/[controller]")] - public class CommandsController : Controller - { - // GET: api/ - [HttpGet] - public string Get() - { - return "Usage: post the command to execute"; - } - - // GET api//5 - /*[HttpGet("{id}")] - public string Get(int id) - { - return "value"; - }*/ - - // POST api//Felis - [HttpPost] - public string Post([FromBody] Command cmd) - { - try - { - return CommandHandler.ExecuteCommand(cmd).message; - } - catch (Exception e) - { - return $"Ein Fehler ist aufgetreten: \n {e.Message}"; - } - } - -/* - - // PUT api//5 - [HttpPut("{id}")] - public void Put(int id, [FromBody]string value) - { - } - - // DELETE api//5 - [HttpDelete("{id}")] - public void Delete(int id) - { - }*/ - } -} \ No newline at end of file diff --git a/DSACore/Controllers/LobbyController.cs b/DSACore/Controllers/LobbyController.cs deleted file mode 100644 index 7890b4f..0000000 --- a/DSACore/Controllers/LobbyController.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System; -using DSACore.Models.Network; -using DSALib.Commands; -using DSALib.Models.Network; -using Microsoft.AspNetCore.Mvc; - -namespace DSACore.Controllers -{ - public class ScribbleController : Controller - { - [Route("[controller]")] - // GET: api/ - [HttpGet] - public string Get() - { - return "Usage: get /tokens/{Token}"; - } - - [HttpPost] - public string Post([FromBody] Command cmd) - { - try - { - return CommandHandler.ExecuteCommand(cmd).message; - } - catch (Exception e) - { - return $"Ein Fehler ist aufgetreten: \n {e.Message}"; - } - } - } -} \ No newline at end of file diff --git a/DSACore/Controllers/TokensController.cs b/DSACore/Controllers/TokensController.cs deleted file mode 100644 index a85cabe..0000000 --- a/DSACore/Controllers/TokensController.cs +++ /dev/null @@ -1,25 +0,0 @@ -using DSACore.Hubs; -using Microsoft.AspNetCore.Mvc; - -namespace DSACore.Controllers -{ - [Route("lobby/[controller]")] - [ApiController] - public class TokensController : Controller - { - // GET - [HttpGet("{token}")] - public ActionResult Get(string token) - { - if (!int.TryParse(token, out var intToken)) - return BadRequest("The token has to be a 32 bit unsigned integer"); - - if (intToken == 42) return Ok("Scribble"); - - if (!Users.Tokens.Exists(x => x.GetHashCode() == intToken)) return NotFound(); - - var group = Users.Tokens.Find(x => x.GetHashCode() == intToken); - return Ok(group.Group); - } - } -} \ No newline at end of file diff --git a/DSACore/Controllers/ValuesController.cs b/DSACore/Controllers/ValuesController.cs deleted file mode 100644 index eb08898..0000000 --- a/DSACore/Controllers/ValuesController.cs +++ /dev/null @@ -1,45 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; - -namespace DSACore.Controllers -{ - [Route("api/[controller]")] - [ApiController] - public class ValuesController : ControllerBase - { - // GET api/values - [HttpGet] - public ActionResult> Get() - { - return new string[] { "value1", "value2" }; - } - - // GET api/values/5 - [HttpGet("{id}")] - public ActionResult Get(int id) - { - return "value"; - } - - // POST api/values - [HttpPost] - public void Post([FromBody] string value) - { - } - - // PUT api/values/5 - [HttpPut("{id}")] - public void Put(int id, [FromBody] string value) - { - } - - // DELETE api/values/5 - [HttpDelete("{id}")] - public void Delete(int id) - { - } - } -} diff --git a/DSACore/DSACore.csproj b/DSACore/DSACore.csproj deleted file mode 100644 index f7def31..0000000 --- a/DSACore/DSACore.csproj +++ /dev/null @@ -1,28 +0,0 @@ - - - - netcoreapp2.2 - DSACore.Program - - - - - - - - - - - - - - - - - - - - - - - diff --git a/DSACore/Hubs/Login.cs b/DSACore/Hubs/Login.cs deleted file mode 100644 index f08c24a..0000000 --- a/DSACore/Hubs/Login.cs +++ /dev/null @@ -1,205 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using DSACore.Models.Network; -using DSALib.Commands; -using DSALib.DSA_Game.Characters; -using DSALib.FireBase; -using DSALib.Models.Network; -using Microsoft.AspNetCore.SignalR; -using Group = DSACore.Models.Network.Group; - -namespace DSACore.Hubs -{ - public class Users : Hub - { - //private static Dictionary UserGroup = new Dictionary(); - - private const string ReceiveMethod = "ReceiveMessage"; //receiveMethod; - - static Users() { - DsaGroups = Database.GetGroups().Result.Select(x=>new Group(x.Item1, x.Item2)).ToList(); - DsaGroups.Add(new Group("login", "")); - DsaGroups.Add(new Group("online", "")); - //AddGroups(); - } - - private static List DsaGroups { get; } - public static List Tokens { get; } = new List(); - - - public async Task SendMessage(string user, string message) - { - try - { - var group = getGroup(Context.ConnectionId).Name; - } - catch (InvalidOperationException) - { - await Clients.Caller.SendCoreAsync(ReceiveMethod, - new object[] { "Nutzer ist in keiner Gruppe. Erst joinen!" }); - } - - if (message[0] == '/') - { - var args = message.Split(' ', StringSplitOptions.RemoveEmptyEntries).ToList(); - - var Timon = args.Any(x => x == "hallo"); - - var ident = args.First().Replace("/", ""); - if (args.Count > 0) args.RemoveAt(0); - - var ret = CommandHandler.ExecuteCommand(new Command - { - CharId = 0, - CmdIdentifier = ident, - CmdTexts = args, - Name = user - }); - - switch (ret.ResponseType) - { - case ResponseType.Caller: - case ResponseType.Error: - await Clients.Caller.SendAsync(ReceiveMethod, ret.message); - break; - case ResponseType.Broadcast: - await SendToGroup(ret.message); - break; - } - } - else - { - await SendToGroup(message); - } - } - - private Task SendToGroup(string message) - { - try - { - var group = getGroup(Context.ConnectionId).Name; - return Clients.Group(group).SendCoreAsync(ReceiveMethod, - new object[] {getUser(Context.ConnectionId).Name, message}); - } - catch (InvalidOperationException) - { - return Clients.Caller.SendCoreAsync(ReceiveMethod, - new object[] {"Nutzer ist in keiner Gruppe. Erst joinen!"}); - } - } - - private Group getGroup(string id) - { - return DsaGroups.First(x => x.Users.Exists(y => y.ConnectionId.Equals(id))); - } - - private User getUser(string id) - { - return DsaGroups.First(x => x.Users.Exists(y => y.ConnectionId.Equals(id))).Users - .First(z => z.ConnectionId.Equals(id)); - } - - public async Task GetGroups() { - var test = await Database.GetGroups(); - foreach (var group in test.Select(x => new Group(x.Item1, x.Item2)).ToList()) - if (!DsaGroups.Exists(x => x.Name.Equals(group.Name))) - DsaGroups.Add(group); - - await Clients.Caller.SendCoreAsync("ListGroups", new object[] {DsaGroups.Select(x => x.SendGroup())}); - //throw new NotImplementedException("add database call to get groups"); - } - - public async Task AddGroup(string group, string password) - { - DsaGroups.Add(new Group(group, password)); - var Dgroup = new DSALib.Models.Database.Groups.Group {Name = group, Id = DsaGroups.Count - 1}; - //Database.AddGroup(Dgroup); - await Clients.Caller.SendCoreAsync(ReceiveMethod, new[] {$"group {group} sucessfully added"}); - //throw new NotImplementedException("add database call to add groups"); - } - - public async Task UploadChar(string xml) - { - var group = getGroup(Context.ConnectionId); - - await Database.AddChar(new Character(new MemoryStream(Encoding.UTF8.GetBytes(xml))), group.Name); - //throw new NotImplementedException("add database call to add groups"); - } - - public async Task Login(string group, string user, string hash) - { - //string password = System.Text.Encoding.UTF8.GetString(hash); - if (hash == DsaGroups.First(x => x.Name == group).Password) - { - var gGroup = DsaGroups.First(x => x.Name.Equals(group)); - if (!gGroup.Users.Exists(x => x.Name.Equals(user))) - { - await Groups.RemoveFromGroupAsync(Context.ConnectionId, "login"); - await Groups.AddToGroupAsync(Context.ConnectionId, group); - gGroup.Users.Add(new User {ConnectionId = Context.ConnectionId, Name = user}); - await SendToGroup("Ein neuer Nutzer hat die Gruppe betreten"); - await Clients.Caller.SendAsync("LoginResponse", 0); - await Clients.Caller.SendAsync("PlayerStatusChanged", new[] {user, "online"}); - - Tokens.Add(new Token(group)); - await Clients.Caller.SendAsync("Token", Tokens.Last().GetHashCode()); - purgeTokens(); - } - else - { - await Clients.Caller.SendAsync("LoginResponse", 1); - } - } - else - { - await Clients.Caller.SendAsync("LoginResponse", 2); - //await Clients.Caller.SendAsync(receiveMethod, "Falsches Passwort!"); - } - } - - private void purgeTokens() - { - Tokens.RemoveAll(x => !x.IsValid()); - } - - public override Task OnDisconnectedAsync(Exception exception) - { - Disconnect().Wait(); - return base.OnDisconnectedAsync(exception); - } - - public override Task OnConnectedAsync() - { - Groups.AddToGroupAsync(Context.ConnectionId, "login").Wait(); - Groups.AddToGroupAsync(Context.ConnectionId, "online").Wait(); - return base.OnConnectedAsync(); - } - - public async Task Disconnect() - { - await Groups.RemoveFromGroupAsync(Context.ConnectionId, "online"); - if (DsaGroups.Exists(x => x.Users.Exists(y => y.ConnectionId == Context.ConnectionId))) - try - { - var group = getGroup(Context.ConnectionId); - - - var user = getUser(Context.ConnectionId); - - await Clients.Caller.SendAsync("PlayerStatusChanged", new[] {user.Name, "offline"}); - //await SendToGroup(user.Name + " disconnected from the Server"); - group.Users.Remove(user); - await Groups.RemoveFromGroupAsync(Context.ConnectionId, group.Name); - } - catch (Exception e) - { - Console.WriteLine(e); - //throw; - } - } - } -} \ No newline at end of file diff --git a/DSACore/Models/Network/Group.cs b/DSACore/Models/Network/Group.cs deleted file mode 100644 index efe12ee..0000000 --- a/DSACore/Models/Network/Group.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace DSACore.Models.Network -{ - public class Group - { - public Group(string name, string password) - { - Name = name; - Password = password; - } - - public Group(string name, int userOnline) - { - Name = name ?? throw new ArgumentNullException(nameof(name)); - } - - public string Name { get; set; } - public string Password { get; set; } - public List Users { get; set; } = new List(); - - public int UserCount => Users.Count; - - public SendGroup SendGroup() - { - return new SendGroup(Name, UserCount); - } - } - - public class SendGroup - { - public SendGroup(string name, int userCount) - { - Name = name ?? throw new ArgumentNullException(nameof(name)); - UserCount = userCount; - } - - public string Name { get; set; } - - public int UserCount { get; set; } - } -} \ No newline at end of file diff --git a/DSACore/Models/Network/Token.cs b/DSACore/Models/Network/Token.cs deleted file mode 100644 index 451cafc..0000000 --- a/DSACore/Models/Network/Token.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; - -namespace DSACore.Models.Network -{ - public class Token - { - private readonly DateTime creation = DateTime.Now; - - public Token(string group) - { - Group = group; - } - - public string Group { get; set; } - - public bool IsValid() - { - return DateTime.Now - creation < TimeSpan.FromMinutes(1); - } - } -} \ No newline at end of file diff --git a/DSACore/Models/Network/User.cs b/DSACore/Models/Network/User.cs deleted file mode 100644 index 8b8008c..0000000 --- a/DSACore/Models/Network/User.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace DSACore.Models.Network -{ - public class User - { - public string Name { get; set; } - public string ConnectionId { get; set; } - public int Char { get; set; } - } -} \ No newline at end of file diff --git a/DSACore/Program.cs b/DSACore/Program.cs deleted file mode 100644 index 8af0a74..0000000 --- a/DSACore/Program.cs +++ /dev/null @@ -1,24 +0,0 @@ -using DSALib.DSA_Game; -using DSALib.FireBase; -using Microsoft.AspNetCore; -using Microsoft.AspNetCore.Hosting; - -namespace DSACore -{ - public class Program - { - public static void Main(string[] args) - { - Database.GetGroup(0).Wait(); - Dsa.Startup(); - CreateWebHostBuilder(args).Build().Run(); - } - - public static IWebHostBuilder CreateWebHostBuilder(string[] args) - { - return WebHost.CreateDefaultBuilder(args) - .UseStartup() - .UseUrls("http://0.0.0.0:5000"); - } - } -} \ No newline at end of file diff --git a/DSACore/Properties/DSALib-Auxiliary-CommandInfo.json b/DSACore/Properties/DSALib-Auxiliary-CommandInfo.json deleted file mode 100644 index b9941f2..0000000 --- a/DSACore/Properties/DSALib-Auxiliary-CommandInfo.json +++ /dev/null @@ -1,101 +0,0 @@ -[ - { - "Name": "ich bin", - "Scope": "All", - "Brief": "Setzt den gespielten Charakter fest", - "Description": [ - "Mit \"!Ich bin\" kann der gespielte Charakter definiert, bzw. gewechselt werden.\n", - " Die Charaktere müssen als *.xml Dateien hinterlegt sein.\n\n", - " !ich Zeigt an welcher Charakter zur Zeit gespielt wird\n", - " !ich bin Zalibius Wechsel zum Helden Zalibius\n", - " !ich Rhoktar Orkische Variante von !ich bin.\n", - " Wechselt zu Rhoktar.\n\n", - " !list chars Zeigt die Liste verfügbarer Charaktere.\n", - " \n" - ] - }, - { - "Name": "List", - "Scope": "All", - "Brief": "Anzeige vonSpielrelevanten Listen", - "Description": [ - "Mit \"!list\" lassen sich spielrelevante Listen ausgeben. Die Angezeigte Liste wird nach einiger Zeit wieder gelöscht.\n", - "\n", - " !list chars Liste aller verfügbaren Helden (eingelesen per *.xml)\n", - " und NSCs.\n", - " (Mit \"!ich bin\" kann der Held ausgewählt werden.)\n", - " !list commands Liste aller verwendbaren Bot-Kommandos.\n", - " !list sounds Liste der Soundeffekte." - ] - }, - { - "Name": "Held", - "Scope": "All", - "Brief": "Anzeige von Heldenwerten", - "Description": [ - "Mit \"!Held\" lassen sich Heldenwerte ausgeben. Mehrere Werte können gleichzeitig angefordert werde. \"!Held LE Waffen\" liefert so z.B. Informationen zur Lebensenergie und den Kampfwerten.\n Bis auf wenige Ausnahmen wird die Angezeigte Liste nach einiger Zeit wieder gelöscht.\n", - "\n", - " !Held Zeigt den Heldenbrief an.\n", - " (Diese Liste wird nicht automatisch gelöscht)\n", - " !Held Eigenschaften Zeigt die Eigenschaften MU/KL/CH/IN/KK/GE/FF/KO.\n", - " !Held e Kurzform von \"!Held Eigenschaften\".\n", - " !Held LE Zeigt LE an.\n", - " !Held AE Zeigt AE an.\n", - " !Held stats Zeigt Eigenschaften und zusätzlich SO/LE/AE.\n", - " !Held Kampfwerte Zeigt AT/PA für aktivierte Waffentalente.\n", - " !Held Waffe/!list w Kurzformen von \"!Held Kampfwerte\".\n", - " !Held Vorteile Zeigt Vor- und Nachteile an.\n", - " !Held v Kurzform von \"!Held Vorteile\".\n", - " !Held Talente Zeigt die Liste aller aktivierten Talente, deren TaW,\n", - " sowie die Probe.\n", - " !Held t Kurzform von \"!Held Talente\".\n", - " !Held Zauber Zeigt die Liste aller aktivierten Zauber, deren ZaW,\n", - " sowie die Probe.\n", - " !Held z Kurzform von \"!Held Zauber\".\n" - ] - }, - { - "Name": "LE", - "Scope": "All", - "Brief": "Ändert dein Leben - im wahrsten Sinne des Wortes", - "Description": [ - "Mit !LE zeigt man die Lebensenergie an, ändert sie, oder setzt sie auf einen neuen Wert\n\n", - " !LE Zeigt Lebensenergie an\n", - " !LE 30 Setzt LE auf 30\n", - " !LE +5 Erhöht LE um 5 (bis zum Maximum)\n", - " !LE ++5 Erhöht LE um 5 (ignoriert Maximum)\n", - " !LE -5 Verringert LE um 5\n \n" - ] - }, - { - "Name": "AE", - "Scope": "All", - "Brief": "Ändert Astralenergie", - "Description": [ - "Mit !AE (oder !Asp) zeigt man die Astralenergie an, ändert sie, oder setzt sie auf einen neuen Wert\n\n", - " !AE Zeigt Astralenergie an\n", - " !AE 30 Setzt Asp auf 30\n", - " !AE +5 Erhöht Asp um 5 (bis zum Maximum)\n", - " !AE ++5 Erhöht Asp um 5 (ignoriert Maximum)\n", - " !AE -5 Verringert Asp um 5 (Minimum 0)\n" - ] - }, - { - "Name": "Gm", - "Scope": "Meister", - "Brief": "Kontrolliere andere Charaktere", - "Description": [ - "Mit !GM fürhrt man commands als eine andere Person aus.", - " !GM [charaktername] [command] [commandattribut] [mofifier]", - " Unterstützte [commands]'s:", - " !GM [name] LE", - " !GM [name] AE", - " !GM [name] Talent", - " !GM [name] Fernkampf", - " !GM [name] Eigenschaft", - " !GM [name] Zauber", - " !GM [name] Angriff", - " !GM [name] Parade" - ] - } -] \ No newline at end of file diff --git a/DSACore/Properties/DSALib-DSA_Game-Characters-Character.json b/DSACore/Properties/DSALib-DSA_Game-Characters-Character.json deleted file mode 100644 index fd387f5..0000000 --- a/DSACore/Properties/DSALib-DSA_Game-Characters-Character.json +++ /dev/null @@ -1,290 +0,0 @@ -[ - { - "Eigenschaften": {}, - "Talente": [], - "Zauber": [], - "Kampftalente": [], - "Vorteile": [], - "PropTable": { - "MU": "Mut", - "KL": "Klugheit", - "IN": "Intuition", - "CH": "Charisma", - "FF": "Fingerfertigkeit", - "GE": "Gewandtheit", - "KO": "Konstitution", - "KK": "Körperkraft" - }, - "Lebenspunkte_Basis": 30, - "Lebenspunkte_Aktuell": 30, - "Ausdauer_Basis": 0, - "Ausdauer_Aktuell": 0, - "Astralpunkte_Basis": 20, - "Astralpunkte_Aktuell": 20, - "Name": "Felis Exodus Schattenwald" - }, - { - "Eigenschaften": {}, - "Talente": [], - "Zauber": [], - "Kampftalente": [], - "Vorteile": [], - "PropTable": { - "MU": "Mut", - "KL": "Klugheit", - "IN": "Intuition", - "CH": "Charisma", - "FF": "Fingerfertigkeit", - "GE": "Gewandtheit", - "KO": "Konstitution", - "KK": "Körperkraft" - }, - "Lebenspunkte_Basis": 29, - "Lebenspunkte_Aktuell": 29, - "Ausdauer_Basis": 0, - "Ausdauer_Aktuell": 0, - "Astralpunkte_Basis": 0, - "Astralpunkte_Aktuell": 0, - "Name": "Gardist" - }, - { - "Eigenschaften": {}, - "Talente": [], - "Zauber": [], - "Kampftalente": [], - "Vorteile": [], - "PropTable": { - "MU": "Mut", - "KL": "Klugheit", - "IN": "Intuition", - "CH": "Charisma", - "FF": "Fingerfertigkeit", - "GE": "Gewandtheit", - "KO": "Konstitution", - "KK": "Körperkraft" - }, - "Lebenspunkte_Basis": 31, - "Lebenspunkte_Aktuell": 31, - "Ausdauer_Basis": 0, - "Ausdauer_Aktuell": 0, - "Astralpunkte_Basis": 0, - "Astralpunkte_Aktuell": 0, - "Name": "Hartmut Reiher" - }, - { - "Eigenschaften": {}, - "Talente": [], - "Zauber": [], - "Kampftalente": [], - "Vorteile": [], - "PropTable": { - "MU": "Mut", - "KL": "Klugheit", - "IN": "Intuition", - "CH": "Charisma", - "FF": "Fingerfertigkeit", - "GE": "Gewandtheit", - "KO": "Konstitution", - "KK": "Körperkraft" - }, - "Lebenspunkte_Basis": 21, - "Lebenspunkte_Aktuell": 21, - "Ausdauer_Basis": 0, - "Ausdauer_Aktuell": 0, - "Astralpunkte_Basis": 35, - "Astralpunkte_Aktuell": 35, - "Name": "Helga vom Drachenei, Tausendsasserin" - }, - { - "Eigenschaften": {}, - "Talente": [], - "Zauber": [], - "Kampftalente": [], - "Vorteile": [], - "PropTable": { - "MU": "Mut", - "KL": "Klugheit", - "IN": "Intuition", - "CH": "Charisma", - "FF": "Fingerfertigkeit", - "GE": "Gewandtheit", - "KO": "Konstitution", - "KK": "Körperkraft" - }, - "Lebenspunkte_Basis": 25, - "Lebenspunkte_Aktuell": 25, - "Ausdauer_Basis": 0, - "Ausdauer_Aktuell": 0, - "Astralpunkte_Basis": 0, - "Astralpunkte_Aktuell": 0, - "Name": "Krenko" - }, - { - "Eigenschaften": {}, - "Talente": [], - "Zauber": [], - "Kampftalente": [], - "Vorteile": [], - "PropTable": { - "MU": "Mut", - "KL": "Klugheit", - "IN": "Intuition", - "CH": "Charisma", - "FF": "Fingerfertigkeit", - "GE": "Gewandtheit", - "KO": "Konstitution", - "KK": "Körperkraft" - }, - "Lebenspunkte_Basis": 39, - "Lebenspunkte_Aktuell": 39, - "Ausdauer_Basis": 0, - "Ausdauer_Aktuell": 0, - "Astralpunkte_Basis": 0, - "Astralpunkte_Aktuell": 0, - "Name": "Ledur Torfinson" - }, - { - "Eigenschaften": {}, - "Talente": [], - "Zauber": [], - "Kampftalente": [], - "Vorteile": [], - "PropTable": { - "MU": "Mut", - "KL": "Klugheit", - "IN": "Intuition", - "CH": "Charisma", - "FF": "Fingerfertigkeit", - "GE": "Gewandtheit", - "KO": "Konstitution", - "KK": "Körperkraft" - }, - "Lebenspunkte_Basis": 26, - "Lebenspunkte_Aktuell": 26, - "Ausdauer_Basis": 0, - "Ausdauer_Aktuell": 0, - "Astralpunkte_Basis": 13, - "Astralpunkte_Aktuell": 13, - "Name": "Morla" - }, - { - "Eigenschaften": {}, - "Talente": [], - "Zauber": [], - "Kampftalente": [], - "Vorteile": [], - "PropTable": { - "MU": "Mut", - "KL": "Klugheit", - "IN": "Intuition", - "CH": "Charisma", - "FF": "Fingerfertigkeit", - "GE": "Gewandtheit", - "KO": "Konstitution", - "KK": "Körperkraft" - }, - "Lebenspunkte_Basis": 28, - "Lebenspunkte_Aktuell": 28, - "Ausdauer_Basis": 0, - "Ausdauer_Aktuell": 0, - "Astralpunkte_Basis": 40, - "Astralpunkte_Aktuell": 40, - "Name": "Numeri Illuminus" - }, - { - "Eigenschaften": {}, - "Talente": [], - "Zauber": [], - "Kampftalente": [], - "Vorteile": [], - "PropTable": { - "MU": "Mut", - "KL": "Klugheit", - "IN": "Intuition", - "CH": "Charisma", - "FF": "Fingerfertigkeit", - "GE": "Gewandtheit", - "KO": "Konstitution", - "KK": "Körperkraft" - }, - "Lebenspunkte_Basis": 39, - "Lebenspunkte_Aktuell": 39, - "Ausdauer_Basis": 0, - "Ausdauer_Aktuell": 0, - "Astralpunkte_Basis": 16, - "Astralpunkte_Aktuell": 16, - "Name": "Potus" - }, - { - "Eigenschaften": {}, - "Talente": [], - "Zauber": [], - "Kampftalente": [], - "Vorteile": [], - "PropTable": { - "MU": "Mut", - "KL": "Klugheit", - "IN": "Intuition", - "CH": "Charisma", - "FF": "Fingerfertigkeit", - "GE": "Gewandtheit", - "KO": "Konstitution", - "KK": "Körperkraft" - }, - "Lebenspunkte_Basis": 18, - "Lebenspunkte_Aktuell": 18, - "Ausdauer_Basis": 0, - "Ausdauer_Aktuell": 0, - "Astralpunkte_Basis": 13, - "Astralpunkte_Aktuell": 13, - "Name": "Pump aus der Gosse" - }, - { - "Eigenschaften": {}, - "Talente": [], - "Zauber": [], - "Kampftalente": [], - "Vorteile": [], - "PropTable": { - "MU": "Mut", - "KL": "Klugheit", - "IN": "Intuition", - "CH": "Charisma", - "FF": "Fingerfertigkeit", - "GE": "Gewandtheit", - "KO": "Konstitution", - "KK": "Körperkraft" - }, - "Lebenspunkte_Basis": 34, - "Lebenspunkte_Aktuell": 34, - "Ausdauer_Basis": 0, - "Ausdauer_Aktuell": 0, - "Astralpunkte_Basis": 17, - "Astralpunkte_Aktuell": 17, - "Name": "Rhoktar4" - }, - { - "Eigenschaften": {}, - "Talente": [], - "Zauber": [], - "Kampftalente": [], - "Vorteile": [], - "PropTable": { - "MU": "Mut", - "KL": "Klugheit", - "IN": "Intuition", - "CH": "Charisma", - "FF": "Fingerfertigkeit", - "GE": "Gewandtheit", - "KO": "Konstitution", - "KK": "Körperkraft" - }, - "Lebenspunkte_Basis": 28, - "Lebenspunkte_Aktuell": 28, - "Ausdauer_Basis": 0, - "Ausdauer_Aktuell": 0, - "Astralpunkte_Basis": 43, - "Astralpunkte_Aktuell": 43, - "Name": "Volant" - } -] \ No newline at end of file diff --git a/DSACore/Properties/PublishProfiles/FolderProfile.pubxml b/DSACore/Properties/PublishProfiles/FolderProfile.pubxml deleted file mode 100644 index 2fd07c5..0000000 --- a/DSACore/Properties/PublishProfiles/FolderProfile.pubxml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - FileSystem - FileSystem - Release - Any CPU - - True - False - netcoreapp2.1 - 35a5e2cc-0fd4-4bc0-acbf-38599caed1c4 - false - <_IsPortable>true - bin\Release\netcoreapp2.1\publish\ - False - win-x64 - - \ No newline at end of file diff --git a/DSACore/Properties/PublishProfiles/FolderProfile1.pubxml b/DSACore/Properties/PublishProfiles/FolderProfile1.pubxml deleted file mode 100644 index e03b55a..0000000 --- a/DSACore/Properties/PublishProfiles/FolderProfile1.pubxml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - FileSystem - FileSystem - Release - Any CPU - - True - False - netcoreapp2.1 - linux-x64 - 35a5e2cc-0fd4-4bc0-acbf-38599caed1c4 - false - <_IsPortable>true - bin\Release\netcoreapp2.1\publish\ - False - - \ No newline at end of file diff --git a/DSACore/Properties/launchSettings.json b/DSACore/Properties/launchSettings.json deleted file mode 100644 index 2da5fec..0000000 --- a/DSACore/Properties/launchSettings.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "$schema": "http://json.schemastore.org/launchsettings.json", - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:2170", - "sslPort": 44365 - } - }, - "profiles": { - "IIS Express": { - "commandName": "IISExpress", - "launchBrowser": true, - "launchUrl": "api/commands", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - }, - "DSACore": { - "commandName": "Project", - "launchBrowser": true, - "launchUrl": "api/commands", - "applicationUrl": "https://0.0.0.0:5001;http://0.0.0.0:5000", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - } - } -} \ No newline at end of file diff --git a/DSACore/Startup.cs b/DSACore/Startup.cs deleted file mode 100644 index ef22802..0000000 --- a/DSACore/Startup.cs +++ /dev/null @@ -1,47 +0,0 @@ -using DSACore.Hubs; -using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; - -namespace DSACore -{ - public class Startup - { - public Startup(IConfiguration configuration) - { - Configuration = configuration; - } - - public IConfiguration Configuration { get; } - - // This method gets called by the runtime. Use this method to add services to the container. - public void ConfigureServices(IServiceCollection services) - { - - services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1); - - services.AddSignalR(); - } - - // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. - public void Configure(IApplicationBuilder app, IHostingEnvironment env) - { - if (env.IsDevelopment()) - app.UseDeveloperExceptionPage(); - else - app.UseHsts(); - - app.UseCors("CorsPolicy"); - - app.UseSignalR(routes => { routes.MapHub("/login"); }); - - app.UseWebSockets(); - - //app.UseCors("AllowSpecificOrigin"); - app.UseHttpsRedirection(); - app.UseMvc(); - } - } -} \ No newline at end of file diff --git a/DSACore/appsettings.Development.json b/DSACore/appsettings.Development.json deleted file mode 100644 index e203e94..0000000 --- a/DSACore/appsettings.Development.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "Logging": { - "LogLevel": { - "Default": "Debug", - "System": "Information", - "Microsoft": "Information" - } - } -} diff --git a/DSACore/appsettings.json b/DSACore/appsettings.json deleted file mode 100644 index dee968c..0000000 --- a/DSACore/appsettings.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "Logging": { - "LogLevel": { - "Microsoft.AspNetCore.SignalR": "Debug", - "Microsoft.AspNetCore.Http.Connections": "Debug", - "Default": "Debug" - } - }, - "AllowedHosts": "*" -} diff --git a/DSALib/Auxiliary/Calculator/Argument.cs b/DSALib/Auxiliary/Calculator/Argument.cs deleted file mode 100644 index e681377..0000000 --- a/DSALib/Auxiliary/Calculator/Argument.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System; - -namespace DSALib.Auxiliary.Calculator -{ - /// - /// Provides an ISolvable class to save numbers. The class handles Argument checking and conversion from string to int. - /// - public class Argument : ISolvable - { - private readonly int value; - - public Argument(string value) - { - // check whether the value given is an empty string - if (string.IsNullOrEmpty(value)) - throw new ArgumentException("Argument kann nicht mit einem leeren string instanziert werden. ", - nameof(value)); - - if (!int.TryParse(value, out var result)) - throw new ArgumentException($"Kann {value} nicht in Integer konvertieren"); - - this.value = result; - } - - public int Solve() - { - return value; - } - - public override string ToString() - { - return value.ToString(); - } - } -} \ No newline at end of file diff --git a/DSALib/Auxiliary/Calculator/ISolvable.cs b/DSALib/Auxiliary/Calculator/ISolvable.cs deleted file mode 100644 index 844e9b3..0000000 --- a/DSALib/Auxiliary/Calculator/ISolvable.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace DSALib.Auxiliary.Calculator -{ - /// - /// Object has to be able to return an integer as it's value - /// - public interface ISolvable - { - int Solve(); - } -} \ No newline at end of file diff --git a/DSALib/Auxiliary/Calculator/Operator.cs b/DSALib/Auxiliary/Calculator/Operator.cs deleted file mode 100644 index e6aeec6..0000000 --- a/DSALib/Auxiliary/Calculator/Operator.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System; -using DSALibv.Auxiliary.Calculator; - -namespace DSALib.Auxiliary.Calculator -{ - /// - /// The Operator Class represents a binary operator with tow Arguments and an Operation type - /// - public class Operator : ISolvable - { - private readonly ISolvable arg1, arg2; - - public Operator(ISolvable arg1, ISolvable arg2, Ops operatorType) - { - this.arg1 = arg1; - this.arg2 = arg2; - OperatorType = operatorType; - } - - public Ops OperatorType { get; set; } - - public int Solve() - { - int result; - switch (OperatorType) - { - case Ops.Dice: - result = Dice.Roll(arg1.Solve(), arg2.Solve()); - break; - case Ops.Multiply: - result = arg1.Solve() * arg2.Solve(); - break; - case Ops.Add: - result = arg1.Solve() + arg2.Solve(); - break; - case Ops.Subtract: - result = arg1.Solve() - arg2.Solve(); - break; - default: - throw new ArgumentOutOfRangeException(); - } - - return result; - } - - public override string ToString() - { - return $"({arg1} {OperatorType} {arg2})"; - } - } -} \ No newline at end of file diff --git a/DSALib/Auxiliary/Calculator/Ops.cs b/DSALib/Auxiliary/Calculator/Ops.cs deleted file mode 100644 index 93046d0..0000000 --- a/DSALib/Auxiliary/Calculator/Ops.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace DSALibv.Auxiliary.Calculator -{ - /// - /// The Different Operations, witch can be performed in execution-order - /// - public enum Ops - { - Dice, - Multiply, - Subtract, - Add - } -} \ No newline at end of file diff --git a/DSALib/Auxiliary/Calculator/StringSolver.cs b/DSALib/Auxiliary/Calculator/StringSolver.cs deleted file mode 100644 index 45d6a54..0000000 --- a/DSALib/Auxiliary/Calculator/StringSolver.cs +++ /dev/null @@ -1,183 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using DSALibv.Auxiliary.Calculator; - -namespace DSALib.Auxiliary.Calculator -{ - /// - /// The StringSolver divides the calculation string into operations and SubStringSolvers if the string contains - /// parentheses - /// - public class StringSolver : ISolvable - { - private readonly List arguments = new List(); - private readonly string input; - - public StringSolver(string input) - { - this.input = input; - } - - public int Solve() - { - var workInput = "0+" + input.Replace(" ", string.Empty).ToLower(); - workInput = ExpandParentheses(workInput); - - // Create a List of the different parts of the calculation, e.g.:{"0", "+", "(5+6)", "d", "3"}. - AtomizeOperations(workInput); - - // traverse the List in order of Operation to Create the binary operation tree . - NestOperations(); - - // the List now contains only the top operation node, witch can be solved recursively, - return ((ISolvable) arguments.First()).Solve(); - } - - public override string ToString() - { - return "(0+" + input.Replace(" ", string.Empty).ToLower() + ")"; - } - - private static string - GetInner(ref string input) // extract the inner bracket an remove the section from the input string - { - var depth = 0; - for (var index = 1; index < input.Length; index++) - { - var c = input[index]; - switch (c) - { - case '(': - depth++; - break; - case ')': - if (depth == 0) - { - var split = input.Substring(1, index - 1); - input = input.Substring(index + 1); - return split.Equals(string.Empty) ? "0" : split; - } - else - { - depth--; - } - - break; - } - } - - throw new ArgumentException("Invalid brace sequence"); - } - - private static Ops GetOps(char c) - { - switch (c) - { - case 'd': - case 'w': - return Ops.Dice; - case '+': - return Ops.Add; - case '-': - return Ops.Subtract; - case '*': - return Ops.Multiply; - default: - return Ops.Multiply; - } - } - - private static string ExpandParentheses(string input) // insert * between Parentheses and digits - { - for (var i = 0; i < input.Length - 1; i++) - if (input[i + 1] == '(' && char.IsNumber(input[i])) - input = input.Insert(i + 1, "*"); - - for (var i = 1; i < input.Length; i++) - if (input[i - 1] == ')' && char.IsNumber(input[i])) - input = input.Insert(i, "*"); - - return input; - } - - private void AtomizeOperations(string workInput) - { - for (var index = 0; index < workInput.Length; index++) - { - var c = workInput[index]; - - if (char.IsNumber(c)) - { - // if char number, check if at end of string, else continue looping - if (index == workInput.Length - 1) - // if at end of string; add remaining number to arguments - arguments.Add(new Argument(workInput.Substring(0, index + 1))); - - continue; - } - - switch (c) - { - case ')': - throw new ArgumentException("Invalid brace sequence"); - case '(': - arguments.Add(new StringSolver(GetInner(ref workInput))); - index = -1; - break; - default: - if (index > 0) arguments.Add(new Argument(workInput.Substring(0, index))); - - arguments.Add(GetOps(c)); - workInput = workInput.Remove(0, index + 1); - index = -1; - break; - } - } - } - - private void NestOperations() - { - foreach (Ops currentOp in Enum.GetValues(typeof(Ops))) - // cycle through operators in operational order - for (var index = 0; index < arguments.Count; index++) - { - var arg = arguments[index]; - - if (arg.GetType() != typeof(Ops)) continue; - - // arg is of type Ops - var op = (Ops) arg; - - if (op != currentOp) continue; - - // arg describes the current operation - HandleSpecialFormatting(ref index, op); // Deal with special needs... - - // replace the previous current and next Element in the List with one Operation object - var temp = new Operator((ISolvable) arguments[index - 1], (ISolvable) arguments[index + 1], op); - arguments[index - 1] = temp; - arguments.RemoveRange(index, 2); - index--; - } - } - - private void HandleSpecialFormatting(ref int index, Ops op) - { - var arg1 = arguments[index - 1]; - if (arg1.GetType() == typeof(Ops)) - { - if (op == Ops.Dice) arguments.Insert(index++, new Argument("1")); // w6 -> 1w6 - - if (op == Ops.Subtract) arguments.Insert(index++, new Argument("0")); // +-3 -> +0-3 - } - - var arg2 = arguments[index + 1]; // 3+-5 -> 3+(0-5) - if (arg2.GetType() == typeof(Ops)) - { - arguments[index + 1] = new Operator(new Argument("0"), (ISolvable) arguments[index + 2], (Ops) arg2); - arguments.RemoveAt(index + 2); - } - } - } -} \ No newline at end of file diff --git a/DSALib/Auxiliary/CommandInfo.cs b/DSALib/Auxiliary/CommandInfo.cs deleted file mode 100644 index d8e2188..0000000 --- a/DSALib/Auxiliary/CommandInfo.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System.Linq; - -namespace DSALib.Auxiliary -{ - public struct CommandInfo - { - public CommandInfo(string name, string brief, string[] description, string scope) - { - Name = name; - Scope = scope; - Brief = brief; - Description = description; - } - - public string Name { get; } - - public string Scope { get; } - - public string Brief { get; } - - public string[] Description { get; } - - public string GetDescription() - { - return Description.Aggregate((s, c) => s + c); - } - } -} \ No newline at end of file diff --git a/DSALib/Auxiliary/Dice.cs b/DSALib/Auxiliary/Dice.cs deleted file mode 100644 index 0bfabeb..0000000 --- a/DSALib/Auxiliary/Dice.cs +++ /dev/null @@ -1,45 +0,0 @@ -using System; -using System.Linq; - -namespace DSALib.Auxiliary -{ - public static class Dice // roll it! - { - private static readonly Random Rnd = new Random(); - - public static int Roll(int d = 20) - { - return Rnd.Next(d) + 1; - } - - public static int Roll(string input) - { - var strings = input.ToLower().Split(new[] {'w', 'd'}, 2, StringSplitOptions.RemoveEmptyEntries).ToList(); - - - if (strings.Count != 2) - throw new ArgumentException($"{input}: does not satisfy the format requirements( dice count (d|w) die size)"); - - var count = Convert.ToInt32(strings[0]); - var d = Convert.ToInt32(strings[0]); - - return Roll(count, d); - } - - public static int Roll(int count, int d) - { - if (d <= 0 || count <= 0) return 0; - - var sum = 0; - for (var i = 0; i < Math.Abs(count); i++) - { - var roll = Roll(d); - sum += roll; - } - - sum *= Math.Abs(count) / count; - - return sum; - } - } -} \ No newline at end of file diff --git a/DSALib/Auxiliary/Extensions.cs b/DSALib/Auxiliary/Extensions.cs deleted file mode 100644 index 7d367a5..0000000 --- a/DSALib/Auxiliary/Extensions.cs +++ /dev/null @@ -1,25 +0,0 @@ -namespace DSALib.Auxiliary -{ - public static class StringExtension - { - //This mehod extends string. It adds spaces until a fixed length is reached. - //If the original string is already longer, it is returner unmodified. - public static string AddSpaces(this string str, int length) - { - var temp = str; - for (var i = str.Length; i < length; i++) temp += " "; - return temp; - } - - - //This mehod extends string. - //It adds spaces at the HEAD of a string until a fixed length is reached. - //If the original string is already longer, it is returner unmodified. - public static string AddSpacesAtHead(this string str, int length) - { - var temp = ""; - for (var i = str.Length; i < length; i++) temp += " "; - return temp + str; - } - } -} \ No newline at end of file diff --git a/DSALib/Auxiliary/IDataObjectEnumerableExtension.cs b/DSALib/Auxiliary/IDataObjectEnumerableExtension.cs deleted file mode 100644 index b8a6067..0000000 --- a/DSALib/Auxiliary/IDataObjectEnumerableExtension.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text.RegularExpressions; -using System.Threading.Tasks; -using DSALib.Auxiliary; -using DSALib.Models.Database; - -namespace DSACore.Auxiliary -{ - public static class DataObjectEnumerableExtension - { - public static IDataObject Match(this IEnumerable dataObjects, string name) - { - return (dataObjects as IOrderedEnumerable ?? throw new InvalidOperationException()).OrderBy(x => SpellCorrect.Compare(name,x.Name)).Last(); - } - - public static bool TryMatch(this IEnumerable dataObjects,out IDataObject data, string name) - { - data = (dataObjects as IOrderedEnumerable ?? throw new InvalidOperationException()).OrderBy(x => SpellCorrect.Compare(name,x.Name)).Last(); - - return SpellCorrect.IsMatch(name, data.Name); - } - } -} diff --git a/DSALib/Auxiliary/RandomMisc.cs b/DSALib/Auxiliary/RandomMisc.cs deleted file mode 100644 index 2723930..0000000 --- a/DSALib/Auxiliary/RandomMisc.cs +++ /dev/null @@ -1,52 +0,0 @@ -using System; -using System.Linq; -using System.Text; - -namespace DSALib.Auxiliary -{ - public static class RandomMisc - { - private static readonly Random Rand = new Random(); - - // use: 4w6 +4 - public static string Roll(string input) - { - var output = new StringBuilder(); - var strings = input.Split('w', 'd').ToList(); - var count = Convert.ToInt32(strings[0]); - strings = strings[1].Split(' ').ToList(); - var d = Convert.ToInt32(strings[0]); - - if (strings.Count > 0) - { - } - - var sum = 0; - for (var i = 0; i < count; i++) - { - var roll = Dice.Roll(d); - sum += roll; - output.Append("[" + roll + "] "); - } - - if (strings.Count > 1) - { - sum += Convert.ToInt32(strings[1]); - output.Append("sum: " + sum); - } - - return output.ToString(); - } - - public static double Random(double stdDev = 1, double mean = 0) - { - var u1 = Rand.NextDouble(); // uniform(0,1) random doubles - var u2 = Rand.NextDouble(); - var randStdNormal = Math.Sqrt(-2.0 * Math.Log(u1)) * - Math.Sin(2.0 * Math.PI * u2); // random normal(0,1) - var randNormal = - mean + stdDev * randStdNormal; // random normal(mean,stdDev^2) - return randNormal; - } - } -} \ No newline at end of file diff --git a/DSALib/Auxiliary/SpellCorrect.cs b/DSALib/Auxiliary/SpellCorrect.cs deleted file mode 100644 index 79908c4..0000000 --- a/DSALib/Auxiliary/SpellCorrect.cs +++ /dev/null @@ -1,61 +0,0 @@ -using System; - -namespace DSALib.Auxiliary -{ - public class SpellCorrect - { - public const double ErrorThreshold = 1 / 3.0; - private const double Match = 3.0; - private const double Gap = -1.5; - private const double Mismatch = -2.0; - - public static double Compare(string s, string q) - { - s = s.ToLower(); - q = q.ToLower(); - - int i, j; - - var matrix = new double[s.Length + 1, q.Length + 1]; - var max = 0.0; - matrix[0, 0] = 0.0; - - for (i = 1; i < s.Length; i++) - matrix[i, 0] = i * Gap; - - for (i = 1; i < q.Length; i++) matrix[0, i] = 0.0; - - - for (i = 1; i <= s.Length; i++) - for (j = 1; j <= q.Length; j++) - { - double decay = j / (s.Length * 1000.0); - var add = s[i - 1] == q[j - 1] ? Match - decay : Mismatch; - var score = matrix[i - 1, j - 1] + add; - - if (score < matrix[i - 1, j] + Gap) score = matrix[i - 1, j] + Gap; - - if (score < matrix[i, j - 1] + Gap) score = matrix[i, j - 1] + Gap; - - if (i > 1 && j > 1) - if (s[i - 1] == q[j - 2] && s[i - 2] == q[j - 1]) - { - add = 3 / 2.0 * Match - decay; - if (score < matrix[i - 2, j - 2] + add) score = matrix[i - 2, j - 2] + add; - } - - if (max < score && i == s.Length) max = score; - - matrix[i, j] = score; - } - - return max; - } - - public static bool IsMatch(string s1, string s2) - { - var score = Compare(s1, s2); - return score > ErrorThreshold * s1.Length; - } - } -} \ No newline at end of file diff --git a/DSALib/Auxiliary/TalentEnumerableExtension.cs b/DSALib/Auxiliary/TalentEnumerableExtension.cs deleted file mode 100644 index 6ec7fcc..0000000 --- a/DSALib/Auxiliary/TalentEnumerableExtension.cs +++ /dev/null @@ -1,74 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using System.Text; -using DSACore.Auxiliary; -using DSALib.DSA_Game.Characters; -using DSALib.Models.Dsa; - -namespace DSALib.Auxiliary -{ - public static class TalentEnumerableExtension - { - public static string ProbenTest(this IEnumerable List, Character c, string talentName, int erschwernis = 0) - { - var output = new StringBuilder(); - var sc = new SpellCorrect(); - - if (!List.TryMatch(out var iTalent, talentName)) - return $"{c.Name} kann nicht {talentName}..."; - - var talent = (Talent) iTalent; - var props = talent.GetEigenschaften(); // get the required properties - var tap = talent.Value; // get taw - var werte = props.Select(p => c.Eigenschaften[c.PropTable[p]]).ToArray(); - - output.AppendFormat( - "{0} würfelt: {1} \n{2} - {3} taw:{4} {5} \n", - c.Name, - talent.Name, - talent.Probe, - string.Join("/", werte), - talent.Value, - erschwernis.Equals(0) ? string.Empty : "Erschwernis: " + erschwernis); - - output.Append(" "); - tap -= erschwernis; - var gesamtErschwernis = tap; - if (gesamtErschwernis < 0) - { - tap = 0; - for (var i = 0; i <= 2; i++) - { - // foreach property, dice and tap - var temp = Dice.Roll(); - var eigenschaft = c.Eigenschaften[c.PropTable[props[i]]]; - - if (eigenschaft + gesamtErschwernis < temp) tap -= temp - (eigenschaft + gesamtErschwernis); - - output.Append($"[{temp}]"); // add to string - } - - if (tap >= 0) tap = 1; - } - else - { - for (var i = 0; i <= 2; i++) - { - // foreach property, dice and tap - var temp = Dice.Roll(); - var eigenschaft = c.Eigenschaften[c.PropTable[props[i]]]; - - if (eigenschaft < temp) tap -= temp - eigenschaft; - - output.Append($"[{temp}]"); // add to string - } - } - - tap = tap == 0 ? 1 : tap; - - output.AppendFormat(" tap: {0,2}", tap); - - return output.ToString(); // return output - } - } -} \ No newline at end of file diff --git a/DSALib/Auxiliary/WeaponImporter.cs b/DSALib/Auxiliary/WeaponImporter.cs deleted file mode 100644 index 61eb33e..0000000 --- a/DSALib/Auxiliary/WeaponImporter.cs +++ /dev/null @@ -1,175 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net.Http; -using System.Text.RegularExpressions; -using System.Threading.Tasks; -using DSALib.FireBase; -using DSALib.Models.Database.Dsa; - -namespace DSALib.Auxiliary -{ - public class WeaponImporter - { - private readonly List Range = new List(); - private readonly List Weapons = new List(); - - public async Task DownloadWeapons() - { - var client = new HttpClient(); - - - for (var i = 1; i <= 25; i++) - { - var responseString = - await client.GetStringAsync("http://diarium.eu/dsa4-forge/ajax/categoryChanged/" + i); - - var talentRegex = new Regex(@"(?<=