Beispiel #1
0
        public void Stop()
        {
            if (State != EngineState.Started)
            {
                throw new Exception("Server is not started");
            }

            State = EngineState.Stopping;

            Logger.Info("Stopping queue listener...");
            queueListener.Stop();

            Logger.Info("Pausing system variable updates");
            systemVariablesUpdater.Pause();

            Logger.Info("Stopping TCP server...");
            server.Stop();

            Logger.Info("Stopping policy server...");
            policyServer.Stop();

            Logger.Info("Stopping thrift server");
            thriftServer.Stop();

            Logger.Info("Waiting for scheduler to end...");
            scheduler.Pause();

            Logger.Info("Closing regions file...");
            world.Regions.Unload();

            Logger.Info("Goodbye!");

            State = EngineState.Stopped;
        }
Beispiel #2
0
 public void Dispose()
 {
     if (_server != null)
     {
         _server.Stop();
         _server.Dispose();
     }
 }
Beispiel #3
0
        void server_OnCrash(INetworkServer server)
        {
            Console.WriteLine("Server Crash: {0} on Port {1}", server, server.Port);

            server.Stop();
            if (server is BaseServer)
            {
                Servers.Remove((BaseServer)server);
            }
        }
Beispiel #4
0
        private void DisposeServer()
        {
            DisposeChannel(_serverChannel);
            _serverChannel = null;

            if (_server != null)
            {
                _server.Stop();
                _server.Dispose();
            }
        }
Beispiel #5
0
        protected override async Task ExecuteAsync(CancellationToken stoppingToken)
        {
            Console.WriteLine("Starting server...");
            _networkServer.Start();
            Console.WriteLine("Server started");

            while (!stoppingToken.IsCancellationRequested)
            {
                await Task.Delay(1000, stoppingToken);
            }

            Console.WriteLine("Server shutting down...");
            _networkServer.Stop();

            Console.WriteLine("Server finished");
        }
Beispiel #6
0
        void server_OnCrash(INetworkServer server)
        {
            Console.WriteLine("Server Crash: {0} on Port {1}", server, server.Port);

            server.Stop();
            if (server is BaseServer)
                Servers.Remove((BaseServer)server);
        }
Beispiel #7
0
 private void OnApplicationStopping()
 {
     _logger.Debug("AppStopping");
     _networkServer.Stop();
 }
 public async Task StopAsync(CancellationToken cancellationToken)
 {
     await networkServer.Stop(cancellationToken);
 }
Beispiel #9
0
 private void OnApplicationStopping()
 {
     _networkServer.Stop();
 }