adds OBJECT_CHAT toggle

This commit is contained in:
Madpeter 2021-10-23 02:23:20 +01:00
parent 237405a6a7
commit 90319671b7
4 changed files with 10 additions and 1 deletions

View file

@ -223,6 +223,10 @@ namespace BetterSecondBot.bottypes
} }
protected void On_MessageEvent(MessageEventArgs e) protected void On_MessageEvent(MessageEventArgs e)
{ {
if((myconfig.OBJECT_CHAT == false) && (e.avatar == false) && (e.group == false) && (e.localchat == true))
{
return;
}
EventHandler<MessageEventArgs> handler = _MessageEvent; EventHandler<MessageEventArgs> handler = _MessageEvent;
handler?.Invoke(this, e); handler?.Invoke(this, e);
} }

View file

@ -47,6 +47,7 @@ ENV Log2File_Level='1'
ENV Setting_LogCommands='false' ENV Setting_LogCommands='false'
ENV Agent_Channel='auto' ENV Agent_Channel='auto'
ENV Agent_Version='auto' ENV Agent_Version='auto'
ENV OBJECT_CHAT='false'
ENV SQLDB_Enabled='false' ENV SQLDB_Enabled='false'
ENV SQLDB_Host='127.0.0.1' ENV SQLDB_Host='127.0.0.1'
ENV SQLDB_Port='3306' ENV SQLDB_Port='3306'

View file

@ -107,8 +107,10 @@ namespace BetterSecondBotShared.Json
public string Agent_Channel { get; set; } public string Agent_Channel { get; set; }
public string Agent_Version { get; set; } public string Agent_Version { get; set; }
// Database // Object Chat
public bool OBJECT_CHAT { get; set; }
// Database
public bool SQLDB_Enabled { get; set; } public bool SQLDB_Enabled { get; set; }
public string SQLDB_Host { get; set; } public string SQLDB_Host { get; set; }
public int SQLDB_Port { get; set; } public int SQLDB_Port { get; set; }

View file

@ -171,6 +171,7 @@ namespace BetterSecondBotShared.Json
+ "3: +Warnings\n" + "3: +Warnings\n"
+ "4: +Debug\n"; + "4: +Debug\n";
} }
else if (cmd == "OBJECT_CHAT") { return "Enable object chat to be passed over messages event"; }
else if (cmd == "Agent_Channel") { return "What channel to use for the client - should only be used if badly coded grids that are unable to accept custom clients: leave auto otherwise"; } else if (cmd == "Agent_Channel") { return "What channel to use for the client - should only be used if badly coded grids that are unable to accept custom clients: leave auto otherwise"; }
else if (cmd == "Agent_Version") { return "What version to use for the client - should only be used if badly coded grids that are unable to accept custom clients: leave auto otherwise"; } else if (cmd == "Agent_Version") { return "What version to use for the client - should only be used if badly coded grids that are unable to accept custom clients: leave auto otherwise"; }
return "Unknown value:" + cmd; return "Unknown value:" + cmd;
@ -302,6 +303,7 @@ namespace BetterSecondBotShared.Json
else if (cmd == "Log2File_Level") { return "1"; } else if (cmd == "Log2File_Level") { return "1"; }
else if (cmd == "Agent_Channel") { return "auto"; } else if (cmd == "Agent_Channel") { return "auto"; }
else if (cmd == "Agent_Version") { return "auto"; } else if (cmd == "Agent_Version") { return "auto"; }
else if (cmd == "OBJECT_CHAT") { return "False"; }
return "Unknown value:" + cmd; return "Unknown value:" + cmd;
} }
#endregion #endregion