示例#1
0
        static void Main(string[] args)
        {
            Trace.Listeners.Add(new ConsoleTraceListener());
            var sitePath = GlobalConst.SiteDiskPath;

            if (args.Length > 0)
            {
                sitePath = args[0];
            }

            //var ar = new ZeroKWeb.AutoRegistrator(sitePath);
            //ar.Main();

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

            spg.RunAll();
        }
示例#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("~");

            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();
        }