aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-03-08 02:17:45 +0000
committerJustin Clark-Casey (justincc)2012-03-08 02:17:45 +0000
commit650d761c06149b59148e57e90cb47dcfa8d65f6a (patch)
treef4624d2146a638187cbaa2d11d4b83d0e319ec87 /OpenSim
parentMerge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff)
downloadopensim-SC_OLD-650d761c06149b59148e57e90cb47dcfa8d65f6a.zip
opensim-SC_OLD-650d761c06149b59148e57e90cb47dcfa8d65f6a.tar.gz
opensim-SC_OLD-650d761c06149b59148e57e90cb47dcfa8d65f6a.tar.bz2
opensim-SC_OLD-650d761c06149b59148e57e90cb47dcfa8d65f6a.tar.xz
Display help commander topics in capitalized form - the commands themselves are still lowercase.
Also convert the estate commands to simply AddCommand() calls so that commands from two different modules can be placed in the same category
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/Application/OpenSimBase.cs10
-rw-r--r--OpenSim/Region/CoreModules/World/Estate/EstateManagementCommands.cs47
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs2
3 files changed, 14 insertions, 45 deletions
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs
index 27a58a4..d3c1102 100644
--- a/OpenSim/Region/Application/OpenSimBase.cs
+++ b/OpenSim/Region/Application/OpenSimBase.cs
@@ -242,8 +242,10 @@ namespace OpenSim
242 242
243 foreach (string topic in topics) 243 foreach (string topic in topics)
244 { 244 {
245 m_console.Commands.AddCommand(topic, false, "help " + topic, 245 string capitalizedTopic = char.ToUpper(topic[0]) + topic.Substring(1);
246 "help " + topic, 246
247 m_console.Commands.AddCommand(capitalizedTopic, false, "help " + capitalizedTopic,
248 "help " + capitalizedTopic,
247 "Get help on plugin command '" + topic + "'", 249 "Get help on plugin command '" + topic + "'",
248 HandleCommanderHelp); 250 HandleCommanderHelp);
249// 251//
@@ -267,7 +269,7 @@ namespace OpenSim
267 269
268 foreach (string command in commander.Commands.Keys) 270 foreach (string command in commander.Commands.Keys)
269 { 271 {
270 m_console.Commands.AddCommand(topic, false, 272 m_console.Commands.AddCommand(capitalizedTopic, false,
271 topic + " " + command, 273 topic + " " + command,
272 topic + " " + commander.Commands[command].ShortHelp(), 274 topic + " " + commander.Commands[command].ShortHelp(),
273 String.Empty, HandleCommanderCommand); 275 String.Empty, HandleCommanderCommand);
@@ -286,7 +288,7 @@ namespace OpenSim
286 // Only safe for the interactive console, since it won't 288 // Only safe for the interactive console, since it won't
287 // let us come here unless both scene and commander exist 289 // let us come here unless both scene and commander exist
288 // 290 //
289 ICommander moduleCommander = SceneManager.CurrentOrFirstScene.GetCommander(cmd[1]); 291 ICommander moduleCommander = SceneManager.CurrentOrFirstScene.GetCommander(cmd[1].ToLower());
290 if (moduleCommander != null) 292 if (moduleCommander != null)
291 m_console.Output(moduleCommander.Help); 293 m_console.Output(moduleCommander.Help);
292 } 294 }
diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementCommands.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementCommands.cs
index 0375c4f..18cdda5 100644
--- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementCommands.cs
+++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementCommands.cs
@@ -62,58 +62,25 @@ namespace OpenSim.Region.CoreModules.World.Estate
62 { 62 {
63 m_log.DebugFormat("[ESTATE MODULE]: Setting up estate commands for region {0}", m_module.Scene.RegionInfo.RegionName); 63 m_log.DebugFormat("[ESTATE MODULE]: Setting up estate commands for region {0}", m_module.Scene.RegionInfo.RegionName);
64 64
65 m_module.Scene.AddCommand("estate", m_module, "set terrain texture", 65 m_module.Scene.AddCommand("Regions", m_module, "set terrain texture",
66 "set terrain texture <number> <uuid> [<x>] [<y>]", 66 "set terrain texture <number> <uuid> [<x>] [<y>]",
67 "Sets the terrain <number> to <uuid>, if <x> or <y> are specified, it will only " + 67 "Sets the terrain <number> to <uuid>, if <x> or <y> are specified, it will only " +
68 "set it on regions with a matching coordinate. Specify -1 in <x> or <y> to wildcard" + 68 "set it on regions with a matching coordinate. Specify -1 in <x> or <y> to wildcard" +
69 " that coordinate.", 69 " that coordinate.",
70 consoleSetTerrainTexture); 70 consoleSetTerrainTexture);
71 71
72 m_module.Scene.AddCommand("estate", m_module, "set terrain heights", 72 m_module.Scene.AddCommand("Regions", m_module, "set terrain heights",
73 "set terrain heights <corner> <min> <max> [<x>] [<y>]", 73 "set terrain heights <corner> <min> <max> [<x>] [<y>]",
74 "Sets the terrain texture heights on corner #<corner> to <min>/<max>, if <x> or <y> are specified, it will only " + 74 "Sets the terrain texture heights on corner #<corner> to <min>/<max>, if <x> or <y> are specified, it will only " +
75 "set it on regions with a matching coordinate. Specify -1 in <x> or <y> to wildcard" + 75 "set it on regions with a matching coordinate. Specify -1 in <x> or <y> to wildcard" +
76 " that coordinate. Corner # SW = 0, NW = 1, SE = 2, NE = 3.", 76 " that coordinate. Corner # SW = 0, NW = 1, SE = 2, NE = 3.",
77 consoleSetTerrainHeights); 77 consoleSetTerrainHeights);
78
79 Command showCommand
80 = new Command("show", CommandIntentions.COMMAND_STATISTICAL, ShowEstatesCommand, "Shows all estates on the simulator.");
81
82 m_commander.RegisterCommand("show", showCommand);
83 78
84 m_module.Scene.RegisterModuleCommander(m_commander); 79 m_module.Scene.AddCommand(
85 80 "Estates", m_module, "estate show", "estate show", "Shows all estates on the simulator.", "", ShowEstatesCommand);
86 m_module.Scene.EventManager.OnPluginConsole += EventManagerOnPluginConsole;
87 } 81 }
88 82
89 public void Close() 83 public void Close() {}
90 {
91 m_module.Scene.EventManager.OnPluginConsole -= EventManagerOnPluginConsole;
92 m_module.Scene.UnregisterModuleCommander(m_commander.Name);
93 }
94
95 /// <summary>
96 /// Processes commandline input. Do not call directly.
97 /// </summary>
98 /// <param name="args">Commandline arguments</param>
99 protected void EventManagerOnPluginConsole(string[] args)
100 {
101 if (args[0] == "estate")
102 {
103 if (args.Length == 1)
104 {
105 m_commander.ProcessConsoleCommand("help", new string[0]);
106 return;
107 }
108
109 string[] tmpArgs = new string[args.Length - 2];
110 int i;
111 for (i = 2; i < args.Length; i++)
112 tmpArgs[i - 2] = args[i];
113
114 m_commander.ProcessConsoleCommand(args[1], tmpArgs);
115 }
116 }
117 84
118 protected void consoleSetTerrainTexture(string module, string[] args) 85 protected void consoleSetTerrainTexture(string module, string[] args)
119 { 86 {
@@ -201,7 +168,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
201 } 168 }
202 } 169 }
203 170
204 protected void ShowEstatesCommand(Object[] args) 171 protected void ShowEstatesCommand(string module, string[] cmd)
205 { 172 {
206 StringBuilder report = new StringBuilder(); 173 StringBuilder report = new StringBuilder();
207 RegionInfo ri = m_module.Scene.RegionInfo; 174 RegionInfo ri = m_module.Scene.RegionInfo;
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index ecadd24..9e59d50 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -596,7 +596,7 @@ namespace OpenSim.Region.Framework.Scenes
596 596
597 #endregion Region Settings 597 #endregion Region Settings
598 598
599 MainConsole.Instance.Commands.AddCommand("estate", false, "reload estate", 599 MainConsole.Instance.Commands.AddCommand("Estates", false, "reload estate",
600 "reload estate", 600 "reload estate",
601 "Reload the estate data", HandleReloadEstate); 601 "Reload the estate data", HandleReloadEstate);
602 602