From 8e37e7eb07d55146f5c130dc3fd58c1b546e596b Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Mon, 2 Aug 2010 00:54:58 +0200 Subject: [PATCH 01/20] Remove the (wrong) implementation if llPointAt. It never worked on the LL grid and is officially deprecated. There is no way to rotate an avatar programmatically. --- .../ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 525f0f0ea2..ed63aeee02 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -3248,17 +3248,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llPointAt(LSL_Vector pos) { m_host.AddScriptLPS(1); - ScenePresence Owner = World.GetScenePresence(m_host.UUID); - LSL_Rotation rot = llEuler2Rot(pos); - Owner.PreviousRotation = Owner.Rotation; - Owner.Rotation = (new Quaternion((float)rot.x,(float)rot.y,(float)rot.z,(float)rot.s)); } public void llStopPointAt() { m_host.AddScriptLPS(1); - ScenePresence Owner = m_host.ParentGroup.Scene.GetScenePresence(m_host.OwnerID); - Owner.Rotation = Owner.PreviousRotation; } public void llTargetOmega(LSL_Vector axis, double spinrate, double gain) From f04d51378f864d2eb522678b3fb1e239f746bd35 Mon Sep 17 00:00:00 2001 From: Tom Date: Tue, 3 Aug 2010 11:06:41 -0700 Subject: [PATCH 02/20] Drop the RestClient timeout from 15 minutes to 30 seconds. This does not address the problem, but it will allow the regions to recover in the event that the remote server goes away. --- OpenSim/Framework/Communications/RestClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Framework/Communications/RestClient.cs b/OpenSim/Framework/Communications/RestClient.cs index 97b3b60cce..42c0b18a37 100644 --- a/OpenSim/Framework/Communications/RestClient.cs +++ b/OpenSim/Framework/Communications/RestClient.cs @@ -363,7 +363,7 @@ namespace OpenSim.Framework.Communications _request = (HttpWebRequest) WebRequest.Create(buildUri()); _request.KeepAlive = false; _request.ContentType = "application/xml"; - _request.Timeout = 900000; + _request.Timeout = 30000; _request.Method = RequestMethod; _asyncException = null; _request.ContentLength = src.Length; From 6e3c79f31e4a552ef81e73156d3f84cbcfbdb2cf Mon Sep 17 00:00:00 2001 From: Mike Rieker Date: Tue, 3 Aug 2010 20:09:00 +0000 Subject: [PATCH 03/20] don't mask current time reads (since we don't mask the corresponding subtract) if you mask the reads you have to mask the subtract as well. simplest is just don't mask any of it. --- OpenSim/Framework/Watchdog.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/OpenSim/Framework/Watchdog.cs b/OpenSim/Framework/Watchdog.cs index 5d46905a73..bc19dd1c28 100644 --- a/OpenSim/Framework/Watchdog.cs +++ b/OpenSim/Framework/Watchdog.cs @@ -51,7 +51,7 @@ namespace OpenSim.Framework public ThreadWatchdogInfo(Thread thread) { Thread = thread; - LastTick = Environment.TickCount & Int32.MaxValue; + LastTick = Environment.TickCount; } } @@ -143,7 +143,7 @@ namespace OpenSim.Framework try { if (m_threads.TryGetValue(threadID, out threadInfo)) - threadInfo.LastTick = Environment.TickCount & Int32.MaxValue; + threadInfo.LastTick = Environment.TickCount; else AddThread(new ThreadWatchdogInfo(Thread.CurrentThread)); } @@ -160,7 +160,7 @@ namespace OpenSim.Framework lock (m_threads) { - int now = Environment.TickCount & Int32.MaxValue; + int now = Environment.TickCount; foreach (ThreadWatchdogInfo threadInfo in m_threads.Values) { From 1d1da5069ca91282228f453476bee2444138b230 Mon Sep 17 00:00:00 2001 From: Tom Date: Tue, 3 Aug 2010 14:11:11 -0700 Subject: [PATCH 04/20] Catch a meshing exception caused by corrupt or missing sculpt maps, and mark the prim as "mesh failed" so it doesn't try meshing continuously --- OpenSim/Region/Physics/ChOdePlugin/ODEPrim.cs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/Physics/ChOdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/ChOdePlugin/ODEPrim.cs index 7e70db9870..60eda41016 100644 --- a/OpenSim/Region/Physics/ChOdePlugin/ODEPrim.cs +++ b/OpenSim/Region/Physics/ChOdePlugin/ODEPrim.cs @@ -131,6 +131,7 @@ namespace OpenSim.Region.Physics.OdePlugin //public GCHandle gc; private CollisionLocker ode; + private bool m_meshfailed = false; private bool m_taintforce = false; private bool m_taintaddangularforce = false; private Vector3 m_force; @@ -1882,12 +1883,20 @@ namespace OpenSim.Region.Physics.OdePlugin m_targetSpace = targetspace; - if (_mesh == null) + if (_mesh == null && m_meshfailed == false) { if (_parent_scene.needsMeshing(_pbs)) { // Don't need to re-enable body.. it's done in SetMesh - _mesh = _parent_scene.mesher.CreateMesh(m_primName, _pbs, _size, _parent_scene.meshSculptLOD, IsPhysical); + try + { + _mesh = _parent_scene.mesher.CreateMesh(m_primName, _pbs, _size, _parent_scene.meshSculptLOD, IsPhysical); + } + catch + { + //Don't continuously try to mesh prims when meshing has failed + m_meshfailed = true; + } // createmesh returns null when it's a shape that isn't a cube. // m_log.Debug(m_localID); } From ae99c1393d4555d4cd26249b149078e4cd3d439f Mon Sep 17 00:00:00 2001 From: Tom Date: Tue, 3 Aug 2010 15:31:04 -0700 Subject: [PATCH 05/20] Fix scripted sit offset in child prims --- .../Region/Framework/Scenes/ScenePresence.cs | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index efe3365b55..1fc4a81ad6 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -1935,8 +1935,14 @@ namespace OpenSim.Region.Framework.Scenes //Console.WriteLine("Scripted, unoccupied"); part.SetAvatarOnSitTarget(UUID); // set that Av will be on it offset = new Vector3(avSitOffSet.X, avSitOffSet.Y, avSitOffSet.Z); // change ofset to the scripted one - sitOrientation = avSitOrientation; // Change rotatione to the scripted one - OffsetRotation = avSitOrientation; + + Quaternion nrot = avSitOrientation; + if (!part.IsRoot) + { + nrot = nrot * part.RotationOffset; + } + sitOrientation = nrot; // Change rotatione to the scripted one + OffsetRotation = nrot; autopilot = false; // Jump direct to scripted llSitPos() } else @@ -2010,7 +2016,7 @@ namespace OpenSim.Region.Framework.Scenes // offsetr = (part.OffsetPosition * Quaternion.Inverse(part.ParentGroup.RootPart.RotationOffset)) + (offset * partIRot); // if (part.LinkNum < 2) 091216 All this was necessary because of the GetWorldRotation error. // { // Single, or Root prim of linkset, target is ClickOffset * RootRot - offsetr = offset * partIRot; + //offsetr = offset * partIRot; // // else // { // Child prim, offset is (ChildOffset * RootRot) + (ClickOffset * ChildRot) @@ -2029,7 +2035,7 @@ namespace OpenSim.Region.Framework.Scenes //Console.WriteLine("Camera Eye ={0}", cameraEyeOffset); //NOTE: SendSitResponse should be relative to the GROUP *NOT* THE PRIM if we're sitting on a child - ControllingClient.SendSitResponse(part.ParentGroup.UUID, offsetr + part.OffsetPosition, sitOrientation, autopilot, cameraAtOffset, cameraEyeOffset, forceMouselook); + ControllingClient.SendSitResponse(part.ParentGroup.UUID, ((offset * part.RotationOffset) + part.OffsetPosition), sitOrientation, autopilot, cameraAtOffset, cameraEyeOffset, forceMouselook); m_requestedSitTargetUUID = part.UUID; //KF: Correct autopilot target // This calls HandleAgentSit twice, once from here, and the client calls @@ -2343,6 +2349,10 @@ namespace OpenSim.Region.Framework.Scenes Quaternion sitTargetOrient = part.SitTargetOrientation; m_pos = new Vector3(sitTargetPos.X, sitTargetPos.Y, sitTargetPos.Z); m_pos += SIT_TARGET_ADJUSTMENT; + if (!part.IsRoot) + { + m_pos *= part.RotationOffset; + } m_bodyRot = sitTargetOrient; m_parentPosition = part.AbsolutePosition; part.IsOccupied = true; From e3cea888fba0afbb97e55b1a2aa8335f78a4ac26 Mon Sep 17 00:00:00 2001 From: Tom Date: Tue, 3 Aug 2010 16:07:18 -0700 Subject: [PATCH 06/20] Fix some more issues causing regions with corrupt sculpts to freeze. --- OpenSim/Region/Physics/ChOdePlugin/ODEPrim.cs | 27 ++++++++++++++----- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/OpenSim/Region/Physics/ChOdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/ChOdePlugin/ODEPrim.cs index 60eda41016..1604c4b9c3 100644 --- a/OpenSim/Region/Physics/ChOdePlugin/ODEPrim.cs +++ b/OpenSim/Region/Physics/ChOdePlugin/ODEPrim.cs @@ -2136,7 +2136,7 @@ Console.WriteLine(" JointCreateFixed"); // we don't need to do space calculation because the client sends a position update also. // Construction of new prim - if (_parent_scene.needsMeshing(_pbs)) + if (_parent_scene.needsMeshing(_pbs) && m_meshfailed == false) { float meshlod = _parent_scene.meshSculptLOD; @@ -2146,8 +2146,15 @@ Console.WriteLine(" JointCreateFixed"); IMesh mesh = null; - if (_parent_scene.needsMeshing(_pbs)) - mesh = _parent_scene.mesher.CreateMesh(oldname, _pbs, _size, meshlod, IsPhysical); + try + { + if (_parent_scene.needsMeshing(_pbs)) + mesh = _parent_scene.mesher.CreateMesh(oldname, _pbs, _size, meshlod, IsPhysical); + } + catch + { + m_meshfailed = true; + } //IMesh mesh = _parent_scene.mesher.CreateMesh(oldname, _pbs, _size, meshlod, IsPhysical); //Console.WriteLine("changesize 1"); @@ -2242,17 +2249,23 @@ Console.WriteLine(" JointCreateFixed"); if (_size.Z <= 0) _size.Z = 0.01f; // Construction of new prim - if (_parent_scene.needsMeshing(_pbs)) + if (_parent_scene.needsMeshing(_pbs) && m_meshfailed == false) { // Don't need to re-enable body.. it's done in SetMesh float meshlod = _parent_scene.meshSculptLOD; if (IsPhysical) meshlod = _parent_scene.MeshSculptphysicalLOD; - - IMesh mesh = _parent_scene.mesher.CreateMesh(oldname, _pbs, _size, meshlod, IsPhysical); + try + { + IMesh mesh = _parent_scene.mesher.CreateMesh(oldname, _pbs, _size, meshlod, IsPhysical); + CreateGeom(m_targetSpace, mesh); + } + catch + { + m_meshfailed = true; + } // createmesh returns null when it doesn't mesh. - CreateGeom(m_targetSpace, mesh); } else { From d9ae8370632810ae10bc1ca4e7a2c51431200d0d Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Wed, 4 Aug 2010 00:45:15 +0200 Subject: [PATCH 07/20] Allow specifying default region flags. Correct a typo. --- OpenSim/Services/GridService/GridService.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/OpenSim/Services/GridService/GridService.cs b/OpenSim/Services/GridService/GridService.cs index f49d86d50a..ebaed42dc5 100644 --- a/OpenSim/Services/GridService/GridService.cs +++ b/OpenSim/Services/GridService/GridService.cs @@ -124,7 +124,7 @@ namespace OpenSim.Services.GridService { // Regions reserved for the null key cannot be taken. if ((string)region.Data["PrincipalID"] == UUID.Zero.ToString()) - return "Region location us reserved"; + return "Region location is reserved"; // Treat it as an auth request // @@ -210,6 +210,7 @@ namespace OpenSim.Services.GridService { int newFlags = 0; string regionName = rdata.RegionName.Trim().Replace(' ', '_'); + newFlags = ParseFlags(newFlags, gridConfig.GetString("DefaultRegionFlags", String.Empty)); newFlags = ParseFlags(newFlags, gridConfig.GetString("Region_" + regionName, String.Empty)); newFlags = ParseFlags(newFlags, gridConfig.GetString("Region_" + rdata.RegionID.ToString(), String.Empty)); rdata.Data["flags"] = newFlags.ToString(); From 239478f3a9b0f651b451282cd204269545b025d9 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Tue, 3 Aug 2010 16:02:52 -0700 Subject: [PATCH 08/20] Bug fix (HG): mantis #4891. This doesn't actually fix the underlying bug, but it clears up the circular dependency issue between Gatekeeper and UserAgents that had made me resort to in-process remote calls, which, in turn, were hitting bugs down there somewhere in mono. NOTE: CONFIGURATION CHANGE IN ROBUST.HG.INI.EXAMPLE !!!###!!! --- .../HypergridService/GatekeeperService.cs | 87 ++++++++++--------- .../HypergridService/UserAgentService.cs | 16 ++-- bin/Robust.HG.ini.example | 1 + bin/config-include/StandaloneHypergrid.ini | 2 + 4 files changed, 58 insertions(+), 48 deletions(-) diff --git a/OpenSim/Services/HypergridService/GatekeeperService.cs b/OpenSim/Services/HypergridService/GatekeeperService.cs index c5cfe75fdf..3fc932758b 100644 --- a/OpenSim/Services/HypergridService/GatekeeperService.cs +++ b/OpenSim/Services/HypergridService/GatekeeperService.cs @@ -49,61 +49,64 @@ namespace OpenSim.Services.HypergridService LogManager.GetLogger( MethodBase.GetCurrentMethod().DeclaringType); - IGridService m_GridService; - IPresenceService m_PresenceService; - IUserAccountService m_UserAccountService; - IUserAgentService m_UserAgentService; - ISimulationService m_SimulationService; + private static bool m_Initialized = false; - string m_AuthDll; + private static IGridService m_GridService; + private static IPresenceService m_PresenceService; + private static IUserAccountService m_UserAccountService; + private static IUserAgentService m_UserAgentService; + private static ISimulationService m_SimulationService; - UUID m_ScopeID; - bool m_AllowTeleportsToAnyRegion; - string m_ExternalName; - GridRegion m_DefaultGatewayRegion; + private static UUID m_ScopeID; + private static bool m_AllowTeleportsToAnyRegion; + private static string m_ExternalName; + private static GridRegion m_DefaultGatewayRegion; public GatekeeperService(IConfigSource config, ISimulationService simService) { - IConfig serverConfig = config.Configs["GatekeeperService"]; - if (serverConfig == null) - throw new Exception(String.Format("No section GatekeeperService in config file")); + if (!m_Initialized) + { + m_Initialized = true; - string accountService = serverConfig.GetString("UserAccountService", String.Empty); - string homeUsersService = serverConfig.GetString("HomeUsersSecurityService", string.Empty); - string gridService = serverConfig.GetString("GridService", String.Empty); - string presenceService = serverConfig.GetString("PresenceService", String.Empty); - string simulationService = serverConfig.GetString("SimulationService", String.Empty); + IConfig serverConfig = config.Configs["GatekeeperService"]; + if (serverConfig == null) + throw new Exception(String.Format("No section GatekeeperService in config file")); - //m_AuthDll = serverConfig.GetString("AuthenticationService", String.Empty); + string accountService = serverConfig.GetString("UserAccountService", String.Empty); + string homeUsersService = serverConfig.GetString("HomeUsersSecurityService", string.Empty); + string gridService = serverConfig.GetString("GridService", String.Empty); + string presenceService = serverConfig.GetString("PresenceService", String.Empty); + string simulationService = serverConfig.GetString("SimulationService", String.Empty); - // These 3 are mandatory, the others aren't - if (gridService == string.Empty || presenceService == string.Empty || m_AuthDll == string.Empty) - throw new Exception("Incomplete specifications, Gatekeeper Service cannot function."); - - string scope = serverConfig.GetString("ScopeID", UUID.Zero.ToString()); - UUID.TryParse(scope, out m_ScopeID); - //m_WelcomeMessage = serverConfig.GetString("WelcomeMessage", "Welcome to OpenSim!"); - m_AllowTeleportsToAnyRegion = serverConfig.GetBoolean("AllowTeleportsToAnyRegion", true); - m_ExternalName = serverConfig.GetString("ExternalName", string.Empty); + // These 3 are mandatory, the others aren't + if (gridService == string.Empty || presenceService == string.Empty) + throw new Exception("Incomplete specifications, Gatekeeper Service cannot function."); + + string scope = serverConfig.GetString("ScopeID", UUID.Zero.ToString()); + UUID.TryParse(scope, out m_ScopeID); + //m_WelcomeMessage = serverConfig.GetString("WelcomeMessage", "Welcome to OpenSim!"); + m_AllowTeleportsToAnyRegion = serverConfig.GetBoolean("AllowTeleportsToAnyRegion", true); + m_ExternalName = serverConfig.GetString("ExternalName", string.Empty); - Object[] args = new Object[] { config }; - m_GridService = ServerUtils.LoadPlugin(gridService, args); - m_PresenceService = ServerUtils.LoadPlugin(presenceService, args); + Object[] args = new Object[] { config }; + m_GridService = ServerUtils.LoadPlugin(gridService, args); + m_PresenceService = ServerUtils.LoadPlugin(presenceService, args); - if (accountService != string.Empty) - m_UserAccountService = ServerUtils.LoadPlugin(accountService, args); - if (homeUsersService != string.Empty) - m_UserAgentService = ServerUtils.LoadPlugin(homeUsersService, args); + if (accountService != string.Empty) + m_UserAccountService = ServerUtils.LoadPlugin(accountService, args); + if (homeUsersService != string.Empty) + m_UserAgentService = ServerUtils.LoadPlugin(homeUsersService, args); - if (simService != null) - m_SimulationService = simService; - else if (simulationService != string.Empty) - m_SimulationService = ServerUtils.LoadPlugin(simulationService, args); + if (simService != null) + m_SimulationService = simService; + else if (simulationService != string.Empty) + m_SimulationService = ServerUtils.LoadPlugin(simulationService, args); - if (m_GridService == null || m_PresenceService == null || m_SimulationService == null) - throw new Exception("Unable to load a required plugin, Gatekeeper Service cannot function."); + if (m_GridService == null || m_PresenceService == null || m_SimulationService == null) + throw new Exception("Unable to load a required plugin, Gatekeeper Service cannot function."); - m_log.Debug("[GATEKEEPER SERVICE]: Starting..."); + m_log.Debug("[GATEKEEPER SERVICE]: Starting..."); + } } public GatekeeperService(IConfigSource config) diff --git a/OpenSim/Services/HypergridService/UserAgentService.cs b/OpenSim/Services/HypergridService/UserAgentService.cs index aec82e8868..4bee4b5ed5 100644 --- a/OpenSim/Services/HypergridService/UserAgentService.cs +++ b/OpenSim/Services/HypergridService/UserAgentService.cs @@ -61,7 +61,8 @@ namespace OpenSim.Services.HypergridService protected static IGridUserService m_GridUserService; protected static IGridService m_GridService; - protected static GatekeeperServiceConnector m_GatekeeperConnector; + //protected static GatekeeperServiceConnector m_GatekeeperConnector; + protected static IGatekeeperService m_GatekeeperService; protected static bool m_BypassClientVerification; @@ -69,6 +70,8 @@ namespace OpenSim.Services.HypergridService { if (!m_Initialized) { + m_Initialized = true; + m_log.DebugFormat("[HOME USERS SECURITY]: Starting..."); IConfig serverConfig = config.Configs["UserAgentService"]; @@ -77,18 +80,18 @@ namespace OpenSim.Services.HypergridService string gridService = serverConfig.GetString("GridService", String.Empty); string gridUserService = serverConfig.GetString("GridUserService", String.Empty); + string gatekeeperService = serverConfig.GetString("GatekeeperService", String.Empty); m_BypassClientVerification = serverConfig.GetBoolean("BypassClientVerification", false); - if (gridService == string.Empty || gridUserService == string.Empty) + if (gridService == string.Empty || gridUserService == string.Empty || gatekeeperService == string.Empty) throw new Exception(String.Format("Incomplete specifications, UserAgent Service cannot function.")); Object[] args = new Object[] { config }; m_GridService = ServerUtils.LoadPlugin(gridService, args); m_GridUserService = ServerUtils.LoadPlugin(gridUserService, args); - m_GatekeeperConnector = new GatekeeperServiceConnector(); - - m_Initialized = true; + //m_GatekeeperConnector = new GatekeeperServiceConnector(); + m_GatekeeperService = ServerUtils.LoadPlugin(gatekeeperService, args); } } @@ -135,7 +138,8 @@ namespace OpenSim.Services.HypergridService agentCircuit.ServiceSessionID = "http://" + region.ExternalHostName + ":" + region.HttpPort + ";" + UUID.Random(); TravelingAgentInfo old = UpdateTravelInfo(agentCircuit, region); - bool success = m_GatekeeperConnector.CreateAgent(region, agentCircuit, (uint)Constants.TeleportFlags.ViaLogin, out reason); + //bool success = m_GatekeeperConnector.CreateAgent(region, agentCircuit, (uint)Constants.TeleportFlags.ViaLogin, out reason); + bool success = m_GatekeeperService.LoginAgent(agentCircuit, finalDestination, out reason); if (!success) { diff --git a/bin/Robust.HG.ini.example b/bin/Robust.HG.ini.example index 0cf9ab1431..9269e39d89 100644 --- a/bin/Robust.HG.ini.example +++ b/bin/Robust.HG.ini.example @@ -207,6 +207,7 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003 ;; for the service GridUserService = "OpenSim.Services.UserAccountService.dll:GridUserService" GridService = "OpenSim.Services.GridService.dll:GridService" + GatekeeperService = "OpenSim.Services.HypergridService.dll:GatekeeperService" ;; The interface that local users get when they are in other grids. ;; This restricts the inventory operations while in other grids. diff --git a/bin/config-include/StandaloneHypergrid.ini b/bin/config-include/StandaloneHypergrid.ini index e87270d7e8..35e7da26ed 100644 --- a/bin/config-include/StandaloneHypergrid.ini +++ b/bin/config-include/StandaloneHypergrid.ini @@ -114,6 +114,8 @@ ;; for the service GridUserService = "OpenSim.Services.UserAccountService.dll:GridUserService" GridService = "OpenSim.Services.GridService.dll:GridService" + GatekeeperService = "OpenSim.Services.HypergridService.dll:GatekeeperService" + ;; The interface that local users get when they are in other grids ;; This greatly restricts the inventory operations while in other grids From 16bdb53683bf15a39f77603d558eda026fd4d21e Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Wed, 4 Aug 2010 00:45:15 +0200 Subject: [PATCH 09/20] Allow specifying default region flags. Correct a typo. --- OpenSim/Services/GridService/GridService.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/OpenSim/Services/GridService/GridService.cs b/OpenSim/Services/GridService/GridService.cs index f49d86d50a..ebaed42dc5 100644 --- a/OpenSim/Services/GridService/GridService.cs +++ b/OpenSim/Services/GridService/GridService.cs @@ -124,7 +124,7 @@ namespace OpenSim.Services.GridService { // Regions reserved for the null key cannot be taken. if ((string)region.Data["PrincipalID"] == UUID.Zero.ToString()) - return "Region location us reserved"; + return "Region location is reserved"; // Treat it as an auth request // @@ -210,6 +210,7 @@ namespace OpenSim.Services.GridService { int newFlags = 0; string regionName = rdata.RegionName.Trim().Replace(' ', '_'); + newFlags = ParseFlags(newFlags, gridConfig.GetString("DefaultRegionFlags", String.Empty)); newFlags = ParseFlags(newFlags, gridConfig.GetString("Region_" + regionName, String.Empty)); newFlags = ParseFlags(newFlags, gridConfig.GetString("Region_" + rdata.RegionID.ToString(), String.Empty)); rdata.Data["flags"] = newFlags.ToString(); From 9c7e35860e290e6bb77da7749d4d3b82a5c75418 Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 4 Aug 2010 01:00:06 +0100 Subject: [PATCH 10/20] re-Add the XML configuration loader dll. It's gone AWOL in a cleanup, but still needed for web-loading region configs and for loading legacy XML region files --- bin/OpenSim.Framework.Configuration.XML.dll | Bin 0 -> 5120 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100755 bin/OpenSim.Framework.Configuration.XML.dll diff --git a/bin/OpenSim.Framework.Configuration.XML.dll b/bin/OpenSim.Framework.Configuration.XML.dll new file mode 100755 index 0000000000000000000000000000000000000000..de0b87527cde5700c62ae33cb93a1ac6aab990cd GIT binary patch literal 5120 zcmeHLTWlOx8UD}gdTnpWG~T$eLoSTtG;FOhaw3Psr4+~ZI&teunq504qDscQV|&Q# zoXyN^V&_t&qKb+{rNRTKLWq|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)-<- Date: Wed, 4 Aug 2010 01:09:51 +0100 Subject: [PATCH 11/20] Revert "re-Add the XML configuration loader dll. It's gone AWOL in a cleanup, but" This reverts commit 9c7e35860e290e6bb77da7749d4d3b82a5c75418. --- bin/OpenSim.Framework.Configuration.XML.dll | Bin 5120 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100755 bin/OpenSim.Framework.Configuration.XML.dll diff --git a/bin/OpenSim.Framework.Configuration.XML.dll b/bin/OpenSim.Framework.Configuration.XML.dll deleted file mode 100755 index de0b87527cde5700c62ae33cb93a1ac6aab990cd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5120 zcmeHLTWlOx8UD}gdTnpWG~T$eLoSTtG;FOhaw3Psr4+~ZI&teunq504qDscQV|&Q# zoXyN^V&_t&qKb+{rNRTKLWq|lQG^f=NK{2gl_(NIwB;f2z(pz-1s;%)xb>~!`_GwO zuN`v{$^#Od&H2yy|MQ>kznuTfj5B@iMM@D-8vX8FqE|6;8&UM1lbcvJKk%AK-|Bp` z?^QANW?yN=i>z8GmqVv&m7O4vv9;)0VLhG}RdEsRQ2*A)gk=S^UW;g!CnH1^ zPQ>PRLA$Y8{IB>O7EwowQU&~}7T%8C)foI6+d#0UVnsZy%_6#Bhf!FDQ29232?uJT zx3m#>Z-=fgp~xwt3+RlMLvLv#M58UNn%;eAhXr}FjaYhmE*Y7d!JOmSx}6`B;kfTl zJ6=H5s4PR*wJW|)4I~}6L2dN)e&icT5ed*&!8gxsYw-Ij-EZV!Iy-Q{NZo+l^Z?Lz z4rb`%i50`RhV^s^Qj^GE_6A7WxW@ERKBo|*7NxLq6}l`ApKj_x3|*#L_hM6*?d%!c zMYk~myUWOC^01#ZqBb_dHjQiSP#!g(9cFdSNA2LZwf9OSEvubtmz|im%Pi>eGHdqS z07^RXy+=9!4E)SWltLo{ZGs(^+aW#F)Mocvv~>(RYMv+BdCW7$HMTPh7s+6UGQWg( zl*ywQv%eTPu~(NI7U&K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Tnx!CimEQ2L)dE5&L9bU?CZGAQw zEXgF?_0^(t*}WId9#cT|(BVMsh3P4JY+6?8zWeyUqpZGIkhBdbG8^Fw8IG8J7MZp@>Svw}LBaVK_4a?E$4sL3}c6QQgohhBjmXMH`R zPUAEcU~$W(`tml0}aXVI3|h-9!n=tJdISSaie7UfJchMdulk z_~9G%sRD)gN%Tj_!jmVU%eenOo(C21Hmy<>oJA9m_;?1{m``IK;pahn8T@0^zon7r5N4W$*b8Eq5Q?rorn!fVjM-tOa-CftGR+Jt=Q`6C&Wec6)3a|;InGF9SHmRJykMxoeiDZj0~F3 zCp?ejl}Hf1wX*jorMc4RXWug4?)&nO|EhzzAC%vZ_(mtXxe-l&bqsDHXT4MC3nTd3 zL%nTT!t)`}c`D+oY@P}@{UR!7mS(_Df==kay6C&T11_MVl6I!>6EAfe$|HJ)-<- Date: Wed, 4 Aug 2010 01:10:01 +0100 Subject: [PATCH 12/20] Revert "remove long unused OpenSim/Framework/Configuration/* projects" This reverts commit cdd3f17b2bee58def470635cfc06e26b0d0145b2. --- .../Configuration/HTTP/HTTPConfiguration.cs | 119 +++++++++++++++ .../HTTP/RemoteConfigSettings.cs | 63 ++++++++ .../Configuration/XML/XmlConfiguration.cs | 141 ++++++++++++++++++ prebuild.xml | 52 +++++++ 4 files changed, 375 insertions(+) create mode 100644 OpenSim/Framework/Configuration/HTTP/HTTPConfiguration.cs create mode 100644 OpenSim/Framework/Configuration/HTTP/RemoteConfigSettings.cs create mode 100644 OpenSim/Framework/Configuration/XML/XmlConfiguration.cs diff --git a/OpenSim/Framework/Configuration/HTTP/HTTPConfiguration.cs b/OpenSim/Framework/Configuration/HTTP/HTTPConfiguration.cs new file mode 100644 index 0000000000..3dce578193 --- /dev/null +++ b/OpenSim/Framework/Configuration/HTTP/HTTPConfiguration.cs @@ -0,0 +1,119 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System; +using System.IO; +using System.Net; +using System.Reflection; +using System.Text; +using log4net; +using OpenSim.Framework.Configuration.XML; + +namespace OpenSim.Framework.Configuration.HTTP +{ + public class HTTPConfiguration : IGenericConfig + { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + + private RemoteConfigSettings remoteConfigSettings; + + private XmlConfiguration xmlConfig; + + private string configFileName = String.Empty; + + public HTTPConfiguration() + { + remoteConfigSettings = new RemoteConfigSettings("remoteconfig.xml"); + xmlConfig = new XmlConfiguration(); + } + + public void SetFileName(string fileName) + { + configFileName = fileName; + } + + public void LoadData() + { + try + { + StringBuilder sb = new StringBuilder(); + + byte[] buf = new byte[8192]; + HttpWebRequest request = + (HttpWebRequest) WebRequest.Create(remoteConfigSettings.baseConfigURL + configFileName); + HttpWebResponse response = (HttpWebResponse) request.GetResponse(); + + Stream resStream = response.GetResponseStream(); + + string tempString = null; + int count = 0; + + do + { + count = resStream.Read(buf, 0, buf.Length); + if (count != 0) + { + tempString = Util.UTF8.GetString(buf, 0, count); + sb.Append(tempString); + } + } while (count > 0); + LoadDataFromString(sb.ToString()); + } + catch (WebException) + { + m_log.Warn("Unable to connect to remote configuration file (" + + remoteConfigSettings.baseConfigURL + configFileName + + "). Creating local file instead."); + xmlConfig.SetFileName(configFileName); + xmlConfig.LoadData(); + } + } + + public void LoadDataFromString(string data) + { + xmlConfig.LoadDataFromString(data); + } + + public string GetAttribute(string attributeName) + { + return xmlConfig.GetAttribute(attributeName); + } + + public bool SetAttribute(string attributeName, string attributeValue) + { + return true; + } + + public void Commit() + { + } + + public void Close() + { + } + } +} diff --git a/OpenSim/Framework/Configuration/HTTP/RemoteConfigSettings.cs b/OpenSim/Framework/Configuration/HTTP/RemoteConfigSettings.cs new file mode 100644 index 0000000000..10bc88aa6c --- /dev/null +++ b/OpenSim/Framework/Configuration/HTTP/RemoteConfigSettings.cs @@ -0,0 +1,63 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System; + +namespace OpenSim.Framework.Configuration.HTTP +{ + public class RemoteConfigSettings + { + private ConfigurationMember configMember; + + public string baseConfigURL = String.Empty; + + public RemoteConfigSettings(string filename) + { + configMember = + new ConfigurationMember(filename, "REMOTE CONFIG SETTINGS", loadConfigurationOptions, + handleIncomingConfiguration,true); + configMember.forceConfigurationPluginLibrary("OpenSim.Framework.Configuration.XML.dll"); + configMember.performConfigurationRetrieve(); + } + + public void loadConfigurationOptions() + { + configMember.addConfigurationOption("base_config_url", + ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, + "URL Containing Configuration Files", "http://localhost/", false); + } + + public bool handleIncomingConfiguration(string configuration_key, object configuration_result) + { + if (configuration_key == "base_config_url") + { + baseConfigURL = (string) configuration_result; + } + return true; + } + } +} diff --git a/OpenSim/Framework/Configuration/XML/XmlConfiguration.cs b/OpenSim/Framework/Configuration/XML/XmlConfiguration.cs new file mode 100644 index 0000000000..43162fc227 --- /dev/null +++ b/OpenSim/Framework/Configuration/XML/XmlConfiguration.cs @@ -0,0 +1,141 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System; +using System.IO; +using System.Xml; + +namespace OpenSim.Framework.Configuration.XML +{ + public class XmlConfiguration : IGenericConfig + { + private XmlDocument doc; + private XmlNode rootNode; + private XmlNode configNode; + private string fileName; + private bool createdFile = false; + + public void SetFileName(string file) + { + fileName = file; + } + + private void LoadDataToClass() + { + rootNode = doc.SelectSingleNode("Root"); + if (null == rootNode) + throw new Exception("Error: Invalid .xml File. Missing "); + + configNode = rootNode.SelectSingleNode("Config"); + if (null == configNode) + throw new Exception("Error: Invalid .xml File. should contain a "); + } + + public void LoadData() + { + lock (this) + { + doc = new XmlDocument(); + if (File.Exists(fileName)) + { + XmlTextReader reader = new XmlTextReader(fileName); + reader.WhitespaceHandling = WhitespaceHandling.None; + doc.Load(reader); + reader.Close(); + } + else + { + createdFile = true; + rootNode = doc.CreateNode(XmlNodeType.Element, "Root", String.Empty); + doc.AppendChild(rootNode); + configNode = doc.CreateNode(XmlNodeType.Element, "Config", String.Empty); + rootNode.AppendChild(configNode); + } + + LoadDataToClass(); + + if (createdFile) + { + Commit(); + } + } + } + + public void LoadDataFromString(string data) + { + doc = new XmlDocument(); + doc.LoadXml(data); + + LoadDataToClass(); + } + + public string GetAttribute(string attributeName) + { + string result = null; + if (configNode.Attributes[attributeName] != null) + { + result = ((XmlAttribute) configNode.Attributes.GetNamedItem(attributeName)).Value; + } + return result; + } + + public bool SetAttribute(string attributeName, string attributeValue) + { + if (configNode.Attributes[attributeName] != null) + { + ((XmlAttribute) configNode.Attributes.GetNamedItem(attributeName)).Value = attributeValue; + } + else + { + XmlAttribute attri; + attri = doc.CreateAttribute(attributeName); + attri.Value = attributeValue; + configNode.Attributes.Append(attri); + } + return true; + } + + public void Commit() + { + if (fileName == null || fileName == String.Empty) + return; + + if (!Directory.Exists(Util.configDir())) + { + Directory.CreateDirectory(Util.configDir()); + } + doc.Save(fileName); + } + + public void Close() + { + configNode = null; + rootNode = null; + doc = null; + } + } +} diff --git a/prebuild.xml b/prebuild.xml index 5f55461268..8a6d3a1e7a 100644 --- a/prebuild.xml +++ b/prebuild.xml @@ -255,6 +255,58 @@ + + + + ../../../../bin/ + + + + + ../../../../bin/ + + + + ../../../../bin/ + + + + + + + + + + + + + + + + ../../../../bin/ + + + + + ../../../../bin/ + + + + ../../../../bin/ + + + + + + + + + + + + + + From d57bfec702fd6eb067ab5d46cb791690ae81e10d Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Wed, 4 Aug 2010 02:16:46 +0200 Subject: [PATCH 13/20] A god is a god is a god is a god. Right? Right. You're a god from 200, let's show it! --- OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs index 50d2f9da82..06b1b00a22 100644 --- a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs @@ -218,7 +218,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat fromPos = avatar.AbsolutePosition; fromName = avatar.Name; fromID = c.Sender.AgentId; - if (avatar.GodLevel > 200) + if (avatar.GodLevel >= 200) { fromNamePrefix = m_adminPrefix; } From 5ff9db7388b5b05e49092d8ee59b3d1b5c963e78 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Wed, 4 Aug 2010 02:51:41 +0200 Subject: [PATCH 14/20] Clean up some messiness in IM sending. Having offline IM enabled now no longer suppresses "Inventory Saved" messages. --- .../Avatar/InstantMessage/InstantMessageModule.cs | 3 ++- .../Avatar/InstantMessage/MessageTransferModule.cs | 13 ++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs index ffdac58ac9..cbea54cc87 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs @@ -187,7 +187,8 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage delegate(bool success) { if (dialog == (uint)InstantMessageDialog.StartTyping || - dialog == (uint)InstantMessageDialog.StopTyping) + dialog == (uint)InstantMessageDialog.StopTyping || + dialog == (uint)InstantMessageDialog.MessageFromObject) { return; } diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs index 83209fc86f..d025f0c0e3 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs @@ -185,13 +185,16 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage { UndeliveredMessage handlerUndeliveredMessage = OnUndeliveredMessage; - // If this event has handlers, then the IM will be considered - // delivered. This will suppress the error message. + // If this event has handlers, then an IM from an agent will be + // considered delivered. This will suppress the error message. // if (handlerUndeliveredMessage != null) { handlerUndeliveredMessage(im); - result(true); + if (im.dialog == (byte)InstantMessageDialog.MessageFromAgent) + result(true); + else + result(false); return; } @@ -504,14 +507,14 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage // if (upd.RegionID == prevRegionID) { - m_log.Error("[GRID INSTANT MESSAGE]: Unable to deliver an instant message"); + // m_log.Error("[GRID INSTANT MESSAGE]: Unable to deliver an instant message"); HandleUndeliveredMessage(im, result); return; } } else { - m_log.Error("[GRID INSTANT MESSAGE]: Unable to deliver an instant message"); + // m_log.Error("[GRID INSTANT MESSAGE]: Unable to deliver an instant message"); HandleUndeliveredMessage(im, result); return; } From 0020dbee23bf0bab979225dbcdcc9cbcbe72f27b Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Wed, 4 Aug 2010 03:23:19 +0200 Subject: [PATCH 15/20] Remove StandAlone from default hardcoded config --- OpenSim/Region/Application/ConfigurationLoader.cs | 15 --------------- OpenSim/Tools/Configger/ConfigurationLoader.cs | 15 --------------- 2 files changed, 30 deletions(-) diff --git a/OpenSim/Region/Application/ConfigurationLoader.cs b/OpenSim/Region/Application/ConfigurationLoader.cs index cac5fa99c8..09f7bea14f 100644 --- a/OpenSim/Region/Application/ConfigurationLoader.cs +++ b/OpenSim/Region/Application/ConfigurationLoader.cs @@ -307,21 +307,6 @@ namespace OpenSim config.Set("EventQueue", true); } - { - IConfig config = defaultConfig.Configs["StandAlone"]; - - if (null == config) - config = defaultConfig.AddConfig("StandAlone"); - - config.Set("accounts_authenticate", true); - config.Set("welcome_message", "Welcome to OpenSimulator"); - config.Set("inventory_plugin", "OpenSim.Data.SQLite.dll"); - config.Set("inventory_source", ""); - config.Set("userDatabase_plugin", "OpenSim.Data.SQLite.dll"); - config.Set("user_source", ""); - config.Set("LibrariesXMLFile", string.Format(".{0}inventory{0}Libraries.xml", Path.DirectorySeparatorChar)); - } - { IConfig config = defaultConfig.Configs["Network"]; diff --git a/OpenSim/Tools/Configger/ConfigurationLoader.cs b/OpenSim/Tools/Configger/ConfigurationLoader.cs index 1619a22fe3..3d1b668934 100644 --- a/OpenSim/Tools/Configger/ConfigurationLoader.cs +++ b/OpenSim/Tools/Configger/ConfigurationLoader.cs @@ -241,21 +241,6 @@ namespace OpenSim.Tools.Configger config.Set("EventQueue", true); } - { - IConfig config = defaultConfig.Configs["StandAlone"]; - - if (null == config) - config = defaultConfig.AddConfig("StandAlone"); - - config.Set("accounts_authenticate", true); - config.Set("welcome_message", "Welcome to OpenSimulator"); - config.Set("inventory_plugin", "OpenSim.Data.SQLite.dll"); - config.Set("inventory_source", ""); - config.Set("userDatabase_plugin", "OpenSim.Data.SQLite.dll"); - config.Set("user_source", ""); - config.Set("LibrariesXMLFile", string.Format(".{0}inventory{0}Libraries.xml", Path.DirectorySeparatorChar)); - } - { IConfig config = defaultConfig.Configs["Network"]; From f1c51c8bb4c634cedf9eb57a1bb339d3e8052b10 Mon Sep 17 00:00:00 2001 From: Tom Date: Tue, 3 Aug 2010 19:51:32 -0700 Subject: [PATCH 16/20] Scripted sit target fixes --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 1fc4a81ad6..d857a1cc55 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -1939,7 +1939,7 @@ namespace OpenSim.Region.Framework.Scenes Quaternion nrot = avSitOrientation; if (!part.IsRoot) { - nrot = nrot * part.RotationOffset; + nrot = part.RotationOffset * avSitOrientation; } sitOrientation = nrot; // Change rotatione to the scripted one OffsetRotation = nrot; From cd9506e8428da7b984bdd833e6855534a90f3b5e Mon Sep 17 00:00:00 2001 From: Tom Date: Tue, 3 Aug 2010 22:41:02 -0700 Subject: [PATCH 17/20] Don't know HOW we missed this, llSetPos was broken in child prims (and in the llSetPrimitveParams family), it was using the global coordinate as a start location. This resolves mantis #204 --- .../Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 52d32851c9..0a1a10c189 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -2116,7 +2116,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } else { - LSL_Vector rel_vec = SetPosAdjust(currentPos, targetPos); + LSL_Vector rel_vec = SetPosAdjust(new LSL_Vector(part.OffsetPosition.X, part.OffsetPosition.Y, part.OffsetPosition.Z), targetPos); part.OffsetPosition = new Vector3((float)rel_vec.x, (float)rel_vec.y, (float)rel_vec.z); SceneObjectGroup parent = part.ParentGroup; parent.HasGroupChanged = true; From 463fbb4990226661238f1cc30587a5d1e270d44f Mon Sep 17 00:00:00 2001 From: Tom Date: Wed, 4 Aug 2010 00:17:02 -0700 Subject: [PATCH 18/20] If a user has no home position set, tell them so instead of leaving the request dangling --- .../EntityTransfer/EntityTransferModule.cs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 927eeab405..1d1a0a13e7 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs @@ -549,6 +549,12 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer if (uinfo != null) { + if (uinfo.HomeRegionID == UUID.Zero) + { + // can't find the Home region: Tell viewer and abort + client.SendTeleportFailed("You don't have a home position set."); + return; + } GridRegion regionInfo = m_aScene.GridService.GetRegionByUUID(UUID.Zero, uinfo.HomeRegionID); if (regionInfo == null) { @@ -556,7 +562,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer client.SendTeleportFailed("Your home region could not be found."); return; } - m_log.DebugFormat("[ENTITY TRANSFER MODULE]: User's home region is {0} {1} ({2}-{3})", + m_log.DebugFormat("[ENTITY TRANSFER MODULE]: User's home region is {0} {1} ({2}-{3})", regionInfo.RegionName, regionInfo.RegionID, regionInfo.RegionLocX / Constants.RegionSize, regionInfo.RegionLocY / Constants.RegionSize); // a little eekie that this goes back to Scene and with a forced cast, will fix that at some point... @@ -564,6 +570,12 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer client, regionInfo.RegionHandle, uinfo.HomePosition, uinfo.HomeLookAt, (uint)(Constants.TeleportFlags.SetLastToTarget | Constants.TeleportFlags.ViaHome)); } + else + { + // can't find the Home region: Tell viewer and abort + client.SendTeleportFailed("Your home region could not be found."); + return; + } } #endregion From a48c4932108c68156ee62e9e39da618e55d85902 Mon Sep 17 00:00:00 2001 From: sacha Date: Wed, 4 Aug 2010 08:16:55 +0000 Subject: [PATCH 19/20] Cost Reduction : Removing verbose message.... --- .../Avatar/Inventory/Transfer/InventoryTransferModule.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs index 0d04491a9f..98545f9c20 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs @@ -153,7 +153,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer private void OnInstantMessage(IClientAPI client, GridInstantMessage im) { - m_log.InfoFormat("[INVENTORY TRANSFER]: OnInstantMessage {0}", im.dialog); + //m_log.InfoFormat("[INVENTORY TRANSFER]: OnInstantMessage {0}", im.dialog); Scene scene = FindClientScene(client.AgentId); From 4a3321077163f4e93ac67609428c0e6fa4d31b9e Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Wed, 4 Aug 2010 18:12:31 +0200 Subject: [PATCH 20/20] Send attachment updates only to the owner if it's a HUD --- OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index a9f9d605a6..4ab719d728 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -3485,6 +3485,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP /// public void SendPrimUpdate(ISceneEntity entity, PrimUpdateFlags updateFlags) { + if (entity is SceneObjectPart) + { + SceneObjectPart e = (SceneObjectPart)entity; + SceneObjectGroup g = e.ParentGroup; + if (g.RootPart.Shape.State > 30) // HUD + if (g.OwnerID != AgentId) + return; // Don't send updates for other people's HUDs + } + double priority = m_prioritizer.GetUpdatePriority(this, entity); lock (m_entityUpdates.SyncRoot)