diff options
author | Justin Clarke Casey | 2008-08-05 17:52:06 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-08-05 17:52:06 +0000 |
commit | de0a6e7f2bd86aef0ce65a4b0b854ae465ebdfae (patch) | |
tree | 2728142d2a8ff74a30253a58f587c7b2c9f2937a /OpenSim | |
parent | * Make currently selected region appear in the region console prompt (diff) | |
download | opensim-SC_OLD-de0a6e7f2bd86aef0ce65a4b0b854ae465ebdfae.zip opensim-SC_OLD-de0a6e7f2bd86aef0ce65a4b0b854ae465ebdfae.tar.gz opensim-SC_OLD-de0a6e7f2bd86aef0ce65a4b0b854ae465ebdfae.tar.bz2 opensim-SC_OLD-de0a6e7f2bd86aef0ce65a4b0b854ae465ebdfae.tar.xz |
* Try and make the contents of the region prompt more obvious by returning to printing the selected region after a change attempt has been made.
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/Application/OpenSim.cs | 49 |
1 files changed, 18 insertions, 31 deletions
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index 0dc4560..bf7044f 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs | |||
@@ -90,10 +90,7 @@ namespace OpenSim | |||
90 | m_log.InfoFormat("[OPENSIM MAIN]: Running in {0} mode", (m_sandbox ? "sandbox" : "grid")); | 90 | m_log.InfoFormat("[OPENSIM MAIN]: Running in {0} mode", (m_sandbox ? "sandbox" : "grid")); |
91 | 91 | ||
92 | m_console = new ConsoleBase("Region", this); | 92 | m_console = new ConsoleBase("Region", this); |
93 | MainConsole.Instance = m_console; | 93 | MainConsole.Instance = m_console; |
94 | |||
95 | // For now, start at the 'root' level by default | ||
96 | ChangeSelectedRegion(new string[] {"root"}); | ||
97 | 94 | ||
98 | base.Startup(); | 95 | base.Startup(); |
99 | 96 | ||
@@ -119,6 +116,9 @@ namespace OpenSim | |||
119 | PrintFileToConsole("startuplogo.txt"); | 116 | PrintFileToConsole("startuplogo.txt"); |
120 | RegisterCmd("echoTest", RunEchoTest, "this echos your command args to see how they are parsed"); | 117 | RegisterCmd("echoTest", RunEchoTest, "this echos your command args to see how they are parsed"); |
121 | RegisterCmd("kickuser", KickUserCommand, "kickuser [first] [last] - attempts to log off a user from any region we are serving"); | 118 | RegisterCmd("kickuser", KickUserCommand, "kickuser [first] [last] - attempts to log off a user from any region we are serving"); |
119 | |||
120 | // For now, start at the 'root' level by default | ||
121 | ChangeSelectedRegion(new string[] {"root"}); | ||
122 | } | 122 | } |
123 | 123 | ||
124 | private void RunAutoTimerScript(object sender, EventArgs e) | 124 | private void RunAutoTimerScript(object sender, EventArgs e) |
@@ -129,16 +129,6 @@ namespace OpenSim | |||
129 | } | 129 | } |
130 | } | 130 | } |
131 | 131 | ||
132 | /// <summary> | ||
133 | /// Get the name of the region which is currently selected for single region operations | ||
134 | /// </summary> | ||
135 | /// <returns></returns> | ||
136 | private string GetSelectedRegionName() | ||
137 | { | ||
138 | if (m_sceneManager.CurrentScene == null) return "Root"; | ||
139 | return m_sceneManager.CurrentScene.RegionInfo.RegionName; | ||
140 | } | ||
141 | |||
142 | #region Console Commands | 132 | #region Console Commands |
143 | 133 | ||
144 | private void RunEchoTest(string[] cmdparams) | 134 | private void RunEchoTest(string[] cmdparams) |
@@ -255,9 +245,9 @@ namespace OpenSim | |||
255 | m_console.Notice(" alert [First] [Last] [Message] - send an alert to a user. Case sensitive."); | 245 | m_console.Notice(" alert [First] [Last] [Message] - send an alert to a user. Case sensitive."); |
256 | m_console.Notice(" alert general [Message] - send an alert to all users."); | 246 | m_console.Notice(" alert general [Message] - send an alert to all users."); |
257 | m_console.Notice("backup - persist simulator objects to the database ahead of the normal schedule."); | 247 | m_console.Notice("backup - persist simulator objects to the database ahead of the normal schedule."); |
258 | m_console.Notice("clear-assets - clear asset cache"); | 248 | m_console.Notice("clear-assets - clear the asset cache"); |
259 | m_console.Notice("create-region <name> <regionfile.xml> - creates a new region"); | 249 | m_console.Notice("create-region <name> <regionfile.xml> - create a new region"); |
260 | m_console.Notice("change-region [name] - sets the region that many of these commands affect."); | 250 | m_console.Notice("change-region <name> - select the region that single region commands operate upon."); |
261 | m_console.Notice("command-script [filename] - Execute command in a file."); | 251 | m_console.Notice("command-script [filename] - Execute command in a file."); |
262 | m_console.Notice("debug - debugging commands"); | 252 | m_console.Notice("debug - debugging commands"); |
263 | m_console.Notice(" debug packet 0..255 - print incoming/outgoing packets (0=off)"); | 253 | m_console.Notice(" debug packet 0..255 - print incoming/outgoing packets (0=off)"); |
@@ -291,9 +281,6 @@ namespace OpenSim | |||
291 | m_console.Notice("create user - adds a new user."); | 281 | m_console.Notice("create user - adds a new user."); |
292 | } | 282 | } |
293 | 283 | ||
294 | m_console.Notice(""); | ||
295 | m_console.Notice("Selected region: " + GetSelectedRegionName()); | ||
296 | m_console.Notice(""); | ||
297 | break; | 284 | break; |
298 | 285 | ||
299 | case "save-xml": | 286 | case "save-xml": |
@@ -519,15 +506,19 @@ namespace OpenSim | |||
519 | { | 506 | { |
520 | if (cmdparams.Length > 0) | 507 | if (cmdparams.Length > 0) |
521 | { | 508 | { |
522 | string regionName = CombineParams(cmdparams, 0); | 509 | string newRegionName = CombineParams(cmdparams, 0); |
523 | 510 | ||
524 | if (!m_sceneManager.TrySetCurrentScene(regionName)) | 511 | if (!m_sceneManager.TrySetCurrentScene(newRegionName)) |
525 | { | 512 | m_console.Error("Couldn't select region " + newRegionName); |
526 | m_console.Error("CONSOLE", "Couldn't set current region to: " + regionName); | ||
527 | } | ||
528 | } | 513 | } |
529 | 514 | else | |
530 | m_console.DefaultPrompt = String.Format("Region ({0}) ", GetSelectedRegionName()); | 515 | { |
516 | m_console.Error("Usage: change-region <region name>"); | ||
517 | } | ||
518 | |||
519 | string regionName = (m_sceneManager.CurrentScene == null ? "root" : m_sceneManager.CurrentScene.RegionInfo.RegionName); | ||
520 | m_console.Notice(String.Format("Currently selected region is {0}", regionName)); | ||
521 | m_console.DefaultPrompt = String.Format("Region ({0}) ", regionName); | ||
531 | } | 522 | } |
532 | 523 | ||
533 | /// <summary> | 524 | /// <summary> |
@@ -673,10 +664,6 @@ namespace OpenSim | |||
673 | }); | 664 | }); |
674 | break; | 665 | break; |
675 | } | 666 | } |
676 | |||
677 | m_console.Notice(""); | ||
678 | m_console.Notice("Selected region: " + GetSelectedRegionName()); | ||
679 | m_console.Notice(""); | ||
680 | } | 667 | } |
681 | 668 | ||
682 | /// <summary> | 669 | /// <summary> |