Website Summary Files Commits Branches @commit @diff @stats
path: root / src / Web
diff options
context:
space:
mode:
Commit5bd0777227894df6204cd8e52d19f019f296e910 (patch)
Author
 ivaylo.zhelev <ivaylo.zhelev@solarwinds.com>
2021-02-27 10:57:48 +0200
Committer
 ivaylo.zhelev <ivaylo.zhelev@solarwinds.com>
2021-02-27 10:57:48 +0200
Files4114f7f7ee104db21575fe8daa1506d7bcd2b4a5 /src/Web
pusg-api-5bd0777227894df6204cd8e52d19f019f296e910.tar
pusg-api-5bd0777227894df6204cd8e52d19f019f296e910.tar.gz
pusg-api-5bd0777227894df6204cd8e52d19f019f296e910.zip
Parente8ee7b69663a95d97b226266ebe3ccc95e13c309 (diff)
Added User Participants functionality
1 files changed, 4 insertions, 1 deletions
-rw-r--r--src/Web/PUSG.Web/Hubs/HomeHub.cs5
diff --git a/src/Web/PUSG.Web/Hubs/HomeHub.cs b/src/Web/PUSG.Web/Hubs/HomeHub.cs
index 2f9677e..06a8d8e 100644
--- a/src/Web/PUSG.Web/Hubs/HomeHub.cs
+++ b/src/Web/PUSG.Web/Hubs/HomeHub.cs
@@ -38,7 +38,9 @@ namespace PUSG.Web.Hubs
{
if(!this.sessionService.IsLogged(username))
{
+ await this.BroadcastToLoggedIn("OnLoggedIn", username);
this.sessionService.AddUser(this.Context.ConnectionId, username);
+ await this.Clients.Caller.SendAsync("OnLoggedIn", this.sessionService.Users.Values);
}
}
@@ -53,9 +55,10 @@ namespace PUSG.Web.Hubs
public override async Task OnDisconnectedAsync(Exception exception)
{
+ string username = this.sessionService.Users[this.Context.ConnectionId];
this.sessionService.LiveConnections.Remove(this.Context.ConnectionId);
this.sessionService.RemoveUser(this.Context.ConnectionId);
-
+ await this.BroadcastToLoggedIn("OnLoggedOut", username);
await base.OnDisconnectedAsync(exception);
}
}