Exemple #1
0
        static void Main(string[] args)
        {
            ServerRunner runner = new ServerRunner();

            runner.Logger = new ConsoleLogger();
            runner.Run();
        }
Exemple #2
0
        private ServerRunner DeployServer(string packageName, string storageType)
        {
            var serverDirectory = NewDataPath(packageName, true);

            IOExtensions.CopyDirectory("../../../packages/" + packageName + "/tools/", serverDirectory);

            return(ServerRunner.Run(Port, storageType, Path.Combine(serverDirectory, "Raven.Server.exe")));
        }
Exemple #3
0
        private void ServerThreadProc(object arg)
        {
            Thread.CurrentThread.Name = "Server Net";

            runner = new ServerRunner();
            runner.Run();

            lock (serverThreadLock)
                serverThread = null;

            this.Stop();
        }
        public static void Run(ServerRunner webServer)
        {
            RegisterAssembly();

            try
            {
                webServer.Run();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
Exemple #5
0
        public static void StartApplication(MvcApplication mvcApplication)
        {
            if (Interlocked.Exchange(ref isStarted, 1) == 1)
            {
                return;                                              // prevent double start
            }
            var listener = new ZkServerTraceListener();

            Trace.Listeners.Add(listener);
            Trace.TraceInformation("Starting Zero-K.info web and application");

            GlobalConst.SiteDiskPath = MapPath("~");

            AwardCalculator = new AwardCalculator();
            AwardCalculator.RecomputeNow();

            var sitePath = mvcApplication.Server.MapPath("~");

            ZkServerRunner = new ServerRunner(sitePath, new PlanetwarsEventCreator());
            Server         = ZkServerRunner.ZkLobbyServer;

            Trace.TraceInformation("Starting lobby server");
            ZkServerRunner.Run();
            listener.ZkLobbyServer = Server;

            ForumPostIndexer = new ForumPostIndexer();

            SteamDepotGenerator = new SteamDepotGenerator(sitePath, Path.Combine(sitePath, "..", "steamworks", "tools", "ContentBuilder", "content"));


            SetupPaypalInterface();


            // HACK Task.Factory.StartNew(() => SteamDepotGenerator.RunAll());

            Trace.TraceInformation("Starting autoregistrator");
            AutoRegistrator = new AutoRegistrator(MapPath("~"));
            AutoRegistrator.NewZkReleaseRegistered += (game, chobby) =>
            {
                SteamDepotGenerator.RunAll();
                Server.SetGame(game);
            };

            AutoRegistrator.RunMainAndMapSyncAsync();
        }
Exemple #6
0
        public static void StartApplication(MvcApplication mvcApplication)
        {
            var listener = new ZkServerTraceListener();

            Trace.Listeners.Add(listener);

            ZkServerRunner = new ServerRunner(mvcApplication.Server.MapPath("~"));
            Server         = ZkServerRunner.ZkLobbyServer;
            ZkServerRunner.Run();
            listener.ZkLobbyServer = Server;

            SetupPaypalInterface();

            if (GlobalConst.PlanetWarsMode == PlanetWarsModes.Running)
            {
                PlanetWarsMatchMaker = new PlanetWarsMatchMaker(Server);
            }
        }
Exemple #7
0
        private static int Main(string[] args)
        {
            using CancellationTokenSource cts = new CancellationTokenSource();

            void CancelHandler(object sender, ConsoleCancelEventArgs args)
            {
                args.Cancel = true;
                cts.Cancel();
                Console.CancelKeyPress -= CancelHandler !;
            }

            Console.CancelKeyPress += CancelHandler;

            return(new Parser(settings => { settings.HelpWriter = Console.Out; })
                   .ParseArguments <ClientOptions, ServerOptions, InProcOptions>(args)
                   .MapResult(
                       (ClientOptions opts) => ClientRunner.Run(opts, cts),
                       (ServerOptions opts) => ServerRunner.Run(opts, cts.Token),
                       (InProcOptions opts) => InProcRunner.Run(opts, cts),
                       _ => 1));
        }
Exemple #8
0
        private static async Task <int> Execute(string[] args, CancellationToken token)
        {
            var settings = SettingsParser.ParseArgs(CesxSettings.Default, args);

            Console.WriteLine("CESX: starting with settings");
            Console.WriteLine(settings);

            if (!settings.SkipBackup)
            {
                Console.WriteLine("CESX: Creating backup...");
                var backuper = new ServerBackuper(settings);
                backuper.DoBackup();
                Console.WriteLine("CESX: Done!");
            }

            if (!settings.SkipUpdate)
            {
                Console.WriteLine("CESX: Try updating server files");
                _updater = new ServerUpdater(settings);

                Console.WriteLine("CESX: Downloading SteamCmd...");
                await _updater.EnsureSteamCmdExistsAsync(token);

                Console.WriteLine("CESX: Done!");

                Console.WriteLine("CESX: Running steamcmd...");
                await _updater.RunSteamCmdUpdaterAsync(token);

                Console.WriteLine("CESX: Done!");

                //_updater.Dispose();
            }

            Console.WriteLine("CESX: Starting the server instance");
            _server = new ServerRunner(settings);
            _server.Run();

            return((int)ExitCode.Success);
        }