aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Application/OpenSim.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Application/OpenSim.cs')
-rw-r--r--OpenSim/Region/Application/OpenSim.cs130
1 files changed, 7 insertions, 123 deletions
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>