Exemplo n.º 1
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("~");

            LadderCalculator = new LadderCalculator();
            LadderCalculator.RecomputeNow();

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

            ZkServerRunner = new ServerRunner(sitePath, new PlanetwarsEventCreator(), LadderCalculator);
            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();
        }
Exemplo n.º 2
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("~");

            LadderCalculator = new LadderCalculator();

            ZkServerRunner = new ServerRunner(mvcApplication.Server.MapPath("~"), new PlanetwarsEventCreator(), LadderCalculator);
            Server = ZkServerRunner.ZkLobbyServer;

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

            ForumPostIndexer = new ForumPostIndexer();

            Trace.TraceInformation("Starting autoregistrator");
            AutoRegistrator = new AutoRegistrator(MapPath("~"));
            AutoRegistrator.RunMainAndMapSyncAsync();

 

            SetupPaypalInterface();

            if (GlobalConst.PlanetWarsMode == PlanetWarsModes.Running) PlanetWarsMatchMaker = new PlanetWarsMatchMaker(Server);
        }