Ejemplo 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("~");

            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();
        }
Ejemplo n.º 2
0
        public static void StartApplication(MvcApplication mvcApplication)
        {
            var listener = new ZkServerTraceListener();
            Trace.Listeners.Add(listener);

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

            SetupPaypalInterface();

            if (GlobalConst.PlanetWarsMode == PlanetWarsModes.Running) PlanetWarsMatchMaker = new PlanetWarsMatchMaker(Server);
        }
Ejemplo n.º 3
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);
        }