aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorMelanie Thielker2009-05-20 13:50:33 +0000
committerMelanie Thielker2009-05-20 13:50:33 +0000
commit4065ebff15e228d7227500f3a2275025f5d16966 (patch)
tree3ffddea94c9fab8218289c5bc4e188e9f52a53c2 /OpenSim/Region
parentrefactoring instantiation of Location object: moving it out of the for (diff)
downloadopensim-SC-4065ebff15e228d7227500f3a2275025f5d16966.zip
opensim-SC-4065ebff15e228d7227500f3a2275025f5d16966.tar.gz
opensim-SC-4065ebff15e228d7227500f3a2275025f5d16966.tar.bz2
opensim-SC-4065ebff15e228d7227500f3a2275025f5d16966.tar.xz
Remove the pre-log4net, discrete output methods from the consoles
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/Application/OpenSim.cs85
-rw-r--r--OpenSim/Region/Application/OpenSimBase.cs2
2 files changed, 43 insertions, 44 deletions
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs
index 282963c..6c1fee5 100644
--- a/OpenSim/Region/Application/OpenSim.cs
+++ b/OpenSim/Region/Application/OpenSim.cs
@@ -357,7 +357,7 @@ namespace OpenSim
357 if (presence.Firstname.ToLower().Contains(cmdparams[2].ToLower()) && 357 if (presence.Firstname.ToLower().Contains(cmdparams[2].ToLower()) &&
358 presence.Lastname.ToLower().Contains(cmdparams[3].ToLower())) 358 presence.Lastname.ToLower().Contains(cmdparams[3].ToLower()))
359 { 359 {
360 m_console.Notice( 360 m_log.Info(
361 String.Format( 361 String.Format(
362 "Kicking user: {0,-16}{1,-16}{2,-37} in region: {3,-16}", 362 "Kicking user: {0,-16}{1,-16}{2,-37} in region: {3,-16}",
363 presence.Firstname, presence.Lastname, presence.UUID, regionInfo.RegionName)); 363 presence.Firstname, presence.Lastname, presence.UUID, regionInfo.RegionName));
@@ -372,7 +372,7 @@ namespace OpenSim
372 presence.Scene.IncomingCloseAgent(presence.UUID); 372 presence.Scene.IncomingCloseAgent(presence.UUID);
373 } 373 }
374 } 374 }
375 m_console.Notice(""); 375 m_log.Info("");
376 } 376 }
377 377
378 /// <summary> 378 /// <summary>
@@ -418,7 +418,7 @@ namespace OpenSim
418 418
419 private void HandleForceUpdate(string module, string[] args) 419 private void HandleForceUpdate(string module, string[] args)
420 { 420 {
421 m_console.Notice("Updating all clients"); 421 m_log.Info("Updating all clients");
422 m_sceneManager.ForceCurrentSceneClientUpdate(); 422 m_sceneManager.ForceCurrentSceneClientUpdate();
423 } 423 }
424 424
@@ -430,7 +430,7 @@ namespace OpenSim
430 } 430 }
431 else 431 else
432 { 432 {
433 m_console.Notice("Argument error: edit scale <prim name> <x> <y> <z>"); 433 m_log.Info("Argument error: edit scale <prim name> <x> <y> <z>");
434 } 434 }
435 } 435 }
436 436
@@ -438,7 +438,7 @@ namespace OpenSim
438 { 438 {
439 if (cmd.Length < 4 || !cmd[3].EndsWith(".xml")) 439 if (cmd.Length < 4 || !cmd[3].EndsWith(".xml"))
440 { 440 {
441 m_console.Error("Usage: create region <region name> <region_file.xml>"); 441 m_log.Error("Usage: create region <region name> <region_file.xml>");
442 return; 442 return;
443 } 443 }
444 444
@@ -485,8 +485,8 @@ namespace OpenSim
485 case "set": 485 case "set":
486 if (cmdparams.Length < 4) 486 if (cmdparams.Length < 4)
487 { 487 {
488 m_console.Error(n, "SYNTAX: " + n + " SET SECTION KEY VALUE"); 488 m_log.Error("SYNTAX: " + n + " SET SECTION KEY VALUE");
489 m_console.Error(n, "EXAMPLE: " + n + " SET ScriptEngine.DotNetEngine NumberOfScriptThreads 5"); 489 m_log.Error("EXAMPLE: " + n + " SET ScriptEngine.DotNetEngine NumberOfScriptThreads 5");
490 } 490 }
491 else 491 else
492 { 492 {
@@ -502,7 +502,7 @@ namespace OpenSim
502 c.Set(cmdparams[2], _value); 502 c.Set(cmdparams[2], _value);
503 m_config.Source.Merge(source); 503 m_config.Source.Merge(source);
504 504
505 m_console.Error(n, n + " " + n + " " + cmdparams[1] + " " + cmdparams[2] + " " + 505 m_log.Error(n + " " + n + " " + cmdparams[1] + " " + cmdparams[2] + " " +
506 _value); 506 _value);
507 } 507 }
508 } 508 }
@@ -511,20 +511,20 @@ namespace OpenSim
511 case "get": 511 case "get":
512 if (cmdparams.Length < 3) 512 if (cmdparams.Length < 3)
513 { 513 {
514 m_console.Error(n, "SYNTAX: " + n + " GET SECTION KEY"); 514 m_log.Error("SYNTAX: " + n + " GET SECTION KEY");
515 m_console.Error(n, "EXAMPLE: " + n + " GET ScriptEngine.DotNetEngine NumberOfScriptThreads"); 515 m_log.Error("EXAMPLE: " + n + " GET ScriptEngine.DotNetEngine NumberOfScriptThreads");
516 } 516 }
517 else 517 else
518 { 518 {
519 IConfig c = m_config.Source.Configs[cmdparams[1]]; // DefaultConfig().Configs[cmdparams[1]]; 519 IConfig c = m_config.Source.Configs[cmdparams[1]]; // DefaultConfig().Configs[cmdparams[1]];
520 if (c == null) 520 if (c == null)
521 { 521 {
522 m_console.Notice(n, "Section \"" + cmdparams[1] + "\" does not exist."); 522 m_log.Info("Section \"" + cmdparams[1] + "\" does not exist.");
523 break; 523 break;
524 } 524 }
525 else 525 else
526 { 526 {
527 m_console.Notice(n + " GET " + cmdparams[1] + " " + cmdparams[2] + ": " + 527 m_log.Info(n + " GET " + cmdparams[1] + " " + cmdparams[2] + ": " +
528 c.GetString(cmdparams[2])); 528 c.GetString(cmdparams[2]));
529 } 529 }
530 } 530 }
@@ -532,7 +532,7 @@ namespace OpenSim
532 break; 532 break;
533 533
534 case "save": 534 case "save":
535 m_console.Notice("Saving configuration file: " + Application.iniFilePath); 535 m_log.Info("Saving configuration file: " + Application.iniFilePath);
536 m_config.Save(Application.iniFilePath); 536 m_config.Save(Application.iniFilePath);
537 break; 537 break;
538 } 538 }
@@ -552,7 +552,7 @@ namespace OpenSim
552 case "list": 552 case "list":
553 foreach (IRegionModule irm in m_moduleLoader.GetLoadedSharedModules) 553 foreach (IRegionModule irm in m_moduleLoader.GetLoadedSharedModules)
554 { 554 {
555 m_console.Notice("Shared region module: " + irm.Name); 555 m_log.Info("Shared region module: " + irm.Name);
556 } 556 }
557 break; 557 break;
558 case "unload": 558 case "unload":
@@ -562,7 +562,7 @@ namespace OpenSim
562 { 562 {
563 if (rm.Name.ToLower() == cmdparams[1].ToLower()) 563 if (rm.Name.ToLower() == cmdparams[1].ToLower())
564 { 564 {
565 m_console.Notice("Unloading module: " + rm.Name); 565 m_log.Info("Unloading module: " + rm.Name);
566 m_moduleLoader.UnloadModule(rm); 566 m_moduleLoader.UnloadModule(rm);
567 } 567 }
568 } 568 }
@@ -573,7 +573,7 @@ namespace OpenSim
573 { 573 {
574 foreach (Scene s in new ArrayList(m_sceneManager.Scenes)) 574 foreach (Scene s in new ArrayList(m_sceneManager.Scenes))
575 { 575 {
576 m_console.Notice("Loading module: " + cmdparams[1]); 576 m_log.Info("Loading module: " + cmdparams[1]);
577 m_moduleLoader.LoadRegionModules(cmdparams[1], s); 577 m_moduleLoader.LoadRegionModules(cmdparams[1], s);
578 } 578 }
579 } 579 }
@@ -618,7 +618,7 @@ namespace OpenSim
618 if (m_sceneManager.TryGetScene(regRemoveName, out removeScene)) 618 if (m_sceneManager.TryGetScene(regRemoveName, out removeScene))
619 RemoveRegion(removeScene, false); 619 RemoveRegion(removeScene, false);
620 else 620 else
621 m_console.Error("no region with that name"); 621 m_log.Error("no region with that name");
622 break; 622 break;
623 623
624 case "delete-region": 624 case "delete-region":
@@ -628,7 +628,7 @@ namespace OpenSim
628 if (m_sceneManager.TryGetScene(regDeleteName, out killScene)) 628 if (m_sceneManager.TryGetScene(regDeleteName, out killScene))
629 RemoveRegion(killScene, true); 629 RemoveRegion(killScene, true);
630 else 630 else
631 m_console.Error("no region with that name"); 631 m_log.Error("no region with that name");
632 break; 632 break;
633 633
634 case "restart": 634 case "restart":
@@ -672,15 +672,15 @@ namespace OpenSim
672 string newRegionName = CombineParams(cmdparams, 2); 672 string newRegionName = CombineParams(cmdparams, 2);
673 673
674 if (!m_sceneManager.TrySetCurrentScene(newRegionName)) 674 if (!m_sceneManager.TrySetCurrentScene(newRegionName))
675 m_console.Error("Couldn't select region " + newRegionName); 675 m_log.Error("Couldn't select region " + newRegionName);
676 } 676 }
677 else 677 else
678 { 678 {
679 m_console.Error("Usage: change region <region name>"); 679 m_log.Error("Usage: change region <region name>");
680 } 680 }
681 681
682 string regionName = (m_sceneManager.CurrentScene == null ? "root" : m_sceneManager.CurrentScene.RegionInfo.RegionName); 682 string regionName = (m_sceneManager.CurrentScene == null ? "root" : m_sceneManager.CurrentScene.RegionInfo.RegionName);
683 m_console.Notice(String.Format("Currently selected region is {0}", regionName)); 683 m_log.Info(String.Format("Currently selected region is {0}", regionName));
684 m_console.DefaultPrompt = String.Format("Region ({0}) ", regionName); 684 m_console.DefaultPrompt = String.Format("Region ({0}) ", regionName);
685 m_console.ConsoleScene = m_sceneManager.CurrentScene; 685 m_console.ConsoleScene = m_sceneManager.CurrentScene;
686 } 686 }
@@ -697,7 +697,7 @@ namespace OpenSim
697 } 697 }
698 else 698 else
699 { 699 {
700 m_console.Notice("Create user is not available in grid mode, use the user server."); 700 m_log.Info("Create user is not available in grid mode, use the user server.");
701 } 701 }
702 } 702 }
703 703
@@ -713,7 +713,7 @@ namespace OpenSim
713 } 713 }
714 else 714 else
715 { 715 {
716 m_console.Notice("Reset user password is not available in grid mode, use the user-server."); 716 m_log.Info("Reset user password is not available in grid mode, use the user-server.");
717 } 717 }
718 } 718 }
719 719
@@ -738,9 +738,9 @@ namespace OpenSim
738 } 738 }
739 else 739 else
740 { 740 {
741 m_console.Error("packet debug should be 0..255"); 741 m_log.Error("packet debug should be 0..255");
742 } 742 }
743 m_console.Notice("New packet debug: " + newDebug.ToString()); 743 m_log.Info("New packet debug: " + newDebug.ToString());
744 } 744 }
745 745
746 break; 746 break;
@@ -750,7 +750,7 @@ namespace OpenSim
750 { 750 {
751 if (m_sceneManager.CurrentScene == null) 751 if (m_sceneManager.CurrentScene == null)
752 { 752 {
753 m_console.Notice("Please use 'change region <regioname>' first"); 753 m_log.Info("Please use 'change region <regioname>' first");
754 } 754 }
755 else 755 else
756 { 756 {
@@ -759,8 +759,7 @@ namespace OpenSim
759 bool physicsOn = !Convert.ToBoolean(args[4]); 759 bool physicsOn = !Convert.ToBoolean(args[4]);
760 m_sceneManager.CurrentScene.SetSceneCoreDebug(scriptingOn, collisionsOn, physicsOn); 760 m_sceneManager.CurrentScene.SetSceneCoreDebug(scriptingOn, collisionsOn, physicsOn);
761 761
762 m_console.Notice( 762 m_log.Info(
763 "CONSOLE",
764 String.Format( 763 String.Format(
765 "Set debug scene scripting = {0}, collisions = {1}, physics = {2}", 764 "Set debug scene scripting = {0}, collisions = {1}, physics = {2}",
766 !scriptingOn, !collisionsOn, !physicsOn)); 765 !scriptingOn, !collisionsOn, !physicsOn));
@@ -768,13 +767,13 @@ namespace OpenSim
768 } 767 }
769 else 768 else
770 { 769 {
771 m_console.Error("debug scene <scripting> <collisions> <physics> (where inside <> is true/false)"); 770 m_log.Error("debug scene <scripting> <collisions> <physics> (where inside <> is true/false)");
772 } 771 }
773 772
774 break; 773 break;
775 774
776 default: 775 default:
777 m_console.Error("Unknown debug"); 776 m_log.Error("Unknown debug");
778 break; 777 break;
779 } 778 }
780 } 779 }
@@ -805,9 +804,9 @@ namespace OpenSim
805 agents = m_sceneManager.GetCurrentSceneAvatars(); 804 agents = m_sceneManager.GetCurrentSceneAvatars();
806 } 805 }
807 806
808 m_console.Notice(String.Format("\nAgents connected: {0}\n", agents.Count)); 807 m_log.Info(String.Format("\nAgents connected: {0}\n", agents.Count));
809 808
810 m_console.Notice( 809 m_log.Info(
811 String.Format("{0,-16}{1,-16}{2,-37}{3,-11}{4,-16}", "Firstname", "Lastname", 810 String.Format("{0,-16}{1,-16}{2,-37}{3,-11}{4,-16}", "Firstname", "Lastname",
812 "Agent ID", "Root/Child", "Region")); 811 "Agent ID", "Root/Child", "Region"));
813 812
@@ -825,7 +824,7 @@ namespace OpenSim
825 regionName = regionInfo.RegionName; 824 regionName = regionInfo.RegionName;
826 } 825 }
827 826
828 m_console.Notice( 827 m_log.Info(
829 String.Format( 828 String.Format(
830 "{0,-16}{1,-16}{2,-37}{3,-11}{4,-16}", 829 "{0,-16}{1,-16}{2,-37}{3,-11}{4,-16}",
831 presence.Firstname, 830 presence.Firstname,
@@ -835,14 +834,14 @@ namespace OpenSim
835 regionName)); 834 regionName));
836 } 835 }
837 836
838 m_console.Notice(""); 837 m_log.Info("");
839 break; 838 break;
840 839
841 case "modules": 840 case "modules":
842 m_console.Notice("The currently loaded shared modules are:"); 841 m_log.Info("The currently loaded shared modules are:");
843 foreach (IRegionModule module in m_moduleLoader.GetLoadedSharedModules) 842 foreach (IRegionModule module in m_moduleLoader.GetLoadedSharedModules)
844 { 843 {
845 m_console.Notice("Shared Module: " + module.Name); 844 m_log.Info("Shared Module: " + module.Name);
846 } 845 }
847 break; 846 break;
848 847
@@ -850,7 +849,7 @@ namespace OpenSim
850 m_sceneManager.ForEachScene( 849 m_sceneManager.ForEachScene(
851 delegate(Scene scene) 850 delegate(Scene scene)
852 { 851 {
853 m_console.Notice("Region Name: " + scene.RegionInfo.RegionName + " , Region XLoc: " + 852 m_log.Info("Region Name: " + scene.RegionInfo.RegionName + " , Region XLoc: " +
854 scene.RegionInfo.RegionLocX + " , Region YLoc: " + 853 scene.RegionInfo.RegionLocX + " , Region YLoc: " +
855 scene.RegionInfo.RegionLocY + " , Region Port: " + 854 scene.RegionInfo.RegionLocY + " , Region Port: " +
856 scene.RegionInfo.InternalEndPoint.Port.ToString()); 855 scene.RegionInfo.InternalEndPoint.Port.ToString());
@@ -878,7 +877,7 @@ namespace OpenSim
878 { 877 {
879 rating = "PG"; 878 rating = "PG";
880 } 879 }
881 m_console.Notice("Region Name: " + scene.RegionInfo.RegionName + " , Region Rating: " + 880 m_log.Info("Region Name: " + scene.RegionInfo.RegionName + " , Region Rating: " +
882 rating); 881 rating);
883 }); 882 });
884 break; 883 break;
@@ -1044,7 +1043,7 @@ namespace OpenSim
1044 { 1043 {
1045 loadOffset.Z = (float) Convert.ToDecimal(cmdparams[6]); 1044 loadOffset.Z = (float) Convert.ToDecimal(cmdparams[6]);
1046 } 1045 }
1047 m_console.Error("loadOffsets <X,Y,Z> = <" + loadOffset.X + "," + loadOffset.Y + "," + 1046 m_log.Error("loadOffsets <X,Y,Z> = <" + loadOffset.X + "," + loadOffset.Y + "," +
1048 loadOffset.Z + ">"); 1047 loadOffset.Z + ">");
1049 } 1048 }
1050 } 1049 }
@@ -1058,7 +1057,7 @@ namespace OpenSim
1058 } 1057 }
1059 catch (FileNotFoundException) 1058 catch (FileNotFoundException)
1060 { 1059 {
1061 m_console.Error("Default xml not found. Usage: load-xml <filename>"); 1060 m_log.Error("Default xml not found. Usage: load-xml <filename>");
1062 } 1061 }
1063 } 1062 }
1064 } 1063 }
@@ -1085,7 +1084,7 @@ namespace OpenSim
1085 } 1084 }
1086 catch (FileNotFoundException) 1085 catch (FileNotFoundException)
1087 { 1086 {
1088 m_console.Error("Specified xml not found. Usage: load xml2 <filename>"); 1087 m_log.Error("Specified xml not found. Usage: load xml2 <filename>");
1089 } 1088 }
1090 } 1089 }
1091 else 1090 else
@@ -1096,7 +1095,7 @@ namespace OpenSim
1096 } 1095 }
1097 catch (FileNotFoundException) 1096 catch (FileNotFoundException)
1098 { 1097 {
1099 m_console.Error("Default xml not found. Usage: load xml2 <filename>"); 1098 m_log.Error("Default xml not found. Usage: load xml2 <filename>");
1100 } 1099 }
1101 } 1100 }
1102 } 1101 }
@@ -1120,7 +1119,7 @@ namespace OpenSim
1120 } 1119 }
1121 catch (Exception e) 1120 catch (Exception e)
1122 { 1121 {
1123 m_console.Error(e.Message); 1122 m_log.Error(e.Message);
1124 } 1123 }
1125 } 1124 }
1126 1125
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs
index eaf6e4f..3ea636a 100644
--- a/OpenSim/Region/Application/OpenSimBase.cs
+++ b/OpenSim/Region/Application/OpenSimBase.cs
@@ -273,7 +273,7 @@ namespace OpenSim
273 // 273 //
274 ICommander moduleCommander = SceneManager.CurrentOrFirstScene.GetCommander(cmd[1]); 274 ICommander moduleCommander = SceneManager.CurrentOrFirstScene.GetCommander(cmd[1]);
275 if (moduleCommander != null) 275 if (moduleCommander != null)
276 m_console.Notice(moduleCommander.Help); 276 m_console.Output(moduleCommander.Help);
277 } 277 }
278 278
279 protected override void Initialize() 279 protected override void Initialize()