Ejemplo n.º 1
0
        public ServerContext([NotNull] CommandLineOptions startupOptions)
        {
            StartupOptions = startupOptions;

            if (startupOptions.Port > 0)
            {
                Options.ServerPort = startupOptions.Port;
            }

            ServerConsole = new ServerConsole();
            ServerLogic   = new ServerLogic();
            RestApi       = new RestApi(startupOptions.ApiPort);

            Network = CreateNetwork();
        }
Ejemplo n.º 2
0
        protected override void InternalStart()
        {
            try
            {
                InternalStartNetworking();

                if (!StartupOptions.DoNotShowConsole)
                {
                    ThreadConsole = ServerConsole.Start();
                }

                ThreadLogic = ServerLogic.Start();
            }
            catch (Exception exception)
            {
                Log.Error(exception);
                Dispose();

                throw;
            }
        }