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.cs144
1 files changed, 8 insertions, 136 deletions
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs
index eccd276..693aedc 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 {
@@ -348,26 +352,6 @@ namespace OpenSim
348 "kill uuid <UUID>", 352 "kill uuid <UUID>",
349 "Kill an object by UUID", KillUUID); 353 "Kill an object by UUID", KillUUID);
350 354
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
362 m_console.Commands.AddCommand("hypergrid", false, "link-mapping", "link-mapping [<x> <y>] <cr>",
363 "Set local coordinate to map HG regions to", RunCommand);
364 m_console.Commands.AddCommand("hypergrid", false, "link-region",
365 "link-region <Xloc> <Yloc> <HostName>:<HttpPort>[:<RemoteRegionName>] <cr>",
366 "Link a hypergrid region", RunCommand);
367 m_console.Commands.AddCommand("hypergrid", false, "unlink-region",
368 "unlink-region <local name> or <HostName>:<HttpPort> <cr>",
369 "Unlink a hypergrid region", RunCommand);
370
371 } 355 }
372 356
373 public override void ShutdownSpecific() 357 public override void ShutdownSpecific()
@@ -420,7 +404,7 @@ namespace OpenSim
420 404
421 foreach (ScenePresence presence in agents) 405 foreach (ScenePresence presence in agents)
422 { 406 {
423 RegionInfo regionInfo = m_sceneManager.GetRegionInfo(presence.RegionHandle); 407 RegionInfo regionInfo = presence.Scene.RegionInfo;
424 408
425 if (presence.Firstname.ToLower().Contains(cmdparams[2].ToLower()) && 409 if (presence.Firstname.ToLower().Contains(cmdparams[2].ToLower()) &&
426 presence.Lastname.ToLower().Contains(cmdparams[3].ToLower())) 410 presence.Lastname.ToLower().Contains(cmdparams[3].ToLower()))
@@ -777,38 +761,6 @@ namespace OpenSim
777 } 761 }
778 762
779 /// <summary> 763 /// <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. 764 /// Turn on some debugging values for OpenSim.
813 /// </summary> 765 /// </summary>
814 /// <param name="args"></param> 766 /// <param name="args"></param>
@@ -908,7 +860,7 @@ namespace OpenSim
908 860
909 foreach (ScenePresence presence in agents) 861 foreach (ScenePresence presence in agents)
910 { 862 {
911 RegionInfo regionInfo = m_sceneManager.GetRegionInfo(presence.RegionHandle); 863 RegionInfo regionInfo = presence.Scene.RegionInfo;
912 string regionName; 864 string regionName;
913 865
914 if (regionInfo == null) 866 if (regionInfo == null)
@@ -1047,86 +999,6 @@ namespace OpenSim
1047 } 999 }
1048 1000
1049 /// <summary> 1001 /// <summary>
1050 /// Create a new user
1051 /// </summary>
1052 /// <param name="cmdparams">string array with parameters: firstname, lastname, password, locationX, locationY, email</param>
1053 protected void CreateUser(string[] cmdparams)
1054 {
1055 string firstName;
1056 string lastName;
1057 string password;
1058 string email;
1059 uint regX = 1000;
1060 uint regY = 1000;
1061
1062 IConfig standalone;
1063 if ((standalone = m_config.Source.Configs["StandAlone"]) != null)
1064 {
1065 regX = (uint)standalone.GetInt("default_location_x", (int)regX);
1066 regY = (uint)standalone.GetInt("default_location_y", (int)regY);
1067 }
1068
1069
1070 if (cmdparams.Length < 3)
1071 firstName = MainConsole.Instance.CmdPrompt("First name", "Default");
1072 else firstName = cmdparams[2];
1073
1074 if (cmdparams.Length < 4)
1075 lastName = MainConsole.Instance.CmdPrompt("Last name", "User");
1076 else lastName = cmdparams[3];
1077
1078 if (cmdparams.Length < 5)
1079 password = MainConsole.Instance.PasswdPrompt("Password");
1080 else password = cmdparams[4];
1081
1082 if (cmdparams.Length < 6)
1083 regX = Convert.ToUInt32(MainConsole.Instance.CmdPrompt("Start Region X", regX.ToString()));
1084 else regX = Convert.ToUInt32(cmdparams[5]);
1085
1086 if (cmdparams.Length < 7)
1087 regY = Convert.ToUInt32(MainConsole.Instance.CmdPrompt("Start Region Y", regY.ToString()));
1088 else regY = Convert.ToUInt32(cmdparams[6]);
1089
1090 if (cmdparams.Length < 8)
1091 email = MainConsole.Instance.CmdPrompt("Email", "");
1092 else email = cmdparams[7];
1093
1094 if (null == m_commsManager.UserProfileCacheService.GetUserDetails(firstName, lastName))
1095 {
1096 m_commsManager.UserAdminService.AddUser(firstName, lastName, password, email, regX, regY);
1097 }
1098 else
1099 {
1100 MainConsole.Instance.Output(string.Format("A user with the name {0} {1} already exists!", firstName, lastName));
1101 }
1102 }
1103
1104 /// <summary>
1105 /// Reset a user password.
1106 /// </summary>
1107 /// <param name="cmdparams"></param>
1108 private void ResetUserPassword(string[] cmdparams)
1109 {
1110 string firstName;
1111 string lastName;
1112 string newPassword;
1113
1114 if (cmdparams.Length < 4)
1115 firstName = MainConsole.Instance.CmdPrompt("First name");
1116 else firstName = cmdparams[3];
1117
1118 if (cmdparams.Length < 5)
1119 lastName = MainConsole.Instance.CmdPrompt("Last name");
1120 else lastName = cmdparams[4];
1121
1122 if (cmdparams.Length < 6)
1123 newPassword = MainConsole.Instance.PasswdPrompt("New password");
1124 else newPassword = cmdparams[5];
1125
1126 m_commsManager.UserAdminService.ResetUserPassword(firstName, lastName, newPassword);
1127 }
1128
1129 /// <summary>
1130 /// Use XML2 format to serialize data to a file 1002 /// Use XML2 format to serialize data to a file
1131 /// </summary> 1003 /// </summary>
1132 /// <param name="module"></param> 1004 /// <param name="module"></param>