diff options
Diffstat (limited to 'OpenSim/Region/Application')
-rw-r--r-- | OpenSim/Region/Application/HGCommands.cs | 6 | ||||
-rw-r--r-- | OpenSim/Region/Application/OpenSim.cs | 130 | ||||
-rw-r--r-- | OpenSim/Region/Application/OpenSimBase.cs | 40 |
3 files changed, 14 insertions, 162 deletions
diff --git a/OpenSim/Region/Application/HGCommands.cs b/OpenSim/Region/Application/HGCommands.cs index 7ae161d..5b99d7d 100644 --- a/OpenSim/Region/Application/HGCommands.cs +++ b/OpenSim/Region/Application/HGCommands.cs | |||
@@ -44,14 +44,14 @@ namespace OpenSim | |||
44 | { | 44 | { |
45 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 45 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
46 | 46 | ||
47 | public static Scene CreateScene(RegionInfo regionInfo, AgentCircuitManager circuitManager, CommunicationsManager m_commsManager, | 47 | public static Scene CreateScene(RegionInfo regionInfo, AgentCircuitManager circuitManager, |
48 | StorageManager storageManager, ModuleLoader m_moduleLoader, ConfigSettings m_configSettings, OpenSimConfigSource m_config, string m_version) | 48 | StorageManager storageManager, ModuleLoader m_moduleLoader, ConfigSettings m_configSettings, OpenSimConfigSource m_config, string m_version) |
49 | { | 49 | { |
50 | HGSceneCommunicationService sceneGridService = new HGSceneCommunicationService(m_commsManager); | 50 | SceneCommunicationService sceneGridService = new SceneCommunicationService(); |
51 | 51 | ||
52 | return | 52 | return |
53 | new HGScene( | 53 | new HGScene( |
54 | regionInfo, circuitManager, m_commsManager, sceneGridService, storageManager, | 54 | regionInfo, circuitManager, sceneGridService, storageManager, |
55 | m_moduleLoader, false, m_configSettings.PhysicalPrim, | 55 | m_moduleLoader, false, m_configSettings.PhysicalPrim, |
56 | m_configSettings.See_into_region_from_neighbor, m_config.Source, m_version); | 56 | m_configSettings.See_into_region_from_neighbor, m_config.Source, m_version); |
57 | } | 57 | } |
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index e09d730..299f519 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs | |||
@@ -153,6 +153,11 @@ namespace OpenSim | |||
153 | RegisterConsoleCommands(); | 153 | RegisterConsoleCommands(); |
154 | 154 | ||
155 | base.StartupSpecific(); | 155 | base.StartupSpecific(); |
156 | |||
157 | MainServer.Instance.AddStreamHandler(new OpenSim.SimStatusHandler()); | ||
158 | MainServer.Instance.AddStreamHandler(new OpenSim.XSimStatusHandler(this)); | ||
159 | if (userStatsURI != String.Empty) | ||
160 | MainServer.Instance.AddStreamHandler(new OpenSim.UXSimStatusHandler(this)); | ||
156 | 161 | ||
157 | if (m_console is RemoteConsole) | 162 | if (m_console is RemoteConsole) |
158 | { | 163 | { |
@@ -348,16 +353,6 @@ namespace OpenSim | |||
348 | "kill uuid <UUID>", | 353 | "kill uuid <UUID>", |
349 | "Kill an object by UUID", KillUUID); | 354 | "Kill an object by UUID", KillUUID); |
350 | 355 | ||
351 | if (ConfigurationSettings.Standalone) | ||
352 | { | ||
353 | m_console.Commands.AddCommand("region", false, "create user", | ||
354 | "create user [<first> [<last> [<pass> [<x> <y> [<email>]]]]]", | ||
355 | "Create a new user", HandleCreateUser); | ||
356 | |||
357 | m_console.Commands.AddCommand("region", false, "reset user password", | ||
358 | "reset user password [<first> [<last> [<password>]]]", | ||
359 | "Reset a user password", HandleResetUserPassword); | ||
360 | } | ||
361 | 356 | ||
362 | m_console.Commands.AddCommand("hypergrid", false, "link-mapping", "link-mapping [<x> <y>] <cr>", | 357 | m_console.Commands.AddCommand("hypergrid", false, "link-mapping", "link-mapping [<x> <y>] <cr>", |
363 | "Set local coordinate to map HG regions to", RunCommand); | 358 | "Set local coordinate to map HG regions to", RunCommand); |
@@ -420,7 +415,7 @@ namespace OpenSim | |||
420 | 415 | ||
421 | foreach (ScenePresence presence in agents) | 416 | foreach (ScenePresence presence in agents) |
422 | { | 417 | { |
423 | RegionInfo regionInfo = m_sceneManager.GetRegionInfo(presence.RegionHandle); | 418 | RegionInfo regionInfo = presence.Scene.RegionInfo; |
424 | 419 | ||
425 | if (presence.Firstname.ToLower().Contains(cmdparams[2].ToLower()) && | 420 | if (presence.Firstname.ToLower().Contains(cmdparams[2].ToLower()) && |
426 | presence.Lastname.ToLower().Contains(cmdparams[3].ToLower())) | 421 | presence.Lastname.ToLower().Contains(cmdparams[3].ToLower())) |
@@ -777,37 +772,6 @@ namespace OpenSim | |||
777 | m_console.ConsoleScene = m_sceneManager.CurrentScene; | 772 | m_console.ConsoleScene = m_sceneManager.CurrentScene; |
778 | } | 773 | } |
779 | 774 | ||
780 | /// <summary> | ||
781 | /// Execute switch for some of the create commands | ||
782 | /// </summary> | ||
783 | /// <param name="args"></param> | ||
784 | private void HandleCreateUser(string module, string[] cmd) | ||
785 | { | ||
786 | if (ConfigurationSettings.Standalone) | ||
787 | { | ||
788 | CreateUser(cmd); | ||
789 | } | ||
790 | else | ||
791 | { | ||
792 | m_log.Info("Create user is not available in grid mode, use the user server."); | ||
793 | } | ||
794 | } | ||
795 | |||
796 | /// <summary> | ||
797 | /// Execute switch for some of the reset commands | ||
798 | /// </summary> | ||
799 | /// <param name="args"></param> | ||
800 | protected void HandleResetUserPassword(string module, string[] cmd) | ||
801 | { | ||
802 | if (ConfigurationSettings.Standalone) | ||
803 | { | ||
804 | ResetUserPassword(cmd); | ||
805 | } | ||
806 | else | ||
807 | { | ||
808 | m_log.Info("Reset user password is not available in grid mode, use the user-server."); | ||
809 | } | ||
810 | } | ||
811 | 775 | ||
812 | /// <summary> | 776 | /// <summary> |
813 | /// Turn on some debugging values for OpenSim. | 777 | /// Turn on some debugging values for OpenSim. |
@@ -909,7 +873,7 @@ namespace OpenSim | |||
909 | 873 | ||
910 | foreach (ScenePresence presence in agents) | 874 | foreach (ScenePresence presence in agents) |
911 | { | 875 | { |
912 | RegionInfo regionInfo = m_sceneManager.GetRegionInfo(presence.RegionHandle); | 876 | RegionInfo regionInfo = presence.Scene.RegionInfo; |
913 | string regionName; | 877 | string regionName; |
914 | 878 | ||
915 | if (regionInfo == null) | 879 | if (regionInfo == null) |
@@ -1041,86 +1005,6 @@ namespace OpenSim | |||
1041 | } | 1005 | } |
1042 | 1006 | ||
1043 | /// <summary> | 1007 | /// <summary> |
1044 | /// Create a new user | ||
1045 | /// </summary> | ||
1046 | /// <param name="cmdparams">string array with parameters: firstname, lastname, password, locationX, locationY, email</param> | ||
1047 | protected void CreateUser(string[] cmdparams) | ||
1048 | { | ||
1049 | string firstName; | ||
1050 | string lastName; | ||
1051 | string password; | ||
1052 | string email; | ||
1053 | uint regX = 1000; | ||
1054 | uint regY = 1000; | ||
1055 | |||
1056 | IConfig standalone; | ||
1057 | if ((standalone = m_config.Source.Configs["StandAlone"]) != null) | ||
1058 | { | ||
1059 | regX = (uint)standalone.GetInt("default_location_x", (int)regX); | ||
1060 | regY = (uint)standalone.GetInt("default_location_y", (int)regY); | ||
1061 | } | ||
1062 | |||
1063 | |||
1064 | if (cmdparams.Length < 3) | ||
1065 | firstName = MainConsole.Instance.CmdPrompt("First name", "Default"); | ||
1066 | else firstName = cmdparams[2]; | ||
1067 | |||
1068 | if (cmdparams.Length < 4) | ||
1069 | lastName = MainConsole.Instance.CmdPrompt("Last name", "User"); | ||
1070 | else lastName = cmdparams[3]; | ||
1071 | |||
1072 | if (cmdparams.Length < 5) | ||
1073 | password = MainConsole.Instance.PasswdPrompt("Password"); | ||
1074 | else password = cmdparams[4]; | ||
1075 | |||
1076 | if (cmdparams.Length < 6) | ||
1077 | regX = Convert.ToUInt32(MainConsole.Instance.CmdPrompt("Start Region X", regX.ToString())); | ||
1078 | else regX = Convert.ToUInt32(cmdparams[5]); | ||
1079 | |||
1080 | if (cmdparams.Length < 7) | ||
1081 | regY = Convert.ToUInt32(MainConsole.Instance.CmdPrompt("Start Region Y", regY.ToString())); | ||
1082 | else regY = Convert.ToUInt32(cmdparams[6]); | ||
1083 | |||
1084 | if (cmdparams.Length < 8) | ||
1085 | email = MainConsole.Instance.CmdPrompt("Email", ""); | ||
1086 | else email = cmdparams[7]; | ||
1087 | |||
1088 | if (null == m_commsManager.UserProfileCacheService.GetUserDetails(firstName, lastName)) | ||
1089 | { | ||
1090 | m_commsManager.UserAdminService.AddUser(firstName, lastName, password, email, regX, regY); | ||
1091 | } | ||
1092 | else | ||
1093 | { | ||
1094 | m_log.ErrorFormat("[CONSOLE]: A user with the name {0} {1} already exists!", firstName, lastName); | ||
1095 | } | ||
1096 | } | ||
1097 | |||
1098 | /// <summary> | ||
1099 | /// Reset a user password. | ||
1100 | /// </summary> | ||
1101 | /// <param name="cmdparams"></param> | ||
1102 | private void ResetUserPassword(string[] cmdparams) | ||
1103 | { | ||
1104 | string firstName; | ||
1105 | string lastName; | ||
1106 | string newPassword; | ||
1107 | |||
1108 | if (cmdparams.Length < 4) | ||
1109 | firstName = MainConsole.Instance.CmdPrompt("First name"); | ||
1110 | else firstName = cmdparams[3]; | ||
1111 | |||
1112 | if (cmdparams.Length < 5) | ||
1113 | lastName = MainConsole.Instance.CmdPrompt("Last name"); | ||
1114 | else lastName = cmdparams[4]; | ||
1115 | |||
1116 | if (cmdparams.Length < 6) | ||
1117 | newPassword = MainConsole.Instance.PasswdPrompt("New password"); | ||
1118 | else newPassword = cmdparams[5]; | ||
1119 | |||
1120 | m_commsManager.UserAdminService.ResetUserPassword(firstName, lastName, newPassword); | ||
1121 | } | ||
1122 | |||
1123 | /// <summary> | ||
1124 | /// Use XML2 format to serialize data to a file | 1008 | /// Use XML2 format to serialize data to a file |
1125 | /// </summary> | 1009 | /// </summary> |
1126 | /// <param name="module"></param> | 1010 | /// <param name="module"></param> |
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index cf2ab65..f265769 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs | |||
@@ -36,8 +36,7 @@ using Nini.Config; | |||
36 | using OpenMetaverse; | 36 | using OpenMetaverse; |
37 | using OpenSim.Framework; | 37 | using OpenSim.Framework; |
38 | using OpenSim.Framework.Communications; | 38 | using OpenSim.Framework.Communications; |
39 | using OpenSim.Framework.Communications.Services; | 39 | |
40 | using OpenSim.Framework.Communications.Cache; | ||
41 | using OpenSim.Framework.Console; | 40 | using OpenSim.Framework.Console; |
42 | using OpenSim.Framework.Servers; | 41 | using OpenSim.Framework.Servers; |
43 | using OpenSim.Framework.Servers.HttpServer; | 42 | using OpenSim.Framework.Servers.HttpServer; |
@@ -85,8 +84,6 @@ namespace OpenSim | |||
85 | 84 | ||
86 | protected ConfigurationLoader m_configLoader; | 85 | protected ConfigurationLoader m_configLoader; |
87 | 86 | ||
88 | protected GridInfoService m_gridInfoService; | ||
89 | |||
90 | public ConsoleCommand CreateAccount = null; | 87 | public ConsoleCommand CreateAccount = null; |
91 | 88 | ||
92 | protected List<IApplicationPlugin> m_plugins = new List<IApplicationPlugin>(); | 89 | protected List<IApplicationPlugin> m_plugins = new List<IApplicationPlugin>(); |
@@ -555,35 +552,6 @@ namespace OpenSim | |||
555 | scene.PhysicsScene.SetTerrain(scene.Heightmap.GetFloatsSerialised()); | 552 | scene.PhysicsScene.SetTerrain(scene.Heightmap.GetFloatsSerialised()); |
556 | scene.PhysicsScene.SetWaterLevel((float) regionInfo.RegionSettings.WaterHeight); | 553 | scene.PhysicsScene.SetWaterLevel((float) regionInfo.RegionSettings.WaterHeight); |
557 | 554 | ||
558 | // TODO: Remove this cruft once MasterAvatar is fully deprecated | ||
559 | //Master Avatar Setup | ||
560 | UserProfileData masterAvatar; | ||
561 | if (scene.RegionInfo.MasterAvatarAssignedUUID == UUID.Zero) | ||
562 | { | ||
563 | masterAvatar = | ||
564 | m_commsManager.UserService.SetupMasterUser(scene.RegionInfo.MasterAvatarFirstName, | ||
565 | scene.RegionInfo.MasterAvatarLastName, | ||
566 | scene.RegionInfo.MasterAvatarSandboxPassword); | ||
567 | } | ||
568 | else | ||
569 | { | ||
570 | masterAvatar = m_commsManager.UserService.SetupMasterUser(scene.RegionInfo.MasterAvatarAssignedUUID); | ||
571 | scene.RegionInfo.MasterAvatarFirstName = masterAvatar.FirstName; | ||
572 | scene.RegionInfo.MasterAvatarLastName = masterAvatar.SurName; | ||
573 | } | ||
574 | |||
575 | if (masterAvatar == null) | ||
576 | { | ||
577 | m_log.Info("[PARCEL]: No master avatar found, using null."); | ||
578 | scene.RegionInfo.MasterAvatarAssignedUUID = UUID.Zero; | ||
579 | } | ||
580 | else | ||
581 | { | ||
582 | m_log.InfoFormat("[PARCEL]: Found master avatar {0} {1} [" + masterAvatar.ID.ToString() + "]", | ||
583 | scene.RegionInfo.MasterAvatarFirstName, scene.RegionInfo.MasterAvatarLastName); | ||
584 | scene.RegionInfo.MasterAvatarAssignedUUID = masterAvatar.ID; | ||
585 | } | ||
586 | |||
587 | return scene; | 555 | return scene; |
588 | } | 556 | } |
589 | 557 | ||
@@ -608,13 +576,13 @@ namespace OpenSim | |||
608 | { | 576 | { |
609 | bool hgrid = ConfigSource.Source.Configs["Startup"].GetBoolean("hypergrid", false); | 577 | bool hgrid = ConfigSource.Source.Configs["Startup"].GetBoolean("hypergrid", false); |
610 | if (hgrid) | 578 | if (hgrid) |
611 | return HGCommands.CreateScene(regionInfo, circuitManager, m_commsManager, | 579 | return HGCommands.CreateScene(regionInfo, circuitManager, |
612 | storageManager, m_moduleLoader, m_configSettings, m_config, m_version); | 580 | storageManager, m_moduleLoader, m_configSettings, m_config, m_version); |
613 | 581 | ||
614 | SceneCommunicationService sceneGridService = new SceneCommunicationService(m_commsManager); | 582 | SceneCommunicationService sceneGridService = new SceneCommunicationService(); |
615 | 583 | ||
616 | return new Scene( | 584 | return new Scene( |
617 | regionInfo, circuitManager, m_commsManager, sceneGridService, | 585 | regionInfo, circuitManager, sceneGridService, |
618 | storageManager, m_moduleLoader, false, m_configSettings.PhysicalPrim, | 586 | storageManager, m_moduleLoader, false, m_configSettings.PhysicalPrim, |
619 | m_configSettings.See_into_region_from_neighbor, m_config.Source, m_version); | 587 | m_configSettings.See_into_region_from_neighbor, m_config.Source, m_version); |
620 | } | 588 | } |