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 +++++++++++ 7 files changed, 66 insertions(+), 5 deletions(-) create mode 100644 DSACore/Properties/PublishProfiles/FolderProfile.pubxml create mode 100644 DSACore/Properties/PublishProfiles/FolderProfile1.pubxml (limited to 'DSACore') 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(); } -- cgit v1.2.3-70-g09d2