58 lines
1.8 KiB
C#
58 lines
1.8 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using VRage.Plugins;
|
|
using SpaceEngineers;
|
|
using System.IO;
|
|
using DTLib.Demystifier;
|
|
|
|
namespace UplinkLauncher;
|
|
|
|
internal static class UplinkLauncher
|
|
{
|
|
public static readonly string PluginsLocalDir = "Plugins\\Local";
|
|
public static void Main(string[] args)
|
|
{
|
|
try
|
|
{
|
|
Console.WriteLine("Starting Uplink SE");
|
|
Console.WriteLine(new string('-', Console.WindowWidth));
|
|
|
|
//MANUALLY ADDED, REMOVE LATER
|
|
string[] enabledPlugins =
|
|
{
|
|
"ModelSwap.dll",
|
|
"DontTellMeWhatToBuild.dll"
|
|
};
|
|
|
|
List<string> plugins = new List<string>();
|
|
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);
|
|
|
|
// 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);
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
Console.WriteLine("Crashed with exception:");
|
|
Console.WriteLine(e.ToStringDemystified());
|
|
Console.WriteLine("\nPress enter to exit...");
|
|
Console.ReadLine();
|
|
}
|
|
}
|
|
} |