diff --git a/.gitignore b/.gitignore index 66c9c19..47db3fd 100644 --- a/.gitignore +++ b/.gitignore @@ -11,16 +11,30 @@ x86/ [Aa][Rr][Mm]/ [Aa][Rr][Mm]64/ bld/ +.bin/ [Bb]in/ [Oo]bj/ +[Oo]ut/ +[Nn]uget/ + +# Temporary files [Ll]og/ [Ll]ogs/ +*.log +[Tt]emp/ +[Tt]mp/ +*.tmp +*.temp +.old*/ +old/ -# Visual Studio 2015/2017 cache/options directory +# IDE files .vs/ +.idea/ +.editorconfig +*.user +*.vcxproj.filters #/Bin64/ symlink [Bb]in64/ - -#Files -*.bat \ No newline at end of file +[Bb]in64 diff --git a/UplinkLauncher/App.config b/UplinkLauncher/App.config deleted file mode 100644 index 193aecc..0000000 --- a/UplinkLauncher/App.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/UplinkLauncher/UplinkLauncher.cs b/UplinkLauncher/UplinkLauncher.cs index c157183..75b135e 100644 --- a/UplinkLauncher/UplinkLauncher.cs +++ b/UplinkLauncher/UplinkLauncher.cs @@ -1,38 +1,58 @@ using System; using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using VRage.Plugins; using SpaceEngineers; using System.IO; -using System.Reflection; -using System.Threading; +using DTLib.Demystifier; +namespace UplinkLauncher; -namespace Lunar.UplinkLauncher +internal static class UplinkLauncher { - internal class UplinkLauncher + public static readonly string PluginsLocalDir = "Plugins\\Local"; + public static void Main(string[] args) { - public static int Main(string[] args) + try { - string exeLocation = Path.GetDirectoryName(Path.GetFullPath(Assembly.GetExecutingAssembly().Location)); + Console.WriteLine("Starting Uplink SE"); + Console.WriteLine(new string('-', Console.WindowWidth)); + + //MANUALLY ADDED, REMOVE LATER + string[] enabledPlugins = + { + "ModelSwap.dll", + "DontTellMeWhatToBuild.dll" + }; List plugins = new List(); - //MANUALLY ADDED, REMOVE LATER - plugins.Add("C:\\Users\\Lunar\\Games\\Steam\\steamapps\\common\\SpaceEngineers\\Bin64\\Plugins\\Local\\ModelSwap.dll"); - plugins.Add("C:\\Users\\Lunar\\Games\\Steam\\steamapps\\common\\SpaceEngineers\\Bin64\\Plugins\\Local\\DontTellMeWhatToBuild.dll"); + if (!Directory.Exists(PluginsLocalDir)) + Directory.CreateDirectory(PluginsLocalDir); + foreach (string plugin in enabledPlugins) + { + Console.WriteLine("Adding plugin: " + plugin); + plugins.Add(Path.GetFullPath(Path.Combine(PluginsLocalDir, plugin))); + } + MyPlugins.RegisterUserAssemblyFiles(plugins); - string appIdFile = Path.Combine(exeLocation, "steam_appid.txt"); + // why this file isn't created automatically? + // how game handles this without this magnificent launcher??? + string appIdFile = "steam_appid.txt"; if (!File.Exists(appIdFile)) { + Console.WriteLine($"Could not find '{appIdFile}', creating new file"); File.WriteAllText(appIdFile, "244850"); } + // finally start ze game!!! MyProgram.Main(args); - return 0; + } + catch (Exception e) + { + Console.WriteLine("Crashed with exception:"); + Console.WriteLine(e.ToStringDemystified()); + Console.WriteLine("\nPress enter to exit..."); + Console.ReadLine(); } } -} +} \ No newline at end of file diff --git a/UplinkLauncher/UplinkLauncher.csproj b/UplinkLauncher/UplinkLauncher.csproj index 86d6a92..ae9c8d6 100644 --- a/UplinkLauncher/UplinkLauncher.csproj +++ b/UplinkLauncher/UplinkLauncher.csproj @@ -1,77 +1,39 @@ - - - + + - Debug - AnyCPU - {2534AAEB-1F27-43F9-86C5-A1726DACB98D} - WinExe - Lunar.UplinkLauncher - UplinkLauncher - v4.8 - 512 - true - true - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - + Exe + net48 + Release;Debug + x64 x64 - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - UplinkSE_logo.ico + latest + disable + enable + true + false + false + true + ..\UplinkSE_logo.ico + - + + + - - - - - - - - ..\..\SpaceEngineersLauncher\Bin64\0Harmony.dll + + false - - False - ..\Bin64\Sandbox.Game.dll + + false - - False - ..\Bin64\SpaceEngineers.exe + + false - - False - ..\Bin64\SpaceEngineers.Game.dll - - - False - ..\Bin64\Steamworks.NET.dll - - - - False - ..\Bin64\VRage.dll + + false - + \ No newline at end of file diff --git a/UplinkLauncher/UplinkSE_logo.ico b/UplinkLauncher/UplinkSE_logo.ico deleted file mode 100644 index 433f0a2..0000000 Binary files a/UplinkLauncher/UplinkSE_logo.ico and /dev/null differ diff --git a/UplinkSE.sln b/UplinkSE.sln index 01008b2..5761a6f 100644 --- a/UplinkSE.sln +++ b/UplinkSE.sln @@ -7,20 +7,31 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UplinkSE", "UplinkSE\Uplink EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UplinkLauncher", "UplinkLauncher\UplinkLauncher.csproj", "{2534AAEB-1F27-43F9-86C5-A1726DACB98D}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SolutionFolder", "SolutionFolder", "{F9D624C2-7460-4672-AA31-1E8887084041}" + ProjectSection(SolutionItems) = preProject + .gitignore = .gitignore + README.md = README.md + UplinkSE_logo.ico = UplinkSE_logo.ico + UplinkSE_logo.png = UplinkSE_logo.png + install.sh = install.sh + launch.sh = launch.sh + build.sh = build.sh + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU + Release|x64 = Release|x64 + Debug|x64 = Debug|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {28965A64-C9EC-4168-82E2-AE66B5D8A29F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {28965A64-C9EC-4168-82E2-AE66B5D8A29F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {28965A64-C9EC-4168-82E2-AE66B5D8A29F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {28965A64-C9EC-4168-82E2-AE66B5D8A29F}.Release|Any CPU.Build.0 = Release|Any CPU - {2534AAEB-1F27-43F9-86C5-A1726DACB98D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2534AAEB-1F27-43F9-86C5-A1726DACB98D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2534AAEB-1F27-43F9-86C5-A1726DACB98D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2534AAEB-1F27-43F9-86C5-A1726DACB98D}.Release|Any CPU.Build.0 = Release|Any CPU + {2534AAEB-1F27-43F9-86C5-A1726DACB98D}.Release|x64.ActiveCfg = Release|x64 + {2534AAEB-1F27-43F9-86C5-A1726DACB98D}.Release|x64.Build.0 = Release|x64 + {2534AAEB-1F27-43F9-86C5-A1726DACB98D}.Debug|x64.ActiveCfg = Debug|x64 + {2534AAEB-1F27-43F9-86C5-A1726DACB98D}.Debug|x64.Build.0 = Debug|x64 + {28965A64-C9EC-4168-82E2-AE66B5D8A29F}.Release|x64.ActiveCfg = Release|x64 + {28965A64-C9EC-4168-82E2-AE66B5D8A29F}.Release|x64.Build.0 = Release|x64 + {28965A64-C9EC-4168-82E2-AE66B5D8A29F}.Debug|x64.ActiveCfg = Debug|x64 + {28965A64-C9EC-4168-82E2-AE66B5D8A29F}.Debug|x64.Build.0 = Debug|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/UplinkSE/App.config b/UplinkSE/App.config deleted file mode 100644 index 193aecc..0000000 --- a/UplinkSE/App.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/UplinkSE/UplinkSE.cs b/UplinkSE/UplinkSE.cs index 8f1f66f..3339129 100644 --- a/UplinkSE/UplinkSE.cs +++ b/UplinkSE/UplinkSE.cs @@ -1,33 +1,27 @@ -using HarmonyLib; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System; using VRage.Plugins; -namespace Lunar.Uplink +namespace UplinkSE; + +internal class UplinkSE : IHandleInputPlugin { - internal class UplinkSE : IHandleInputPlugin + public void Init(object gameInstance) { - public void Init(object gameInstance) - { - throw new NotImplementedException(); - } - - public void HandleInput() - { - throw new NotImplementedException(); - } - - public void Update() - { - throw new NotImplementedException(); - } - - public void Dispose() - { - throw new NotImplementedException(); - } + throw new NotImplementedException(); } -} + + public void HandleInput() + { + throw new NotImplementedException(); + } + + public void Update() + { + throw new NotImplementedException(); + } + + public void Dispose() + { + throw new NotImplementedException(); + } +} \ No newline at end of file diff --git a/UplinkSE/UplinkSE.csproj b/UplinkSE/UplinkSE.csproj index acb99aa..8232793 100644 --- a/UplinkSE/UplinkSE.csproj +++ b/UplinkSE/UplinkSE.csproj @@ -1,68 +1,37 @@ - - - + + - Debug - AnyCPU - {28965A64-C9EC-4168-82E2-AE66B5D8A29F} Library - Lunar.Uplink - UplinkSE - v4.8 - 512 - true - true - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - + net48 + Release;Debug + x64 x64 - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - UplinkSE_logo.ico + latest + disable + enable + true + false + false + true + - + + - - - - - - - - ..\Bin64\0Harmony.dll + + false - - ..\Bin64\Sandbox.Game.dll + + false - - ..\Bin64\SpaceEngineers.exe + + false - - ..\Bin64\SpaceEngineers.Game.dll - - - ..\Bin64\VRage.dll + + false - + \ No newline at end of file diff --git a/UplinkSE/UplinkSE_logo.ico b/UplinkSE/UplinkSE_logo.ico deleted file mode 100644 index 433f0a2..0000000 Binary files a/UplinkSE/UplinkSE_logo.ico and /dev/null differ diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..0757936 --- /dev/null +++ b/build.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +set -eo pipefail + +BUILD_PATH="bin" +rm -rf "$BUILD_PATH" +dotnet publish "UplinkLauncher/UplinkLauncher.csproj" -o "$BUILD_PATH" \ + -c Debug --arch x64 +tree -h bin diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..c8ba714 --- /dev/null +++ b/install.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash +set -eo pipefail + +# symlink to ???/SpaceEngineers/Bin64 +GAME_BIN64_PATH="Bin64" +BUILD_PATH="bin" + +for f in $(find "$BUILD_PATH" -type f); do + cp -v "$f" "$GAME_BIN64_PATH" +done diff --git a/launch.sh b/launch.sh new file mode 100755 index 0000000..fef2393 --- /dev/null +++ b/launch.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash +set -eo pipefail + +GAME_BIN64_PATH="Bin64" +cd "$GAME_BIN64_PATH" +./UplinkLauncher.exe