Website Summary Files Commits Branches @commit @diff @stats
path: root / src / Web / PUSG.Web / Static
diff options
context:
space:
mode:
Commite8ee7b69663a95d97b226266ebe3ccc95e13c309 (patch)
Author
 ivaylo.zhelev <ivaylo.zhelev@solarwinds.com>
2021-01-31 16:42:30 +0200
Committer
 ivaylo.zhelev <ivaylo.zhelev@solarwinds.com>
2021-01-31 16:42:30 +0200
Files9eed7de1b817c812d61514950a9299aa2cb8d887 /src/Web/PUSG.Web/Static
pusg-api-e8ee7b69663a95d97b226266ebe3ccc95e13c309.tar
pusg-api-e8ee7b69663a95d97b226266ebe3ccc95e13c309.tar.gz
pusg-api-e8ee7b69663a95d97b226266ebe3ccc95e13c309.zip
Parent6fb05a2a6f94e008dc689291d0522f39f87a6622 (diff)
Major Business Logic Implementation
* Added GameHub * Added Back-End Game Loop and Game Mechanics * Added End Game and Result message
2 files changed, 0 insertions, 59 deletions
-rw-r--r--src/Web/PUSG.Web/Static/ISessionService.cs19
-rw-r--r--src/Web/PUSG.Web/Static/SessionService.cs40
diff --git a/src/Web/PUSG.Web/Static/ISessionService.cs b/src/Web/PUSG.Web/Static/ISessionService.cs
deleted file mode 100644
index 05eae53..0000000
--- a/src/Web/PUSG.Web/Static/ISessionService.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-using System.Collections.Generic;
-
-namespace PUSG.Web.Static
-{
- public interface ISessionService
- {
- bool IsLogged(string username);
-
- void AddUser(string connectionId, string username);
-
- void RemoveUser(string connectionId);
-
- Dictionary<string, string> Users { get; }
-
- List<string> LiveConnections { get; }
-
- KeyValuePair<string, string> GetUser(string connectionId);
- }
-}
diff --git a/src/Web/PUSG.Web/Static/SessionService.cs b/src/Web/PUSG.Web/Static/SessionService.cs
deleted file mode 100644
index 0e8e61a..0000000
--- a/src/Web/PUSG.Web/Static/SessionService.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-using System.Collections.Generic;
-using System.Linq;
-
-namespace PUSG.Web.Static
-{
- public class SessionService : ISessionService
- {
- private Dictionary<string, string> users;
-
- public SessionService()
- {
- this.users = new Dictionary<string, string>();
- this.LiveConnections = new List<string>();
- }
-
- public Dictionary<string, string> Users => this.users;
-
- public List<string> LiveConnections { get; }
-
- public void AddUser(string connectionId, string username)
- {
- this.users[connectionId] = username;
- }
-
- public KeyValuePair<string, string> GetUser(string connectionId)
- {
- return this.users.SingleOrDefault(user => user.Key == connectionId);
- }
-
- public bool IsLogged(string credential)
- {
- return this.users.ContainsKey(credential) || this.users.ContainsValue(credential);
- }
-
- public void RemoveUser(string connectionId)
- {
- this.users.Remove(connectionId);
- }
- }
-}