mirror of
https://github.com/opensim/opensim.git
synced 2026-08-08 02:05:34 +08:00
Add "set bots" command to make it possible to set SEND_AGENT_UPDATES on all bots whilst pCampbot is running
This commit is contained in:
@@ -202,6 +202,9 @@ namespace pCampBot
|
||||
"bot", false, "stand", "stand", "Stand all bots.",
|
||||
HandleStand);
|
||||
|
||||
m_console.Commands.AddCommand(
|
||||
"bot", false, "set bots", "set bots <key> <value>", "Set a setting for all bots.", HandleSetBots);
|
||||
|
||||
m_console.Commands.AddCommand(
|
||||
"bot", false, "show regions", "show regions", "Show regions known to bots", HandleShowRegions);
|
||||
|
||||
@@ -519,6 +522,30 @@ namespace pCampBot
|
||||
Environment.Exit(0);
|
||||
}
|
||||
|
||||
private void HandleSetBots(string module, string[] cmd)
|
||||
{
|
||||
string key = cmd[2];
|
||||
string rawValue = cmd[3];
|
||||
|
||||
if (key == "SEND_AGENT_UPDATES")
|
||||
{
|
||||
bool newSendAgentUpdatesSetting;
|
||||
|
||||
if (!ConsoleUtil.TryParseConsoleBool(MainConsole.Instance, rawValue, out newSendAgentUpdatesSetting))
|
||||
return;
|
||||
|
||||
MainConsole.Instance.OutputFormat(
|
||||
"Setting SEND_AGENT_UPDATES to {0} for all bots", newSendAgentUpdatesSetting);
|
||||
|
||||
lock (m_bots)
|
||||
m_bots.ForEach(b => b.Client.Settings.SEND_AGENT_UPDATES = newSendAgentUpdatesSetting);
|
||||
}
|
||||
else
|
||||
{
|
||||
MainConsole.Instance.Output("Error: Only setting currently available is SEND_AGENT_UPDATES");
|
||||
}
|
||||
}
|
||||
|
||||
private void HandleShowRegions(string module, string[] cmd)
|
||||
{
|
||||
string outputFormat = "{0,-30} {1, -20} {2, -5} {3, -5}";
|
||||
|
||||
Reference in New Issue
Block a user