Ejemplo n.º 1
0
 public HomeController(
     StargateDbContext dbContext,
     Debugger debugger)
 {
     _dbContext = dbContext;
     _debugger  = debugger;
 }
Ejemplo n.º 2
0
 public ChannelController(
     StargateDbContext dbContext,
     CoreApiService coreApiService)
 {
     _dbContext      = dbContext;
     _coreApiService = coreApiService;
 }
Ejemplo n.º 3
0
 public TimedCleaner(
     ILogger <TimedCleaner> logger,
     StargateDbContext dbContext)
 {
     _logger    = logger;
     _dbContext = dbContext;
 }
Ejemplo n.º 4
0
 public ChannelController(
     StargateDbContext dbContext,
     ACTokenManager tokenManager)
 {
     _dbContext    = dbContext;
     _tokenManager = tokenManager;
 }
Ejemplo n.º 5
0
 public ListenController(StargateDbContext dbContext,
                         StargateMemory memoryContext,
                         IPusher <WebSocket> pusher)
 {
     _dbContext     = dbContext;
     _memoryContext = memoryContext;
     _pusher        = pusher;
 }
Ejemplo n.º 6
0
 public MessageController(
     StargateDbContext dbContext,
     Counter counter,
     CoreApiService coreApiService)
 {
     _dbContext      = dbContext;
     _counter        = counter;
     _coreApiService = coreApiService;
 }
Ejemplo n.º 7
0
 public MessageController(
     StargateDbContext dbContext,
     StargateMemory memoryContext,
     Counter counter,
     ACTokenManager tokenManager)
 {
     _dbContext     = dbContext;
     _memoryContext = memoryContext;
     _counter       = counter;
     _tokenManager  = tokenManager;
 }
Ejemplo n.º 8
0
 public HomeController(
     StargateDbContext dbContext,
     Debugger debugger,
     AppsContainer appsContainer,
     ChannelService channelService)
 {
     _dbContext      = dbContext;
     _debugger       = debugger;
     _appsContainer  = appsContainer;
     _channelService = channelService;
 }
Ejemplo n.º 9
0
 public ChannelController(
     StargateDbContext dbContext,
     ACTokenValidator tokenManager,
     StargateMemory stargateMemory,
     Counter counter)
 {
     _dbContext      = dbContext;
     _tokenManager   = tokenManager;
     _stargateMemory = stargateMemory;
     _counter        = counter;
 }
Ejemplo n.º 10
0
 public ListenController(
     StargateDbContext dbContext,
     StargateMemory memoryContext,
     WebSocketPusher pusher,
     ILogger <ListenController> logger,
     Counter counter)
 {
     _dbContext     = dbContext;
     _memoryContext = memoryContext;
     _pusher        = pusher;
     _logger        = logger;
     _counter       = counter;
 }
Ejemplo n.º 11
0
 public ChannelController(
     StargateDbContext dbContext,
     ACTokenManager tokenManager,
     ConnectedCountService connectedCountService,
     LastAccessService lastAccessService,
     ChannelLiveJudger channelLiveJudger)
 {
     _dbContext             = dbContext;
     _tokenManager          = tokenManager;
     _connectedCountService = connectedCountService;
     _lastAccessService     = lastAccessService;
     _channelLiveJudger     = channelLiveJudger;
 }
Ejemplo n.º 12
0
 public async Task AllClean(StargateDbContext dbContext)
 {
     try
     {
         var middleMessage = _memoryContext.Messages.Average(t => t.Id);
         _memoryContext.Messages.RemoveAll(t => t.Id < middleMessage);
         dbContext.Channels.RemoveRange(dbContext.Channels.Where(t => DateTime.UtcNow > t.CreateTime + TimeSpan.FromSeconds(t.LifeTime)));
         await dbContext.SaveChangesAsync();
     }
     catch (Exception e)
     {
         _logger.LogError(e, "Cleaner crashed!");
     }
 }
Ejemplo n.º 13
0
 public HomeController(
     StargateDbContext dbContext,
     Debugger debugger,
     AppsContainer appsContainer,
     ChannelService channelService,
     Counter counter,
     StargateMemory memory)
 {
     _dbContext      = dbContext;
     _debugger       = debugger;
     _appsContainer  = appsContainer;
     _channelService = channelService;
     _counter        = counter;
     _memory         = memory;
 }
Ejemplo n.º 14
0
 public void Configure(IApplicationBuilder app, IHostingEnvironment env, StargateDbContext dbContext)
 {
     if (env.IsDevelopment())
     {
         app.UseDeveloperExceptionPage();
         app.UseDatabaseErrorPage();
     }
     else
     {
         app.UseEnforceHttps();
     }
     app.UseWebSockets();
     app.UseStaticFiles();
     app.UseMvcWithDefaultRoute();
     app.UseLanguageSwitcher();
     app.UseAiursoftAuthenticationFromConfiguration(Configuration, "Test");
 }
Ejemplo n.º 15
0
 private async Task AllClean(StargateDbContext dbContext)
 {
     try
     {
         if (_memoryContext.Messages.Any())
         {
             var middleMessage = _memoryContext.Messages.Average(t => t.Id);
             _memoryContext.Messages.RemoveAll(t => t.Id < middleMessage);
         }
         var toDelete = dbContext
                        .Channels
                        .ToList()
                        .Where(t => _channelLiveJudge.IsDead(t.Id))
                        .ToList();
         dbContext.Channels.RemoveRange(toDelete);
         await dbContext.SaveChangesAsync();
     }
     catch (Exception e)
     {
         _logger.LogError(e, "Cleaner crashed!");
     }
 }
Ejemplo n.º 16
0
 public ListenController(
     StargateDbContext dbContext,
     StargateMemory memoryContext,
     WebSocketPusher pusher,
     ILogger <ListenController> logger,
     Counter counter,
     AppsContainer appsContainer,
     EventService eventService,
     ConnectedCountService connectedCountService,
     LastAccessService lastAccessService,
     ChannelLiveJudger channelLiveJudger)
 {
     _dbContext             = dbContext;
     _memoryContext         = memoryContext;
     _pusher                = pusher;
     _logger                = logger;
     _counter               = counter;
     _appsContainer         = appsContainer;
     _eventService          = eventService;
     _connectedCountService = connectedCountService;
     _lastAccessService     = lastAccessService;
     _channelLiveJudger     = channelLiveJudger;
 }
Ejemplo n.º 17
0
 public HomeController(StargateDbContext dbContext)
 {
     this._dbContext = dbContext;
 }
Ejemplo n.º 18
0
 public MessageController(StargateDbContext dbContext)
 {
     _dbContext = dbContext;
 }
Ejemplo n.º 19
0
 public ChannelController(StargateDbContext dbContext)
 {
     _dbContext = dbContext;
 }
Ejemplo n.º 20
0
 public MessageController(StargateDbContext dbContext,
                          Counter counter)
 {
     _dbContext = dbContext;
     _counter   = counter;
 }
 public ListenController(StargateDbContext dbContext,
                         WebSocketPusher pusher)
 {
     _dbContext = dbContext;
     _pusher    = pusher;
 }