aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Application
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Application')
-rw-r--r--OpenSim/Region/Application/Application.cs1
-rw-r--r--OpenSim/Region/Application/ConfigurationLoader.cs14
-rw-r--r--OpenSim/Region/Application/HGCommands.cs60
-rwxr-xr-xOpenSim/Region/Application/OpenSim.cs150
-rw-r--r--OpenSim/Region/Application/OpenSimBase.cs43
5 files changed, 14 insertions, 254 deletions
diff --git a/OpenSim/Region/Application/Application.cs b/OpenSim/Region/Application/Application.cs
index 555baa4..7721cdf 100644
--- a/OpenSim/Region/Application/Application.cs
+++ b/OpenSim/Region/Application/Application.cs
@@ -129,7 +129,6 @@ namespace OpenSim
129 configSource.AddSwitch("Startup", "inifile"); 129 configSource.AddSwitch("Startup", "inifile");
130 configSource.AddSwitch("Startup", "inimaster"); 130 configSource.AddSwitch("Startup", "inimaster");
131 configSource.AddSwitch("Startup", "inidirectory"); 131 configSource.AddSwitch("Startup", "inidirectory");
132 configSource.AddSwitch("Startup", "gridmode");
133 configSource.AddSwitch("Startup", "physics"); 132 configSource.AddSwitch("Startup", "physics");
134 configSource.AddSwitch("Startup", "gui"); 133 configSource.AddSwitch("Startup", "gui");
135 configSource.AddSwitch("Startup", "console"); 134 configSource.AddSwitch("Startup", "console");
diff --git a/OpenSim/Region/Application/ConfigurationLoader.cs b/OpenSim/Region/Application/ConfigurationLoader.cs
index 21edcc5..655c5ca 100644
--- a/OpenSim/Region/Application/ConfigurationLoader.cs
+++ b/OpenSim/Region/Application/ConfigurationLoader.cs
@@ -304,7 +304,6 @@ namespace OpenSim
304 304
305 config.Set("region_info_source", "filesystem"); 305 config.Set("region_info_source", "filesystem");
306 306
307 config.Set("gridmode", false);
308 config.Set("physics", "OpenDynamicsEngine"); 307 config.Set("physics", "OpenDynamicsEngine");
309 config.Set("meshing", "Meshmerizer"); 308 config.Set("meshing", "Meshmerizer");
310 config.Set("physical_prim", true); 309 config.Set("physical_prim", true);
@@ -342,19 +341,7 @@ namespace OpenSim
342 if (null == config) 341 if (null == config)
343 config = defaultConfig.AddConfig("Network"); 342 config = defaultConfig.AddConfig("Network");
344 343
345 config.Set("default_location_x", 1000);
346 config.Set("default_location_y", 1000);
347 config.Set("http_listener_port", ConfigSettings.DefaultRegionHttpPort); 344 config.Set("http_listener_port", ConfigSettings.DefaultRegionHttpPort);
348 config.Set("remoting_listener_port", ConfigSettings.DefaultRegionRemotingPort);
349 config.Set("grid_server_url", "http://127.0.0.1:" + ConfigSettings.DefaultGridServerHttpPort.ToString());
350 config.Set("grid_send_key", "null");
351 config.Set("grid_recv_key", "null");
352 config.Set("user_server_url", "http://127.0.0.1:" + ConfigSettings.DefaultUserServerHttpPort.ToString());
353 config.Set("user_send_key", "null");
354 config.Set("user_recv_key", "null");
355 config.Set("asset_server_url", "http://127.0.0.1:" + ConfigSettings.DefaultAssetServerHttpPort.ToString());
356 config.Set("inventory_server_url", "http://127.0.0.1:" + ConfigSettings.DefaultInventoryServerHttpPort.ToString());
357 config.Set("secure_inventory_server", "true");
358 } 345 }
359 346
360 return defaultConfig; 347 return defaultConfig;
@@ -368,7 +355,6 @@ namespace OpenSim
368 IConfig startupConfig = m_config.Source.Configs["Startup"]; 355 IConfig startupConfig = m_config.Source.Configs["Startup"];
369 if (startupConfig != null) 356 if (startupConfig != null)
370 { 357 {
371 m_configSettings.Standalone = !startupConfig.GetBoolean("gridmode", false);
372 m_configSettings.PhysicsEngine = startupConfig.GetString("physics"); 358 m_configSettings.PhysicsEngine = startupConfig.GetString("physics");
373 m_configSettings.MeshEngineName = startupConfig.GetString("meshing"); 359 m_configSettings.MeshEngineName = startupConfig.GetString("meshing");
374 m_configSettings.PhysicalPrim = startupConfig.GetBoolean("physical_prim", true); 360 m_configSettings.PhysicalPrim = startupConfig.GetBoolean("physical_prim", true);
diff --git a/OpenSim/Region/Application/HGCommands.cs b/OpenSim/Region/Application/HGCommands.cs
deleted file mode 100644
index 7ae161d..0000000
--- a/OpenSim/Region/Application/HGCommands.cs
+++ /dev/null
@@ -1,60 +0,0 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
29using System.Collections.Generic;
30using System.Reflection;
31using System.Xml;
32using log4net;
33using Nini.Config;
34using OpenSim.Framework;
35using OpenSim.Framework.Communications;
36using OpenSim.Framework.Console;
37using OpenSim.Region.Framework;
38using OpenSim.Region.Framework.Scenes;
39using OpenSim.Region.Framework.Scenes.Hypergrid;
40
41namespace OpenSim
42{
43 public class HGCommands
44 {
45// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
46
47 public static Scene CreateScene(RegionInfo regionInfo, AgentCircuitManager circuitManager, CommunicationsManager m_commsManager,
48 StorageManager storageManager, ModuleLoader m_moduleLoader, ConfigSettings m_configSettings, OpenSimConfigSource m_config, string m_version)
49 {
50 HGSceneCommunicationService sceneGridService = new HGSceneCommunicationService(m_commsManager);
51
52 return
53 new HGScene(
54 regionInfo, circuitManager, m_commsManager, sceneGridService, storageManager,
55 m_moduleLoader, false, m_configSettings.PhysicalPrim,
56 m_configSettings.See_into_region_from_neighbor, m_config.Source, m_version);
57 }
58
59 }
60}
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs
index a86a831..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 {
@@ -190,6 +194,8 @@ namespace OpenSim
190 194
191 PrintFileToConsole("startuplogo.txt"); 195 PrintFileToConsole("startuplogo.txt");
192 196
197 m_log.InfoFormat("[NETWORK]: Using {0} as SYSTEMIP", Util.GetLocalHost().ToString());
198
193 // For now, start at the 'root' level by default 199 // For now, start at the 'root' level by default
194 if (m_sceneManager.Scenes.Count == 1) // If there is only one region, select it 200 if (m_sceneManager.Scenes.Count == 1) // If there is only one region, select it
195 ChangeSelectedRegion("region", 201 ChangeSelectedRegion("region",
@@ -348,26 +354,6 @@ namespace OpenSim
348 "kill uuid <UUID>", 354 "kill uuid <UUID>",
349 "Kill an object by UUID", KillUUID); 355 "Kill an object by UUID", KillUUID);
350 356
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 } 357 }
372 358
373 public override void ShutdownSpecific() 359 public override void ShutdownSpecific()
@@ -420,7 +406,7 @@ namespace OpenSim
420 406
421 foreach (ScenePresence presence in agents) 407 foreach (ScenePresence presence in agents)
422 { 408 {
423 RegionInfo regionInfo = m_sceneManager.GetRegionInfo(presence.RegionHandle); 409 RegionInfo regionInfo = presence.Scene.RegionInfo;
424 410
425 if (presence.Firstname.ToLower().Contains(cmdparams[2].ToLower()) && 411 if (presence.Firstname.ToLower().Contains(cmdparams[2].ToLower()) &&
426 presence.Lastname.ToLower().Contains(cmdparams[3].ToLower())) 412 presence.Lastname.ToLower().Contains(cmdparams[3].ToLower()))
@@ -433,7 +419,7 @@ namespace OpenSim
433 // kick client... 419 // kick client...
434 if (alert != null) 420 if (alert != null)
435 presence.ControllingClient.Kick(alert); 421 presence.ControllingClient.Kick(alert);
436 else 422 else
437 presence.ControllingClient.Kick("\nThe OpenSim manager kicked you out.\n"); 423 presence.ControllingClient.Kick("\nThe OpenSim manager kicked you out.\n");
438 424
439 // ...and close on our side 425 // ...and close on our side
@@ -640,7 +626,6 @@ namespace OpenSim
640 } 626 }
641 } 627 }
642 628
643
644 /// <summary> 629 /// <summary>
645 /// Load, Unload, and list Region modules in use 630 /// Load, Unload, and list Region modules in use
646 /// </summary> 631 /// </summary>
@@ -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)
@@ -972,7 +925,6 @@ namespace OpenSim
972 scene.RegionInfo.RegionLocX, 925 scene.RegionInfo.RegionLocX,
973 scene.RegionInfo.RegionLocY, 926 scene.RegionInfo.RegionLocY,
974 scene.RegionInfo.InternalEndPoint.Port)); 927 scene.RegionInfo.InternalEndPoint.Port));
975
976 }); 928 });
977 break; 929 break;
978 930
@@ -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>
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs
index cf2ab65..06ffa91 100644
--- a/OpenSim/Region/Application/OpenSimBase.cs
+++ b/OpenSim/Region/Application/OpenSimBase.cs
@@ -36,8 +36,7 @@ using Nini.Config;
36using OpenMetaverse; 36using OpenMetaverse;
37using OpenSim.Framework; 37using OpenSim.Framework;
38using OpenSim.Framework.Communications; 38using OpenSim.Framework.Communications;
39using OpenSim.Framework.Communications.Services; 39
40using OpenSim.Framework.Communications.Cache;
41using OpenSim.Framework.Console; 40using OpenSim.Framework.Console;
42using OpenSim.Framework.Servers; 41using OpenSim.Framework.Servers;
43using OpenSim.Framework.Servers.HttpServer; 42using 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
@@ -606,15 +574,10 @@ namespace OpenSim
606 protected override Scene CreateScene(RegionInfo regionInfo, StorageManager storageManager, 574 protected override Scene CreateScene(RegionInfo regionInfo, StorageManager storageManager,
607 AgentCircuitManager circuitManager) 575 AgentCircuitManager circuitManager)
608 { 576 {
609 bool hgrid = ConfigSource.Source.Configs["Startup"].GetBoolean("hypergrid", false); 577 SceneCommunicationService sceneGridService = new SceneCommunicationService();
610 if (hgrid)
611 return HGCommands.CreateScene(regionInfo, circuitManager, m_commsManager,
612 storageManager, m_moduleLoader, m_configSettings, m_config, m_version);
613
614 SceneCommunicationService sceneGridService = new SceneCommunicationService(m_commsManager);
615 578
616 return new Scene( 579 return new Scene(
617 regionInfo, circuitManager, m_commsManager, sceneGridService, 580 regionInfo, circuitManager, sceneGridService,
618 storageManager, m_moduleLoader, false, m_configSettings.PhysicalPrim, 581 storageManager, m_moduleLoader, false, m_configSettings.PhysicalPrim,
619 m_configSettings.See_into_region_from_neighbor, m_config.Source, m_version); 582 m_configSettings.See_into_region_from_neighbor, m_config.Source, m_version);
620 } 583 }