Skip to content

Commit

Permalink
fixed inject
Browse files Browse the repository at this point in the history
  • Loading branch information
Rynchodon committed Jan 22, 2017
1 parent 584137f commit 6d6b447
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
4 changes: 3 additions & 1 deletion Injector/Injector.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,14 @@
<ProjectReference Include="..\Loader\Loader.csproj">
<Project>{5c2d3832-ddcb-4c1d-855c-5510625db149}</Project>
<Name>Loader</Name>
<Private>False</Private>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(SolutionDir)\global.config" />
<PropertyGroup>
<PostBuildEvent>start cmd.exe /C ""$(ReferencePath)\LoadArms.exe" --author=Rynchodon --repo=Load-ARMS --allBuilds LoadARMS.exe LoadArms.dll "..\..\..\..\Load-ARMS Readme.txt" "..\..\..\..\Load-ARMS License.txt""</PostBuildEvent>
<PostBuildEvent>copy ..\..\..\..\Loader\bin\x64\Release\LoadARMS.dll LoadARMS.dll
start cmd.exe /C ""$(ReferencePath)\LoadArms.exe" --author=Rynchodon --repo=Load-ARMS --allBuilds LoadARMS.exe LoadArms.dll "..\..\..\..\Load-ARMS Readme.txt" "..\..\..\..\Load-ARMS License.txt""</PostBuildEvent>
</PropertyGroup>
<PropertyGroup>
<PreBuildEvent>
Expand Down
2 changes: 1 addition & 1 deletion Injector/Properties/VersionInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.5.1.0")]
[assembly: AssemblyVersion("0.5.2.0")]
10 changes: 7 additions & 3 deletions Loader/LoadArms.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
using System.Xml;
using RGiesecke.DllExport;
using Sandbox;
using Sandbox.Game.World;
using Sandbox.Graphics.GUI;
using VRage.Game.Components;
using VRage.Plugins;

namespace Rynchodon.Loader
Expand Down Expand Up @@ -82,8 +84,7 @@ public static void RunInSEProcess()
{
if (_instance != null)
return;
LoadArms instance = new LoadArms();
MySandboxGame.Static.Invoke(() => instance.Init(MySandboxGame.Static));
MySandboxGame.Static.Invoke(() => typeof(MyPlugins).GetMethod("LoadPlugins", BindingFlags.Static | BindingFlags.NonPublic).Invoke(null, new object[] { Assembly.GetExecutingAssembly() }));
return;
}
Thread.Sleep(1);
Expand Down Expand Up @@ -157,7 +158,7 @@ private struct Data
private ParallelTasks.Task _task;
private DownloadProgress.Stats _downProgress = new DownloadProgress.Stats();
private List<IPlugin> _plugins;
private bool _startedRobocopy;
private bool _initialized, _startedRobocopy;

/// <summary>
/// Creates an instance of LoadArms and starts the updating process.
Expand Down Expand Up @@ -239,6 +240,7 @@ public void Init(object gameInstance)
{
if (_instance != this)
return;
_initialized = true;

if (!_task.IsComplete)
MyGuiSandbox.AddScreen(new DownloadProgress(_task, _downProgress));
Expand All @@ -251,6 +253,8 @@ void IPlugin.Update()
{
if (_instance != this)
return;
if (!_initialized)
Init(MySandboxGame.Static);

if (_plugins != null)
{
Expand Down
3 changes: 2 additions & 1 deletion Publish.bat
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
cd Injector\bin\x64\Release
"C:\Games\Steam\SteamApps\common\SpaceEngineers\Bin64\LoadArms.exe" --author=Rynchodon --repo=Load-ARMS --allBuilds --publish LoadARMS.exe LoadArms.dll "..\..\..\..\Load-ARMS Readme.txt" "..\..\..\..\Load-ARMS License.txt"
"C:\Games\Steam\SteamApps\common\SpaceEngineers\Bin64\LoadArms.exe" --author=Rynchodon --repo=Load-ARMS --allBuilds --publish LoadARMS.exe LoadArms.dll "..\..\..\..\Load-ARMS Readme.txt" "..\..\..\..\Load-ARMS License.txt"
timeout 60

0 comments on commit 6d6b447

Please sign in to comment.