aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Application/OpenSim.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Application/OpenSim.cs')
-rwxr-xr-xOpenSim/Region/Application/OpenSim.cs143
1 files changed, 8 insertions, 135 deletions
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs
index 05e283e..7e81650 100755
--- a/OpenSim/Region/Application/OpenSim.cs
+++ b/OpenSim/Region/Application/OpenSim.cs
@@ -122,8 +122,7 @@ namespace OpenSim
122 m_log.Info("===================================================================="); 122 m_log.Info("====================================================================");
123 m_log.Info("========================= STARTING OPENSIM ========================="); 123 m_log.Info("========================= STARTING OPENSIM =========================");
124 m_log.Info("===================================================================="); 124 m_log.Info("====================================================================");
125 m_log.InfoFormat("[OPENSIM MAIN]: Running in {0} mode", 125 m_log.InfoFormat("[OPENSIM MAIN]: Running ");
126 (ConfigurationSettings.Standalone ? "sandbox" : "grid"));
127 //m_log.InfoFormat("[OPENSIM MAIN]: GC Is Server GC: {0}", GCSettings.IsServerGC.ToString()); 126 //m_log.InfoFormat("[OPENSIM MAIN]: GC Is Server GC: {0}", GCSettings.IsServerGC.ToString());
128 // http://msdn.microsoft.com/en-us/library/bb384202.aspx 127 // http://msdn.microsoft.com/en-us/library/bb384202.aspx
129 //GCSettings.LatencyMode = GCLatencyMode.Batch; 128 //GCSettings.LatencyMode = GCLatencyMode.Batch;
@@ -153,6 +152,11 @@ namespace OpenSim
153 RegisterConsoleCommands(); 152 RegisterConsoleCommands();
154 153
155 base.StartupSpecific(); 154 base.StartupSpecific();
155
156 MainServer.Instance.AddStreamHandler(new OpenSim.SimStatusHandler());
157 MainServer.Instance.AddStreamHandler(new OpenSim.XSimStatusHandler(this));
158 if (userStatsURI != String.Empty)
159 MainServer.Instance.AddStreamHandler(new OpenSim.UXSimStatusHandler(this));
156 160
157 if (m_console is RemoteConsole) 161 if (m_console is RemoteConsole)
158 { 162 {
@@ -350,25 +354,6 @@ namespace OpenSim
350 "kill uuid <UUID>", 354 "kill uuid <UUID>",
351 "Kill an object by UUID", KillUUID); 355 "Kill an object by UUID", KillUUID);
352 356
353 if (ConfigurationSettings.Standalone)
354 {
355 m_console.Commands.AddCommand("region", false, "create user",
356 "create user [<first> [<last> [<pass> [<x> <y> [<email>]]]]]",
357 "Create a new user", HandleCreateUser);
358
359 m_console.Commands.AddCommand("region", false, "reset user password",
360 "reset user password [<first> [<last> [<password>]]]",
361 "Reset a user password", HandleResetUserPassword);
362 }
363
364 m_console.Commands.AddCommand("hypergrid", false, "link-mapping", "link-mapping [<x> <y>] <cr>",
365 "Set local coordinate to map HG regions to", RunCommand);
366 m_console.Commands.AddCommand("hypergrid", false, "link-region",
367 "link-region <Xloc> <Yloc> <HostName>:<HttpPort>[:<RemoteRegionName>] <cr>",
368 "Link a hypergrid region", RunCommand);
369 m_console.Commands.AddCommand("hypergrid", false, "unlink-region",
370 "unlink-region <local name> or <HostName>:<HttpPort> <cr>",
371 "Unlink a hypergrid region", RunCommand);
372 } 357 }
373 358
374 public override void ShutdownSpecific() 359 public override void ShutdownSpecific()
@@ -421,7 +406,7 @@ namespace OpenSim
421 406
422 foreach (ScenePresence presence in agents) 407 foreach (ScenePresence presence in agents)
423 { 408 {
424 RegionInfo regionInfo = m_sceneManager.GetRegionInfo(presence.RegionHandle); 409 RegionInfo regionInfo = presence.Scene.RegionInfo;
425 410
426 if (presence.Firstname.ToLower().Contains(cmdparams[2].ToLower()) && 411 if (presence.Firstname.ToLower().Contains(cmdparams[2].ToLower()) &&
427 presence.Lastname.ToLower().Contains(cmdparams[3].ToLower())) 412 presence.Lastname.ToLower().Contains(cmdparams[3].ToLower()))
@@ -777,38 +762,6 @@ namespace OpenSim
777 } 762 }
778 763
779 /// <summary> 764 /// <summary>
780 /// Execute switch for some of the create commands
781 /// </summary>
782 /// <param name="args"></param>
783 private void HandleCreateUser(string module, string[] cmd)
784 {
785 if (ConfigurationSettings.Standalone)
786 {
787 CreateUser(cmd);
788 }
789 else
790 {
791 MainConsole.Instance.Output("Create user is not available in grid mode, use the user server.");
792 }
793 }
794
795 /// <summary>
796 /// Execute switch for some of the reset commands
797 /// </summary>
798 /// <param name="args"></param>
799 protected void HandleResetUserPassword(string module, string[] cmd)
800 {
801 if (ConfigurationSettings.Standalone)
802 {
803 ResetUserPassword(cmd);
804 }
805 else
806 {
807 MainConsole.Instance.Output("Reset user password is not available in grid mode, use the user-server.");
808 }
809 }
810
811 /// <summary>
812 /// Turn on some debugging values for OpenSim. 765 /// Turn on some debugging values for OpenSim.
813 /// </summary> 766 /// </summary>
814 /// <param name="args"></param> 767 /// <param name="args"></param>
@@ -908,7 +861,7 @@ namespace OpenSim
908 861
909 foreach (ScenePresence presence in agents) 862 foreach (ScenePresence presence in agents)
910 { 863 {
911 RegionInfo regionInfo = m_sceneManager.GetRegionInfo(presence.RegionHandle); 864 RegionInfo regionInfo = presence.Scene.RegionInfo;
912 string regionName; 865 string regionName;
913 866
914 if (regionInfo == null) 867 if (regionInfo == null)
@@ -1046,86 +999,6 @@ namespace OpenSim
1046 } 999 }
1047 1000
1048 /// <summary> 1001 /// <summary>
1049 /// Create a new user
1050 /// </summary>
1051 /// <param name="cmdparams">string array with parameters: firstname, lastname, password, locationX, locationY, email</param>
1052 protected void CreateUser(string[] cmdparams)
1053 {
1054 string firstName;
1055 string lastName;
1056 string password;
1057 string email;
1058 uint regX = 1000;
1059 uint regY = 1000;
1060
1061 IConfig standalone;
1062 if ((standalone = m_config.Source.Configs["StandAlone"]) != null)
1063 {
1064 regX = (uint)standalone.GetInt("default_location_x", (int)regX);
1065 regY = (uint)standalone.GetInt("default_location_y", (int)regY);
1066 }
1067
1068
1069 if (cmdparams.Length < 3)
1070 firstName = MainConsole.Instance.CmdPrompt("First name", "Default");
1071 else firstName = cmdparams[2];
1072
1073 if (cmdparams.Length < 4)
1074 lastName = MainConsole.Instance.CmdPrompt("Last name", "User");
1075 else lastName = cmdparams[3];
1076
1077 if (cmdparams.Length < 5)
1078 password = MainConsole.Instance.PasswdPrompt("Password");
1079 else password = cmdparams[4];
1080
1081 if (cmdparams.Length < 6)
1082 regX = Convert.ToUInt32(MainConsole.Instance.CmdPrompt("Start Region X", regX.ToString()));
1083 else regX = Convert.ToUInt32(cmdparams[5]);
1084
1085 if (cmdparams.Length < 7)
1086 regY = Convert.ToUInt32(MainConsole.Instance.CmdPrompt("Start Region Y", regY.ToString()));
1087 else regY = Convert.ToUInt32(cmdparams[6]);
1088
1089 if (cmdparams.Length < 8)
1090 email = MainConsole.Instance.CmdPrompt("Email", "");
1091 else email = cmdparams[7];
1092
1093 if (null == m_commsManager.UserProfileCacheService.GetUserDetails(firstName, lastName))
1094 {
1095 m_commsManager.UserAdminService.AddUser(firstName, lastName, password, email, regX, regY);
1096 }
1097 else
1098 {
1099 MainConsole.Instance.Output(string.Format("A user with the name {0} {1} already exists!", firstName, lastName));
1100 }
1101 }
1102
1103 /// <summary>
1104 /// Reset a user password.
1105 /// </summary>
1106 /// <param name="cmdparams"></param>
1107 private void ResetUserPassword(string[] cmdparams)
1108 {
1109 string firstName;
1110 string lastName;
1111 string newPassword;
1112
1113 if (cmdparams.Length < 4)
1114 firstName = MainConsole.Instance.CmdPrompt("First name");
1115 else firstName = cmdparams[3];
1116
1117 if (cmdparams.Length < 5)
1118 lastName = MainConsole.Instance.CmdPrompt("Last name");
1119 else lastName = cmdparams[4];
1120
1121 if (cmdparams.Length < 6)
1122 newPassword = MainConsole.Instance.PasswdPrompt("New password");
1123 else newPassword = cmdparams[5];
1124
1125 m_commsManager.UserAdminService.ResetUserPassword(firstName, lastName, newPassword);
1126 }
1127
1128 /// <summary>
1129 /// Use XML2 format to serialize data to a file 1002 /// Use XML2 format to serialize data to a file
1130 /// </summary> 1003 /// </summary>
1131 /// <param name="module"></param> 1004 /// <param name="module"></param>