Exemple #1
0
        private static void CheckTLS(Action onAccept = null)
        {
            RegistryKey registryKey = Registry.CurrentUser.OpenSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\", writable: true);
            RegistryKey subkey      = registryKey.CreateSubKey("Internet Settings");
            int         val         = (int)subkey.GetValue("SecureProtocols");
            WarningBox  warningBox  = new WarningBox();

            if (val < 2048)
            {
                warningBox.Show("TLS 1.2 must be enabled in order for the Habbo application to run.", 28, AddKey, delegate
                {
                    warningBox.Close();
                });
                return;
            }
            subkey.Close();
            onAccept?.Invoke();
            void AddKey()
            {
                val += 2048;
                subkey.SetValue("SecureProtocols", val, RegistryValueKind.DWord);
                subkey.Close();
                warningBox.Close();
                onAccept?.Invoke();
            }
        }
Exemple #2
0
 private static void Main()
 {
     ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
     AddFontForPublicUsage();
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(defaultValue: false);
     if (!File.Exists(versionFilePath))
     {
         Version graph = new Version(flashVersion, unityVersion, launcherVersion);
         DataContractJsonSerializer dataContractJsonSerializer = new DataContractJsonSerializer(typeof(Version));
         using (MemoryStream memoryStream = new MemoryStream())
         {
             dataContractJsonSerializer.WriteObject((Stream)memoryStream, (object)graph);
             memoryStream.Position = 0L;
             string value = new StreamReader(memoryStream).ReadToEnd();
             using (StreamWriter streamWriter = File.CreateText(versionFilePath))
             {
                 streamWriter.Write(value);
             }
         }
     }
     else
     {
         string s = File.ReadAllText(versionFilePath);
         DataContractJsonSerializer dataContractJsonSerializer2 = new DataContractJsonSerializer(typeof(Version));
         using (MemoryStream stream = new MemoryStream(Encoding.UTF8.GetBytes(s)))
         {
             Version obj = dataContractJsonSerializer2.ReadObject((Stream)stream) as Version;
             flashVersion    = obj.FlashVersionNumber;
             unityVersion    = obj.UnityVersionNumber;
             launcherVersion = obj.LauncherVersionNumber;
         }
     }
     GetConfig();
     loadingDialog = new WarningBox();
     loadingDialog.Show("Loading");
     Application.Run(loadingDialog);
 }
Exemple #3
0
 private static void OnJsonDl(object sender, DownloadStringCompletedEventArgs e)
 {
     if (e.Cancelled)
     {
         return;
     }
     if (e.Error == null)
     {
         configJson = e.Result;
         Console.WriteLine(e.Result);
         if (!string.IsNullOrEmpty(configJson) && !string.IsNullOrWhiteSpace(configJson))
         {
             OnConfigLoaded(configJson);
             return;
         }
         WarningBox warningBox = new WarningBox();
         warningBox.Show("Network error - check your connection and try again!");
         Application.Run(warningBox);
         isFlashReady = true;
         isUnityReady = true;
         InitForm(delegate
         {
             SetStatus(isFlashReady, isUnityReady, downloadingFlash, downloadingUnity);
         });
     }
     else
     {
         WarningBox warningBox2 = new WarningBox();
         warningBox2.Show("Network error - check your connection and try again!");
         Application.Run(warningBox2);
         isFlashReady = true;
         isUnityReady = true;
         InitForm(delegate
         {
             SetStatus(isFlashReady, isUnityReady, downloadingFlash, downloadingUnity);
         });
     }
 }
Exemple #4
0
 private static void OnConfigLoaded(Config config)
 {
     if (config.WindowsLauncherVersion <= launcherVersion)
     {
         if (config.WindowsFlashVersion <= flashVersion)
         {
             isFlashReady = true;
         }
         else
         {
             isFlashReady = false;
         }
         if (config.WindowsUnityVersion <= unityVersion)
         {
             isUnityReady = true;
         }
         else
         {
             isUnityReady = false;
         }
         InitForm(delegate
         {
             SetStatus(isFlashReady, isUnityReady, downloadingFlash, downloadingUnity);
         });
     }
     else
     {
         WarningBox warningBox = new WarningBox();
         warningBox.Show("Your launcher is out of date!");
         warningBox.AddOnCloseEvent(delegate
         {
             Application.Exit();
         });
         Process.Start("https://www.habbo.com/");
         Application.Run(warningBox);
     }
 }