Merge pull request #238 from sp-tarkov/update-inject
Use SptWebSocketConnectionHandler directly
This commit is contained in:
@@ -11,7 +11,7 @@ namespace SPTarkov.Server.Core.Helpers;
|
||||
|
||||
[Injectable]
|
||||
public class NotificationSendHelper(
|
||||
IEnumerable<IWebSocketConnectionHandler> _sptWebSocketConnectionHandler,
|
||||
SptWebSocketConnectionHandler _sptWebSocketConnectionHandler,
|
||||
HashUtil _hashUtil,
|
||||
SaveServer _saveServer,
|
||||
NotificationService _notificationService,
|
||||
@@ -25,13 +25,9 @@ public class NotificationSendHelper(
|
||||
/// <param name="notificationMessage"></param>
|
||||
public void SendMessage(string sessionID, WsNotificationEvent notificationMessage)
|
||||
{
|
||||
var sptWebSocketConnectionHandler = _sptWebSocketConnectionHandler
|
||||
.OfType<SptWebSocketConnectionHandler>()
|
||||
.FirstOrDefault(wsh => wsh.GetHookUrl() == "/notifierServer/getwebsocket/");
|
||||
|
||||
if (sptWebSocketConnectionHandler.IsWebSocketConnected(sessionID))
|
||||
if (_sptWebSocketConnectionHandler.IsWebSocketConnected(sessionID))
|
||||
{
|
||||
sptWebSocketConnectionHandler.SendMessage(sessionID, notificationMessage);
|
||||
_sptWebSocketConnectionHandler.SendMessage(sessionID, notificationMessage);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user