示例#1
0
 static void Listen()
 {
     try
     {
         if (SettingsManager.Settings.PortForwarding)
         {
             HttpServerManager.ForwardPort();
         }
         Forwarded = true;
         sv.listen();
     }
     catch
     {
     }
 }
示例#2
0
        /// <summary>
        /// The main entry point for the application.
        /// </summary>

        static void Main()
        {
            Application.ThreadException += new ThreadExceptionEventHandler(Application_ThreadException);

            AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
            SettingsManager.Init();
            //  //  [DISABLED] Console.Title = "Ghostblade Replay Server";
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            string[] args = Environment.GetCommandLineArgs();
            if (args.Length == 6)
            {
                string GameId = args[1];
                string Region = args[2];
                string gpath  = args[3];
                string lol    = args[4];
                string rep    = args[5];

                //     ReplayServer server = new ReplayServer(GameId, Region);
                GhostReplayServer sv = new GhostReplayServer(9068, GameId, Region, gpath, lol, rep);
                sv.listen();
            }
            else if (args.Length == 7)
            {
                string GameId = args[1];
                string Region = args[2];
                string gpath  = args[3];
                string lol    = args[4];
                string rep    = args[5];
                string ext    = args[6];

                if (int.TryParse(ext, out port))
                {
                    //     ReplayServer server = new ReplayServer(GameId, Region);


                    GhostReplayServer sv = new GhostReplayServer(port, GameId, Region, gpath, lol, rep);
                    sv.listen();
                }
            }
        }