summaryrefslogtreecommitdiff
path: root/DSACore
diff options
context:
space:
mode:
authoruzvkl <dennis.kobert@student.kit.edu>2019-06-11 23:33:41 +0200
committeruzvkl <dennis.kobert@student.kit.edu>2019-06-11 23:33:41 +0200
commitaf74efccf8d21e6151022b71f3cacd3fa83024ee (patch)
tree20f383065d5cadea36e8d11d4bb3b35eca99f691 /DSACore
parente6181c24124d97f2fbc932b8a68311e625463156 (diff)
Seperate the Core from dsa gamelogic
Diffstat (limited to 'DSACore')
-rw-r--r--DSACore/Controllers/CommandsController.cs56
-rw-r--r--DSACore/Controllers/LobbyController.cs32
-rw-r--r--DSACore/Controllers/TokensController.cs25
-rw-r--r--DSACore/Controllers/ValuesController.cs45
-rw-r--r--DSACore/DSACore.csproj28
-rw-r--r--DSACore/Hubs/Login.cs205
-rw-r--r--DSACore/Models/Network/Group.cs43
-rw-r--r--DSACore/Models/Network/Token.cs21
-rw-r--r--DSACore/Models/Network/User.cs9
-rw-r--r--DSACore/Program.cs24
-rw-r--r--DSACore/Properties/DSALib-Auxiliary-CommandInfo.json101
-rw-r--r--DSACore/Properties/DSALib-DSA_Game-Characters-Character.json290
-rw-r--r--DSACore/Properties/PublishProfiles/FolderProfile.pubxml23
-rw-r--r--DSACore/Properties/PublishProfiles/FolderProfile1.pubxml23
-rw-r--r--DSACore/Properties/launchSettings.json30
-rw-r--r--DSACore/Startup.cs47
-rw-r--r--DSACore/appsettings.Development.json9
-rw-r--r--DSACore/appsettings.json10
18 files changed, 1021 insertions, 0 deletions
diff --git a/DSACore/Controllers/CommandsController.cs b/DSACore/Controllers/CommandsController.cs
new file mode 100644
index 0000000..b6e0be2
--- /dev/null
+++ b/DSACore/Controllers/CommandsController.cs
@@ -0,0 +1,56 @@
+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/<controller>
+ [HttpGet]
+ public string Get()
+ {
+ return "Usage: post the command to execute";
+ }
+
+ // GET api/<controller>/5
+ /*[HttpGet("{id}")]
+ public string Get(int id)
+ {
+ return "value";
+ }*/
+
+ // POST api/<controller>/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/<controller>/5
+ [HttpPut("{id}")]
+ public void Put(int id, [FromBody]string value)
+ {
+ }
+
+ // DELETE api/<controller>/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
new file mode 100644
index 0000000..7890b4f
--- /dev/null
+++ b/DSACore/Controllers/LobbyController.cs
@@ -0,0 +1,32 @@
+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/<controller>
+ [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
new file mode 100644
index 0000000..a85cabe
--- /dev/null
+++ b/DSACore/Controllers/TokensController.cs
@@ -0,0 +1,25 @@
+using DSACore.Hubs;
+using Microsoft.AspNetCore.Mvc;
+
+namespace DSACore.Controllers
+{
+ [Route("lobby/[controller]")]
+ [ApiController]
+ public class TokensController : Controller
+ {
+ // GET
+ [HttpGet("{token}")]
+ public ActionResult<string> 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
new file mode 100644
index 0000000..eb08898
--- /dev/null
+++ b/DSACore/Controllers/ValuesController.cs
@@ -0,0 +1,45 @@
+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<IEnumerable<string>> Get()
+ {
+ return new string[] { "value1", "value2" };
+ }
+
+ // GET api/values/5
+ [HttpGet("{id}")]
+ public ActionResult<string> 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
new file mode 100644
index 0000000..b350c64
--- /dev/null
+++ b/DSACore/DSACore.csproj
@@ -0,0 +1,28 @@
+<Project Sdk="Microsoft.NET.Sdk.Web">
+
+ <PropertyGroup>
+ <TargetFramework>netcoreapp2.2</TargetFramework>
+ <StartupObject>DSACore.Program</StartupObject>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <Compile Remove="wwwroot\**" />
+ <Content Remove="wwwroot\**" />
+ <EmbeddedResource Remove="wwwroot\**" />
+ <None Remove="wwwroot\**" />
+ </ItemGroup>
+
+ <ItemGroup>
+ <PackageReference Include="Microsoft.AspNetCore.App" />
+ </ItemGroup>
+
+ <ItemGroup>
+ <ProjectReference Include="..\dsa\DSALib\DSALib.csproj" />
+ <ProjectReference Include="..\dsa\FireBase\FireBase.csproj" />
+ </ItemGroup>
+
+ <ItemGroup>
+ <Compile Remove="Controllers\ValuesController.cs" />
+ </ItemGroup>
+
+</Project>
diff --git a/DSACore/Hubs/Login.cs b/DSACore/Hubs/Login.cs
new file mode 100644
index 0000000..f08c24a
--- /dev/null
+++ b/DSACore/Hubs/Login.cs
@@ -0,0 +1,205 @@
+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<string, User> UserGroup = new Dictionary<string, User>();
+
+ 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<Group> DsaGroups { get; }
+ public static List<Token> Tokens { get; } = new List<Token>();
+
+
+ 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
new file mode 100644
index 0000000..efe12ee
--- /dev/null
+++ b/DSACore/Models/Network/Group.cs
@@ -0,0 +1,43 @@
+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<User> Users { get; set; } = new List<User>();
+
+ 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
new file mode 100644
index 0000000..451cafc
--- /dev/null
+++ b/DSACore/Models/Network/Token.cs
@@ -0,0 +1,21 @@
+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
new file mode 100644
index 0000000..8b8008c
--- /dev/null
+++ b/DSACore/Models/Network/User.cs
@@ -0,0 +1,9 @@
+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
new file mode 100644
index 0000000..8af0a74
--- /dev/null
+++ b/DSACore/Program.cs
@@ -0,0 +1,24 @@
+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<Startup>()
+ .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
new file mode 100644
index 0000000..b9941f2
--- /dev/null
+++ b/DSACore/Properties/DSALib-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/Properties/DSALib-DSA_Game-Characters-Character.json b/DSACore/Properties/DSALib-DSA_Game-Characters-Character.json
new file mode 100644
index 0000000..fd387f5
--- /dev/null
+++ b/DSACore/Properties/DSALib-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/Properties/PublishProfiles/FolderProfile.pubxml b/DSACore/Properties/PublishProfiles/FolderProfile.pubxml
new file mode 100644
index 0000000..2fd07c5
--- /dev/null
+++ b/DSACore/Properties/PublishProfiles/FolderProfile.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>
+ <ProjectGuid>35a5e2cc-0fd4-4bc0-acbf-38599caed1c4</ProjectGuid>
+ <SelfContained>false</SelfContained>
+ <_IsPortable>true</_IsPortable>
+ <publishUrl>bin\Release\netcoreapp2.1\publish\</publishUrl>
+ <DeleteExistingFiles>False</DeleteExistingFiles>
+ <RuntimeIdentifier>win-x64</RuntimeIdentifier>
+ </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..e03b55a
--- /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>linux-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
new file mode 100644
index 0000000..2da5fec
--- /dev/null
+++ b/DSACore/Properties/launchSettings.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://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
new file mode 100644
index 0000000..ef22802
--- /dev/null
+++ b/DSACore/Startup.cs
@@ -0,0 +1,47 @@
+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<Users>("/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
new file mode 100644
index 0000000..e203e94
--- /dev/null
+++ b/DSACore/appsettings.Development.json
@@ -0,0 +1,9 @@
+{
+ "Logging": {
+ "LogLevel": {
+ "Default": "Debug",
+ "System": "Information",
+ "Microsoft": "Information"
+ }
+ }
+}
diff --git a/DSACore/appsettings.json b/DSACore/appsettings.json
new file mode 100644
index 0000000..dee968c
--- /dev/null
+++ b/DSACore/appsettings.json
@@ -0,0 +1,10 @@
+{
+ "Logging": {
+ "LogLevel": {
+ "Microsoft.AspNetCore.SignalR": "Debug",
+ "Microsoft.AspNetCore.Http.Connections": "Debug",
+ "Default": "Debug"
+ }
+ },
+ "AllowedHosts": "*"
+}