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:
parent
4882732b7f
commit
f015c79b75
2 changed files with 4 additions and 2 deletions
|
@ -6,7 +6,7 @@ using System.Reflection;
|
||||||
[assembly: AssemblyCompany("ZNI")]
|
[assembly: AssemblyCompany("ZNI")]
|
||||||
[assembly: AssemblyAlgorithmId(System.Configuration.Assemblies.AssemblyHashAlgorithm.MD5)]
|
[assembly: AssemblyAlgorithmId(System.Configuration.Assemblies.AssemblyHashAlgorithm.MD5)]
|
||||||
[assembly: AssemblyCopyright("(C) 2020 Tara Piccari")]
|
[assembly: AssemblyCopyright("(C) 2020 Tara Piccari")]
|
||||||
[assembly: AssemblyFileVersion("5.0.5.1006")]
|
[assembly: AssemblyFileVersion("5.0.5.1007")]
|
||||||
[assembly: AssemblyDescription("Second Life Bot - BotCore5")]
|
[assembly: AssemblyDescription("Second Life Bot - BotCore5")]
|
||||||
|
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ namespace Bot.Assemble
|
||||||
public class ASMInfo
|
public class ASMInfo
|
||||||
{
|
{
|
||||||
public static string BotName = "ZBotCore";
|
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
|
public static string GitPassword
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
|
|
@ -46,6 +46,7 @@ namespace Bot
|
||||||
|
|
||||||
public static unsafe void Main(string[] args)
|
public static unsafe void Main(string[] args)
|
||||||
{
|
{
|
||||||
|
File.WriteAllText("PID.lock", Process.GetCurrentProcess().Id.ToString());
|
||||||
Console.WriteLine("Setting up Main Configuration");
|
Console.WriteLine("Setting up Main Configuration");
|
||||||
Log = new Logger("BotCore5");
|
Log = new Logger("BotCore5");
|
||||||
BotSession.Instance.Logger = Log;
|
BotSession.Instance.Logger = Log;
|
||||||
|
@ -497,6 +498,7 @@ namespace Bot
|
||||||
AutoResetEvent are = new AutoResetEvent(false);
|
AutoResetEvent are = new AutoResetEvent(false);
|
||||||
are.WaitOne(TimeSpan.FromMinutes(5));
|
are.WaitOne(TimeSpan.FromMinutes(5));
|
||||||
}
|
}
|
||||||
|
File.Delete("PID.lock");
|
||||||
Environment.Exit(0);
|
Environment.Exit(0);
|
||||||
|
|
||||||
//System.Console.WriteLine("PAUSING. PRESS ANY KEY TO EXIT");
|
//System.Console.WriteLine("PAUSING. PRESS ANY KEY TO EXIT");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue