Esempio n. 1
0
 public static bool InitSafe()
 {
     lock (Mutex)
     {
         return(SteamAPI.InitSafe());
     }
 }
Esempio n. 2
0
        private static void InitializeInner()
        {
            var initialized = SteamAPI.InitSafe();

            for (var i = 0; i < 3 && !initialized; i++)
            {
                Logging.Debug($"Delayed Steam initialization, attempt #{i + 1} {(SteamAPI.IsSteamRunning() ? "" : "(Steam not running)")}");
                Thread.Sleep(150);

                try {
                    SteamAPI.Shutdown();
                } catch (Exception e) {
                    Logging.Debug("Steam API shutdown not required: " + e);
                }

                initialized = SteamAPI.Init();
            }

            if (!initialized)
            {
                Logging.Debug("Still not initialized…");

                if (!SteamAPI.RestartAppIfNecessary(new AppId_t(244210u)))
                {
                    MessageBox.Show("Steam can’t be initialized.", "Steam Inactive", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                }

                Environment.Exit(0);
            }

            RunCallbacks().Forget();
            SteamUtils.SetOverlayNotificationPosition(ENotificationPosition.k_EPositionBottomLeft);
        }
Esempio n. 3
0
        private static void InitializeInner()
        {
            var initialized = SteamAPI.InitSafe();

            for (var i = 0; i < 3 && !initialized; i++)
            {
                Logging.Write($"Delayed Steam initialization, attempt #{i + 1} {(SteamAPI.IsSteamRunning() ? "" : "(Steam not running)")}");
                Thread.Sleep(150);

                try {
                    SteamAPI.Shutdown();
                } catch (Exception e) {
                    Logging.Write("Steam API shutdown not required: " + e);
                }

                initialized = SteamAPI.Init();
            }

            if (!initialized)
            {
                Logging.Write("Still not initialized…");

                if (!SteamAPI.RestartAppIfNecessary(new AppId_t(244210u)))
                {
                    MessageBox.Show("Steam can’t be initialized.", "Steam Inactive", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                }

                Environment.Exit(0);
            }

            RunCallbacks().Ignore();
            SteamUtils.SetOverlayNotificationPosition(ENotificationPosition.k_EPositionBottomLeft);

            try {
                if (SteamIdHelper.Instance != null)
                {
                    SteamIdHelper.Instance.Value = SteamUser.GetSteamID().ToString();
                }
            } catch (Exception e) {
                Logging.Error(e);
            }

            AppDomain.CurrentDomain.ProcessExit += (sender, args) => SteamAPI.Shutdown();
        }
Esempio n. 4
0
 public static void InitPlatformAPI()
 {
     if (Settings.isConventionDemo)
     {
         return;
     }
     PlatformAPISettings.Running = SteamAPI.Init();
     if (!PlatformAPISettings.Running)
     {
         PlatformAPISettings.Report = "First Init Failed. ";
         Console.WriteLine("Steam Init Failed!");
         PlatformAPISettings.Running = SteamAPI.InitSafe();
         PlatformAPISettings.Report  = PlatformAPISettings.Report + " Second init Running = " + (object)PlatformAPISettings.Running;
         Console.WriteLine(PlatformAPISettings.Report);
     }
     else
     {
         PlatformAPISettings.Report = "Steam API Running :" + (object)PlatformAPISettings.Running;
     }
     if (PlatformAPISettings.Running)
     {
         PlatformAPISettings.RemoteStorageRunning = SteamRemoteStorage.IsCloudEnabledForAccount();
     }
 }
Esempio n. 5
0
 public static void InitPlatformAPI()
 {
     if (Settings.isConventionDemo)
     {
         return;
     }
     Running = true; // SteamAPI.Init();
     if (!Running)
     {
         Report = "First Init Failed. ";
         Console.WriteLine("Steam Init Failed!");
         Running = SteamAPI.InitSafe();
         Report  = Report + " Second init Running = " + Running;
     }
     else
     {
         Report = "Steam API Running :" + Running;
     }
     if (!Running)
     {
         return;
     }
     RemoteStorageRunning = false; // SteamRemoteStorage.IsCloudEnabledForAccount();
 }
Esempio n. 6
0
 private void startClick(object sender, EventArgs e)
 {
     Environment.SetEnvironmentVariable("SteamAppID", "252490");
     SteamAPI.InitSafe();
 }