Use a PID lock file instead of making the wait executable go by the process name to allow for multiple bots on a single machine

This commit is contained in:
Zontreck 2020-08-31 23:12:25 -07:00
parent 4882732b7f
commit f015c79b75
2 changed files with 4 additions and 2 deletions

View file

@ -6,7 +6,7 @@ using System.Reflection;
[assembly: AssemblyCompany("ZNI")]
[assembly: AssemblyAlgorithmId(System.Configuration.Assemblies.AssemblyHashAlgorithm.MD5)]
[assembly: AssemblyCopyright("(C) 2020 Tara Piccari")]
[assembly: AssemblyFileVersion("5.0.5.1006")]
[assembly: AssemblyFileVersion("5.0.5.1007")]
[assembly: AssemblyDescription("Second Life Bot - BotCore5")]
@ -15,7 +15,7 @@ namespace Bot.Assemble
public class ASMInfo
{
public static string BotName = "ZBotCore";
public static string BotVer = "5.0.5.1006";
public static string BotVer = "5.0.5.1007";
public static string GitPassword
{
get

View file

@ -46,6 +46,7 @@ namespace Bot
public static unsafe void Main(string[] args)
{
File.WriteAllText("PID.lock", Process.GetCurrentProcess().Id.ToString());
Console.WriteLine("Setting up Main Configuration");
Log = new Logger("BotCore5");
BotSession.Instance.Logger = Log;
@ -497,6 +498,7 @@ namespace Bot
AutoResetEvent are = new AutoResetEvent(false);
are.WaitOne(TimeSpan.FromMinutes(5));
}
File.Delete("PID.lock");
Environment.Exit(0);
//System.Console.WriteLine("PAUSING. PRESS ANY KEY TO EXIT");