Beispiel #1
0
        private void DownloadLocalizationFile(string strDownloadSource, string strLocalizationFilename)
        {
            lock (this.m_objDownloadingLocalizations) {
                CDownloadFile cdfUpdatedLocalization = new CDownloadFile(strDownloadSource, strLocalizationFilename);
                cdfUpdatedLocalization.DownloadComplete += new CDownloadFile.DownloadFileEventDelegate(m_cdfUpdatedLocalization_DownloadComplete);
                this.m_lstDownloadingLocalizations.Add(cdfUpdatedLocalization);

                cdfUpdatedLocalization.BeginDownload();
            }
        }
Beispiel #2
0
        private void DownloadLocalizationFile(string strDownloadSource, string strLocalizationFilename)
        {
            lock (DownloadingLocalizationsLock) {
                var cdfUpdatedLocalization = new CDownloadFile(strDownloadSource, strLocalizationFilename);
                cdfUpdatedLocalization.DownloadComplete += new CDownloadFile.DownloadFileEventDelegate(m_cdfUpdatedLocalization_DownloadComplete);
                DownloadingLocalizations.Add(cdfUpdatedLocalization);

                cdfUpdatedLocalization.BeginDownload();
            }
        }
Beispiel #3
0
        private void DownloadGameConfigFile(string strDownloadSource, string strGameConfigFilename)
        {
            lock (DownloadingGameConfigsLock) {
                var cdfUpdatedGameConfig = new CDownloadFile(strDownloadSource, strGameConfigFilename);
                cdfUpdatedGameConfig.DownloadComplete += new CDownloadFile.DownloadFileEventDelegate(m_cdfUpdatedGameConfig_DownloadComplete);
                DownloadingGameConfigs.Add(cdfUpdatedGameConfig);

                cdfUpdatedGameConfig.BeginDownload();
            }
        }
Beispiel #4
0
        private void DownloadGameConfigFile(string strDownloadSource, string strGameConfigFilename)
        {
            lock (this.m_objDownloadingGameConfigs)
            {
                CDownloadFile cdfUpdatedGameConfig = new CDownloadFile(strDownloadSource, strGameConfigFilename);
                cdfUpdatedGameConfig.DownloadComplete += new CDownloadFile.DownloadFileEventDelegate(m_cdfUpdatedGameConfig_DownloadComplete);
                this.m_lstDownloadingGameConfigs.Add(cdfUpdatedGameConfig);

                cdfUpdatedGameConfig.BeginDownload();
            }
        }
Beispiel #5
0
        private void VersionChecker_DownloadComplete(CDownloadFile sender) {
            string[] versionData = Encoding.UTF8.GetString(sender.CompleteFileData).Split('\n');

            if (versionData.Length >= 4 && (ProconUpdate == null || ProconUpdate.FileDownloading == false)) {
                // Download file, alert or auto apply once complete with release notes.
                ProconUpdate = new CDownloadFile(versionData[2], versionData[3]);
                ProconUpdate.DownloadComplete += new CDownloadFile.DownloadFileEventDelegate(cdfPRoConUpdate_DownloadComplete);

                if (UpdateDownloading != null) {
                    FrostbiteConnection.RaiseEvent(UpdateDownloading.GetInvocationList(), ProconUpdate);
                }

                ProconUpdate.BeginDownload();
            }
        }
Beispiel #6
0
        private void lnkHttpServerForwardedTest_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            CDownloadFile portTest = new CDownloadFile("http://www.phogue.net/procon/testport.php?port=" + this.txtHttpServerStartPort.Text);

            portTest.DownloadComplete += new CDownloadFile.DownloadFileEventDelegate(portTest_DownloadComplete);
            portTest.DownloadError    += new CDownloadFile.DownloadFileEventDelegate(portTest_DownloadError);

            this.picHttpServerForwardedTestStatus.Image = this.m_frmParent.picAjaxStyleLoading.Image;
            //this.tmrPortCheckTester.Enabled = true;
            this.lnkHttpServerForwardedTest.Enabled         = false;
            this.lblHttpServerForwardedTestStatus.Text      = this.m_praApplication.CurrentLanguage.GetLocalized("frmOptions.lblHttpServerForwardedTestStatus.Running", this.txtHttpServerStartPort.Text);
            this.lblHttpServerForwardedTestStatus.ForeColor = Color.Black;

            portTest.BeginDownload();
        }
Beispiel #7
0
        public void DownloadPackage(string extractPath)
        {
            CDownloadFile packageDownload = null;

            if (this.Uid.Length > 0 && this.Md5.Length > 0 && this.Version != null)
            {
                packageDownload = new CDownloadFile(String.Format("http://phogue.net/procon/packages/download.php?uid={0}&version={1}", this.Uid, this.Version), extractPath);

                packageDownload.DownloadComplete       += new CDownloadFile.DownloadFileEventDelegate(packageDownload_DownloadComplete);
                packageDownload.DownloadError          += new CDownloadFile.DownloadFileEventDelegate(packageDownload_DownloadError);
                packageDownload.DownloadProgressUpdate += new CDownloadFile.DownloadFileEventDelegate(packageDownload_DownloadProgressUpdate);

                packageDownload.BeginDownload();
            }
        }
Beispiel #8
0
        private void VersionChecker_DownloadComplete(CDownloadFile sender)
        {
            string[] versionData = Encoding.UTF8.GetString(sender.CompleteFileData).Split('\n');

            if (versionData.Length >= 4 && (ProconUpdate == null || ProconUpdate.FileDownloading == false))
            {
                // Download file, alert or auto apply once complete with release notes.
                ProconUpdate = new CDownloadFile(versionData[2], versionData[3]);
                ProconUpdate.DownloadComplete += new CDownloadFile.DownloadFileEventDelegate(cdfPRoConUpdate_DownloadComplete);

                if (UpdateDownloading != null)
                {
                    FrostbiteConnection.RaiseEvent(UpdateDownloading.GetInvocationList(), ProconUpdate);
                }

                ProconUpdate.BeginDownload();
            }
        }
Beispiel #9
0
        public void DownloadPackage(string extractPath) {
            CDownloadFile packageDownload = null;

            if (this.Uid.Length > 0 && this.Md5.Length > 0 && this.Version != null) {
                packageDownload = new CDownloadFile(String.Format("http://phogue.net/procon/packages/download.php?uid={0}&version={1}", this.Uid, this.Version), extractPath);

                packageDownload.DownloadComplete += new CDownloadFile.DownloadFileEventDelegate(packageDownload_DownloadComplete);
                packageDownload.DownloadError += new CDownloadFile.DownloadFileEventDelegate(packageDownload_DownloadError);
                packageDownload.DownloadProgressUpdate += new CDownloadFile.DownloadFileEventDelegate(packageDownload_DownloadProgressUpdate);

                packageDownload.BeginDownload();
            }
        }
Beispiel #10
0
        private void VersionChecker_DownloadComplete(CDownloadFile sender)
        {
            string[] versionData = Encoding.UTF8.GetString(sender.CompleteFileData).Split('\n');
            GameConfigHint = false;

            if (versionData.Length >= 4 && (ProconUpdate == null || ProconUpdate.FileDownloading == false))
            {
                bool blContinueFileDownload = true;

                try {
                    if (Directory.Exists(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Updates")) == true)
                    {
                        AssemblyName proconAssemblyName = AssemblyName.GetAssemblyName(Path.Combine(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Updates"), "PRoCon.exe"));

                        // If an update has already been downloaded but not installed..
                        if (new Version(versionData[0]).CompareTo(proconAssemblyName.Version) >= 0)
                        {
                            blContinueFileDownload = false;
                        }
                    }
                }
                catch (Exception) {
                }

                if (blContinueFileDownload == true)
                {
                    if (new Version(versionData[0]).CompareTo(Assembly.GetExecutingAssembly().GetName().Version) > 0)
                    {
                        // Download file, alert or auto apply once complete with release notes.
                        ProconUpdate = new CDownloadFile(versionData[2], versionData[3]);
                        ProconUpdate.DownloadComplete += new CDownloadFile.DownloadFileEventDelegate(cdfPRoConUpdate_DownloadComplete);

                        if (UpdateDownloading != null)
                        {
                            this.UpdateDownloading(ProconUpdate);
                        }

                        ProconUpdate.BeginDownload();
                    }
                    else
                    {
                        if (NoVersionAvailable != null)
                        {
                            this.NoVersionAvailable();
                        }

                        lock (DownloadingLocalizationsLock) {
                            foreach (CDownloadFile cdfFile in DownloadingLocalizations)
                            {
                                cdfFile.EndDownload();
                            }

                            DownloadingLocalizations.Clear();
                        }

                        lock (DownloadingGameConfigsLock) {
                            foreach (CDownloadFile cdfFile in DownloadingGameConfigs)
                            {
                                cdfFile.EndDownload();
                            }

                            DownloadingGameConfigs.Clear();
                        }

                        for (int i = 4; i < versionData.Length; i++)
                        {
                            List <string> lstExtensibilityVersion = Packet.Wordify(versionData[i]);

                            if (lstExtensibilityVersion.Count >= 4 && System.String.Compare(lstExtensibilityVersion[0], "localization", System.StringComparison.OrdinalIgnoreCase) == 0)
                            {
                                try {
                                    if (File.Exists(Path.Combine(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Localization"), lstExtensibilityVersion[2])) == true)
                                    {
                                        if (System.String.Compare(lstExtensibilityVersion[1], MD5File(Path.Combine(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Localization"), lstExtensibilityVersion[2])), System.StringComparison.OrdinalIgnoreCase) != 0)
                                        {
                                            // Download new localization file and tell options to reload it once completed.
                                            DownloadLocalizationFile(lstExtensibilityVersion[3], lstExtensibilityVersion[2]);
                                            Thread.Sleep(100); // I don't know how many languages there may be later so sleep on it to prevent spam.
                                        }
                                    }
                                    else
                                    {
                                        // Download new localization file and tell options to load it once completed.
                                        DownloadLocalizationFile(lstExtensibilityVersion[3], lstExtensibilityVersion[2]);
                                        Thread.Sleep(100);
                                    }
                                }
                                catch (Exception) {
                                }
                            }

                            // GameConfigs
                            if (lstExtensibilityVersion.Count >= 4 && System.String.Compare(lstExtensibilityVersion[0], "gameconfig", System.StringComparison.OrdinalIgnoreCase) == 0 && Application.OptionsSettings.AutoCheckGameConfigsForUpdates == true)
                            {
                                try {
                                    if (File.Exists(Path.Combine(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Configs"), lstExtensibilityVersion[2])) == true)
                                    {
                                        if (System.String.Compare(lstExtensibilityVersion[1], MD5File(Path.Combine(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Configs"), lstExtensibilityVersion[2])), System.StringComparison.OrdinalIgnoreCase) != 0)
                                        {
                                            // Download new GameConfig file
                                            DownloadGameConfigFile(lstExtensibilityVersion[3], lstExtensibilityVersion[2]);
                                            Thread.Sleep(100); // we don't know how many will come.
                                        }
                                    }
                                    else
                                    {
                                        // Download new GameConfig file
                                        DownloadGameConfigFile(lstExtensibilityVersion[3], lstExtensibilityVersion[2]);
                                        Thread.Sleep(100);
                                    }
                                }
                                catch (Exception) {
                                }
                            }
                        }
                    }
                }
                else
                {
                    DownloadedUnzippedComplete();
                }
            }
        }
Beispiel #11
0
        private void lnkHttpServerForwardedTest_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) {

            CDownloadFile portTest = new CDownloadFile("http://www.phogue.net/procon/testport.php?port=" + this.txtHttpServerStartPort.Text);
            portTest.DownloadComplete += new CDownloadFile.DownloadFileEventDelegate(portTest_DownloadComplete);
            portTest.DownloadError += new CDownloadFile.DownloadFileEventDelegate(portTest_DownloadError);

            this.picHttpServerForwardedTestStatus.Image = this.m_frmParent.picAjaxStyleLoading.Image;
            //this.tmrPortCheckTester.Enabled = true;
            this.lnkHttpServerForwardedTest.Enabled = false;
            this.lblHttpServerForwardedTestStatus.Text = this.m_praApplication.CurrentLanguage.GetLocalized("frmOptions.lblHttpServerForwardedTestStatus.Running", this.txtHttpServerStartPort.Text);
            this.lblHttpServerForwardedTestStatus.ForeColor = Color.Black;

            portTest.BeginDownload();
        }
Beispiel #12
0
        private void DownloadLocalizationFile(string strDownloadSource, string strLocalizationFilename) {
            lock (this.m_objDownloadingLocalizations) {
                CDownloadFile cdfUpdatedLocalization = new CDownloadFile(strDownloadSource, strLocalizationFilename);
                cdfUpdatedLocalization.DownloadComplete += new CDownloadFile.DownloadFileEventDelegate(m_cdfUpdatedLocalization_DownloadComplete);
                this.m_lstDownloadingLocalizations.Add(cdfUpdatedLocalization);

                cdfUpdatedLocalization.BeginDownload();
            }
        }
Beispiel #13
0
        private void DownloadGameConfigFile(string strDownloadSource, string strGameConfigFilename)
        {
            lock (this.m_objDownloadingGameConfigs)
            {
                CDownloadFile cdfUpdatedGameConfig = new CDownloadFile(strDownloadSource, strGameConfigFilename);
                cdfUpdatedGameConfig.DownloadComplete += new CDownloadFile.DownloadFileEventDelegate(m_cdfUpdatedGameConfig_DownloadComplete);
                this.m_lstDownloadingGameConfigs.Add(cdfUpdatedGameConfig);

                cdfUpdatedGameConfig.BeginDownload();
            }
        }
Beispiel #14
0
        private void DownloadLocalizationFile(string strDownloadSource, string strLocalizationFilename) {
            lock (DownloadingLocalizationsLock) {
                var cdfUpdatedLocalization = new CDownloadFile(strDownloadSource, strLocalizationFilename);
                cdfUpdatedLocalization.DownloadComplete += new CDownloadFile.DownloadFileEventDelegate(m_cdfUpdatedLocalization_DownloadComplete);
                DownloadingLocalizations.Add(cdfUpdatedLocalization);

                cdfUpdatedLocalization.BeginDownload();
            }
        }
Beispiel #15
0
        private void VersionChecker_DownloadComplete(CDownloadFile sender) {
            string[] versionData = Encoding.UTF8.GetString(sender.CompleteFileData).Split('\n');
            GameConfigHint = false;

            if (versionData.Length >= 4 && (ProconUpdate == null || ProconUpdate.FileDownloading == false)) {
                bool blContinueFileDownload = true;

                try {
                    if (Directory.Exists(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Updates")) == true) {
                        AssemblyName proconAssemblyName = AssemblyName.GetAssemblyName(Path.Combine(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Updates"), "PRoCon.exe"));

                        // If an update has already been downloaded but not installed..
                        if (new Version(versionData[0]).CompareTo(proconAssemblyName.Version) >= 0) {
                            blContinueFileDownload = false;
                        }
                    }
                }
                catch (Exception) {
                }

                if (blContinueFileDownload == true) {
                    if (new Version(versionData[0]).CompareTo(Assembly.GetExecutingAssembly().GetName().Version) > 0) {
                        // Download file, alert or auto apply once complete with release notes.
                        ProconUpdate = new CDownloadFile(versionData[2], versionData[3]);
                        ProconUpdate.DownloadComplete += new CDownloadFile.DownloadFileEventDelegate(cdfPRoConUpdate_DownloadComplete);

                        if (UpdateDownloading != null) {
                            this.UpdateDownloading(ProconUpdate);
                        }

                        ProconUpdate.BeginDownload();
                    }
                    else {
                        if (NoVersionAvailable != null) {
                            this.NoVersionAvailable();
                        }

                        lock (DownloadingLocalizationsLock) {
                            foreach (CDownloadFile cdfFile in DownloadingLocalizations) {
                                cdfFile.EndDownload();
                            }

                            DownloadingLocalizations.Clear();
                        }

                        lock (DownloadingGameConfigsLock) {
                            foreach (CDownloadFile cdfFile in DownloadingGameConfigs) {
                                cdfFile.EndDownload();
                            }

                            DownloadingGameConfigs.Clear();
                        }

                        for (int i = 4; i < versionData.Length; i++) {
                            List<string> lstExtensibilityVersion = Packet.Wordify(versionData[i]);

                            if (lstExtensibilityVersion.Count >= 4 && System.String.Compare(lstExtensibilityVersion[0], "localization", System.StringComparison.OrdinalIgnoreCase) == 0) {
                                try {
                                    if (File.Exists(Path.Combine(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Localization"), lstExtensibilityVersion[2])) == true) {
                                        if (System.String.Compare(lstExtensibilityVersion[1], MD5File(Path.Combine(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Localization"), lstExtensibilityVersion[2])), System.StringComparison.OrdinalIgnoreCase) != 0) {
                                            // Download new localization file and tell options to reload it once completed.
                                            DownloadLocalizationFile(lstExtensibilityVersion[3], lstExtensibilityVersion[2]);
                                            Thread.Sleep(100); // I don't know how many languages there may be later so sleep on it to prevent spam.
                                        }
                                    }
                                    else {
                                        // Download new localization file and tell options to load it once completed.
                                        DownloadLocalizationFile(lstExtensibilityVersion[3], lstExtensibilityVersion[2]);
                                        Thread.Sleep(100);
                                    }
                                }
                                catch (Exception) {
                                }
                            }

                            // GameConfigs
                            if (lstExtensibilityVersion.Count >= 4 && System.String.Compare(lstExtensibilityVersion[0], "gameconfig", System.StringComparison.OrdinalIgnoreCase) == 0 && Application.OptionsSettings.AutoCheckGameConfigsForUpdates == true) {
                                try {
                                    if (File.Exists(Path.Combine(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Configs"), lstExtensibilityVersion[2])) == true) {
                                        if (System.String.Compare(lstExtensibilityVersion[1], MD5File(Path.Combine(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Configs"), lstExtensibilityVersion[2])), System.StringComparison.OrdinalIgnoreCase) != 0) {
                                            // Download new GameConfig file 
                                            DownloadGameConfigFile(lstExtensibilityVersion[3], lstExtensibilityVersion[2]);
                                            Thread.Sleep(100); // we don't know how many will come.
                                        }
                                    }
                                    else {
                                        // Download new GameConfig file
                                        DownloadGameConfigFile(lstExtensibilityVersion[3], lstExtensibilityVersion[2]);
                                        Thread.Sleep(100);
                                    }
                                }
                                catch (Exception) {
                                }
                            }
                        }
                    }
                }
                else {
                    DownloadedUnzippedComplete();
                }
            }
        }
Beispiel #16
0
        private void DownloadGameConfigFile(string strDownloadSource, string strGameConfigFilename) {
            lock (DownloadingGameConfigsLock) {
                var cdfUpdatedGameConfig = new CDownloadFile(strDownloadSource, strGameConfigFilename);
                cdfUpdatedGameConfig.DownloadComplete += new CDownloadFile.DownloadFileEventDelegate(m_cdfUpdatedGameConfig_DownloadComplete);
                DownloadingGameConfigs.Add(cdfUpdatedGameConfig);

                cdfUpdatedGameConfig.BeginDownload();
            }
        }