Example #1
0
        public static void Start(ActorConfigManager configManager)
        {
            CheckArg.ActorConfigManager(configManager);
            ActorTagHelper.FullHost = configManager.Host().Host;

            _serverInstance = new ActorServer
            {
                _configManager = configManager ?? throw new ActorException(MessageNullConfigManager),
                                       Name = configManager.Host().Host,
                                       Port = configManager.Host().Port
            };

            _serverInstance.ListenerService      = configManager.GetListenerService();
            _serverInstance.SerializeService     = configManager.GetSerializeService();
            _serverInstance.HostService          = configManager.GetHostService();
            _serverInstance.ServerCommandService = ActorConfigManager.GetServerCommandService();
            _serverInstance.DoInit(new HostRelayActor(_serverInstance.ListenerService));
        }
Example #2
0
        private void DoInit(HostRelayActor hostRelayActor)
        {
            DirectoryActor.GetDirectory(); // Start directory
            ActorConsole.Register();       // Start console
            // should work now
            SendByName.Send("Actor Server Start", "Console");
            if (ServerCommandService == null)
            {
                ServerCommandService = new ServerCommandService();
                ServerCommandService.RegisterCommand(new DiscoServerCommand());
                ServerCommandService.RegisterCommand(new StatServerCommand());
            }
            Become(ServerCommandService);
            if (hostRelayActor == null)
            {
                return;
            }

            ListenerService = _configManager.GetListenerService();
            ShardDirectoryActor.AttachShardDirectoryActor(this);
            _actHostRelay = hostRelayActor;
            _actHostRelay.SendMessage(HostRelayActor.ListenOrder);
        }