summaryrefslogtreecommitdiff
path: root/DSACore/Hubs
diff options
context:
space:
mode:
authorDennis Kobert <d-kobert@web.de>2019-05-19 17:00:02 +0200
committerDennis Kobert <d-kobert@web.de>2019-05-19 17:00:02 +0200
commitc4d046858e0822b7c2c540ac2368b2c0e88e7a26 (patch)
tree8ff5cfd8646908784a45762a6148ebc150810160 /DSACore/Hubs
parentf89f308c525e9deebc6d2cf6416e27dfe1a299dc (diff)
general refectoring
added 42 as dummy Token
Diffstat (limited to 'DSACore/Hubs')
-rw-r--r--DSACore/Hubs/Login.cs30
1 files changed, 15 insertions, 15 deletions
diff --git a/DSACore/Hubs/Login.cs b/DSACore/Hubs/Login.cs
index f589e49..1f6ca39 100644
--- a/DSACore/Hubs/Login.cs
+++ b/DSACore/Hubs/Login.cs
@@ -1,14 +1,14 @@
-using DSACore.DSA_Game.Characters;
-using DSACore.FireBase;
-using DSACore.Models.Network;
-using Microsoft.AspNetCore.SignalR;
-using System;
+using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
-using Microsoft.CodeAnalysis.CSharp.Syntax;
+using DSACore.Commands;
+using DSACore.DSA_Game.Characters;
+using DSACore.FireBase;
+using DSACore.Models.Network;
+using Microsoft.AspNetCore.SignalR;
namespace DSACore.Hubs
{
@@ -18,9 +18,6 @@ namespace DSACore.Hubs
private const string ReceiveMethod = "ReceiveMessage"; //receiveMethod;
- private static List<Group> DsaGroups { get; set; }
- public static List<Token> Tokens { get; } = new List<Token>();
-
static Users()
{
DsaGroups = Database.GetGroups().Result;
@@ -29,6 +26,9 @@ namespace DSACore.Hubs
//AddGroups();
}
+ private static List<Group> DsaGroups { get; }
+ public static List<Token> Tokens { get; } = new List<Token>();
+
[Obsolete]
private static async void AddGroups()
@@ -60,7 +60,7 @@ namespace DSACore.Hubs
var ident = args.First().Replace("/", "");
if (args.Count > 0) args.RemoveAt(0);
- var ret = Commands.CommandHandler.ExecuteCommand(new Command
+ var ret = CommandHandler.ExecuteCommand(new Command
{
CharId = 0,
CmdIdentifier = ident,
@@ -116,8 +116,8 @@ namespace DSACore.Hubs
var test = await Database.GetGroups();
foreach (var group in test)
- if (!DsaGroups.Exists(x => x.Name.Equals(@group.Name)))
- DsaGroups.Add(@group);
+ 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");
@@ -128,7 +128,7 @@ namespace DSACore.Hubs
DsaGroups.Add(new Group(group, password));
var Dgroup = new Models.Database.Groups.Group {Name = group, Id = DsaGroups.Count - 1};
//Database.AddGroup(Dgroup);
- await Clients.Caller.SendCoreAsync(ReceiveMethod, new[] {$"group {@group} sucessfully added"});
+ await Clients.Caller.SendCoreAsync(ReceiveMethod, new[] {$"group {group} sucessfully added"});
//throw new NotImplementedException("add database call to add groups");
}
@@ -202,8 +202,8 @@ namespace DSACore.Hubs
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);
+ group.Users.Remove(user);
+ await Groups.RemoveFromGroupAsync(Context.ConnectionId, group.Name);
}
catch (Exception e)
{