diff options
-rw-r--r-- | DSACore/DSA_Game/Dsa.cs | 8 | ||||
-rw-r--r-- | DSACore/DSA_Game/Save/Properties.cs | 2 | ||||
-rw-r--r-- | DSACore/Program.cs | 3 | ||||
-rw-r--r-- | DSACore/Properties/PublishProfiles/FolderProfile.pubxml | 22 | ||||
-rw-r--r-- | DSACore/Properties/PublishProfiles/FolderProfile1.pubxml | 23 | ||||
-rw-r--r-- | DSACore/Properties/launchSettings.json | 2 | ||||
-rw-r--r-- | DSACore/Startup.cs | 11 | ||||
-rw-r--r-- | WebInterface/NodeJSServer/dist/chat.js | 2 | ||||
-rw-r--r-- | ZooBOTanica/App.config | 6 | ||||
-rw-r--r-- | ZooBOTanica/Properties/Resources.Designer.cs | 58 | ||||
-rw-r--r-- | ZooBOTanica/Properties/Settings.Designer.cs | 30 | ||||
-rw-r--r-- | ZooBOTanica/ZooBOTanica.csproj | 4 |
12 files changed, 111 insertions, 60 deletions
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<ICharacter> Chars { get; set; } = new List<ICharacter>(); // 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<Startup>(); 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 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +Diese Datei wird vom Veröffentlichungs-/Paketierungsprozess Ihres Webprojekts verwendet. Sie können das Verhalten dieses Prozesses anpassen, +indem Sie diese MSBuild-Datei bearbeiten. Weitere Informationen hierzu finden Sie unter https://go.microsoft.com/fwlink/?LinkID=208121. +--> +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <WebPublishMethod>FileSystem</WebPublishMethod> + <PublishProvider>FileSystem</PublishProvider> + <LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration> + <LastUsedPlatform>Any CPU</LastUsedPlatform> + <SiteUrlToLaunchAfterPublish /> + <LaunchSiteAfterPublish>True</LaunchSiteAfterPublish> + <ExcludeApp_Data>False</ExcludeApp_Data> + <TargetFramework>netcoreapp2.1</TargetFramework> + <ProjectGuid>35a5e2cc-0fd4-4bc0-acbf-38599caed1c4</ProjectGuid> + <SelfContained>false</SelfContained> + <_IsPortable>true</_IsPortable> + <publishUrl>bin\Release\netcoreapp2.1\publish\</publishUrl> + <DeleteExistingFiles>False</DeleteExistingFiles> + </PropertyGroup> +</Project>
\ 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 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +Diese Datei wird vom Veröffentlichungs-/Paketierungsprozess Ihres Webprojekts verwendet. Sie können das Verhalten dieses Prozesses anpassen, +indem Sie diese MSBuild-Datei bearbeiten. Weitere Informationen hierzu finden Sie unter https://go.microsoft.com/fwlink/?LinkID=208121. +--> +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <WebPublishMethod>FileSystem</WebPublishMethod> + <PublishProvider>FileSystem</PublishProvider> + <LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration> + <LastUsedPlatform>Any CPU</LastUsedPlatform> + <SiteUrlToLaunchAfterPublish /> + <LaunchSiteAfterPublish>True</LaunchSiteAfterPublish> + <ExcludeApp_Data>False</ExcludeApp_Data> + <TargetFramework>netcoreapp2.1</TargetFramework> + <RuntimeIdentifier>win-x64</RuntimeIdentifier> + <ProjectGuid>35a5e2cc-0fd4-4bc0-acbf-38599caed1c4</ProjectGuid> + <SelfContained>false</SelfContained> + <_IsPortable>true</_IsPortable> + <publishUrl>bin\Release\netcoreapp2.1\publish\</publishUrl> + <DeleteExistingFiles>False</DeleteExistingFiles> + </PropertyGroup> +</Project>
\ 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>("/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, "<").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 @@ -<?xml version="1.0" encoding="utf-8" ?> +<?xml version="1.0" encoding="utf-8"?> <configuration> <startup> - <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" /> + <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2"/> </startup> -</configuration>
\ No newline at end of file +</configuration> 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 @@ //------------------------------------------------------------------------------ // <auto-generated> // 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. // </auto-generated> //------------------------------------------------------------------------------ -namespace ZooBOTanica.Properties -{ - - +namespace ZooBOTanica.Properties { + using System; + + /// <summary> /// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw. /// </summary> - // 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() { } - + /// <summary> /// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird. /// </summary> [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; } } - + /// <summary> /// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle - /// Ressourcenlookups, die diese stark typisierte Ressourcenklasse verwenden. + /// Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden. /// </summary> [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 @@ //------------------------------------------------------------------------------ // <auto-generated> -// 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. // </auto-generated> //------------------------------------------------------------------------------ -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 @@ <OutputType>WinExe</OutputType> <RootNamespace>ZooBOTanica</RootNamespace> <AssemblyName>ZooBOTanica</AssemblyName> - <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> + <TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion> <FileAlignment>512</FileAlignment> <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> + <TargetFrameworkProfile /> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PlatformTarget>AnyCPU</PlatformTarget> @@ -65,6 +66,7 @@ <Compile Include="Properties\Resources.Designer.cs"> <AutoGen>True</AutoGen> <DependentUpon>Resources.resx</DependentUpon> + <DesignTime>True</DesignTime> </Compile> <None Include="Properties\Settings.settings"> <Generator>SettingsSingleFileGenerator</Generator> |