Exemplo n.º 1
0
        public ChronokeeperService GetChronokeeperService(RyuContainer ryu)
        {
            var remoteChronokeeperConfiguration = ryu.Get <RemoteChronokeeperConfiguration>();
            var networkingProxy      = ryu.Get <INetworkingProxy>();
            var endpoint             = networkingProxy.CreateEndPoint(remoteChronokeeperConfiguration.Host, remoteChronokeeperConfiguration.Port);
            var serviceClientFactory = ryu.Get <ServiceClientFactory>();
            var serviceClient        = serviceClientFactory.Remote(endpoint.ToIPEndPoint());

            return(serviceClient.GetService <ChronokeeperService>());
        }
Exemplo n.º 2
0
        public IRyuContainer Bootstrap(RyuConfiguration configuration)
        {
            if (configuration.IsDirectoryAssemblyLoadingEnabled()) {
            assemblyLoader.LoadAssembliesFromNeighboringDirectories();
             }

             var modules = moduleLoader.LoadModules(configuration);
             var container = new RyuContainer(null, activator);
             moduleImporter.ImportModules(container, modules);
             return container;
        }
Exemplo n.º 3
0
        private Gamepad ConstructGamepad(RyuContainer ryu)
        {
            var       gamepad = new RemoteGamepad();
            const int kPort   = 21337;
            var       courierClientFactory = ryu.Get <CourierClientFactory>();
            var       courierClient        = courierClientFactory.CreateUdpCourierClient(kPort,
                                                                                         new CourierClientConfiguration {
                Identifier = Guid.NewGuid()
            });

            ryu.Set(courierClient);
            courierClient.RegisterPayloadHandler <GamepadStateDto>(x => gamepad.Update(x.Payload));
            Console.WriteLine("Constructed courier client");
            return(gamepad);
        }
        public static ChronokeeperServiceImpl CreateChronokeeperServiceImpl(RyuContainer ryu)
        {
            var configuration = ryu.Get <ChronokeeperServiceConfiguration>();
            var timeProxy     = ryu.Get <TimeProxy>();
            var workers       = Util.Generate(
                configuration.WorkerCount,
                workerId => (ChronokeeperWorker) new ChronokeeperWorkerImpl(
                    new ChronokeeperWorkerConfigurationImpl {
                DatacenterId = configuration.DatacenterId,
                WorkerId     = workerId
            }, timeProxy
                    )
                );

            return(new ChronokeeperServiceImpl(workers));
        }
        public NestResult Start(IEggParameters parameters)
        {
            host = parameters?.Host;

            InitializeLogging();

            ryu = new RyuFactory().Create();
            var clusteringConfiguration = new ClusteringConfigurationImpl(IPAddress.Loopback, kZileanServicePort, ClusteringRole.HostOnly);

            ryu.Set <ClusteringConfiguration>(clusteringConfiguration);
            ryu.Setup();
            ryu.Touch <ItzWartyProxiesRyuPackage>();
            ryu.Touch <ServicesRyuPackage>();
            ryu.Touch <ZileanImplRyuPackage>();
            return(NestResult.Success);
        }
 public CoreDaemonApplicationEgg()
 {
     ryu = new RyuFactory().Create();
     ((RyuContainerImpl)ryu).SetLoggerEnabled(true);
 }
 private ChronokeeperServiceConfiguration CreateChronokeeperServiceConfiguration(RyuContainer ryu)
 {
     return(new ChronokeeperServiceConfigurationImpl {
         DatacenterId = 0,
         WorkerCount = 1 << ChronokeeperWorkerImpl.kWorkerBits
     });
 }
 public DargonClientEgg()
 {
     InitializeLogging();
     ryu = new RyuFactory().Create();
     ((RyuContainerImpl)ryu).SetLoggerEnabled(true);
 }
Exemplo n.º 9
0
        public RemoteChronokeeperConfiguration GetRemoteChronokeeperConfiguration(RyuContainer ryu)
        {
            var configurationFactory = ryu.Get <RemoteChronokeeperConfigurationFactory>();

            return(configurationFactory.Create());
        }