summaryrefslogtreecommitdiff
path: root/DSACore
diff options
context:
space:
mode:
Diffstat (limited to 'DSACore')
-rw-r--r--DSACore/Commands/CommandHandler.cs3
-rw-r--r--DSACore/DSACore.csproj2
-rw-r--r--DSACore/DSA_Game/Dsa.cs4
-rw-r--r--DSACore/DSA_Game/Save/Session.cs2
-rw-r--r--DSACore/FireBase/Database.cs24
-rw-r--r--DSACore/Hubs/ChatHub.cs40
-rw-r--r--DSACore/Models/User.cs13
-rw-r--r--DSACore/Properties/PublishProfiles/FolderProfile1.pubxml2
-rw-r--r--DSACore/Properties/launchSettings.json2
-rw-r--r--DSACore/PropertiesDSACore-Audio-Sound.json7
-rw-r--r--DSACore/PropertiesDSACore-Auxiliary-CommandInfo.json101
-rw-r--r--DSACore/PropertiesDSACore-DSA_Game-Characters-Character.json290
-rw-r--r--DSACore/PropertiesNewtonsoft-Json-Linq-JProperty.json30
-rw-r--r--DSACore/Startup.cs21
14 files changed, 531 insertions, 10 deletions
diff --git a/DSACore/Commands/CommandHandler.cs b/DSACore/Commands/CommandHandler.cs
index 446f99e..4b6ca42 100644
--- a/DSACore/Commands/CommandHandler.cs
+++ b/DSACore/Commands/CommandHandler.cs
@@ -97,7 +97,6 @@ namespace DSACore.Commands
private static string CheckCommand(string name, CommandTypes command, string waffe, int erschwernis = 0)
{
var chr = Dsa.GetCharacter(0);
- throw new NotImplementedException("access char by id ore name and group id");
switch (command)
{
@@ -116,6 +115,8 @@ namespace DSACore.Commands
}
return $"{name} verwendet {waffe}";
+
+ throw new NotImplementedException("access char by id ore name and group id");
}
}
}
diff --git a/DSACore/DSACore.csproj b/DSACore/DSACore.csproj
index 67bd4ab..ad760c2 100644
--- a/DSACore/DSACore.csproj
+++ b/DSACore/DSACore.csproj
@@ -2,6 +2,7 @@
<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
+ <StartupObject>DSACore.Program</StartupObject>
</PropertyGroup>
<ItemGroup>
@@ -14,6 +15,7 @@
<ItemGroup>
<ProjectReference Include="..\DSALib\DSALib.csproj" />
+ <ProjectReference Include="..\FireBase\FireBase.csproj" />
</ItemGroup>
</Project>
diff --git a/DSACore/DSA_Game/Dsa.cs b/DSACore/DSA_Game/Dsa.cs
index 7258e8c..94de194 100644
--- a/DSACore/DSA_Game/Dsa.cs
+++ b/DSACore/DSA_Game/Dsa.cs
@@ -13,7 +13,7 @@ namespace DSACore.DSA_Game
public static class Dsa
{
- public const string rootPath = "DiscoBot\\DSACore\\";
+ public const string rootPath = "";//"DiscoBot\\DSACore\\";
private static Session s_session;
@@ -46,7 +46,7 @@ namespace DSACore.DSA_Game
//new .Auxiliary.Calculator.StringSolver("1d100 - (1d200 + 1) * -50000").Solve();
/*Session = new Session();*/
// relation.Add("Papo", "Pump aus der Gosse");
- foreach (var filename in Directory.GetFiles("helden", "*.xml"))
+ foreach (var filename in Directory.GetFiles(rootPath + "helden", "*.xml"))
{
Chars.Add(new Character(filename));
(Chars.Last() as Character)?.Talente.Select(x => new Talent(x.Name, x.Probe, 0))
diff --git a/DSACore/DSA_Game/Save/Session.cs b/DSACore/DSA_Game/Save/Session.cs
index d343920..b402656 100644
--- a/DSACore/DSA_Game/Save/Session.cs
+++ b/DSACore/DSA_Game/Save/Session.cs
@@ -9,7 +9,7 @@ namespace DSACore.DSA_Game.Save
public class Session
{
- public static string DirectoryPath { get; set; } = @"sessions";
+ public static string DirectoryPath { get; set; } = Dsa.rootPath + @"sessions";
public Dictionary<string, string> Relation { get; set; } = new Dictionary<string, string>(); // dictionary to match the char
diff --git a/DSACore/FireBase/Database.cs b/DSACore/FireBase/Database.cs
new file mode 100644
index 0000000..cd21c00
--- /dev/null
+++ b/DSACore/FireBase/Database.cs
@@ -0,0 +1,24 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using Firebase.Database;
+using Firebase.Database.Query;
+
+
+namespace DSACore.FireBase
+{
+ public static class Database
+ {
+ static Database()
+ {
+ var auth = "ABCDE"; // your app secret
+ var firebaseClient = new FirebaseClient(
+ "<URL>",
+ new FirebaseOptions
+ {
+ AuthTokenAsyncFactory = () => Task.FromResult(auth)
+ });
+ }
+ }
+}
diff --git a/DSACore/Hubs/ChatHub.cs b/DSACore/Hubs/ChatHub.cs
index 6af8c38..a8bf883 100644
--- a/DSACore/Hubs/ChatHub.cs
+++ b/DSACore/Hubs/ChatHub.cs
@@ -2,15 +2,53 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
+using DSACore.Models;
using Microsoft.AspNetCore.SignalR;
namespace DSACore.Hubs
{
public class ChatHub : Hub
{
+ private static Dictionary<string, User> UserGroup;
+
public async Task SendMessage(string user, string message)
{
- await Clients.All.SendAsync("ReciveMessage", user, message);
+ var args = message.Split(' ', StringSplitOptions.RemoveEmptyEntries).ToList();
+ var ident = args.First().Replace("!", "");
+ if(args.Count>0){args.RemoveAt(0);}
+
+ await SendToGroup(UserGroup[Context.ConnectionId].Group, user, Commands.CommandHandler.ExecuteCommand(new Command{CharId = 0,CmdIdentifier = ident, CmdTexts = args, Name = user}));
+ }
+
+ private Task SendToGroup(string group, string user, string message)
+ {
+ return Clients.Group(group).SendCoreAsync("ReceiveMessage", new object[] { user, message });
+ }
+
+ public async Task GetGroups()
+ {
+ await Clients.Caller.SendCoreAsync("ListGroups", new object[] { "TheCrew", "Testdata" });
+ throw new NotImplementedException("add database call to get groups");
+ }
+
+ public async Task Login(string group, string password)
+ {
+ if (password == "valid")
+ {
+ UserGroup.Add(Context.ConnectionId, new User{Group = group});
+ await Groups.AddToGroupAsync(Context.ConnectionId, group);
+ }
+
+ await SendToGroup(group, "", "Ein neuer Nutzer hat die Gruppe betreten");
+ }
+
+ public async Task Disconnect()
+ {
+ var user = UserGroup[Context.ConnectionId];
+ await Groups.RemoveFromGroupAsync(Context.ConnectionId, user.Group);
+
+ await SendToGroup(user.Group, user.Name, "Connection lost");
}
+
}
}
diff --git a/DSACore/Models/User.cs b/DSACore/Models/User.cs
new file mode 100644
index 0000000..105e564
--- /dev/null
+++ b/DSACore/Models/User.cs
@@ -0,0 +1,13 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+
+namespace DSACore.Models
+{
+ public class User
+ {
+ public string Name { get; set; }
+ public string Group { get; set; }
+ }
+}
diff --git a/DSACore/Properties/PublishProfiles/FolderProfile1.pubxml b/DSACore/Properties/PublishProfiles/FolderProfile1.pubxml
index e929098..e03b55a 100644
--- a/DSACore/Properties/PublishProfiles/FolderProfile1.pubxml
+++ b/DSACore/Properties/PublishProfiles/FolderProfile1.pubxml
@@ -13,7 +13,7 @@ indem Sie diese MSBuild-Datei bearbeiten. Weitere Informationen hierzu finden Si
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<ExcludeApp_Data>False</ExcludeApp_Data>
<TargetFramework>netcoreapp2.1</TargetFramework>
- <RuntimeIdentifier>win-x64</RuntimeIdentifier>
+ <RuntimeIdentifier>linux-x64</RuntimeIdentifier>
<ProjectGuid>35a5e2cc-0fd4-4bc0-acbf-38599caed1c4</ProjectGuid>
<SelfContained>false</SelfContained>
<_IsPortable>true</_IsPortable>
diff --git a/DSACore/Properties/launchSettings.json b/DSACore/Properties/launchSettings.json
index 2da5fec..50d10a9 100644
--- a/DSACore/Properties/launchSettings.json
+++ b/DSACore/Properties/launchSettings.json
@@ -21,7 +21,7 @@
"commandName": "Project",
"launchBrowser": true,
"launchUrl": "api/commands",
- "applicationUrl": "https://0.0.0.0:5001;http://0.0.0.0:5000",
+ "applicationUrl": "https://192.168.2.58:5001;http://192.168.2.58:5000",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
diff --git a/DSACore/PropertiesDSACore-Audio-Sound.json b/DSACore/PropertiesDSACore-Audio-Sound.json
new file mode 100644
index 0000000..87a0e6b
--- /dev/null
+++ b/DSACore/PropertiesDSACore-Audio-Sound.json
@@ -0,0 +1,7 @@
+[
+ {
+ "Name": "Test",
+ "Url": "http",
+ "Volume": 100
+ }
+] \ No newline at end of file
diff --git a/DSACore/PropertiesDSACore-Auxiliary-CommandInfo.json b/DSACore/PropertiesDSACore-Auxiliary-CommandInfo.json
new file mode 100644
index 0000000..b9941f2
--- /dev/null
+++ b/DSACore/PropertiesDSACore-Auxiliary-CommandInfo.json
@@ -0,0 +1,101 @@
+[
+ {
+ "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/PropertiesDSACore-DSA_Game-Characters-Character.json b/DSACore/PropertiesDSACore-DSA_Game-Characters-Character.json
new file mode 100644
index 0000000..fd387f5
--- /dev/null
+++ b/DSACore/PropertiesDSACore-DSA_Game-Characters-Character.json
@@ -0,0 +1,290 @@
+[
+ {
+ "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/PropertiesNewtonsoft-Json-Linq-JProperty.json b/DSACore/PropertiesNewtonsoft-Json-Linq-JProperty.json
new file mode 100644
index 0000000..5b400e5
--- /dev/null
+++ b/DSACore/PropertiesNewtonsoft-Json-Linq-JProperty.json
@@ -0,0 +1,30 @@
+{
+ "$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://192.168.2.58:5001;http://192.168.2.58:5000",
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/DSACore/Startup.cs b/DSACore/Startup.cs
index 0628151..c189436 100644
--- a/DSACore/Startup.cs
+++ b/DSACore/Startup.cs
@@ -26,12 +26,23 @@ 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.WithOrigins("https://dsa.truekuehli.de")
+ .WithHeaders("Access-Control-Allow-Origin")
+ .AllowAnyHeader()
+ .AllowAnyMethod()
+ .AllowCredentials();
+ }));
+ /*
services.AddCors(options =>
{
options.AddPolicy("AllowSpecificOrigin",
- builder => builder.WithOrigins("https://console.firebase.google.com/project/heldenonline-4d828"));
+ builder => builder.AllowAnyMethod().AllowAnyHeader().AllowAnyOrigin().AllowCredentials()/*WithOrigins("https://dsa.truekuehli.de")#1#);
});
+*/
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
services.AddSignalR();
@@ -49,9 +60,13 @@ namespace DSACore
app.UseHsts();
}
+ app.UseCors("CorsPolicy");
+
app.UseSignalR(routes => { routes.MapHub<ChatHub>("/chatHub"); });
- app.UseCors("AllowSpecificOrigin");
- app.UseHttpsRedirection();
+
+
+ //app.UseCors("AllowSpecificOrigin");
+ //app.UseHttpsRedirection();
app.UseMvc();
}
}