Website Summary Files Commits Branches @commit @diff @stats
path: root / src / Web / PUSG.Web
diff options
context:
space:
mode:
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);
}
}