Ejemplo n.º 1
0
        /// <summary>
        /// Sends the usage stats to the official launchpad server.
        /// </summary>
        static public void SendUsageStats()
        {
            WebRequest sendStatsRequest = null;

            try
            {
                string baseURL      = "http://directorate.asuscomm.com/launchpad/stats.php?";
                string formattedURL = String.Format(baseURL + "guid={0}&launcherVersion={1}&gameName={2}&systemType={3}&officialUpdates={4}",
                                                    Config.GetGUID(),
                                                    Config.GetLocalLauncherVersion(),
                                                    Config.GetGameName(),
                                                    Config.GetSystemTarget().ToString(),
                                                    Config.GetDoOfficialUpdates().ToString()
                                                    );


                sendStatsRequest = WebRequest.Create(formattedURL);
                sendStatsRequest.GetResponse();
            }
            catch (WebException wex)
            {
                Console.WriteLine("WebException in SendUsageStats(): " + wex.Message);
            }
            finally
            {
                sendStatsRequest.Abort();
            }
        }
Ejemplo n.º 2
0
        private static void Main()
        {
            // Bind any unhandled exceptions in the main thread so that they are logged.
            AppDomain.CurrentDomain.UnhandledException += OnUnhandledException;

            log4net.Config.XmlConfigurator.Configure();

            Log.Info("----------------");
            Log.Info($"Launchpad v{Config.GetLocalLauncherVersion()} starting...");
            Log.Info($"Current platform: {ConfigHandler.GetCurrentPlatform()} ({(Environment.Is64BitOperatingSystem ? "x64" : "x86")})");

            // Set correct working directory for compatibility with double-clicking
            Directory.SetCurrentDirectory(ConfigHandler.GetLocalDir());

            Log.Info("Initializing UI...");

            // Bind any unhandled exceptions in the GTK UI so that they are logged.
            GLib.ExceptionManager.UnhandledException += OnGLibUnhandledException;

            // Run the GTK UI
            Gtk.Application.Init();
            MainWindow win = new MainWindow();

            win.Show();
            win.Initialize();
            Gtk.Application.Run();
        }
Ejemplo n.º 3
0
        private static void Main()
        {
            // Bind any unhandled exceptions in the main thread so that they are logged.
            AppDomain.CurrentDomain.UnhandledException += OnUnhandledException;

            Log.Info("----------------");
            Log.Info($"Launchpad v{Config.GetLocalLauncherVersion()} starting...");
            Log.Info($"Current platform: {ConfigHandler.GetCurrentPlatform()} ({(Environment.Is64BitOperatingSystem ? "x64" : "x86")})");

            // Set correct working directory for compatibility with double-clicking
            Directory.SetCurrentDirectory(ConfigHandler.GetLocalDir());

            if (ChecksHandler.IsRunningOnUnix())
            {
                Log.Info("Initializing GTK UI.");
                RunUnixInterface();
            }
            else
            {
                Log.Info("Initializing WinForms UI.");
                RunWindowsInterface();
            }
        }
        /// <summary>
        /// Determines whether the launcher is outdated.
        /// </summary>
        /// <returns><c>true</c> if the launcher is outdated; otherwise, <c>false</c>.</returns>
        public bool IsLauncherOutdated()
        {
            FTPHandler FTP = new FTPHandler();

            try
            {
                Version local  = Config.GetLocalLauncherVersion();
                Version remote = FTP.GetRemoteLauncherVersion();

                if (local < remote)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (WebException wex)
            {
                Console.WriteLine("WebException in IsLauncherOutdated(): " + wex.Message);
                return(false);
            }
        }