public static void quitHearthstoneAndRun()
 {
     Blizzard.Log.Warning("Hearthstone was not run from Battle.net Client");
     if (!bootstrapper.Exists)
     {
         Blizzard.Log.Warning("Hearthstone could not find Battle.net client");
         Error.AddFatalLoc("GLUE_CANNOT_FIND_BATTLENET_CLIENT", new object[0]);
     }
     else
     {
         try
         {
             Process process2 = new Process {
                 StartInfo           = { UseShellExecute = false, FileName = bootstrapper.FullName, Arguments = "-uid hs_beta" },
                 EnableRaisingEvents = true
             };
             process2.Start();
             Blizzard.Log.Warning("Hearthstone ran Battle.net Client.  Exiting.");
             ApplicationMgr.Get().Exit();
         }
         catch (Exception exception)
         {
             Error.AddFatalLoc("GLUE_CANNOT_RUN_BATTLENET_CLIENT", new object[0]);
             object[] args = new object[] { exception.Message };
             Blizzard.Log.Warning("Hearthstone could not launch Battle.net client: {0}", args);
         }
     }
 }
Пример #2
0
    public static IntPtr LoadPlugin(string fileName, bool handleError = true)
    {
        PlatformDependentValue <string> value2 = new PlatformDependentValue <string>(PlatformCategory.OS)
        {
            PC      = "Hearthstone_Data/Plugins/{0}",
            Mac     = "Hearthstone.app/Contents/Plugins/{0}.bundle/Contents/MacOS/{0}",
            iOS     = string.Empty,
            Android = string.Empty
        };

        try
        {
            string filename = string.Format((string)value2, fileName);
            IntPtr ptr      = DLLUtils.LoadLibrary(filename);
            if ((ptr == IntPtr.Zero) && handleError)
            {
                string   str2        = Directory.GetCurrentDirectory().Replace(@"\", "/");
                string   str3        = string.Format("{0}/{1}", str2, filename);
                object[] messageArgs = new object[] { str3 };
                Error.AddDevFatal("Failed to load plugin from '{0}'", messageArgs);
                object[] objArray2 = new object[] { fileName };
                Error.AddFatalLoc("GLOBAL_ERROR_ASSET_LOAD_FAILED", objArray2);
            }
            return(ptr);
        }
        catch (Exception exception)
        {
            object[] objArray3 = new object[] { exception.Message, exception.StackTrace };
            Error.AddDevFatal("FileUtils.LoadPlugin() - Exception occurred. message={0} stackTrace={1}", objArray3);
            return(IntPtr.Zero);
        }
    }
 private void ThrowDnsResolveError(string environment)
 {
     if (ApplicationMgr.IsInternal())
     {
         Error.AddDevFatal("Environment " + environment + " could not be resolved! Please check your environment and Internet connection!", new object[0]);
     }
     else
     {
         Error.AddFatalLoc("GLOBAL_ERROR_NETWORK_NO_CONNECTION", new object[0]);
     }
 }
 private void CheckInactivity()
 {
     if (this.IsCheckingForInactivity())
     {
         if (this.m_activityDetected)
         {
             this.m_inactivityStartTimestamp = UnityEngine.Time.realtimeSinceStartup;
             this.m_activityDetected         = false;
         }
         else
         {
             float num = UnityEngine.Time.realtimeSinceStartup - this.m_inactivityStartTimestamp;
             if (num >= this.m_kickSec)
             {
                 Error.AddFatalLoc("GLOBAL_ERROR_INACTIVITY_KICK", new object[0]);
                 if (ApplicationMgr.AllowResetFromFatalError == null)
                 {
                     UnityEngine.Object.Destroy(this);
                 }
             }
         }
     }
 }
Пример #5
0
 private void AssetsVersionCheckCompleted()
 {
     if (!string.IsNullOrEmpty(UpdateManager.Get().GetError()) && UpdateManager.Get().UpdateIsRequired())
     {
         Error.AddFatalLoc("GLUE_PATCHING_ERROR", new object[0]);
     }
     else
     {
         if (Network.ShouldBeConnectedToAurora())
         {
             BnetPresenceMgr.Get().Initialize();
             BnetFriendMgr.Get().Initialize();
             BnetChallengeMgr.Get().Initialize();
             BnetWhisperMgr.Get().Initialize();
             BnetNearbyPlayerMgr.Get().Initialize();
             FriendChallengeMgr.Get().OnLoggedIn();
             SpectatorManager.Get().Initialize();
             if (!Options.Get().GetBool(Option.CONNECT_TO_AURORA))
             {
                 Options.Get().SetBool(Option.CONNECT_TO_AURORA, true);
             }
             TutorialProgress progress = Options.Get().GetEnum <TutorialProgress>(Option.LOCAL_TUTORIAL_PROGRESS);
             if (progress > TutorialProgress.NOTHING_COMPLETE)
             {
                 this.m_waitingForSetProgress = true;
                 ConnectAPI.SetProgress((long)progress);
             }
             if (WebAuth.GetIsNewCreatedAccount())
             {
                 AdTrackingManager.Get().TrackAccountCreated();
                 WebAuth.SetIsNewCreatedAccount(false);
             }
         }
         ConnectAPI.RequestAccountLicenses();
         ConnectAPI.RequestGameLicenses();
         Box.Get().OnLoggedIn();
         BaseUI.Get().OnLoggedIn();
         InactivePlayerKicker.Get().OnLoggedIn();
         HealthyGamingMgr.Get().OnLoggedIn();
         DefLoader.Get().Initialize();
         CollectionManager.Init();
         AdventureProgressMgr.Init();
         Tournament.Init();
         GameMgr.Get().OnLoggedIn();
         if (Network.ShouldBeConnectedToAurora())
         {
             StoreManager.Get().Init();
         }
         Network.TrackClient(Network.TrackLevel.LEVEL_INFO, Network.TrackWhat.TRACK_LOGIN_FINISHED);
         Network.ResetConnectionFailureCount();
         if (Network.ShouldBeConnectedToAurora())
         {
             ConnectAPI.DoLoginUpdate();
         }
         else
         {
             this.m_waitingForUpdateLoginComplete = false;
         }
         Enum[] args = new Enum[] { PresenceStatus.LOGIN };
         PresenceMgr.Get().SetStatus(args);
         if (SplashScreen.Get() != null)
         {
             SplashScreen.Get().StopPatching();
             SplashScreen.Get().ShowRatings();
         }
         this.PreloadActors();
         if (!Network.ShouldBeConnectedToAurora())
         {
             base.StartCoroutine(this.RegisterScreenWhenReady());
         }
         SceneMgr.Get().LoadShaderPreCompiler();
     }
 }