Example #1
0
 public MessageHub(IMqttHandler mqttHandler, IGamerContextMethods gamerStorage, IHubContext <MessageHub> context, IConfiguration configuration)
 {
     Id            = Guid.NewGuid();
     _mqttHandler  = mqttHandler;
     _gamerStorage = gamerStorage;
     _hubContext   = context;
     ApiUri        = configuration["ApiUri"];
 }
Example #2
0
        public MqttHandler(IConfiguration config, IHubContext <MessageHub> hubContext, IGamerContextMethods gamerStorage)
        {
            Id            = Guid.NewGuid();
            _config       = config;
            _hubContext   = hubContext;
            _gamerStorage = gamerStorage;
            var key = _config.GetValue <string>("MqttSettings:BrokerUri");

            _messageHandler = new MqttMessageHandler(key);
            _messageHandler.Subscribe(Topics.ScoreUpdate);
            _messageHandler.MqttMsgPublishReceived += _messageHandler_MqttMsgPublishReceived;
        }
Example #3
0
 public HomeController(IConfiguration configuration, IGamerContextMethods gamerContextMethods)
 {
     this.configuration       = configuration;
     this.gamerContextMethods = gamerContextMethods;
 }
 public RegistrationController(IGamerContextMethods gamerStorage, IMqttHandler handler)
 {
     _handler          = handler;
     _dbcontextMethods = gamerStorage;
 }