From 9987d7fcb1f46a7a21dcd6e326b99928f13803fa Mon Sep 17 00:00:00 2001
From: Madpeter <57852827+Madpeterz@users.noreply.github.com>
Date: Mon, 22 Jul 2024 20:19:48 +0100
Subject: [PATCH] allow limited service control via the command interface
---
Dockerfile | 1 +
SecondBotEvents/Commands/Services.cs | 138 ++++++++++++++++++
SecondBotEvents/Config/CommandsConfig.cs | 6 +-
SecondBotEvents/Config/config.cs | 10 ++
SecondBotEvents/EventsSecondBot.cs | 1 +
SecondBotEvents/Services/CommandsService.cs | 5 +
.../Services/CustomCommandsService.cs | 2 +-
SecondBotEvents/Services/DataStoreService.cs | 2 +-
SecondBotEvents/Services/DialogService.cs | 2 +-
SecondBotEvents/Services/DiscordService.cs | 2 +-
SecondBotEvents/Services/EventsService.cs | 2 +-
SecondBotEvents/Services/HomeboundService.cs | 2 +-
SecondBotEvents/Services/HttpService.cs | 2 +-
.../Services/InteractionService.cs | 2 +-
SecondBotEvents/Services/RelayService.cs | 2 +-
SecondBotEvents/Services/Services.cs | 13 ++
.../Static/http_commands_helper.cs | 1 +
SecondBotEvents/WikiService.cs | 2 +-
18 files changed, 184 insertions(+), 11 deletions(-)
create mode 100644 SecondBotEvents/Commands/Services.cs
diff --git a/Dockerfile b/Dockerfile
index 7c5ed94..5e9281b 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -36,6 +36,7 @@ ENV basic_Username='' \
commands_TimeWindowSecs=35 \
commands_Enabled='true' \
commands_ObjectMasterOptout='false' \
+ commands_AllowServiceControl='false' \
datastore_AutoCleanAvatars='true' \
datastore_AvatarsCleanAfterMins=10 \
datastore_LocalChatHistoryLimit=120 \
diff --git a/SecondBotEvents/Commands/Services.cs b/SecondBotEvents/Commands/Services.cs
new file mode 100644
index 0000000..26da4f8
--- /dev/null
+++ b/SecondBotEvents/Commands/Services.cs
@@ -0,0 +1,138 @@
+using Newtonsoft.Json;
+using OpenMetaverse;
+using SecondBotEvents.Services;
+using System.Collections.Generic;
+using System.Linq;
+
+
+namespace SecondBotEvents.Commands
+{
+ [ClassInfo("Control services via commands (Requires the command enable service control flag be set to true)
" + about + "
" + + "" + about.Split("
"
+ "View " + commandcount.ToString() + " commands"
+ "