예제 #1
0
 public void Initialize()
 {
     CoreSocialModule._instance = this;
     if (SteamAPI.RestartAppIfNecessary(new AppId_t(105600U)))
     {
         Environment.Exit(1);
     }
     else
     {
         if (!SteamAPI.Init())
         {
             int num = (int)MessageBox.Show(Language.GetTextValue("Error.LaunchFromSteam"), Language.GetTextValue("Error.Error"));
             Environment.Exit(1);
         }
         this.IsSteamValid = true;
         new Thread(new ParameterizedThreadStart(this.SteamCallbackLoop))
         {
             IsBackground = true
         }.Start();
         new Thread(new ParameterizedThreadStart(this.SteamTickLoop))
         {
             IsBackground = true
         }.Start();
         Main.OnTickForThirdPartySoftwareOnly += new Action(this.PulseSteamTick);
         Main.OnTickForThirdPartySoftwareOnly += new Action(this.PulseSteamCallback);
         if (!Platform.IsOSX)
         {
             return;
         }
         // ISSUE: method pointer
         this._onOverlayActivated = Callback <GameOverlayActivated_t> .Create(new Callback <GameOverlayActivated_t> .DispatchDelegate(OnOverlayActivated));
     }
 }
예제 #2
0
        public void Initialize()
        {
            //IL_000b: Unknown result type (might be due to invalid IL or missing references)
            _instance = this;
            if (SteamAPI.RestartAppIfNecessary(new AppId_t(105600u)))
            {
                Environment.Exit(1);
                return;
            }
            if (!SteamAPI.Init())
            {
                MessageBox.Show(Language.GetTextValue("Error.LaunchFromSteam"), Language.GetTextValue("Error.Error"));
                Environment.Exit(1);
            }
            IsSteamValid = true;
            Thread thread = new Thread(SteamCallbackLoop);

            thread.IsBackground = true;
            thread.Start();
            Thread thread2 = new Thread(SteamTickLoop);

            thread2.IsBackground = true;
            thread2.Start();
            Main.OnTickForThirdPartySoftwareOnly += PulseSteamTick;
            Main.OnTickForThirdPartySoftwareOnly += PulseSteamCallback;
            if (Platform.get_IsOSX())
            {
                _onOverlayActivated = Callback <GameOverlayActivated_t> .Create((DispatchDelegate <GameOverlayActivated_t>) OnOverlayActivated);
            }
        }
예제 #3
0
 public override void Initialize()
 {
     //_userStatsReceived = Callback<UserStatsReceived_t>.Create((DispatchDelegate<UserStatsReceived_t>)OnUserStatsReceived);
     SteamUserStats.RequestCurrentStats();
     while (!_areStatsReceived)
     {
         CoreSocialModule.Pulse();
         Thread.Sleep(10);
     }
 }
예제 #4
0
        public override void Initialize()
        {
            // ISSUE: method pointer
            this._userStatsReceived = Callback <UserStatsReceived_t> .Create(new Callback <UserStatsReceived_t> .DispatchDelegate((object)this, __methodptr(OnUserStatsReceived)));

            SteamUserStats.RequestCurrentStats();
            while (!this._areStatsReceived)
            {
                CoreSocialModule.Pulse();
                Thread.Sleep(10);
            }
        }
 private void SteamTickLoop(object context)
 {
     Monitor.Enter(_steamTickLock);
     while (IsSteamValid)
     {
         if (CoreSocialModule.OnTick != null)
         {
             CoreSocialModule.OnTick();
         }
         Monitor.Wait(_steamTickLock);
     }
     Monitor.Exit(_steamTickLock);
 }
예제 #6
0
 public void Initialize()
 {
     CoreSocialModule._instance = this;
     if (!SteamAPI.Init())
     {
         int num = (int)MessageBox.Show(Language.GetTextValue("Error.LaunchFromSteam"), Language.GetTextValue("Error.Error"));
         Environment.Exit(1);
     }
     this.IsSteamValid = true;
     ThreadPool.QueueUserWorkItem(new WaitCallback(this.SteamCallbackLoop), (object)null);
     ThreadPool.QueueUserWorkItem(new WaitCallback(this.SteamTickLoop), (object)null);
     Main.OnTick += new Action(this.PulseSteamTick);
     Main.OnTick += new Action(this.PulseSteamCallback);
 }
 public void Initialize()
 {
     _instance = this;
     if (!SteamAPI.Init())
     {
         MessageBox.Show("Please launch the game from your Steam client.", "Error");
         Environment.Exit(1);
     }
     IsSteamValid = true;
     ThreadPool.QueueUserWorkItem(SteamCallbackLoop, null);
     ThreadPool.QueueUserWorkItem(SteamTickLoop, null);
     Main.OnTick += PulseSteamTick;
     Main.OnTick += PulseSteamCallback;
 }
 private void SteamLoop(object context)
 {
     while (this.IsSteamValid)
     {
         Thread.Sleep(5);
         SteamAPI.RunCallbacks();
         if (CoreSocialModule.OnTick == null)
         {
             continue;
         }
         CoreSocialModule.OnTick();
     }
     SteamAPI.Shutdown();
 }
예제 #9
0
 private void SteamTickLoop(object context)
 {
     Monitor.Enter(this._steamTickLock);
     while (this.IsSteamValid)
     {
         // ISSUE: reference to a compiler-generated field
         if (CoreSocialModule.OnTick != null)
         {
             // ISSUE: reference to a compiler-generated field
             CoreSocialModule.OnTick();
         }
         Monitor.Wait(this._steamTickLock);
     }
     Monitor.Exit(this._steamTickLock);
 }
예제 #10
0
        public override void Initialize()
        {
            this._userStatsReceived =
                Callback <UserStatsReceived_t> .Create(
                    new Callback <UserStatsReceived_t> .DispatchDelegate(OnUserStatsReceived));

            SteamUserStats.RequestCurrentStats();
            while (!this._areStatsReceived)
            {
                CoreSocialModule.Pulse();
                Thread.Sleep(10);
                //Fix By GScience(Attention)
                this._areStatsReceived = true;
            }

            ;
        }
예제 #11
0
 public void Initialize()
 {
     CoreSocialModule._instance = this;
     if (SteamAPI.RestartAppIfNecessary(new AppId_t(105600u)))
     {
         Environment.Exit(1);
         return;
     }
     if (!SteamAPI.Init() && Program.usingSteam)
     {
         MessageBox.Show("Please launch the game from your Steam client.", "Error");
         Environment.Exit(1);
     }
     this.IsSteamValid = true;
     ThreadPool.QueueUserWorkItem(new WaitCallback(this.SteamCallbackLoop), null);
     ThreadPool.QueueUserWorkItem(new WaitCallback(this.SteamTickLoop), null);
     Main.OnTick += new Action(this.PulseSteamTick);
     Main.OnTick += new Action(this.PulseSteamCallback);
 }
예제 #12
0
        public void Initialize()
        {
            _instance = this;
            if (!SteamAPI.Init())
            {
                MessageBox.Show(Language.GetTextValue("Error.LaunchFromSteam"), Language.GetTextValue("Error.Error"));
                Environment.Exit(1);
            }
            IsSteamValid = true;
            Thread thread = new Thread(SteamCallbackLoop);

            thread.IsBackground = true;
            thread.Start();
            Thread thread2 = new Thread(SteamTickLoop);

            thread2.IsBackground = true;
            thread2.Start();
            Main.OnTickForThirdPartySoftwareOnly += PulseSteamTick;
            Main.OnTickForThirdPartySoftwareOnly += PulseSteamCallback;
            Platform.get_IsOSX();
        }
예제 #13
0
 public void Initialize()
 {
     CoreSocialModule._instance = this;
     if (!SteamAPI.Init())
     {
         int num = (int)MessageBox.Show(Language.GetTextValue("Error.LaunchFromSteam"), Language.GetTextValue("Error.Error"));
         Environment.Exit(1);
     }
     this.IsSteamValid = true;
     new Thread(new ParameterizedThreadStart(this.SteamCallbackLoop))
     {
         IsBackground = true
     }.Start();
     new Thread(new ParameterizedThreadStart(this.SteamTickLoop))
     {
         IsBackground = true
     }.Start();
     Main.OnTickForThirdPartySoftwareOnly += new Action(this.PulseSteamTick);
     Main.OnTickForThirdPartySoftwareOnly += new Action(this.PulseSteamCallback);
     Platform.get_IsOSX();
 }
		public void Initialize()
		{
			CoreSocialModule._instance = this;
#if CLIENT
            if (SteamAPI.RestartAppIfNecessary(new AppId_t(105600u)))
			{
				Environment.Exit(1);
				return;
			}
#endif
            if (!SteamAPI.Init())
			{
				MessageBox.Show("Please launch the game from your Steam client.\nUlterraria: If you do not have Steam open and are trying to directly open the .exe, or are running from the Launcher, then open Steam first c:", "Error");
				Environment.Exit(1);
			}
			this.IsSteamValid = true;
			ThreadPool.QueueUserWorkItem(new WaitCallback(this.SteamCallbackLoop), null);
			ThreadPool.QueueUserWorkItem(new WaitCallback(this.SteamTickLoop), null);
			Main.OnTick += new Action(this.PulseSteamTick);
			Main.OnTick += new Action(this.PulseSteamCallback);
		}