public WebsocketMonitor(IStreamClient client, IWebsocketHealthMonitor healthMonitor, IWebsocketEventHandler handler, IScrimMessageBroadcastService messageService, ILogger <WebsocketMonitor> logger) { _client = client; _healthMonitor = healthMonitor; _handler = handler; _messageService = messageService; _logger = logger; _client.OnMessage(OnMessage) .OnDisconnect(OnDisconnect); _messageService.RaiseTeamPlayerChangeEvent += ReceiveTeamPlayerChangeEvent; _messageService.RaiseMatchConfigurationUpdateEvent += ReceiveMatchConfigurationUpdateEvent; }
public WebsocketMonitor(ICensusStreamClient censusStreamClient, IWebsocketEventHandler handler, ILogger <WebsocketMonitor> logger) { _client = censusStreamClient; _handler = handler; _logger = logger; var subscription = new CensusStreamSubscription { Characters = new[] { "all" }, Worlds = new[] { "all" }, EventNames = new[] { "Death", "PlayerLogin", "PlayerLogout" } }; _client.Subscribe(subscription) .OnMessage(OnMessage) .OnDisconnect(OnDisconnect); }