aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorMW2007-09-04 17:53:21 +0000
committerMW2007-09-04 17:53:21 +0000
commit710856e3d34837eaba90f9fae893e6a59758802f (patch)
treeeed7d07f87ce80e7d55098e295cc86dca2cf8d0b /OpenSim/Region
parentAdded "show modules" command that if at root level will display a list of loa... (diff)
downloadopensim-SC_OLD-710856e3d34837eaba90f9fae893e6a59758802f.zip
opensim-SC_OLD-710856e3d34837eaba90f9fae893e6a59758802f.tar.gz
opensim-SC_OLD-710856e3d34837eaba90f9fae893e6a59758802f.tar.bz2
opensim-SC_OLD-710856e3d34837eaba90f9fae893e6a59758802f.tar.xz
Removed the exit-region command, now use "change-region root" or "change-region .." to change back to root level. [Would be nice if the command prompt changed to show what the current region was, but think that will need changes to the console code so for now it will have to stay as it is].
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Application/OpenSimMain.cs41
-rw-r--r--OpenSim/Region/Environment/Interfaces/IHttpRequests.cs12
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs11
3 files changed, 45 insertions, 19 deletions
diff --git a/OpenSim/Region/Application/OpenSimMain.cs b/OpenSim/Region/Application/OpenSimMain.cs
index c94d328..5dfb30b 100644
--- a/OpenSim/Region/Application/OpenSimMain.cs
+++ b/OpenSim/Region/Application/OpenSimMain.cs
@@ -371,7 +371,7 @@ namespace OpenSim
371 /// <param name="cmdparams">Additional arguments passed to the command</param> 371 /// <param name="cmdparams">Additional arguments passed to the command</param>
372 public void RunCmd(string command, string[] cmdparams) 372 public void RunCmd(string command, string[] cmdparams)
373 { 373 {
374 if ((m_consoleRegion == null) || (command == "exit-region") || (command == "change-region")) 374 if ((m_consoleRegion == null) ||(command == "change-region"))
375 { 375 {
376 switch (command) 376 switch (command)
377 { 377 {
@@ -499,14 +499,29 @@ namespace OpenSim
499 case "change-region": 499 case "change-region":
500 if (cmdparams.Length > 0) 500 if (cmdparams.Length > 0)
501 { 501 {
502 string name = this.CombineParams(cmdparams, 0); 502 if ((cmdparams[0].ToLower() == "root") || (cmdparams[0].ToLower() == ".."))
503 Console.WriteLine("Searching for Region: '" + name + "'");
504 foreach (Scene scene in m_localScenes)
505 { 503 {
506 if (scene.RegionInfo.RegionName.ToLower() == name.ToLower()) 504 if (m_consoleRegion != null)
507 { 505 {
508 m_consoleRegion = scene; 506 m_consoleRegion = null;
509 MainLog.Instance.Verbose("Setting current region: " + m_consoleRegion.RegionInfo.RegionName); 507 MainLog.Instance.Verbose("Now at Root level");
508 }
509 else
510 {
511 MainLog.Instance.Verbose("Already at Root level");
512 }
513 }
514 else
515 {
516 string name = this.CombineParams(cmdparams, 0);
517 Console.WriteLine("Searching for Region: '" + name + "'");
518 foreach (Scene scene in m_localScenes)
519 {
520 if (scene.RegionInfo.RegionName.ToLower() == name.ToLower())
521 {
522 m_consoleRegion = scene;
523 MainLog.Instance.Verbose("Setting current region: " + m_consoleRegion.RegionInfo.RegionName);
524 }
510 } 525 }
511 } 526 }
512 } 527 }
@@ -523,18 +538,6 @@ namespace OpenSim
523 } 538 }
524 break; 539 break;
525 540
526 case "exit-region":
527 if (m_consoleRegion != null)
528 {
529 m_consoleRegion = null;
530 MainLog.Instance.Verbose("Exiting region, Now at Root level");
531 }
532 else
533 {
534 MainLog.Instance.Verbose("No region is set. Already at Root level");
535 }
536 break;
537
538 default: 541 default:
539 m_log.Error("Unknown command"); 542 m_log.Error("Unknown command");
540 break; 543 break;
diff --git a/OpenSim/Region/Environment/Interfaces/IHttpRequests.cs b/OpenSim/Region/Environment/Interfaces/IHttpRequests.cs
new file mode 100644
index 0000000..2294631
--- /dev/null
+++ b/OpenSim/Region/Environment/Interfaces/IHttpRequests.cs
@@ -0,0 +1,12 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using libsecondlife;
5
6namespace OpenSim.Region.Environment.Interfaces
7{
8 public interface IHttpRequests
9 {
10 LLUUID MakeHttpRequest(string url, string type, string body);
11 }
12}
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index f8d17b4..dca4222 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -93,6 +93,7 @@ namespace OpenSim.Region.Environment.Scenes
93 // this most likely shouldn't be handled as a API method like this, but doing it for testing purposes 93 // this most likely shouldn't be handled as a API method like this, but doing it for testing purposes
94 public ModuleAPIMethod2<bool, string, byte[]> AddXferFile = null; 94 public ModuleAPIMethod2<bool, string, byte[]> AddXferFile = null;
95 95
96 private IHttpRequests m_httpRequestModule = null;
96 private ISimChat m_simChatModule = null; 97 private ISimChat m_simChatModule = null;
97 98
98 #region Properties 99 #region Properties
@@ -196,6 +197,7 @@ namespace OpenSim.Region.Environment.Scenes
196 public void SetModuleInterfaces() 197 public void SetModuleInterfaces()
197 { 198 {
198 m_simChatModule = this.RequestModuleInterface<ISimChat>(); 199 m_simChatModule = this.RequestModuleInterface<ISimChat>();
200 m_httpRequestModule = this.RequestModuleInterface<IHttpRequests>();
199 201
200 //should change so it uses the module interface functions 202 //should change so it uses the module interface functions
201 AddXferFile = (ModuleAPIMethod2<bool, string, byte[]>)this.RequestAPIMethod("API_AddXferFile"); 203 AddXferFile = (ModuleAPIMethod2<bool, string, byte[]>)this.RequestAPIMethod("API_AddXferFile");
@@ -1318,6 +1320,15 @@ namespace OpenSim.Region.Environment.Scenes
1318 } 1320 }
1319 } 1321 }
1320 1322
1323 public LLUUID MakeHttpRequest(string url, string type, string body)
1324 {
1325 if (m_httpRequestModule != null)
1326 {
1327 return m_httpRequestModule.MakeHttpRequest(url, type, body);
1328 }
1329 return LLUUID.Zero;
1330 }
1331
1321 #region Script Engine 1332 #region Script Engine
1322 private List<OpenSim.Region.Environment.Scenes.Scripting.ScriptEngineInterface> ScriptEngines = new List<OpenSim.Region.Environment.Scenes.Scripting.ScriptEngineInterface>(); 1333 private List<OpenSim.Region.Environment.Scenes.Scripting.ScriptEngineInterface> ScriptEngines = new List<OpenSim.Region.Environment.Scenes.Scripting.ScriptEngineInterface>();
1323 public void AddScriptEngine(OpenSim.Region.Environment.Scenes.Scripting.ScriptEngineInterface ScriptEngine, LogBase m_logger) 1334 public void AddScriptEngine(OpenSim.Region.Environment.Scenes.Scripting.ScriptEngineInterface ScriptEngine, LogBase m_logger)