Exemplo n.º 1
0
        public override void ConfigureServices(IServiceCollection services)
        {
            services.AddSingleton(MiniMeService.Get <ISwitchBoardService>());

            services.AddRequestDecompression(o =>
            {
                o.Providers.Add <Base64DecompressionProvider>();
                o.Providers.Add <ZlibDecompressionProvider>();
            });

            base.ConfigureServices(services);
        }
Exemplo n.º 2
0
        public override void ConfigureServices(IServiceCollection services)
        {
            services
            .AddDbContext <ChunithmContext>()
            .AddSingleton(MiniMeService.Get <IAimeService>())
            .AddRequestDecompression(o =>
            {
                o.Providers.Add <ZlibDecompressionProvider>();
            })
            .AddResponseCompression(o =>
            {
                o.Providers.Add <ZlibCompressionProvider>();
            });

            base.ConfigureServices(services);
        }
Exemplo n.º 3
0
        private static IEnumerable <ServerBase> CreateServers()
        {
            var switchBoard = MiniMeService.Get <ISwitchBoardService>();
            var dnsEntry    = Dns.GetHostEntry(switchBoard.Host);

            if (dnsEntry.AddressList.Length == 0)
            {
                throw new Exception("Dns address not found.");
            }

            var address = dnsEntry.AddressList[0];

            yield return(new AimeServer(new IPEndPoint(address, switchBoard.Ports.Aime)));

            yield return(new AllNetServer(new IPEndPoint(address, switchBoard.Ports.AllNet)));

            yield return(new ChunithmServer(new IPEndPoint(address, switchBoard.Ports.Chunithm)));

            yield return(new BillingServer(new IPEndPoint(address, switchBoard.Ports.Billing)));
        }