Exemplo n.º 1
0
        public Startup(IConfiguration configuration)
        {
            Configuration = configuration;

            {
                var map = new Dictionary <string, List <String> >();

                var kvsConnectionsSection = Configuration.GetSection("KvsConnections");
                foreach (var item in kvsConnectionsSection.GetChildren())
                {
                    map[item.Key] = item.Get <List <string> >();
                }

                evolib.Kvs.Kvs.Initialize(map);
            }

            EvoToolJwt.issuer        = Configuration["Jwt:issuer"];
            EvoToolJwt.audience      = Configuration["Jwt:audience"];
            EvoToolJwt.expiryMinutes = int.Parse(Configuration["Jwt:expiryMinutes"]);

            MatchingServerInfo.Initialize(Configuration);
            AuthenticationServerInfo.Initialize(Configuration);

            DeliveryDataInfo.Initialize(Configuration);

            DbContextFactory.Initialize(Configuration);

            System.Threading.Tasks.Task.Run(async() =>
            {
                using (var commonDB2 = DbContextFactory.CreateCommon2())
                {
                    await TranslationTable.LoadAsync(commonDB2);
                }
            });
        }
Exemplo n.º 2
0
        public Startup(IConfiguration configuration)
        {
            Configuration = configuration;

            {
                var map = new Dictionary <string, List <String> >();

                var kvsConnectionsSection = Configuration.GetSection("KvsConnections");
                foreach (var item in kvsConnectionsSection.GetChildren())
                {
                    map[item.Key] = item.Get <List <string> >();
                }

                Kvs.Initialize(map);
            }

            EvoApiJwt.issuer        = Configuration["Jwt:issuer"];
            EvoApiJwt.audience      = Configuration["Jwt:audience"];
            EvoApiJwt.expiryMinutes = int.Parse(Configuration["Jwt:expiryMinutes"]);

            MatchingServerInfo.Initialize(Configuration);
            SequencingServerInfo.Initialize(Configuration);
            AuthenticationServerInfo.Initialize(Configuration);

            DeliveryDataInfo.Initialize(Configuration);

            evolib.SystemInfo.Initialize(Configuration);

            evolib.VivoxInfo.Initialize(Configuration);

            Task.Run(async() =>
            {
                while (!await MatchingServerInfo.SetupMultiMatchingServersAsync())
                {
                    await Task.Delay(5000);
                }

                while (true)
                {
                    await MasterDataLoader.LoadAsync();
                    await Task.Delay(5000);
                }
            });

            evolib.Kvs.Models.Session.ExpiredSpan = TimeSpan.FromSeconds(
                ProtocolModels.HandShake.HandShake.NextResponseSeconds + 60);
        }