diff --git a/Dockerfile b/Dockerfile index b815a6c..7c5ed94 100644 --- a/Dockerfile +++ b/Dockerfile @@ -35,6 +35,7 @@ ENV basic_Username='' \ commands_EnforceTimeWindow='false' \ commands_TimeWindowSecs=35 \ commands_Enabled='true' \ + commands_ObjectMasterOptout='false' \ datastore_AutoCleanAvatars='true' \ datastore_AvatarsCleanAfterMins=10 \ datastore_LocalChatHistoryLimit=120 \ diff --git a/SecondBotEvents/Config/CommandsConfig.cs b/SecondBotEvents/Config/CommandsConfig.cs index 8024831..845503c 100644 --- a/SecondBotEvents/Config/CommandsConfig.cs +++ b/SecondBotEvents/Config/CommandsConfig.cs @@ -19,6 +19,7 @@ namespace SecondBotEvents.Config settings.Add("EnforceTimeWindow"); settings.Add("TimeWindowSecs"); settings.Add("Enabled"); + settings.Add("ObjectMasterOptout"); settings.Add("HideStatusOutput"); } @@ -27,6 +28,11 @@ namespace SecondBotEvents.Config return ReadSettingAsBool("Enabled", true); } + public bool GetObjectMasterOptout() + { + return ReadSettingAsBool("ObjectMasterOptout", false); + } + public string[] GetMastersCSV() { return ReadSettingAsString("MastersCSV", "Madpeter Zond").Split(","); diff --git a/SecondBotEvents/Services/CommandsService.cs b/SecondBotEvents/Services/CommandsService.cs index d429f1c..12165de 100644 --- a/SecondBotEvents/Services/CommandsService.cs +++ b/SecondBotEvents/Services/CommandsService.cs @@ -140,6 +140,11 @@ namespace SecondBotEvents.Services case InstantMessageDialog.MessageFromObject: { acceptMessage = true; + if(myConfig.GetObjectMasterOptout() == true) + { + string ownername = master.DataStoreService.GetAvatarName(e.IM.FromAgentID); + requireSigning = !myConfig.GetMastersCSV().Contains(ownername); + } break; } case InstantMessageDialog.MessageFromAgent: // shared with SessionSend