From 39da0da55a09a56bae3c250e6108c8edf77bfbfd Mon Sep 17 00:00:00 2001 From: TrueDoctor Date: Thu, 27 Sep 2018 21:02:07 +0200 Subject: fixed some stuff --- DSACore/DSA_Game/Dsa.cs | 8 ++- DSACore/DSA_Game/Save/Properties.cs | 2 +- DSACore/Program.cs | 3 +- .../PublishProfiles/FolderProfile.pubxml | 22 ++++++++ .../PublishProfiles/FolderProfile1.pubxml | 23 +++++++++ DSACore/Properties/launchSettings.json | 2 +- DSACore/Startup.cs | 11 ++++ WebInterface/NodeJSServer/dist/chat.js | 2 +- ZooBOTanica/App.config | 6 +-- ZooBOTanica/Properties/Resources.Designer.cs | 58 ++++++++++------------ ZooBOTanica/Properties/Settings.Designer.cs | 30 +++++------ ZooBOTanica/ZooBOTanica.csproj | 4 +- 12 files changed, 111 insertions(+), 60 deletions(-) create mode 100644 DSACore/Properties/PublishProfiles/FolderProfile.pubxml create mode 100644 DSACore/Properties/PublishProfiles/FolderProfile1.pubxml diff --git a/DSACore/DSA_Game/Dsa.cs b/DSACore/DSA_Game/Dsa.cs index ff74788..7258e8c 100644 --- a/DSACore/DSA_Game/Dsa.cs +++ b/DSACore/DSA_Game/Dsa.cs @@ -13,6 +13,8 @@ namespace DSACore.DSA_Game public static class Dsa { + public const string rootPath = "DiscoBot\\DSACore\\"; + private static Session s_session; public static List Chars { get; set; } = new List(); // list of all characters @@ -37,6 +39,8 @@ namespace DSACore.DSA_Game } } + public static void start(){} + public static void Startup() { //new .Auxiliary.Calculator.StringSolver("1d100 - (1d200 + 1) * -50000").Solve(); @@ -49,8 +53,8 @@ namespace DSACore.DSA_Game .Where(c => !Talente.Exists(v => v.Name.Equals(c.Name))).ToList().ForEach(v => Talente.Add(v)); } - Properties.Deserialize(); - Properties.Serialize(); + Properties.Deserialize(rootPath+"Properties"); + Properties.Serialize(rootPath + "Properties"); Talente = Talente.OrderBy(x => x.Name).ToList(); Session = new Session diff --git a/DSACore/DSA_Game/Save/Properties.cs b/DSACore/DSA_Game/Save/Properties.cs index f201431..caed278 100644 --- a/DSACore/DSA_Game/Save/Properties.cs +++ b/DSACore/DSA_Game/Save/Properties.cs @@ -35,7 +35,7 @@ namespace DSACore.DSA_Game.Save set => objects["Sound"] = value; } - public static void Deserialize(string path = /*@"..\.."*/@"Properties") + public static void Deserialize(string path = @"Properties") { var files = Directory.GetFiles(path, "*.json"); diff --git a/DSACore/Program.cs b/DSACore/Program.cs index 373a39e..2b2f938 100644 --- a/DSACore/Program.cs +++ b/DSACore/Program.cs @@ -14,9 +14,10 @@ namespace DSACore { public static void Main(string[] args) { + DSA_Game.Dsa.Startup(); CreateWebHostBuilder(args).Build().Run(); } - + public static IWebHostBuilder CreateWebHostBuilder(string[] args) => WebHost.CreateDefaultBuilder(args) .UseStartup(); diff --git a/DSACore/Properties/PublishProfiles/FolderProfile.pubxml b/DSACore/Properties/PublishProfiles/FolderProfile.pubxml new file mode 100644 index 0000000..622bb03 --- /dev/null +++ b/DSACore/Properties/PublishProfiles/FolderProfile.pubxml @@ -0,0 +1,22 @@ + + + + + FileSystem + FileSystem + Release + Any CPU + + True + False + netcoreapp2.1 + 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/PublishProfiles/FolderProfile1.pubxml b/DSACore/Properties/PublishProfiles/FolderProfile1.pubxml new file mode 100644 index 0000000..e929098 --- /dev/null +++ b/DSACore/Properties/PublishProfiles/FolderProfile1.pubxml @@ -0,0 +1,23 @@ + + + + + FileSystem + FileSystem + Release + Any CPU + + True + False + netcoreapp2.1 + win-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 index bcc4406..2da5fec 100644 --- a/DSACore/Properties/launchSettings.json +++ b/DSACore/Properties/launchSettings.json @@ -21,7 +21,7 @@ "commandName": "Project", "launchBrowser": true, "launchUrl": "api/commands", - "applicationUrl": "https://localhost:5001;http://localhost:5000", + "applicationUrl": "https://0.0.0.0:5001;http://0.0.0.0:5000", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } diff --git a/DSACore/Startup.cs b/DSACore/Startup.cs index 2d0c2a3..0628151 100644 --- a/DSACore/Startup.cs +++ b/DSACore/Startup.cs @@ -6,6 +6,7 @@ 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; @@ -25,7 +26,15 @@ 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("AllowSpecificOrigin", + builder => builder.WithOrigins("https://console.firebase.google.com/project/heldenonline-4d828")); + }); + 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. @@ -40,6 +49,8 @@ namespace DSACore app.UseHsts(); } + app.UseSignalR(routes => { routes.MapHub("/chatHub"); }); + app.UseCors("AllowSpecificOrigin"); app.UseHttpsRedirection(); app.UseMvc(); } diff --git a/WebInterface/NodeJSServer/dist/chat.js b/WebInterface/NodeJSServer/dist/chat.js index e72465e..6832cc2 100644 --- a/WebInterface/NodeJSServer/dist/chat.js +++ b/WebInterface/NodeJSServer/dist/chat.js @@ -1,6 +1,6 @@ "use strict"; -var connection = new signalR.HubConnectionBuilder().withUrl("https://localhost:44365/chatHub").build(); +var connection = new signalR.HubConnectionBuilder().withUrl("https://192.168.2.58:5001/chatHub").build(); connection.on("ReceiveMessage", function (user, message) { var msg = message.replace(/&/g, "&").replace(//g, ">"); diff --git a/ZooBOTanica/App.config b/ZooBOTanica/App.config index 731f6de..ecdcf8a 100644 --- a/ZooBOTanica/App.config +++ b/ZooBOTanica/App.config @@ -1,6 +1,6 @@ - + - + - \ No newline at end of file + diff --git a/ZooBOTanica/Properties/Resources.Designer.cs b/ZooBOTanica/Properties/Resources.Designer.cs index 877b16a..806f71d 100644 --- a/ZooBOTanica/Properties/Resources.Designer.cs +++ b/ZooBOTanica/Properties/Resources.Designer.cs @@ -1,69 +1,61 @@ //------------------------------------------------------------------------------ // // Dieser Code wurde von einem Tool generiert. -// Laufzeitversion: 4.0.30319.42000 +// Laufzeitversion:4.0.30319.42000 // -// Änderungen an dieser Datei können fehlerhaftes Verhalten verursachen und gehen verloren, wenn -// der Code neu generiert wird. +// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn +// der Code erneut generiert wird. // //------------------------------------------------------------------------------ -namespace ZooBOTanica.Properties -{ - - +namespace ZooBOTanica.Properties { + using System; + + /// /// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw. /// - // Diese Klasse wurde von der StronglyTypedResourceBuilder-Klasse - // über ein Tool wie ResGen oder Visual Studio automatisch generiert. + // 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 Option /str erneut aus, oder erstellen Sie Ihr VS-Projekt neu. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + // 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 - { - + 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() - { + 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 ((resourceMan == null)) - { + 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 - /// Ressourcenlookups, die diese stark typisierte Ressourcenklasse verwenden. + /// Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture - { - get - { + internal static global::System.Globalization.CultureInfo Culture { + get { return resourceCulture; } - set - { + set { resourceCulture = value; } } diff --git a/ZooBOTanica/Properties/Settings.Designer.cs b/ZooBOTanica/Properties/Settings.Designer.cs index a8ccad5..9211d5f 100644 --- a/ZooBOTanica/Properties/Settings.Designer.cs +++ b/ZooBOTanica/Properties/Settings.Designer.cs @@ -1,28 +1,24 @@ //------------------------------------------------------------------------------ // -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 +// Dieser Code wurde von einem Tool generiert. +// Laufzeitversion:4.0.30319.42000 // -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn +// der Code erneut generiert wird. // //------------------------------------------------------------------------------ -namespace ZooBOTanica.Properties -{ - - +namespace ZooBOTanica.Properties { + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase - { - + [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 - { + + public static Settings Default { + get { return defaultInstance; } } diff --git a/ZooBOTanica/ZooBOTanica.csproj b/ZooBOTanica/ZooBOTanica.csproj index 6ef8507..086eb64 100644 --- a/ZooBOTanica/ZooBOTanica.csproj +++ b/ZooBOTanica/ZooBOTanica.csproj @@ -8,9 +8,10 @@ WinExe ZooBOTanica ZooBOTanica - v4.6.1 + v4.7.2 512 true + AnyCPU @@ -65,6 +66,7 @@ True Resources.resx + True SettingsSingleFileGenerator -- cgit v1.2.3-54-g00ecf