55 lines
1.7 KiB
C#
55 lines
1.7 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));
|
|
|
|
List<string> plugins = new List<string>();
|
|
|
|
if (!Directory.Exists(PluginsLocalDir))
|
|
Directory.CreateDirectory(PluginsLocalDir);
|
|
string[] localPlugins = Directory.GetFiles(
|
|
PluginsLocalDir, "*.dll", SearchOption.AllDirectories);
|
|
|
|
foreach (string plugin in localPlugins)
|
|
{
|
|
Console.WriteLine("Adding plugin: " + plugin);
|
|
plugins.Add(Path.GetFullPath(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();
|
|
}
|
|
}
|
|
} |