Esempio n. 1
0
 public MatchTurnGameEventHandler(
     IHubContext <IngameHub, IIngameHubClient> ingameHub,
     IIngameSessionService ingameService)
 {
     this.ingameHub     = ingameHub;
     this.ingameService = ingameService;
 }
Esempio n. 2
0
 public IngameService(
     IMatchRepository matchRepository,
     IIdentityService identityService,
     IIngameSessionService ingameService)
 {
     this.matchRepository = matchRepository;
     this.identityService = identityService;
     this.ingameService   = ingameService;
 }
Esempio n. 3
0
 public IngameHub(
     ILogger <IngameHub> logger,
     IIdentityService identityService,
     IIngameSessionService ingameService,
     IIngameService ingameUserService)
 {
     this.logger            = logger;
     this.identityService   = identityService;
     this.ingameService     = ingameService;
     this.ingameUserService = ingameUserService;
 }
Esempio n. 4
0
        public void Configure(
            IApplicationBuilder app,
            IHostEnvironment env,
            // TODO: remove after testing
            IIngameSessionService ingameService,
            IMatchRepository repository)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            app.UseIdentityProviderMiddleware();
            app.UseRouting();

            if (!env.IsDevelopment())
            {
                app.UseSpaStaticFiles();
            }

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapHub <IngameHub>("/ingamehub");
            });

            app.UseSpa(spa =>
            {
                spa.Options.SourcePath = "Client";

                if (env.IsDevelopment())
                {
                    spa.UseAngularCliServer("start");
                }
            });

            ingameService.Start(repository.LastMatch().Result);
        }