From 8b035dc3c7ec88ec2c715ebaad9c3de5a34078b5 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 24 Jan 2012 18:46:24 +0000 Subject: Restrict accessible of ODECharacter Shell and Body. Add method doc and some error log lines. --- OpenSim/Region/Physics/OdePlugin/ODECharacter.cs | 37 +++++++++++++++++------- OpenSim/Region/Physics/OdePlugin/OdeScene.cs | 2 +- 2 files changed, 27 insertions(+), 12 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs index 68999fc..c6e8286 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs @@ -134,9 +134,18 @@ namespace OpenSim.Region.Physics.OdePlugin | CollisionCategories.Body | CollisionCategories.Character | CollisionCategories.Land); - internal IntPtr Body = IntPtr.Zero; + /// + /// Body for dynamics simulation + /// + internal IntPtr Body { get; private set; } + private OdeScene _parent_scene; - internal IntPtr Shell = IntPtr.Zero; + + /// + /// Collision geometry + /// + internal IntPtr Shell { get; private set; } + private IntPtr Amotor = IntPtr.Zero; private d.Mass ShellMass; @@ -1018,6 +1027,13 @@ namespace OpenSim.Region.Physics.OdePlugin /// private void CreateOdeStructures(float npositionX, float npositionY, float npositionZ, float tensor) { + if (!(Shell == IntPtr.Zero && Body == IntPtr.Zero && Amotor == IntPtr.Zero)) + { + m_log.ErrorFormat( + "[ODE CHARACTER]: Creating ODE structures for {0} even though some already exist. Shell = {1}, Body = {2}, Amotor = {3}", + Name, Shell, Body, Amotor); + } + int dAMotorEuler = 1; // _parent_scene.waitForSpaceUnlock(_parent_scene.space); if (CAPSULE_LENGTH <= 0) @@ -1135,6 +1151,14 @@ namespace OpenSim.Region.Physics.OdePlugin /// internal void DestroyOdeStructures() { + // Create avatar capsule and related ODE data + if (Shell == IntPtr.Zero || Body == IntPtr.Zero || Amotor == IntPtr.Zero) + { + m_log.ErrorFormat( + "[ODE CHARACTER]: Destroying ODE structures for {0} even though some are already null. Shell = {1}, Body = {2}, Amotor = {3}", + Name, Shell, Body, Amotor); + } + // destroy avatar capsule and related ODE data if (Amotor != IntPtr.Zero) { @@ -1260,15 +1284,6 @@ namespace OpenSim.Region.Physics.OdePlugin { if (m_tainted_isPhysical) { - // Create avatar capsule and related ODE data - if (!(Shell == IntPtr.Zero && Body == IntPtr.Zero && Amotor == IntPtr.Zero)) - { - m_log.Warn("[ODE CHARACTER]: re-creating the following avatar ODE data for " + Name + ", even though it already exists - " - + (Shell!=IntPtr.Zero ? "Shell ":"") - + (Body!=IntPtr.Zero ? "Body ":"") - + (Amotor!=IntPtr.Zero ? "Amotor ":"")); - } - CreateOdeStructures(_position.X, _position.Y, _position.Z, m_tensor); _parent_scene.AddCharacter(this); } diff --git a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs index 228eca9..37daf46 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs @@ -1525,7 +1525,7 @@ namespace OpenSim.Region.Physics.OdePlugin chr.CollidingGround = false; chr.CollidingObj = false; - // test the avatar's geometry for collision with the space + // Test the avatar's geometry for collision with the space // This will return near and the space that they are the closest to // And we'll run this again against the avatar and the space segment // This will return with a bunch of possible objects in the space segment -- cgit v1.1 From 7e76397a264042e772855be5245b64b35336744a Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 24 Jan 2012 20:54:35 +0000 Subject: minor: correct text and usage for "image queues show" reigon console command. --- .../Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs b/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs index 95aa864..261029c 100644 --- a/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs +++ b/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs @@ -88,7 +88,7 @@ namespace OpenSim.Region.CoreModules.UDP.Linden (mod, cmd) => MainConsole.Instance.Output(HandleImageQueuesClear(cmd))); scene.AddCommand( - this, "show image queues", + this, "image queues show", "image queues show ", "Show the image queues (textures downloaded via UDP) for a particular client.", (mod, cmd) => MainConsole.Instance.Output(GetImageQueuesReport(cmd))); @@ -293,7 +293,7 @@ namespace OpenSim.Region.CoreModules.UDP.Linden private string GetImageQueuesReport(string[] showParams) { if (showParams.Length < 5 || showParams.Length > 6) - return "Usage: show image queues [full]"; + return "Usage: image queues show [full]"; string firstName = showParams[3]; string lastName = showParams[4]; -- cgit v1.1 From 488fe0ae9c8cadd1abe4a643f61a6a9c7e18e34d Mon Sep 17 00:00:00 2001 From: Dan Lake Date: Tue, 24 Jan 2012 13:41:26 -0800 Subject: Removed unused events in SceneGraph: OnObjectCreate, OnObjectRemove, OnObjectDuplicate --- OpenSim/Region/Framework/Scenes/SceneGraph.cs | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index 1e2901b..1af8346 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs @@ -60,10 +60,6 @@ namespace OpenSim.Region.Framework.Scenes protected internal event PhysicsCrash UnRecoverableError; private PhysicsCrash handlerPhysicsCrash = null; - public event ObjectDuplicateDelegate OnObjectDuplicate; - public event ObjectCreateDelegate OnObjectCreate; - public event ObjectDeleteDelegate OnObjectRemove; - #endregion #region Fields @@ -404,9 +400,6 @@ namespace OpenSim.Region.Framework.Scenes if (attachToBackup) sceneObject.AttachToBackup(); - if (OnObjectCreate != null) - OnObjectCreate(sceneObject); - lock (SceneObjectGroupsByFullID) SceneObjectGroupsByFullID[sceneObject.UUID] = sceneObject; @@ -455,9 +448,6 @@ namespace OpenSim.Region.Framework.Scenes if ((grp.RootPart.Flags & PrimFlags.Physics) == PrimFlags.Physics) RemovePhysicalPrim(grp.PrimCount); } - - if (OnObjectRemove != null) - OnObjectRemove(Entities[uuid]); lock (SceneObjectGroupsByFullID) SceneObjectGroupsByFullID.Remove(grp.UUID); @@ -1979,9 +1969,6 @@ namespace OpenSim.Region.Framework.Scenes // required for physics to update it's position copy.AbsolutePosition = copy.AbsolutePosition; - if (OnObjectDuplicate != null) - OnObjectDuplicate(original, copy); - return copy; } } -- cgit v1.1 From 5e445aaf7b134f51bfdb78a965e55395eca8bad9 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 24 Jan 2012 22:09:13 +0000 Subject: Fix "Abnormal client thread terminations" stat in period CONNECTION STATISTICS to count the number of times clients are disconnected due to ack timeouts. This has been broken for a long period and would only ever show 0. --- OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs index 5610c09..7b1aa2c 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs @@ -492,6 +492,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP if ((Environment.TickCount & Int32.MaxValue) - udpClient.TickLastPacketReceived > 1000 * 60) { m_log.Warn("[LLUDPSERVER]: Ack timeout, disconnecting " + udpClient.AgentID); + StatsManager.SimExtraStats.AddAbnormalClientThreadTermination(); RemoveClient(udpClient); return; -- cgit v1.1 From dc329202ef577d8c544eecd156ba496d7e680f0a Mon Sep 17 00:00:00 2001 From: BlueWall Date: Tue, 24 Jan 2012 17:11:35 -0500 Subject: Put Telehubs on the map --- .../CoreModules/World/WorldMap/WorldMapModule.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs index 9b0e2ff..2f723ef 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs @@ -1250,6 +1250,24 @@ namespace OpenSim.Region.CoreModules.World.WorldMap responsemap["7"] = responsearr; } + if (m_scene.RegionInfo.RegionSettings.TelehubObject != UUID.Zero) + { + SceneObjectPart sop = m_scene.GetSceneObjectPart(m_scene.RegionInfo.RegionSettings.TelehubObject); + + OSDArray responsearr = new OSDArray(); + OSDMap responsemapdata = new OSDMap(); + responsemapdata["X"] = OSD.FromInteger((int)(xstart + sop.AbsolutePosition.X)); + responsemapdata["Y"] = OSD.FromInteger((int)(ystart + sop.AbsolutePosition.Y)); + // responsemapdata["Z"] = OSD.FromInteger((int)m_scene.GetGroundHeight(x,y)); + responsemapdata["ID"] = OSD.FromUUID(sop.UUID); + responsemapdata["Name"] = OSD.FromString(sop.Name); + responsemapdata["Extra"] = OSD.FromInteger(0); // color (unused) + responsemapdata["Extra2"] = OSD.FromInteger(0); // 0 = telehub / 1 = infohub + responsearr.Add(responsemapdata); + + responsemap["1"] = responsearr; + } + return responsemap; } -- cgit v1.1 From 2d0412d366c1c243cc3abfe753f21d59b4c55473 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 24 Jan 2012 22:35:55 +0000 Subject: Make errors reported by OpenSim when it halts because it can't find certain config sections or files a bit more user friendly. --- OpenSim/Region/Application/ConfigurationLoader.cs | 19 ++++++------------- OpenSim/Region/Application/OpenSimBase.cs | 6 +++--- 2 files changed, 9 insertions(+), 16 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Application/ConfigurationLoader.cs b/OpenSim/Region/Application/ConfigurationLoader.cs index 4a7c8b0..8d95c41 100644 --- a/OpenSim/Region/Application/ConfigurationLoader.cs +++ b/OpenSim/Region/Application/ConfigurationLoader.cs @@ -107,15 +107,13 @@ namespace OpenSim } else { - m_log.ErrorFormat("Master ini file {0} not found", masterFilePath); + m_log.ErrorFormat("Master ini file {0} not found", Path.GetFullPath(masterFilePath)); Environment.Exit(1); } } } - - string iniFileName = - startupConfig.GetString("inifile", "OpenSim.ini"); + string iniFileName = startupConfig.GetString("inifile", "OpenSim.ini"); if (IsUri(iniFileName)) { @@ -131,8 +129,7 @@ namespace OpenSim if (!File.Exists(Application.iniFilePath)) { iniFileName = "OpenSim.xml"; - Application.iniFilePath = Path.GetFullPath( - Path.Combine(Util.configDir(), iniFileName)); + Application.iniFilePath = Path.GetFullPath(Path.Combine(Util.configDir(), iniFileName)); } if (File.Exists(Application.iniFilePath)) @@ -142,15 +139,12 @@ namespace OpenSim } } - string iniDirName = - startupConfig.GetString("inidirectory", "config"); - string iniDirPath = - Path.Combine(Util.configDir(), iniDirName); + string iniDirName = startupConfig.GetString("inidirectory", "config"); + string iniDirPath = Path.Combine(Util.configDir(), iniDirName); if (Directory.Exists(iniDirPath)) { - m_log.InfoFormat("Searching folder {0} for config ini files", - iniDirPath); + m_log.InfoFormat("Searching folder {0} for config ini files", iniDirPath); string[] fileEntries = Directory.GetFiles(iniDirName); foreach (string filePath in fileEntries) @@ -172,7 +166,6 @@ namespace OpenSim if (sources.Count == 0) { m_log.FatalFormat("[CONFIG]: Could not load any configuration"); - m_log.FatalFormat("[CONFIG]: Did you copy the OpenSimDefaults.ini.example file to OpenSimDefaults.ini?"); Environment.Exit(1); } diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index 9f9b4f0..a680a59 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs @@ -202,16 +202,16 @@ namespace OpenSim // Load the simulation data service IConfig simDataConfig = m_config.Source.Configs["SimulationDataStore"]; if (simDataConfig == null) - throw new Exception("Configuration file is missing the [SimulationDataStore] section"); + throw new Exception("Configuration file is missing the [SimulationDataStore] section. Have you copied OpenSim.ini.example to OpenSim.ini to reference config-include/ files?"); string module = simDataConfig.GetString("LocalServiceModule", String.Empty); if (String.IsNullOrEmpty(module)) - throw new Exception("Configuration file is missing the LocalServiceModule parameter in the [SimulationDataStore] section"); + throw new Exception("Configuration file is missing the LocalServiceModule parameter in the [SimulationDataStore] section."); m_simulationDataService = ServerUtils.LoadPlugin(module, new object[] { m_config.Source }); // Load the estate data service IConfig estateDataConfig = m_config.Source.Configs["EstateDataStore"]; if (estateDataConfig == null) - throw new Exception("Configuration file is missing the [EstateDataStore] section"); + throw new Exception("Configuration file is missing the [EstateDataStore] section. Have you copied OpenSim.ini.example to OpenSim.ini to reference config-include/ files?"); module = estateDataConfig.GetString("LocalServiceModule", String.Empty); if (String.IsNullOrEmpty(module)) throw new Exception("Configuration file is missing the LocalServiceModule parameter in the [EstateDataStore] section"); -- cgit v1.1