diff options
Diffstat (limited to 'DSACore/Models/Network')
-rw-r--r-- | DSACore/Models/Network/Group.cs | 21 | ||||
-rw-r--r-- | DSACore/Models/Network/Token.cs | 12 | ||||
-rw-r--r-- | DSACore/Models/Network/User.cs | 6 |
3 files changed, 13 insertions, 26 deletions
diff --git a/DSACore/Models/Network/Group.cs b/DSACore/Models/Network/Group.cs index efe12ee..aee9d02 100644 --- a/DSACore/Models/Network/Group.cs +++ b/DSACore/Models/Network/Group.cs @@ -1,18 +1,14 @@ using System; using System.Collections.Generic; -namespace DSACore.Models.Network -{ - public class Group - { - public Group(string name, string password) - { +namespace DSACore.Models.Network { + public class Group { + public Group(string name, string password) { Name = name; Password = password; } - public Group(string name, int userOnline) - { + public Group(string name, int userOnline) { Name = name ?? throw new ArgumentNullException(nameof(name)); } @@ -22,16 +18,13 @@ namespace DSACore.Models.Network public int UserCount => Users.Count; - public SendGroup SendGroup() - { + public SendGroup SendGroup() { return new SendGroup(Name, UserCount); } } - public class SendGroup - { - public SendGroup(string name, int userCount) - { + public class SendGroup { + public SendGroup(string name, int userCount) { Name = name ?? throw new ArgumentNullException(nameof(name)); UserCount = userCount; } diff --git a/DSACore/Models/Network/Token.cs b/DSACore/Models/Network/Token.cs index 451cafc..67b1853 100644 --- a/DSACore/Models/Network/Token.cs +++ b/DSACore/Models/Network/Token.cs @@ -1,20 +1,16 @@ using System; -namespace DSACore.Models.Network -{ - public class Token - { +namespace DSACore.Models.Network { + public class Token { private readonly DateTime creation = DateTime.Now; - public Token(string group) - { + public Token(string group) { Group = group; } public string Group { get; set; } - public bool IsValid() - { + public bool IsValid() { return DateTime.Now - creation < TimeSpan.FromMinutes(1); } } diff --git a/DSACore/Models/Network/User.cs b/DSACore/Models/Network/User.cs index 8b8008c..95a12b2 100644 --- a/DSACore/Models/Network/User.cs +++ b/DSACore/Models/Network/User.cs @@ -1,7 +1,5 @@ -namespace DSACore.Models.Network -{ - public class User - { +namespace DSACore.Models.Network { + public class User { public string Name { get; set; } public string ConnectionId { get; set; } public int Char { get; set; } |