aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/Console/ConsoleBase.cs45
-rw-r--r--OpenSim/Framework/IScene.cs2
-rw-r--r--OpenSim/Framework/Servers/BaseOpenSimServer.cs16
-rw-r--r--OpenSim/Grid/GridServer/GridServerBase.cs8
-rw-r--r--OpenSim/Grid/InventoryServer/Main.cs2
-rw-r--r--OpenSim/Grid/MessagingServer/Main.cs4
-rw-r--r--OpenSim/Grid/UserServer/Main.cs14
-rw-r--r--OpenSim/Region/Application/HGOpenSimNode.cs4
-rw-r--r--OpenSim/Region/Application/OpenSim.cs88
-rw-r--r--OpenSim/Region/Application/OpenSimBase.cs7
-rw-r--r--OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs6
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneBase.cs17
-rw-r--r--OpenSim/Tools/pCampBot/BotManager.cs6
13 files changed, 126 insertions, 93 deletions
diff --git a/OpenSim/Framework/Console/ConsoleBase.cs b/OpenSim/Framework/Console/ConsoleBase.cs
index 8e61587..721e91a 100644
--- a/OpenSim/Framework/Console/ConsoleBase.cs
+++ b/OpenSim/Framework/Console/ConsoleBase.cs
@@ -49,6 +49,11 @@ namespace OpenSim.Framework.Console
49 public string module; 49 public string module;
50 50
51 /// <value> 51 /// <value>
52 /// Whether the module is shared
53 /// </value>
54 public bool shared;
55
56 /// <value>
52 /// Very short BNF description 57 /// Very short BNF description
53 /// </value> 58 /// </value>
54 public string help_text; 59 public string help_text;
@@ -66,7 +71,7 @@ namespace OpenSim.Framework.Console
66 /// <value> 71 /// <value>
67 /// The method to invoke for this command 72 /// The method to invoke for this command
68 /// </value> 73 /// </value>
69 public CommandDelegate fn; 74 public List<CommandDelegate> fn;
70 } 75 }
71 76
72 /// <value> 77 /// <value>
@@ -172,10 +177,11 @@ namespace OpenSim.Framework.Console
172 /// <param name="help"></param> 177 /// <param name="help"></param>
173 /// <param name="longhelp"></param> 178 /// <param name="longhelp"></param>
174 /// <param name="fn"></param> 179 /// <param name="fn"></param>
175 public void AddCommand( 180 public void AddCommand(string module, bool shared, string command,
176 string module, string command, string help, string longhelp, CommandDelegate fn) 181 string help, string longhelp, CommandDelegate fn)
177 { 182 {
178 AddCommand(module, command, help, longhelp, String.Empty, fn); 183 AddCommand(module, shared, command, help, longhelp,
184 String.Empty, fn);
179 } 185 }
180 186
181 /// <summary> 187 /// <summary>
@@ -187,8 +193,9 @@ namespace OpenSim.Framework.Console
187 /// <param name="longhelp"></param> 193 /// <param name="longhelp"></param>
188 /// <param name="descriptivehelp"></param> 194 /// <param name="descriptivehelp"></param>
189 /// <param name="fn"></param> 195 /// <param name="fn"></param>
190 public void AddCommand( 196 public void AddCommand(string module, bool shared, string command,
191 string module, string command, string help, string longhelp, string descriptivehelp, CommandDelegate fn) 197 string help, string longhelp, string descriptivehelp,
198 CommandDelegate fn)
192 { 199 {
193 string[] parts = Parser.Parse(command); 200 string[] parts = Parser.Parse(command);
194 201
@@ -212,15 +219,25 @@ namespace OpenSim.Framework.Console
212 } 219 }
213 } 220 }
214 221
222 CommandInfo info;
223
215 if (current.ContainsKey(String.Empty)) 224 if (current.ContainsKey(String.Empty))
225 {
226 info = (CommandInfo)current[String.Empty];
227 if (!info.shared && !info.fn.Contains(fn))
228 info.fn.Add(fn);
229
216 return; 230 return;
231 }
217 232
218 CommandInfo info = new CommandInfo(); 233 info = new CommandInfo();
219 info.module = module; 234 info.module = module;
235 info.shared = shared;
220 info.help_text = help; 236 info.help_text = help;
221 info.long_help = longhelp; 237 info.long_help = longhelp;
222 info.descriptive_help = descriptivehelp; 238 info.descriptive_help = descriptivehelp;
223 info.fn = fn; 239 info.fn = new List<CommandDelegate>();
240 info.fn.Add(fn);
224 current[String.Empty] = info; 241 current[String.Empty] = info;
225 } 242 }
226 243
@@ -275,7 +292,7 @@ namespace OpenSim.Framework.Console
275 if (s == String.Empty) 292 if (s == String.Empty)
276 { 293 {
277 CommandInfo ci = (CommandInfo)current[String.Empty]; 294 CommandInfo ci = (CommandInfo)current[String.Empty];
278 if (ci.fn != null) 295 if (ci.fn.Count != null)
279 addcr = true; 296 addcr = true;
280 } 297 }
281 else 298 else
@@ -337,9 +354,10 @@ namespace OpenSim.Framework.Console
337 if (current.ContainsKey(String.Empty)) 354 if (current.ContainsKey(String.Empty))
338 { 355 {
339 CommandInfo ci = (CommandInfo)current[String.Empty]; 356 CommandInfo ci = (CommandInfo)current[String.Empty];
340 if (ci.fn == null) 357 if (ci.fn.Count == null)
341 return new string[0]; 358 return new string[0];
342 ci.fn(ci.module, result); 359 foreach (CommandDelegate fn in ci.fn)
360 fn(ci.module, result);
343 return result; 361 return result;
344 } 362 }
345 return new string[0]; 363 return new string[0];
@@ -409,9 +427,8 @@ namespace OpenSim.Framework.Console
409 { 427 {
410 DefaultPrompt = defaultPrompt; 428 DefaultPrompt = defaultPrompt;
411 429
412 Commands.AddCommand( 430 Commands.AddCommand("console", false, "help", "help [<command>]",
413 "console", "help", "help [<command>]", 431 "Get general command list or more detailed help on a specific command", Help);
414 "Get general command list or more detailed help on a specific command", Help);
415 } 432 }
416 433
417 public void SetGuiMode(bool mode) 434 public void SetGuiMode(bool mode)
diff --git a/OpenSim/Framework/IScene.cs b/OpenSim/Framework/IScene.cs
index 493c626..1c0a3b5 100644
--- a/OpenSim/Framework/IScene.cs
+++ b/OpenSim/Framework/IScene.cs
@@ -90,6 +90,6 @@ namespace OpenSim.Framework
90 T RequestModuleInterface<T>(); 90 T RequestModuleInterface<T>();
91 T[] RequestModuleInterfaces<T>(); 91 T[] RequestModuleInterfaces<T>();
92 92
93 void AddCommand(string module, string command, string shorthelp, string longhelp, CommandDelegate callback); 93 void AddCommand(object module, string command, string shorthelp, string longhelp, CommandDelegate callback);
94 } 94 }
95} 95}
diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs
index ac5e183..ff53e1a 100644
--- a/OpenSim/Framework/Servers/BaseOpenSimServer.cs
+++ b/OpenSim/Framework/Servers/BaseOpenSimServer.cs
@@ -104,35 +104,35 @@ namespace OpenSim.Framework.Servers
104 { 104 {
105 SetConsoleLogLevel(new string[] { "ALL" }); 105 SetConsoleLogLevel(new string[] { "ALL" });
106 106
107 m_console.Commands.AddCommand("base", "quit", 107 m_console.Commands.AddCommand("base", false, "quit",
108 "quit", 108 "quit",
109 "Quit the application", HandleQuit); 109 "Quit the application", HandleQuit);
110 110
111 m_console.Commands.AddCommand("base", "shutdown", 111 m_console.Commands.AddCommand("base", false, "shutdown",
112 "shutdown", 112 "shutdown",
113 "Quit the application", HandleQuit); 113 "Quit the application", HandleQuit);
114 114
115 m_console.Commands.AddCommand("base", "set log level", 115 m_console.Commands.AddCommand("base", false, "set log level",
116 "set log level <level>", 116 "set log level <level>",
117 "Set the console logging level", HandleLogLevel); 117 "Set the console logging level", HandleLogLevel);
118 118
119 m_console.Commands.AddCommand("base", "show info", 119 m_console.Commands.AddCommand("base", false, "show info",
120 "show info", 120 "show info",
121 "Show general information", HandleShow); 121 "Show general information", HandleShow);
122 122
123 m_console.Commands.AddCommand("base", "show stats", 123 m_console.Commands.AddCommand("base", false, "show stats",
124 "show stats", 124 "show stats",
125 "Show statistics", HandleShow); 125 "Show statistics", HandleShow);
126 126
127 m_console.Commands.AddCommand("base", "show threads", 127 m_console.Commands.AddCommand("base", false, "show threads",
128 "show threads", 128 "show threads",
129 "Show thread status", HandleShow); 129 "Show thread status", HandleShow);
130 130
131 m_console.Commands.AddCommand("base", "show uptime", 131 m_console.Commands.AddCommand("base", false, "show uptime",
132 "show uptime", 132 "show uptime",
133 "Show server uptime", HandleShow); 133 "Show server uptime", HandleShow);
134 134
135 m_console.Commands.AddCommand("base", "show version", 135 m_console.Commands.AddCommand("base", false, "show version",
136 "show version", 136 "show version",
137 "Show server version", HandleShow); 137 "Show server version", HandleShow);
138 } 138 }
diff --git a/OpenSim/Grid/GridServer/GridServerBase.cs b/OpenSim/Grid/GridServer/GridServerBase.cs
index 3fb07b5..9cc25e8 100644
--- a/OpenSim/Grid/GridServer/GridServerBase.cs
+++ b/OpenSim/Grid/GridServer/GridServerBase.cs
@@ -114,15 +114,17 @@ namespace OpenSim.Grid.GridServer
114 114
115 base.StartupSpecific(); 115 base.StartupSpecific();
116 116
117 m_console.Commands.AddCommand("gridserver", "enable registration", 117 m_console.Commands.AddCommand("gridserver", false,
118 "enable registration",
118 "enable registration", 119 "enable registration",
119 "Enable new regions to register", HandleRegistration); 120 "Enable new regions to register", HandleRegistration);
120 121
121 m_console.Commands.AddCommand("gridserver", "disable registration", 122 m_console.Commands.AddCommand("gridserver", false,
123 "disable registration",
122 "disable registration", 124 "disable registration",
123 "Disable registering new regions", HandleRegistration); 125 "Disable registering new regions", HandleRegistration);
124 126
125 m_console.Commands.AddCommand("gridserver", "show status", 127 m_console.Commands.AddCommand("gridserver", false, "show status",
126 "show status", 128 "show status",
127 "Show registration status", HandleShowStatus); 129 "Show registration status", HandleShowStatus);
128 } 130 }
diff --git a/OpenSim/Grid/InventoryServer/Main.cs b/OpenSim/Grid/InventoryServer/Main.cs
index 4727f6e..862ae58 100644
--- a/OpenSim/Grid/InventoryServer/Main.cs
+++ b/OpenSim/Grid/InventoryServer/Main.cs
@@ -80,7 +80,7 @@ namespace OpenSim.Grid.InventoryServer
80 80
81 base.StartupSpecific(); 81 base.StartupSpecific();
82 82
83 m_console.Commands.AddCommand("inventoryserver", "add user", 83 m_console.Commands.AddCommand("inventoryserver", false, "add user",
84 "add user", 84 "add user",
85 "Add a random user inventory", HandleAddUser); 85 "Add a random user inventory", HandleAddUser);
86 } 86 }
diff --git a/OpenSim/Grid/MessagingServer/Main.cs b/OpenSim/Grid/MessagingServer/Main.cs
index 9b7e731..13f52ab 100644
--- a/OpenSim/Grid/MessagingServer/Main.cs
+++ b/OpenSim/Grid/MessagingServer/Main.cs
@@ -127,11 +127,11 @@ namespace OpenSim.Grid.MessagingServer
127 127
128 base.StartupSpecific(); 128 base.StartupSpecific();
129 129
130 m_console.Commands.AddCommand("messageserver", "clear cache", 130 m_console.Commands.AddCommand("messageserver", false, "clear cache",
131 "clear cache", 131 "clear cache",
132 "Clear presence cache", HandleClearCache); 132 "Clear presence cache", HandleClearCache);
133 133
134 m_console.Commands.AddCommand("messageserver", "register", 134 m_console.Commands.AddCommand("messageserver", false, "register",
135 "register", 135 "register",
136 "Re-register with user server(s)", HandleRegister); 136 "Re-register with user server(s)", HandleRegister);
137 } 137 }
diff --git a/OpenSim/Grid/UserServer/Main.cs b/OpenSim/Grid/UserServer/Main.cs
index 0b0bee1..dd3f0b7 100644
--- a/OpenSim/Grid/UserServer/Main.cs
+++ b/OpenSim/Grid/UserServer/Main.cs
@@ -122,32 +122,32 @@ namespace OpenSim.Grid.UserServer
122 122
123 base.StartupSpecific(); 123 base.StartupSpecific();
124 124
125 m_console.Commands.AddCommand("userserver", "create user", 125 m_console.Commands.AddCommand("userserver", false, "create user",
126 "create user [<first> [<last> [<x> <y> [email]]]]", 126 "create user [<first> [<last> [<x> <y> [email]]]]",
127 "Create a new user account", RunCommand); 127 "Create a new user account", RunCommand);
128 128
129 m_console.Commands.AddCommand("userserver", "reset user password", 129 m_console.Commands.AddCommand("userserver", false, "reset user password",
130 "reset user password [<first> [<last> [<new password>]]]", 130 "reset user password [<first> [<last> [<new password>]]]",
131 "Reset a user's password", RunCommand); 131 "Reset a user's password", RunCommand);
132 132
133 m_console.Commands.AddCommand("userserver", "login level", 133 m_console.Commands.AddCommand("userserver", false, "login level",
134 "login level <level>", 134 "login level <level>",
135 "Set the minimum user level to log in", HandleLoginCommand); 135 "Set the minimum user level to log in", HandleLoginCommand);
136 136
137 m_console.Commands.AddCommand("userserver", "login reset", 137 m_console.Commands.AddCommand("userserver", false, "login reset",
138 "login reset", 138 "login reset",
139 "Reset the login level to allow all users", 139 "Reset the login level to allow all users",
140 HandleLoginCommand); 140 HandleLoginCommand);
141 141
142 m_console.Commands.AddCommand("userserver", "login text", 142 m_console.Commands.AddCommand("userserver", false, "login text",
143 "login text <text>", 143 "login text <text>",
144 "Set the text users will see on login", HandleLoginCommand); 144 "Set the text users will see on login", HandleLoginCommand);
145 145
146 m_console.Commands.AddCommand("userserver", "test-inventory", 146 m_console.Commands.AddCommand("userserver", false, "test-inventory",
147 "test-inventory", 147 "test-inventory",
148 "Perform a test inventory transaction", RunCommand); 148 "Perform a test inventory transaction", RunCommand);
149 149
150 m_console.Commands.AddCommand("userserver", "logoff-user", 150 m_console.Commands.AddCommand("userserver", false, "logoff-user",
151 "logoff-user <first> <last> <message>", 151 "logoff-user <first> <last> <message>",
152 "Log off a named user", RunCommand); 152 "Log off a named user", RunCommand);
153 } 153 }
diff --git a/OpenSim/Region/Application/HGOpenSimNode.cs b/OpenSim/Region/Application/HGOpenSimNode.cs
index 458c6af..6f6d6cb 100644
--- a/OpenSim/Region/Application/HGOpenSimNode.cs
+++ b/OpenSim/Region/Application/HGOpenSimNode.cs
@@ -78,8 +78,8 @@ namespace OpenSim
78 78
79 base.StartupSpecific(); 79 base.StartupSpecific();
80 80
81 MainConsole.Instance.Commands.AddCommand("hypergrid", "link-mapping", "link-mapping [<x> <y>] <cr>", "Set local coordinate to map HG regions to", RunCommand); 81 MainConsole.Instance.Commands.AddCommand("hypergrid", false, "link-mapping", "link-mapping [<x> <y>] <cr>", "Set local coordinate to map HG regions to", RunCommand);
82 MainConsole.Instance.Commands.AddCommand("hypergrid", "link-region", "link-region <Xloc> <Yloc> <HostName>:<HttpPort>[:<RemoteRegionName>] <cr>", "Link a hypergrid region", RunCommand); 82 MainConsole.Instance.Commands.AddCommand("hypergrid", false, "link-region", "link-region <Xloc> <Yloc> <HostName>:<HttpPort>[:<RemoteRegionName>] <cr>", "Link a hypergrid region", RunCommand);
83 } 83 }
84 84
85 protected override void InitialiseStandaloneServices(LibraryRootFolder libraryRootFolder) 85 protected override void InitialiseStandaloneServices(LibraryRootFolder libraryRootFolder)
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs
index 7b47eb4..898e298 100644
--- a/OpenSim/Region/Application/OpenSim.cs
+++ b/OpenSim/Region/Application/OpenSim.cs
@@ -99,185 +99,185 @@ namespace OpenSim
99 m_console.SetGuiMode(m_gui); 99 m_console.SetGuiMode(m_gui);
100 MainConsole.Instance = m_console; 100 MainConsole.Instance = m_console;
101 101
102 m_console.Commands.AddCommand("region", "clear assets", 102 m_console.Commands.AddCommand("region", false, "clear assets",
103 "clear assets", 103 "clear assets",
104 "Clear the asset cache", HandleClearAssets); 104 "Clear the asset cache", HandleClearAssets);
105 105
106 m_console.Commands.AddCommand("region", "force update", 106 m_console.Commands.AddCommand("region", false, "force update",
107 "force update", 107 "force update",
108 "Force the update of all objects on clients", 108 "Force the update of all objects on clients",
109 HandleForceUpdate); 109 HandleForceUpdate);
110 110
111 m_console.Commands.AddCommand("region", "debug packet", 111 m_console.Commands.AddCommand("region", false, "debug packet",
112 "debug packet <level>", 112 "debug packet <level>",
113 "Turn on packet debugging", Debug); 113 "Turn on packet debugging", Debug);
114 114
115 m_console.Commands.AddCommand("region", "debug scene", 115 m_console.Commands.AddCommand("region", false, "debug scene",
116 "debug scene <cripting> <collisions> <physics>", 116 "debug scene <cripting> <collisions> <physics>",
117 "Turn on scene debugging", Debug); 117 "Turn on scene debugging", Debug);
118 118
119 m_console.Commands.AddCommand("region", "change region", 119 m_console.Commands.AddCommand("region", false, "change region",
120 "change region <region name>", 120 "change region <region name>",
121 "Change current console region", ChangeSelectedRegion); 121 "Change current console region", ChangeSelectedRegion);
122 122
123 m_console.Commands.AddCommand("region", "save xml", 123 m_console.Commands.AddCommand("region", false, "save xml",
124 "save xml", 124 "save xml",
125 "Save a region's data in XML format", SaveXml); 125 "Save a region's data in XML format", SaveXml);
126 126
127 m_console.Commands.AddCommand("region", "save xml2", 127 m_console.Commands.AddCommand("region", false, "save xml2",
128 "save xml2", 128 "save xml2",
129 "Save a region's data in XML2 format", SaveXml2); 129 "Save a region's data in XML2 format", SaveXml2);
130 130
131 m_console.Commands.AddCommand("region", "load xml", 131 m_console.Commands.AddCommand("region", false, "load xml",
132 "load xml [-newIDs [<x> <y> <z>]]", 132 "load xml [-newIDs [<x> <y> <z>]]",
133 "Load a region's data from XML format", LoadXml); 133 "Load a region's data from XML format", LoadXml);
134 134
135 m_console.Commands.AddCommand("region", "load xml2", 135 m_console.Commands.AddCommand("region", false, "load xml2",
136 "load xml2", 136 "load xml2",
137 "Load a region's data from XML2 format", LoadXml2); 137 "Load a region's data from XML2 format", LoadXml2);
138 138
139 m_console.Commands.AddCommand("region", "save prims xml2", 139 m_console.Commands.AddCommand("region", false, "save prims xml2",
140 "save prims xml2 [<prim name> <file name>]", 140 "save prims xml2 [<prim name> <file name>]",
141 "Save named prim to XML2", SavePrimsXml2); 141 "Save named prim to XML2", SavePrimsXml2);
142 142
143 m_console.Commands.AddCommand("region", "load oar", 143 m_console.Commands.AddCommand("region", false, "load oar",
144 "load oar <oar name>", 144 "load oar <oar name>",
145 "Load a region's data from OAR archive", LoadOar); 145 "Load a region's data from OAR archive", LoadOar);
146 146
147 m_console.Commands.AddCommand("region", "save oar", 147 m_console.Commands.AddCommand("region", false, "save oar",
148 "save oar <oar name>", 148 "save oar <oar name>",
149 "Save a region's data to an OAR archive", 149 "Save a region's data to an OAR archive",
150 "More information on forthcoming options here soon", SaveOar); 150 "More information on forthcoming options here soon", SaveOar);
151 151
152 /* 152 /*
153 m_console.Commands.AddCommand("region", "save inventory", 153 m_console.Commands.AddCommand("region", false, "save inventory",
154 "save inventory <first> <last> <path> <file>", 154 "save inventory <first> <last> <path> <file>",
155 "Save user inventory data", SaveInv); 155 "Save user inventory data", SaveInv);
156 156
157 m_console.Commands.AddCommand("region", "load inventory", 157 m_console.Commands.AddCommand("region", false, "load inventory",
158 "load inventory <first> <last> <path> <file>", 158 "load inventory <first> <last> <path> <file>",
159 "Load user inventory data", LoadInv); 159 "Load user inventory data", LoadInv);
160 */ 160 */
161 161
162 m_console.Commands.AddCommand("region", "edit scale", 162 m_console.Commands.AddCommand("region", false, "edit scale",
163 "edit scale <name> <x> <y> <z>", 163 "edit scale <name> <x> <y> <z>",
164 "Change the scale of a named prim", HandleEditScale); 164 "Change the scale of a named prim", HandleEditScale);
165 165
166 m_console.Commands.AddCommand("region", "kick user", 166 m_console.Commands.AddCommand("region", false, "kick user",
167 "kick user <first> <last>", 167 "kick user <first> <last>",
168 "Kick a user off the simulator", KickUserCommand); 168 "Kick a user off the simulator", KickUserCommand);
169 169
170 m_console.Commands.AddCommand("region", "show assets", 170 m_console.Commands.AddCommand("region", false, "show assets",
171 "show assets", 171 "show assets",
172 "Show asset data", HandleShow); 172 "Show asset data", HandleShow);
173 173
174 m_console.Commands.AddCommand("region", "show users", 174 m_console.Commands.AddCommand("region", false, "show users",
175 "show users [full]", 175 "show users [full]",
176 "Show user data", HandleShow); 176 "Show user data", HandleShow);
177 177
178 m_console.Commands.AddCommand("region", "show users full", 178 m_console.Commands.AddCommand("region", false, "show users full",
179 "show users full", 179 "show users full",
180 String.Empty, HandleShow); 180 String.Empty, HandleShow);
181 181
182 m_console.Commands.AddCommand("region", "show modules", 182 m_console.Commands.AddCommand("region", false, "show modules",
183 "show modules", 183 "show modules",
184 "Show module data", HandleShow); 184 "Show module data", HandleShow);
185 185
186 m_console.Commands.AddCommand("region", "show regions", 186 m_console.Commands.AddCommand("region", false, "show regions",
187 "show regions", 187 "show regions",
188 "Show region data", HandleShow); 188 "Show region data", HandleShow);
189 189
190 m_console.Commands.AddCommand("region", "show queues", 190 m_console.Commands.AddCommand("region", false, "show queues",
191 "show queues", 191 "show queues",
192 "Show queue data", HandleShow); 192 "Show queue data", HandleShow);
193 193
194 m_console.Commands.AddCommand("region", "alert", 194 m_console.Commands.AddCommand("region", false, "alert",
195 "alert <first> <last> <message>", 195 "alert <first> <last> <message>",
196 "Send an alert to a user", RunCommand); 196 "Send an alert to a user", RunCommand);
197 197
198 m_console.Commands.AddCommand("region", "alert general", 198 m_console.Commands.AddCommand("region", false, "alert general",
199 "alert general <message>", 199 "alert general <message>",
200 "Send an alert everyone", RunCommand); 200 "Send an alert everyone", RunCommand);
201 201
202 m_console.Commands.AddCommand("region", "backup", 202 m_console.Commands.AddCommand("region", false, "backup",
203 "backup", 203 "backup",
204 "Persist objects to the database now", RunCommand); 204 "Persist objects to the database now", RunCommand);
205 205
206 m_console.Commands.AddCommand("region", "create region", 206 m_console.Commands.AddCommand("region", false, "create region",
207 "create region", 207 "create region",
208 "Create a new region", HandleCreateRegion); 208 "Create a new region", HandleCreateRegion);
209 209
210 m_console.Commands.AddCommand("region", "login enable", 210 m_console.Commands.AddCommand("region", false, "login enable",
211 "login enable", 211 "login enable",
212 "Enable logins to the simulator", HandleLoginEnable); 212 "Enable logins to the simulator", HandleLoginEnable);
213 213
214 m_console.Commands.AddCommand("region", "login disable", 214 m_console.Commands.AddCommand("region", false, "login disable",
215 "login disable", 215 "login disable",
216 "Disable logins to the simulator", HandleLoginDisable); 216 "Disable logins to the simulator", HandleLoginDisable);
217 217
218 m_console.Commands.AddCommand("region", "login status", 218 m_console.Commands.AddCommand("region", false, "login status",
219 "login status", 219 "login status",
220 "Display status of logins", HandleLoginStatus); 220 "Display status of logins", HandleLoginStatus);
221 221
222 m_console.Commands.AddCommand("region", "restart", 222 m_console.Commands.AddCommand("region", false, "restart",
223 "restart", 223 "restart",
224 "Restart all sims in this instance", RunCommand); 224 "Restart all sims in this instance", RunCommand);
225 225
226 m_console.Commands.AddCommand("region", "config set", 226 m_console.Commands.AddCommand("region", false, "config set",
227 "config set <section> <field> <value>", 227 "config set <section> <field> <value>",
228 "Set a config option", HandleConfig); 228 "Set a config option", HandleConfig);
229 229
230 m_console.Commands.AddCommand("region", "config get", 230 m_console.Commands.AddCommand("region", false, "config get",
231 "config get <section> <field>", 231 "config get <section> <field>",
232 "Read a config option", HandleConfig); 232 "Read a config option", HandleConfig);
233 233
234 m_console.Commands.AddCommand("region", "config save", 234 m_console.Commands.AddCommand("region", false, "config save",
235 "config save", 235 "config save",
236 "Save current configuration", HandleConfig); 236 "Save current configuration", HandleConfig);
237 237
238 m_console.Commands.AddCommand("region", "command-script", 238 m_console.Commands.AddCommand("region", false, "command-script",
239 "command-script <script>", 239 "command-script <script>",
240 "Run a command script from file", RunCommand); 240 "Run a command script from file", RunCommand);
241 241
242 m_console.Commands.AddCommand("region", "export-map", 242 m_console.Commands.AddCommand("region", false, "export-map",
243 "export-map <file>", 243 "export-map <file>",
244 "Save an image of the world map", RunCommand); 244 "Save an image of the world map", RunCommand);
245 245
246 m_console.Commands.AddCommand("region", "remove-region", 246 m_console.Commands.AddCommand("region", false, "remove-region",
247 "remove-region <name>", 247 "remove-region <name>",
248 "Remove a region from this simulator", RunCommand); 248 "Remove a region from this simulator", RunCommand);
249 249
250 m_console.Commands.AddCommand("region", "delete-region", 250 m_console.Commands.AddCommand("region", false, "delete-region",
251 "delete-region <name>", 251 "delete-region <name>",
252 "Delete a region from disk", RunCommand); 252 "Delete a region from disk", RunCommand);
253 253
254 m_console.Commands.AddCommand("region", "predecode-j2k", 254 m_console.Commands.AddCommand("region", false, "predecode-j2k",
255 "predecode-j2k [<num threads>]>", 255 "predecode-j2k [<num threads>]>",
256 "Precache assets,decode j2k layerdata", RunCommand); 256 "Precache assets,decode j2k layerdata", RunCommand);
257 257
258 m_console.Commands.AddCommand("region", "modules list", 258 m_console.Commands.AddCommand("region", false, "modules list",
259 "modules list", 259 "modules list",
260 "List modules", HandleModules); 260 "List modules", HandleModules);
261 261
262 m_console.Commands.AddCommand("region", "modules load", 262 m_console.Commands.AddCommand("region", false, "modules load",
263 "modules load <name>", 263 "modules load <name>",
264 "Load a module", HandleModules); 264 "Load a module", HandleModules);
265 265
266 m_console.Commands.AddCommand("region", "modules unload", 266 m_console.Commands.AddCommand("region", false, "modules unload",
267 "modules unload <name>", 267 "modules unload <name>",
268 "Unload a module", HandleModules); 268 "Unload a module", HandleModules);
269 269
270 m_console.Commands.AddCommand("region", "Add-InventoryHost", 270 m_console.Commands.AddCommand("region", false, "Add-InventoryHost",
271 "Add-InventoryHost <host>", 271 "Add-InventoryHost <host>",
272 String.Empty, RunCommand); 272 String.Empty, RunCommand);
273 273
274 if (ConfigurationSettings.Standalone) 274 if (ConfigurationSettings.Standalone)
275 { 275 {
276 m_console.Commands.AddCommand("region", "create user", 276 m_console.Commands.AddCommand("region", false, "create user",
277 "create user [<first> [<last> [<pass> [<x> <y> [<email>]]]]]", 277 "create user [<first> [<last> [<pass> [<x> <y> [<email>]]]]]",
278 "Create a new user", HandleCreateUser); 278 "Create a new user", HandleCreateUser);
279 279
280 m_console.Commands.AddCommand("region", "reset user password", 280 m_console.Commands.AddCommand("region", false, "reset user password",
281 "reset user password [<first> [<last> [<password>]]]", 281 "reset user password [<first> [<last> [<password>]]]",
282 "Reset a user password", HandleResetUserPassword); 282 "Reset a user password", HandleResetUserPassword);
283 } 283 }
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs
index aab80d9..d86a47b 100644
--- a/OpenSim/Region/Application/OpenSimBase.cs
+++ b/OpenSim/Region/Application/OpenSimBase.cs
@@ -203,12 +203,12 @@ namespace OpenSim
203 203
204 foreach (string topic in topics) 204 foreach (string topic in topics)
205 { 205 {
206 m_console.Commands.AddCommand("plugin", "help " + topic, 206 m_console.Commands.AddCommand("plugin", false, "help " + topic,
207 "help " + topic, 207 "help " + topic,
208 "Get help on plugin command '" + topic + "'", 208 "Get help on plugin command '" + topic + "'",
209 HandleCommanderHelp); 209 HandleCommanderHelp);
210 210
211 m_console.Commands.AddCommand("plugin", topic, 211 m_console.Commands.AddCommand("plugin", false, topic,
212 topic, 212 topic,
213 "Execute subcommand for plugin '" + topic + "'", 213 "Execute subcommand for plugin '" + topic + "'",
214 null); 214 null);
@@ -221,7 +221,8 @@ namespace OpenSim
221 221
222 foreach (string command in commander.Commands.Keys) 222 foreach (string command in commander.Commands.Keys)
223 { 223 {
224 m_console.Commands.AddCommand(topic, topic + " " + command, 224 m_console.Commands.AddCommand(topic, false,
225 topic + " " + command,
225 topic + " " + commander.Commands[command].ShortHelp(), 226 topic + " " + commander.Commands[command].ShortHelp(),
226 String.Empty, HandleCommanderCommand); 227 String.Empty, HandleCommanderCommand);
227 } 228 }
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
index 1469f5d..6e0f8cb 100644
--- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
+++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
@@ -171,17 +171,17 @@ namespace OpenSim.Region.CoreModules.World.Permissions
171 171
172 m_scene.Permissions.AddCanTeleportHandler(CanTeleport); //NOT YET IMPLEMENTED 172 m_scene.Permissions.AddCanTeleportHandler(CanTeleport); //NOT YET IMPLEMENTED
173 173
174 m_scene.AddCommand("permissions", "bypass permissions", 174 m_scene.AddCommand(this, "bypass permissions",
175 "bypass permissions <true / false>", 175 "bypass permissions <true / false>",
176 "Bypass permission checks", 176 "Bypass permission checks",
177 HandleBypassPermissions); 177 HandleBypassPermissions);
178 178
179 m_scene.AddCommand("permissions", "force permissions", 179 m_scene.AddCommand(this, "force permissions",
180 "force permissions <true / false>", 180 "force permissions <true / false>",
181 "Force permissions on or off", 181 "Force permissions on or off",
182 HandleForcePermissions); 182 HandleForcePermissions);
183 183
184 m_scene.AddCommand("permissions", "debug permissions", 184 m_scene.AddCommand(this, "debug permissions",
185 "debug permissions <true / false>", 185 "debug permissions <true / false>",
186 "Enable permissions debugging", 186 "Enable permissions debugging",
187 HandleDebugPermissions); 187 HandleDebugPermissions);
diff --git a/OpenSim/Region/Framework/Scenes/SceneBase.cs b/OpenSim/Region/Framework/Scenes/SceneBase.cs
index b0f328d..3f5c781 100644
--- a/OpenSim/Region/Framework/Scenes/SceneBase.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneBase.cs
@@ -460,11 +460,24 @@ namespace OpenSim.Region.Framework.Scenes
460 } 460 }
461 } 461 }
462 462
463 public void AddCommand(string module, string command, string shorthelp, string longhelp, CommandDelegate callback) 463 public void AddCommand(object mod, string command, string shorthelp, string longhelp, CommandDelegate callback)
464 { 464 {
465 if (MainConsole.Instance == null) 465 if (MainConsole.Instance == null)
466 return; 466 return;
467 MainConsole.Instance.Commands.AddCommand(module, command, shorthelp, longhelp, callback); 467
468 string modulename = String.Empty;
469 bool shared = false;
470
471 if (mod != null)
472 {
473 if (!(mod is IRegionModule))
474 throw new Exception("AddCommand module parameter must be IRegionModule");
475 IRegionModule module = (IRegionModule)mod;
476 modulename = module.Name;
477 shared = module.IsSharedModule;
478 }
479
480 MainConsole.Instance.Commands.AddCommand(modulename, shared, command, shorthelp, longhelp, callback);
468 } 481 }
469 } 482 }
470} 483}
diff --git a/OpenSim/Tools/pCampBot/BotManager.cs b/OpenSim/Tools/pCampBot/BotManager.cs
index 3b08adc..aed3fa8 100644
--- a/OpenSim/Tools/pCampBot/BotManager.cs
+++ b/OpenSim/Tools/pCampBot/BotManager.cs
@@ -79,16 +79,16 @@ namespace pCampBot
79 } 79 }
80 } 80 }
81 81
82 m_console.Commands.AddCommand("bot", "shutdown", 82 m_console.Commands.AddCommand("bot", false, "shutdown",
83 "shutdown", 83 "shutdown",
84 "Gracefully shut down bots", HandleShutdown); 84 "Gracefully shut down bots", HandleShutdown);
85 85
86 m_console.Commands.AddCommand("bot", "quit", 86 m_console.Commands.AddCommand("bot", false, "quit",
87 "quit", 87 "quit",
88 "Force quit (DANGEROUS, try shutdown first)", 88 "Force quit (DANGEROUS, try shutdown first)",
89 HandleShutdown); 89 HandleShutdown);
90 90
91 m_console.Commands.AddCommand("bot", "add bots", 91 m_console.Commands.AddCommand("bot", false, "add bots",
92 "add bots <number>", 92 "add bots <number>",
93 "Add more bots", HandleAddBots); 93 "Add more bots", HandleAddBots);
94 94