From 0825ce687decbe1ad6bbc3b3e796d3763f3c4447 Mon Sep 17 00:00:00 2001 From: Ionut Andrei Oanca Date: Mon, 7 Dec 2020 01:04:48 +0100 Subject: Add SessionControllerConnected event --- Emby.Server.Implementations/Session/SessionManager.cs | 16 ++++++++++++++++ .../Session/SessionWebSocketListener.cs | 2 ++ 2 files changed, 18 insertions(+) (limited to 'Emby.Server.Implementations/Session') diff --git a/Emby.Server.Implementations/Session/SessionManager.cs b/Emby.Server.Implementations/Session/SessionManager.cs index b3965fccad..885f65c64e 100644 --- a/Emby.Server.Implementations/Session/SessionManager.cs +++ b/Emby.Server.Implementations/Session/SessionManager.cs @@ -128,6 +128,9 @@ namespace Emby.Server.Implementations.Session /// public event EventHandler SessionActivity; + /// + public event EventHandler SessionControllerConnected; + /// /// Gets all connections. /// @@ -312,6 +315,19 @@ namespace Emby.Server.Implementations.Session return session; } + /// + public void OnSessionControllerConnected(SessionInfo info) + { + EventHelper.QueueEventIfNotNull( + SessionControllerConnected, + this, + new SessionEventArgs + { + SessionInfo = info + }, + _logger); + } + /// public void CloseIfNeeded(SessionInfo session) { diff --git a/Emby.Server.Implementations/Session/SessionWebSocketListener.cs b/Emby.Server.Implementations/Session/SessionWebSocketListener.cs index 169eaefd8b..39c369a01d 100644 --- a/Emby.Server.Implementations/Session/SessionWebSocketListener.cs +++ b/Emby.Server.Implementations/Session/SessionWebSocketListener.cs @@ -133,6 +133,8 @@ namespace Emby.Server.Implementations.Session var controller = (WebSocketController)controllerInfo.Item1; controller.AddWebSocket(connection); + + _sessionManager.OnSessionControllerConnected(session); } /// -- cgit v1.2.3