update docker file and tweak services

This commit is contained in:
Madpeter 2022-11-29 21:25:09 +00:00
parent d73b972913
commit 22cc7e8b88
14 changed files with 32 additions and 14 deletions

View file

@ -47,14 +47,7 @@ ENV Basic_BotUserName='' \
Setting_LogCommands='false' \
Agent_Channel='auto' \
Agent_Version='auto' \
OBJECT_CHAT='false' \
SQLDB_Enabled='false' \
SQLDB_Host='127.0.0.1' \
SQLDB_Port='3306' \
SQLDB_Username='' \
SQLDB_Password='' \
SQLDB_Timeout='3' \
SQLDB_Database='secondbot'
OBJECT_CHAT='false'
EXPOSE 80
ENV ASPNETCORE_URLS http://+:80

View file

@ -342,7 +342,7 @@ namespace OpenMetaverse
/// You will get no output on the console. This behavior can be overriden by creating
/// a logger configuration file for log4net
/// </summary>
public static Helpers.LogLevel LOG_LEVEL = Helpers.LogLevel.Debug;
public static Helpers.LogLevel LOG_LEVEL = Helpers.LogLevel.None;
/// <summary>Attach avatar names to log messages</summary>
public bool LOG_NAMES = true;

View file

@ -34,6 +34,7 @@ namespace SecondBotEvents.Services
public override void Start()
{
running = true;
Console.WriteLine("Client service [Starting]");
AutoRestartLoginTimer = new Timer();
AutoRestartLoginTimer.Interval = 30 * 1000;
@ -43,6 +44,7 @@ namespace SecondBotEvents.Services
}
public override void Stop()
{
running = false;
AutoRestartLoginTimer.Stop();
Console.WriteLine("Client service [Stopping]");
ResetClient();

View file

@ -68,11 +68,13 @@ namespace SecondBotEvents.Services
}
public override void Start()
{
running = true;
master.BotClientNoticeEvent += BotClientRestart;
}
public override void Stop()
{
running = false;
acceptNewCommands = false;
}

View file

@ -104,12 +104,13 @@ namespace SecondBotEvents.Services
public override void Start()
{
Stop();
running = true;
master.BotClientNoticeEvent += BotClientRestart;
}
public override void Stop()
{
running = false;
master.BotClientNoticeEvent -= BotClientRestart;
}
}

View file

@ -1043,12 +1043,14 @@ namespace SecondBotEvents.Services
public override void Start()
{
Stop();
running = true;
master.BotClientNoticeEvent += BotClientRestart;
Console.WriteLine("DataStore Service [Starting]");
}
public override void Stop()
{
running = false;
Reset();
master.BotClientNoticeEvent -= BotClientRestart;
if (master.BotClient != null)

View file

@ -220,11 +220,13 @@ namespace SecondBotEvents.Services
public override void Start()
{
Stop();
running = true;
master.BotClientNoticeEvent += BotClientRestart;
}
public override void Stop()
{
running = false;
master.BotClientNoticeEvent -= BotClientRestart;
}
}

View file

@ -404,7 +404,8 @@ namespace SecondBotEvents.Services
public override void Start()
{
if(myConfig.GetEnabled() == false)
running = true;
if (myConfig.GetEnabled() == false)
{
Console.WriteLine("Discord service [Disabled]");
return;
@ -431,6 +432,7 @@ namespace SecondBotEvents.Services
public override void Stop()
{
running = false;
Console.WriteLine("Discord service [Stopping]");
master.BotClientNoticeEvent -= BotClientRestart;
master.SystemStatusMessagesEvent -= SystemStatusEvent;

View file

@ -344,6 +344,7 @@ namespace SecondBotEvents.Services
return;
}
Stop();
running = true;
master.BotClientNoticeEvent += BotClientRestart;
master.SystemStatusMessagesEvent += BotStatusMessage;
}
@ -354,6 +355,7 @@ namespace SecondBotEvents.Services
{
return;
}
running = false;
master.BotClientNoticeEvent -= BotClientRestart;
master.SystemStatusMessagesEvent -= BotStatusMessage;
removeEvents();

View file

@ -267,12 +267,14 @@ namespace SecondBotEvents.Services
return;
}
Stop();
running = true;
master.BotClientNoticeEvent += BotClientRestart;
Console.WriteLine("Homebound Service [Starting]");
}
public override void Stop()
{
running = false;
master.BotClientNoticeEvent -= BotClientRestart;
if (master.BotClient != null)
{

View file

@ -84,11 +84,13 @@ namespace SecondBotEvents.Services
return;
}
Stop();
running = true;
master.BotClientNoticeEvent += BotClientRestart;
}
public override void Stop()
{
running = false;
if (myConfig.GetEnabled() == false)
{
return;

View file

@ -190,12 +190,14 @@ namespace SecondBotEvents.Services
return;
}
Stop();
running = true;
master.BotClientNoticeEvent += BotClientRestart;
Console.WriteLine("Interaction Service [Starting]");
}
public override void Stop()
{
running = false;
if (myConfig.GetEnabled() == false)
{
return;

View file

@ -130,12 +130,14 @@ namespace SecondBotEvents.Services
public override void Start()
{
Stop();
running = true;
master.BotClientNoticeEvent += BotClientRestart;
Console.WriteLine("Relay Service [Starting]");
}
public override void Stop()
{
running = false;
master.BotClientNoticeEvent -= BotClientRestart;
if (master.BotClient != null)
{

View file

@ -8,6 +8,7 @@ namespace SecondBotEvents.Services
public abstract class BotServices
{
public EventsSecondBot master;
protected bool running = false;
public BotServices(EventsSecondBot setMaster)
{
master = setMaster;
@ -32,15 +33,18 @@ namespace SecondBotEvents.Services
public virtual void Start()
{
running = true;
}
public virtual void Stop()
{
running = false;
}
public void Restart()
{
Stop();
if (running == true)
{
Stop();
}
Start();
}
}