From ad0a46175e7efbbd5bdf952aacc69d8a7750b05a Mon Sep 17 00:00:00 2001 From: TrueDoctor Date: Thu, 27 Sep 2018 23:46:43 +0200 Subject: implemented rudemetary groups --- DSACore/DSA_Game/Dsa.cs | 4 +- DSACore/DSA_Game/Save/Session.cs | 2 +- DSACore/Hubs/ChatHub.cs | 31 ++- DSACore/Properties/launchSettings.json | 2 +- DSACore/PropertiesDSACore-Audio-Sound.json | 7 + .../PropertiesDSACore-Auxiliary-CommandInfo.json | 101 +++++++ ...rtiesDSACore-DSA_Game-Characters-Character.json | 290 +++++++++++++++++++++ .../PropertiesNewtonsoft-Json-Linq-JProperty.json | 30 +++ DSACore/Startup.cs | 21 +- 9 files changed, 480 insertions(+), 8 deletions(-) create mode 100644 DSACore/PropertiesDSACore-Audio-Sound.json create mode 100644 DSACore/PropertiesDSACore-Auxiliary-CommandInfo.json create mode 100644 DSACore/PropertiesDSACore-DSA_Game-Characters-Character.json create mode 100644 DSACore/PropertiesNewtonsoft-Json-Linq-JProperty.json 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 Relation { get; set; } = new Dictionary(); // dictionary to match the char diff --git a/DSACore/Hubs/ChatHub.cs b/DSACore/Hubs/ChatHub.cs index 6af8c38..9cd7aed 100644 --- a/DSACore/Hubs/ChatHub.cs +++ b/DSACore/Hubs/ChatHub.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; +using DSACore.Models; using Microsoft.AspNetCore.SignalR; namespace DSACore.Hubs @@ -10,7 +11,35 @@ namespace DSACore.Hubs { public async Task SendMessage(string user, string message) { - await Clients.All.SendAsync("ReciveMessage", user, message); + string group = "default"; + var args = message.Split(' ', StringSplitOptions.RemoveEmptyEntries).ToList(); + var ident = args.First().Replace("!", ""); + if(args.Count>0){args.RemoveAt(0);} + + await SendToGroup(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 Login(string group, string password) + { + if (password == "valid") + { + await Groups.AddToGroupAsync(Context.ConnectionId, group); + } + + await SendToGroup(group, "", "Ein neuer Nutzer hat die Gruppe betreten"); + } + + public async Task Disconnect(string group, string user) + { + await Groups.RemoveFromGroupAsync(Context.ConnectionId, group); + + await SendToGroup(group, user, "Connection lost"); + } + } } 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"); }); - app.UseCors("AllowSpecificOrigin"); - app.UseHttpsRedirection(); + + + //app.UseCors("AllowSpecificOrigin"); + //app.UseHttpsRedirection(); app.UseMvc(); } } -- cgit v1.3.1 From 043cdb904dbe171b6feeb3addf08664a02ab7579 Mon Sep 17 00:00:00 2001 From: TrueDoctor Date: Fri, 28 Sep 2018 00:53:05 +0200 Subject: added FirestoreApis --- DSACore/DSACore.csproj | 2 ++ DSACore/Properties/PublishProfiles/FolderProfile1.pubxml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/DSACore/DSACore.csproj b/DSACore/DSACore.csproj index 67bd4ab..da2feec 100644 --- a/DSACore/DSACore.csproj +++ b/DSACore/DSACore.csproj @@ -9,6 +9,8 @@ + + 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 True False netcoreapp2.1 - win-x64 + linux-x64 35a5e2cc-0fd4-4bc0-acbf-38599caed1c4 false <_IsPortable>true -- cgit v1.3.1 From edb346d1e6599dbe48ec257f3536f6021163673c Mon Sep 17 00:00:00 2001 From: TrueDoctor Date: Fri, 28 Sep 2018 15:16:59 +0200 Subject: added some validation functionality --- DSACore/Hubs/ChatHub.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/DSACore/Hubs/ChatHub.cs b/DSACore/Hubs/ChatHub.cs index 9cd7aed..c429d52 100644 --- a/DSACore/Hubs/ChatHub.cs +++ b/DSACore/Hubs/ChatHub.cs @@ -24,6 +24,11 @@ namespace DSACore.Hubs return Clients.Group(group).SendCoreAsync("ReceiveMessage", new object[] { user, message }); } + public async Task GetGroups() + { + await Clients.Caller.SendCoreAsync("ListGroups", new object[] { "TheCrew", "Testdata" }); + } + public async Task Login(string group, string password) { if (password == "valid") -- cgit v1.3.1 From 9aa97350b7144181c075aec5d44b818a74f2b7e8 Mon Sep 17 00:00:00 2001 From: Dennis Kobert Date: Fri, 28 Sep 2018 15:27:00 +0200 Subject: added client side group authentification --- DiscoBot.sln | 32 +++++++--- WebInterface/NodeJSServer/NodeJSServer.njsproj | 84 ++++++++++++++++++++++++++ WebInterface/NodeJSServer/dist/chat.js | 12 +++- WebInterface/NodeJSServer/dist/index.html | 11 ++-- 4 files changed, 127 insertions(+), 12 deletions(-) create mode 100644 WebInterface/NodeJSServer/NodeJSServer.njsproj diff --git a/DiscoBot.sln b/DiscoBot.sln index 7aab504..0ac2cf2 100644 --- a/DiscoBot.sln +++ b/DiscoBot.sln @@ -7,11 +7,29 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DiscoBot", "DiscoBot\DiscoB EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ZooBOTanica", "ZooBOTanica\ZooBOTanica.csproj", "{58917D99-DC94-4CDD-AD2B-C6E0BAFFCF47}" EndProject -Project("{9092AA53-FB77-4645-B42D-1CCCA6BD08BD}") = "NodeJSServer", "NodeJSServer\NodeJSServer.njsproj", "{57064377-C08C-4218-9C55-0552D40F3877}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DSALib", "DSALib\DSALib.csproj", "{388DD4ED-29C4-4127-AC8F-34DD3FE9F9B0}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DSACore", "DSACore\DSACore.csproj", "{35A5E2CC-0FD4-4BC0-ACBF-38599CAED1C4}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DSACore", "DSACore\DSACore.csproj", "{35A5E2CC-0FD4-4BC0-ACBF-38599CAED1C4}" +EndProject +Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "WebInterface", "WebInterface\", "{9B03E3A4-E233-41DF-AC13-BED4812B3D27}" + ProjectSection(WebsiteProperties) = preProject + TargetFrameworkMoniker = ".NETFramework,Version%3Dv4.0" + Debug.AspNetCompiler.VirtualPath = "/localhost_3664" + Debug.AspNetCompiler.PhysicalPath = "WebInterface\" + Debug.AspNetCompiler.TargetPath = "PrecompiledWeb\localhost_3664\" + Debug.AspNetCompiler.Updateable = "true" + Debug.AspNetCompiler.ForceOverwrite = "true" + Debug.AspNetCompiler.FixedNames = "false" + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.VirtualPath = "/localhost_3664" + Release.AspNetCompiler.PhysicalPath = "WebInterface\" + Release.AspNetCompiler.TargetPath = "PrecompiledWeb\localhost_3664\" + Release.AspNetCompiler.Updateable = "true" + Release.AspNetCompiler.ForceOverwrite = "true" + Release.AspNetCompiler.FixedNames = "false" + Release.AspNetCompiler.Debug = "False" + VWDPort = "3664" + EndProjectSection EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -27,10 +45,6 @@ Global {58917D99-DC94-4CDD-AD2B-C6E0BAFFCF47}.Debug|Any CPU.Build.0 = Debug|Any CPU {58917D99-DC94-4CDD-AD2B-C6E0BAFFCF47}.Release|Any CPU.ActiveCfg = Release|Any CPU {58917D99-DC94-4CDD-AD2B-C6E0BAFFCF47}.Release|Any CPU.Build.0 = Release|Any CPU - {57064377-C08C-4218-9C55-0552D40F3877}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {57064377-C08C-4218-9C55-0552D40F3877}.Debug|Any CPU.Build.0 = Debug|Any CPU - {57064377-C08C-4218-9C55-0552D40F3877}.Release|Any CPU.ActiveCfg = Release|Any CPU - {57064377-C08C-4218-9C55-0552D40F3877}.Release|Any CPU.Build.0 = Release|Any CPU {388DD4ED-29C4-4127-AC8F-34DD3FE9F9B0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {388DD4ED-29C4-4127-AC8F-34DD3FE9F9B0}.Debug|Any CPU.Build.0 = Debug|Any CPU {388DD4ED-29C4-4127-AC8F-34DD3FE9F9B0}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -39,6 +53,10 @@ Global {35A5E2CC-0FD4-4BC0-ACBF-38599CAED1C4}.Debug|Any CPU.Build.0 = Debug|Any CPU {35A5E2CC-0FD4-4BC0-ACBF-38599CAED1C4}.Release|Any CPU.ActiveCfg = Release|Any CPU {35A5E2CC-0FD4-4BC0-ACBF-38599CAED1C4}.Release|Any CPU.Build.0 = Release|Any CPU + {9B03E3A4-E233-41DF-AC13-BED4812B3D27}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9B03E3A4-E233-41DF-AC13-BED4812B3D27}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9B03E3A4-E233-41DF-AC13-BED4812B3D27}.Release|Any CPU.ActiveCfg = Debug|Any CPU + {9B03E3A4-E233-41DF-AC13-BED4812B3D27}.Release|Any CPU.Build.0 = Debug|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/WebInterface/NodeJSServer/NodeJSServer.njsproj b/WebInterface/NodeJSServer/NodeJSServer.njsproj new file mode 100644 index 0000000..6181774 --- /dev/null +++ b/WebInterface/NodeJSServer/NodeJSServer.njsproj @@ -0,0 +1,84 @@ + + + + Debug + 2.0 + {687040f4-1ffd-41aa-b4ca-e132a3d1fb15} + . + ShowAllFiles + webpack.config.js + . + . + {3AF33F2E-1136-4D97-BBB7-1795711AC8B8};{349c5851-65df-11da-9384-00065b846f21};{9092AA53-FB77-4645-B42D-1CCCA6BD08BD} + 14.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + False + True + 0 + / + http://localhost:48022/ + False + True + http://localhost:1337 + False + + + + + + + CurrentPage + True + False + False + False + + + + + + + + + False + False + + + + + \ No newline at end of file diff --git a/WebInterface/NodeJSServer/dist/chat.js b/WebInterface/NodeJSServer/dist/chat.js index 6832cc2..1be6fbc 100644 --- a/WebInterface/NodeJSServer/dist/chat.js +++ b/WebInterface/NodeJSServer/dist/chat.js @@ -14,10 +14,20 @@ connection.start().catch(function (err) { return console.error(err.toString()); }); +document.getElementById("loginButton").addEventListener("click", function (event) { + var group = document.getElementById("userInput").value; + var password = document.getElementById("messageInput").value; + connection.invoke("Login", group, password).catch(function (err) { + return console.error(err.toString()); + }); + event.preventDefault(); +}); + document.getElementById("sendButton").addEventListener("click", function (event) { var user = document.getElementById("userInput").value; var message = document.getElementById("messageInput").value; - connection.invoke("SendMessage", user, message).catch(function (err) { + var group = "TheCrew"; + connection.invoke("SendMessage",group, user, message).catch(function (err) { return console.error(err.toString()); }); event.preventDefault(); diff --git a/WebInterface/NodeJSServer/dist/index.html b/WebInterface/NodeJSServer/dist/index.html index 4264b39..d54470c 100644 --- a/WebInterface/NodeJSServer/dist/index.html +++ b/WebInterface/NodeJSServer/dist/index.html @@ -1,4 +1,4 @@ - + @@ -42,9 +42,12 @@ - + + + + + + + \ No newline at end of file diff --git a/ZooBOTanica/CritCreate.cs b/ZooBOTanica/CritCreate.cs index f570c9e..08a6ff0 100644 --- a/ZooBOTanica/CritCreate.cs +++ b/ZooBOTanica/CritCreate.cs @@ -23,7 +23,7 @@ namespace ZooBOTanica this.AllowDrop = true; } - private void Load(string path) + private new void Load(string path) { this.critter = Critter.Load(path); -- cgit v1.3.1 From f181fed811d5913a45fdbd7b164cb019da500c53 Mon Sep 17 00:00:00 2001 From: TrueDoctor Date: Sat, 29 Sep 2018 16:57:53 +0200 Subject: added firebase --- WebInterface/Web.config | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 WebInterface/Web.config diff --git a/WebInterface/Web.config b/WebInterface/Web.config new file mode 100644 index 0000000..741b7d8 --- /dev/null +++ b/WebInterface/Web.config @@ -0,0 +1,15 @@ + + + + + + + + \ No newline at end of file -- cgit v1.3.1 From 680967aee589e4a8d277044b204de07cbe32f41e Mon Sep 17 00:00:00 2001 From: TrueDoctor Date: Sat, 29 Sep 2018 17:02:10 +0200 Subject: modifyed cahat.js to match chatHub --- WebInterface/NodeJSServer/dist/chat.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WebInterface/NodeJSServer/dist/chat.js b/WebInterface/NodeJSServer/dist/chat.js index 1be6fbc..e9baff1 100644 --- a/WebInterface/NodeJSServer/dist/chat.js +++ b/WebInterface/NodeJSServer/dist/chat.js @@ -27,7 +27,7 @@ document.getElementById("sendButton").addEventListener("click", function (event) var user = document.getElementById("userInput").value; var message = document.getElementById("messageInput").value; var group = "TheCrew"; - connection.invoke("SendMessage",group, user, message).catch(function (err) { + connection.invoke("SendMessage", user, message).catch(function (err) { return console.error(err.toString()); }); event.preventDefault(); -- cgit v1.3.1