Merge branch 'master' into PluginLoader

This commit is contained in:
Garrett
2021-06-17 00:04:00 -05:00
committed by GitHub
5 changed files with 376 additions and 2 deletions

View File

@@ -122,6 +122,12 @@ namespace SeamlessClientPlugin
public void Init(object gameInstance)
{
Utilities.UpdateChecker Checker = new Utilities.UpdateChecker(false);
Task UpdateChecker = new Task(() => Checker.PingUpdateServer());
UpdateChecker.Start();
Patches.GetPatches();
TryShow("Running Seamless Client Plugin v[" + Version + "]");
PingTimer.Elapsed += PingTimer_Elapsed;
@@ -208,6 +214,31 @@ namespace SeamlessClientPlugin
}
public static void RestartClientAfterUpdate()
{
try
{
TryShow("Restarting Client!");
string exe = Assembly.GetEntryAssembly().Location;
Process currentProcess = Process.GetCurrentProcess();
string[] CommandArgs = Environment.GetCommandLineArgs();
string NewCommandLine = "";
for (int i = 1; i < CommandArgs.Length; i++)
{
NewCommandLine += " " + CommandArgs[i];
}
TryShow(NewCommandLine);
Process.Start(exe, NewCommandLine);
currentProcess.Kill();
}
catch (Exception ex)
{
TryShow("Restarting Client error!");
}
}
public static void TryShow(string message)
{
if (MySession.Static?.LocalHumanPlayer != null && Debug)