From 66a5b4d1205058cb66a7dc2d02f52a93175bcc57 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 21 Jul 2017 14:11:03 +0100 Subject: ubOde suport convex shapes on all normal prims and sculpts. Since code is experimental this is controled by options ConvexPrims and ConvexSculpts, on section Mesh, that can be set to false in case of problems --- .../PhysicsModules/ubOdeMeshing/Meshmerizer.cs | 133 ++++++++++++++++++--- bin/OpenSimDefaults.ini | 31 +++-- 2 files changed, 139 insertions(+), 25 deletions(-) diff --git a/OpenSim/Region/PhysicsModules/ubOdeMeshing/Meshmerizer.cs b/OpenSim/Region/PhysicsModules/ubOdeMeshing/Meshmerizer.cs index 0117800..c14abd0 100644 --- a/OpenSim/Region/PhysicsModules/ubOdeMeshing/Meshmerizer.cs +++ b/OpenSim/Region/PhysicsModules/ubOdeMeshing/Meshmerizer.cs @@ -43,8 +43,6 @@ using log4net; using Nini.Config; using System.Reflection; using System.IO; -using System.Runtime.Serialization; -using System.Runtime.Serialization.Formatters.Binary; using Mono.Addins; @@ -72,6 +70,8 @@ namespace OpenSim.Region.PhysicsModule.ubODEMeshing private const string baseDir = null; //"rawFiles"; private bool useMeshiesPhysicsMesh = false; + private bool doConvexPrims = true; + private bool doConvexSculpts = true; private float minSizeForComplexMesh = 0.2f; // prims with all dimensions smaller than this will have a bounding box mesh @@ -103,18 +103,14 @@ namespace OpenSim.Region.PhysicsModule.ubODEMeshing if (mesh_config != null) { useMeshiesPhysicsMesh = mesh_config.GetBoolean("UseMeshiesPhysicsMesh", useMeshiesPhysicsMesh); - if (useMeshiesPhysicsMesh) - { - doMeshFileCache = mesh_config.GetBoolean("MeshFileCache", doMeshFileCache); - cachePath = mesh_config.GetString("MeshFileCachePath", cachePath); - fcache = mesh_config.GetFloat("MeshFileCacheExpireHours", fcache); - doCacheExpire = mesh_config.GetBoolean("MeshFileCacheDoExpire", doCacheExpire); - } - else - { - doMeshFileCache = false; - doCacheExpire = false; - } + + doConvexPrims = mesh_config.GetBoolean("ConvexPrims",doConvexPrims); + doConvexSculpts = mesh_config.GetBoolean("ConvexSculpts",doConvexPrims); + + doMeshFileCache = mesh_config.GetBoolean("MeshFileCache", doMeshFileCache); + cachePath = mesh_config.GetString("MeshFileCachePath", cachePath); + fcache = mesh_config.GetFloat("MeshFileCacheExpireHours", fcache); + doCacheExpire = mesh_config.GetBoolean("MeshFileCacheDoExpire", doCacheExpire); m_Enabled = true; } @@ -330,6 +326,7 @@ namespace OpenSim.Region.PhysicsModule.ubODEMeshing List coords; List faces; + bool needsConvexProcessing = convex; if (primShape.SculptEntry) { @@ -340,23 +337,49 @@ namespace OpenSim.Region.PhysicsModule.ubODEMeshing if (!GenerateCoordsAndFacesFromPrimMeshData(primName, primShape, out coords, out faces, convex)) return null; + needsConvexProcessing = false; } else { if (!GenerateCoordsAndFacesFromPrimSculptData(primName, primShape, lod, out coords, out faces)) return null; + needsConvexProcessing &= doConvexSculpts; } } else { if (!GenerateCoordsAndFacesFromPrimShapeData(primName, primShape, lod, convex, out coords, out faces)) return null; + needsConvexProcessing &= doConvexPrims; } - int numCoords = coords.Count; int numFaces = faces.Count; + if(numCoords < 3 || (!needsConvexProcessing && numFaces < 1)) + { + m_log.ErrorFormat("[MESH]: invalid degenerated mesh for prim {0} ignored", primName); + return null; + } + + if(needsConvexProcessing) + { + List convexcoords; + List convexfaces; + if(CreateHull(coords, out convexcoords, out convexfaces) && convexcoords != null && convexfaces != null) + { + coords.Clear(); + coords = convexcoords; + numCoords = coords.Count; + + faces.Clear(); + faces = convexfaces; + numFaces = faces.Count; + } + else + m_log.ErrorFormat("[ubMESH]: failed to create convex for {0} using normal mesh", primName); + } + Mesh mesh = new Mesh(true); // Add the corresponding triangles to the mesh for (int i = 0; i < numFaces; i++) @@ -371,10 +394,10 @@ namespace OpenSim.Region.PhysicsModule.ubODEMeshing faces.Clear(); if(mesh.numberVertices() < 3 || mesh.numberTriangles() < 1) - { - m_log.ErrorFormat("[MESH]: invalid degenerated mesh for prim " + primName + " ignored"); + { + m_log.ErrorFormat("[MESH]: invalid degenerated mesh for prim {0} ignored", primName); return null; - } + } primShape.SculptData = Utils.EmptyBytes; @@ -1583,5 +1606,79 @@ namespace OpenSim.Region.PhysicsModule.ubODEMeshing catch { } } } + + public bool CreateHull(List inputVertices, out List convexcoords, out List newfaces) + { + convexcoords = null; + newfaces = null; + HullDesc desc = new HullDesc(); + HullResult result = new HullResult(); + + int nInputVerts = inputVertices.Count; + int i; + + List vs = new List(nInputVerts); + float3 f3; + + //useless copy + for(i = 0 ; i < nInputVerts; i++) + { + f3 = new float3(inputVertices[i].X, inputVertices[i].Y, inputVertices[i].Z); + vs.Add(f3); + } + + desc.Vertices = vs; + desc.Flags = HullFlag.QF_TRIANGLES; + desc.MaxVertices = 256; + + try + { + HullError ret = HullUtils.CreateConvexHull(desc, ref result); + if (ret != HullError.QE_OK) + return false; + int nverts = result.OutputVertices.Count; + int nindx = result.Indices.Count; + if(nverts < 3 || nindx< 3) + return false; + if(nindx % 3 != 0) + return false; + + convexcoords = new List(nverts); + Coord c; + vs = result.OutputVertices; + + for(i = 0 ; i < nverts; i++) + { + c = new Coord(vs[i].x, vs[i].y, vs[i].z); + convexcoords.Add(c); + } + + newfaces = new List(nindx / 3); + List indxs = result.Indices; + int k, l, m; + Face f; + for(i = 0 ; i < nindx;) + { + k = indxs[i++]; + l = indxs[i++]; + m = indxs[i++]; + if(k > nInputVerts) + continue; + if(l > nInputVerts) + continue; + if(m > nInputVerts) + continue; + f = new Face(k,l,m); + newfaces.Add(f); + } + return true; + } + catch + { + + return false; + } + return false; + } } } diff --git a/bin/OpenSimDefaults.ini b/bin/OpenSimDefaults.ini index a7b9213..a94311a 100644 --- a/bin/OpenSimDefaults.ini +++ b/bin/OpenSimDefaults.ini @@ -935,18 +935,35 @@ [Mesh] - ; enable / disable Collada mesh support + ; enable / disable mesh asset uploads + ; mesh asset must conform to standard mesh format, with OpenSim extensions ; default is true AllowMeshUpload = true - ; if you use Meshmerizer and want collisions for meshies, setting this to true - ; will cause OpenSim to attempt to decode meshies assets, extract the physics - ; mesh, and use it for collisions. - UseMeshiesPhysicsMesh = true - ; Minimum user level required to upload meshes ;LevelUpload = 0 + ; suport meshs on physics + ;UseMeshiesPhysicsMesh = true + + ;suport convex shape type on normal prims + ; (ubOde only) + ;ConvexPrims = true + + ;suport convex shape type on sculpts + ; (ubOde only) + ;ConvexSculpts = true + + ; mesh cache settings: + ; (ubOde only) + ; do cache (keep true) + ;MeshFileCache = true + ; cache folder name relative to bin/ or absolute path + ;MeshFileCachePath = MeshCache + ;MeshFileCacheDoExpire = true; + ;MeshFileCacheExpireHours = 48 + + [Textures] ; If true, textures generated dynamically (i.e. through osSetDynamicTextureData() and similar OSSL functions) are reused where possible @@ -968,7 +985,7 @@ [ODEPhysicsSettings] ; ## - ; ## Physics stats settings + ; ## Physics stats settings ( most ignored by ubOde ) ; ; If collect_stats is enabled, then extra stat information is collected which is accessible via the MonitorModule -- cgit v1.1 From f6f0b1c51387acc89b0cd3d854cc65f94afa3897 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 21 Jul 2017 14:41:13 +0100 Subject: fix a few EN typos --- bin/OpenSimDefaults.ini | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bin/OpenSimDefaults.ini b/bin/OpenSimDefaults.ini index a94311a..9fb74dc 100644 --- a/bin/OpenSimDefaults.ini +++ b/bin/OpenSimDefaults.ini @@ -943,14 +943,14 @@ ; Minimum user level required to upload meshes ;LevelUpload = 0 - ; suport meshs on physics + ; support meshs on physics ;UseMeshiesPhysicsMesh = true - ;suport convex shape type on normal prims + ;support convex shape type on normal prims ; (ubOde only) ;ConvexPrims = true - ;suport convex shape type on sculpts + ;support convex shape type on sculpts ; (ubOde only) ;ConvexSculpts = true @@ -1472,7 +1472,7 @@ ; active_trees allows module to change its trees in time. ; some will be deleted, others created and rest may grow - ; default is false. You can change it with console comand tree active true | false later + ; default is false. You can change it with console command tree active true | false later active_trees = false ; the trees change execution time rate (in ms) update_rate = 1000 @@ -2064,7 +2064,7 @@ ;XmlRpcServiceWriteKey = 1234 ; Disables HTTP Keep-Alive for XmlRpcGroupsServicesConnector HTTP Requests, - ; only set to false it if you absolute sure regions and groups server suport it. + ; only set to false it if you absolute sure regions and groups server support it. ; XmlRpcDisableKeepAlive = true ; Minimum user level required to create groups -- cgit v1.1 From c1ab1289ab03278acf64743a78e7011c2e146da3 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 21 Jul 2017 16:07:04 +0100 Subject: shape convex should not trigger complex cost (LI) alone --- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index f0a3fab..0bf3c1d 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -1675,7 +1675,7 @@ namespace OpenSim.Region.Framework.Scenes get { byte pst = PhysicsShapeType; - if(pst == (byte) PhysShapeType.none || pst == (byte) PhysShapeType.convex || HasMesh()) + if(pst == (byte) PhysShapeType.none || HasMesh()) return true; return false; } -- cgit v1.1 From 98c64f1aa9b8d824b9cf5921632ef784a3c5be1f Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 22 Jul 2017 00:00:46 +0100 Subject: ubOde remove ols pseudo convex for sculpts --- OpenSim/Region/PhysicsModules/ubOde/ODEMeshWorker.cs | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODEMeshWorker.cs b/OpenSim/Region/PhysicsModules/ubOde/ODEMeshWorker.cs index dc87a78..3f40170 100644 --- a/OpenSim/Region/PhysicsModules/ubOde/ODEMeshWorker.cs +++ b/OpenSim/Region/PhysicsModules/ubOde/ODEMeshWorker.cs @@ -425,17 +425,8 @@ namespace OpenSim.Region.PhysicsModule.ubOde Vector3 size = repData.size; int clod = (int)LevelOfDetail.High; - bool convex; byte shapetype = repData.shapetype; - if (shapetype == 0) - convex = false; - else - { - convex = true; - // sculpts pseudo convex - if (pbs.SculptEntry && pbs.SculptType != (byte)SculptType.Mesh) - clod = (int)LevelOfDetail.Low; - } + bool convex = shapetype == 2; mesh = m_mesher.GetMesh(actor.Name, pbs, size, clod, true, convex); -- cgit v1.1 From d71d13f72be9a342869406aae4139f38e01ef05f Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 22 Jul 2017 01:31:39 +0100 Subject: ubOde: represent small objects as a box. A object is small is all scale dimensions are less or equal to option MinSizeToMeshmerize (in ODEPhysicsSettings) with default of 0.1. This is needed because this objects hit narrow phase with high overlaps alot more, and so have high cpu cost. --- .../Region/PhysicsModules/ubOde/ODEMeshWorker.cs | 28 +++++++++++++++------- OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs | 10 ++++---- 2 files changed, 25 insertions(+), 13 deletions(-) diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODEMeshWorker.cs b/OpenSim/Region/PhysicsModules/ubOde/ODEMeshWorker.cs index 3f40170..5465035 100644 --- a/OpenSim/Region/PhysicsModules/ubOde/ODEMeshWorker.cs +++ b/OpenSim/Region/PhysicsModules/ubOde/ODEMeshWorker.cs @@ -62,6 +62,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde public byte shapetype; public bool hasOBB; public bool hasMeshVolume; + public bool isTooSmall; public MeshState meshState; public UUID? assetID; public meshWorkerCmnds comand; @@ -69,16 +70,14 @@ namespace OpenSim.Region.PhysicsModule.ubOde public class ODEMeshWorker { - private ILog m_log; private ODEScene m_scene; private IMesher m_mesher; public bool meshSculptedPrim = true; - public bool forceSimplePrimMeshing = false; public float meshSculptLOD = 32; public float MeshSculptphysicalLOD = 32; - + public float MinSizeToMeshmerize = 0.1f; private OpenSim.Framework.BlockingQueue workQueue = new OpenSim.Framework.BlockingQueue(); private bool m_running; @@ -93,9 +92,9 @@ namespace OpenSim.Region.PhysicsModule.ubOde if (pConfig != null) { - forceSimplePrimMeshing = pConfig.GetBoolean("force_simple_prim_meshing", forceSimplePrimMeshing); meshSculptedPrim = pConfig.GetBoolean("mesh_sculpted_prim", meshSculptedPrim); meshSculptLOD = pConfig.GetFloat("mesh_lod", meshSculptLOD); + MinSizeToMeshmerize = pConfig.GetFloat("mesh_min_size", MinSizeToMeshmerize); MeshSculptphysicalLOD = pConfig.GetFloat("mesh_physical_lod", MeshSculptphysicalLOD); } m_running = true; @@ -288,6 +287,16 @@ namespace OpenSim.Region.PhysicsModule.ubOde { PrimitiveBaseShape pbs = repData.pbs; // check sculpts or meshs + + Vector3 scale = pbs.Scale; + if(scale.X <= MinSizeToMeshmerize && + scale.Y <= MinSizeToMeshmerize && + scale.Z <= MinSizeToMeshmerize) + { + repData.isTooSmall = true; + return false; + } + if (pbs.SculptEntry) { if (meshSculptedPrim) @@ -299,9 +308,6 @@ namespace OpenSim.Region.PhysicsModule.ubOde return false; } - if (forceSimplePrimMeshing) - return true; - // convex shapes have no holes ushort profilehollow = pbs.ProfileHollow; if(repData.shapetype == 2) @@ -554,10 +560,16 @@ namespace OpenSim.Region.PhysicsModule.ubOde private void CalculateBasicPrimVolume(ODEPhysRepData repData) { - PrimitiveBaseShape _pbs = repData.pbs; Vector3 _size = repData.size; float volume = _size.X * _size.Y * _size.Z; // default + if(repData.isTooSmall) + { + repData.volume = volume; + return; + } + + PrimitiveBaseShape _pbs = repData.pbs; float tmp; float hollowAmount = (float)_pbs.ProfileHollow * 2.0e-5f; diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs b/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs index 76ef88b..b191dbc 100644 --- a/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs +++ b/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs @@ -1733,7 +1733,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde return true; } - private void CreateGeom() + private void CreateGeom(bool OverrideToBox) { bool hasMesh = false; @@ -1742,7 +1742,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde if ((m_meshState & MeshState.MeshNoColide) != 0) m_NoColide = true; - else if(m_mesh != null) + else if(!OverrideToBox && m_mesh != null) { if (GetMeshGeom()) hasMesh = true; @@ -1755,7 +1755,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde { IntPtr geo = IntPtr.Zero; - if (_pbs.ProfileShape == ProfileShape.HalfCircle && _pbs.PathCurve == (byte)Extrusion.Curve1 + if (!OverrideToBox && _pbs.ProfileShape == ProfileShape.HalfCircle && _pbs.PathCurve == (byte)Extrusion.Curve1 && _size.X == _size.Y && _size.Y == _size.Z) { // it's a sphere try @@ -3180,7 +3180,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde primVolume = repData.volume; - CreateGeom(); + CreateGeom(repData.isTooSmall); if (prim_geom != IntPtr.Zero) { @@ -3256,7 +3256,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde primVolume = repData.volume; - CreateGeom(); + CreateGeom(repData.isTooSmall); if (prim_geom != IntPtr.Zero) { -- cgit v1.1 From 93582523a739262ae3e7b459703db90b0a4214e4 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 22 Jul 2017 01:44:29 +0100 Subject: ubOde: make option MinSizeToMeshmerize visible in OpenSimDefaults.ini --- bin/OpenSimDefaults.ini | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/bin/OpenSimDefaults.ini b/bin/OpenSimDefaults.ini index 9fb74dc..164eae6 100644 --- a/bin/OpenSimDefaults.ini +++ b/bin/OpenSimDefaults.ini @@ -1158,12 +1158,14 @@ ; ## additional meshing options ; ## - ; Physical collision mesh proxies are normally created for complex prim shapes, - ; and collisions for simple boxes and spheres are computed algorithmically. - ; If you would rather have mesh proxies for simple prims, you can set this to - ; true. Note that this will increase memory usage and region startup time. - ; Default is false. - ;force_simple_prim_meshing = false + ; Physics needs to create internal meshs (or convert the object meshs or scultps) + ; for all prims except simple boxes and spheres. + + ; collisions of small objects againts larger ones can have a increased CPU load cost + ; so this are represented by a simple BOX + ; if all their scale dimensions are lower or equal to this option. Default is 0.1m + ; (ubOde only) + ; MinSizeToMeshmerize = 0.1 [BulletSim] -- cgit v1.1 From 618e142cf89f1195fbabd27d5c2cadb649e1d0a5 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 22 Jul 2017 01:45:42 +0100 Subject: ubOde: remove some dead code --- .../PhysicsModules/ubOdeMeshing/Meshmerizer.cs | 85 +--------------------- 1 file changed, 1 insertion(+), 84 deletions(-) diff --git a/OpenSim/Region/PhysicsModules/ubOdeMeshing/Meshmerizer.cs b/OpenSim/Region/PhysicsModules/ubOdeMeshing/Meshmerizer.cs index c14abd0..010262f 100644 --- a/OpenSim/Region/PhysicsModules/ubOdeMeshing/Meshmerizer.cs +++ b/OpenSim/Region/PhysicsModules/ubOdeMeshing/Meshmerizer.cs @@ -73,8 +73,6 @@ namespace OpenSim.Region.PhysicsModule.ubODEMeshing private bool doConvexPrims = true; private bool doConvexSculpts = true; - private float minSizeForComplexMesh = 0.2f; // prims with all dimensions smaller than this will have a bounding box mesh - private Dictionary m_uniqueMeshes = new Dictionary(); private Dictionary m_uniqueReleasedMeshes = new Dictionary(); @@ -164,87 +162,6 @@ namespace OpenSim.Region.PhysicsModule.ubODEMeshing #endregion - /// - /// creates a simple box mesh of the specified size. This mesh is of very low vertex count and may - /// be useful as a backup proxy when level of detail is not needed or when more complex meshes fail - /// for some reason - /// - /// - /// - /// - /// - /// - /// - /// - private static Mesh CreateSimpleBoxMesh(float minX, float maxX, float minY, float maxY, float minZ, float maxZ) - { - Mesh box = new Mesh(true); - List vertices = new List(); - // bottom - - vertices.Add(new Vertex(minX, maxY, minZ)); - vertices.Add(new Vertex(maxX, maxY, minZ)); - vertices.Add(new Vertex(maxX, minY, minZ)); - vertices.Add(new Vertex(minX, minY, minZ)); - - box.Add(new Triangle(vertices[0], vertices[1], vertices[2])); - box.Add(new Triangle(vertices[0], vertices[2], vertices[3])); - - // top - - vertices.Add(new Vertex(maxX, maxY, maxZ)); - vertices.Add(new Vertex(minX, maxY, maxZ)); - vertices.Add(new Vertex(minX, minY, maxZ)); - vertices.Add(new Vertex(maxX, minY, maxZ)); - - box.Add(new Triangle(vertices[4], vertices[5], vertices[6])); - box.Add(new Triangle(vertices[4], vertices[6], vertices[7])); - - // sides - - box.Add(new Triangle(vertices[5], vertices[0], vertices[3])); - box.Add(new Triangle(vertices[5], vertices[3], vertices[6])); - - box.Add(new Triangle(vertices[1], vertices[0], vertices[5])); - box.Add(new Triangle(vertices[1], vertices[5], vertices[4])); - - box.Add(new Triangle(vertices[7], vertices[1], vertices[4])); - box.Add(new Triangle(vertices[7], vertices[2], vertices[1])); - - box.Add(new Triangle(vertices[3], vertices[2], vertices[7])); - box.Add(new Triangle(vertices[3], vertices[7], vertices[6])); - - return box; - } - - /// - /// Creates a simple bounding box mesh for a complex input mesh - /// - /// - /// - private static Mesh CreateBoundingBoxMesh(Mesh meshIn) - { - float minX = float.MaxValue; - float maxX = float.MinValue; - float minY = float.MaxValue; - float maxY = float.MinValue; - float minZ = float.MaxValue; - float maxZ = float.MinValue; - - foreach (Vector3 v in meshIn.getVertexList()) - { - if (v.X < minX) minX = v.X; - if (v.Y < minY) minY = v.Y; - if (v.Z < minZ) minZ = v.Z; - - if (v.X > maxX) maxX = v.X; - if (v.Y > maxY) maxY = v.Y; - if (v.Z > maxZ) maxZ = v.Z; - } - - return CreateSimpleBoxMesh(minX, maxX, minY, maxY, minZ, maxZ); - } - private void ReportPrimError(string message, string primName, PrimMesh primMesh) { m_log.Error(message); @@ -261,7 +178,7 @@ namespace OpenSim.Region.PhysicsModule.ubODEMeshing /// private void AddSubMesh(OSDMap subMeshData, List coords, List faces) { - // Console.WriteLine("subMeshMap for {0} - {1}", primName, Util.GetFormattedXml((OSD)subMeshMap)); + // Console.WriteLine("subMeshMap for {0} - {1}", primName, Util.GetFormattedXml((OSD)subMeshMap)); // As per http://wiki.secondlife.com/wiki/Mesh/Mesh_Asset_Format, some Mesh Level // of Detail Blocks (maps) contain just a NoGeometry key to signal there is no -- cgit v1.1 From 3ae210d36f22b139b082fd6a691cf7f89df2d8f6 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 22 Jul 2017 02:04:02 +0100 Subject: ubOde: let small spheres still be spheres --- OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs b/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs index b191dbc..aa208e2 100644 --- a/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs +++ b/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs @@ -1755,7 +1755,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde { IntPtr geo = IntPtr.Zero; - if (!OverrideToBox && _pbs.ProfileShape == ProfileShape.HalfCircle && _pbs.PathCurve == (byte)Extrusion.Curve1 + if (_pbs.ProfileShape == ProfileShape.HalfCircle && _pbs.PathCurve == (byte)Extrusion.Curve1 && _size.X == _size.Y && _size.Y == _size.Z) { // it's a sphere try -- cgit v1.1 From 04eeb0e5cb52f2ae16036626ae337df18054d565 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 22 Jul 2017 23:33:03 +0100 Subject: mantis 8212 do use defined sqlite connection --- OpenSim/Data/SQLite/SQLiteXInventoryData.cs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/OpenSim/Data/SQLite/SQLiteXInventoryData.cs b/OpenSim/Data/SQLite/SQLiteXInventoryData.cs index 7f44a65..7cce5e4 100644 --- a/OpenSim/Data/SQLite/SQLiteXInventoryData.cs +++ b/OpenSim/Data/SQLite/SQLiteXInventoryData.cs @@ -308,14 +308,8 @@ namespace OpenSim.Data.SQLite cmd.CommandText = "update inventoryfolders set version=version+1 where folderID = ?folderID"; cmd.Parameters.Add(new SqliteParameter(":folderID", folderID)); - try - { - cmd.ExecuteNonQuery(); - } - catch (Exception) - { + if(ExecuteNonQuery(cmd, m_Connection) == 0) return false; - } } return true; -- cgit v1.1 From 8b2e95d1c1e1beb83c03bae435ae34ac479de292 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sun, 23 Jul 2017 14:23:44 +0100 Subject: add a rudimentary version control to ubOde meshs cache --- .../PhysicsModules/ubOdeMeshing/Meshmerizer.cs | 180 ++++++++++----------- 1 file changed, 90 insertions(+), 90 deletions(-) diff --git a/OpenSim/Region/PhysicsModules/ubOdeMeshing/Meshmerizer.cs b/OpenSim/Region/PhysicsModules/ubOdeMeshing/Meshmerizer.cs index 010262f..1233d48 100644 --- a/OpenSim/Region/PhysicsModules/ubOdeMeshing/Meshmerizer.cs +++ b/OpenSim/Region/PhysicsModules/ubOdeMeshing/Meshmerizer.cs @@ -36,7 +36,7 @@ using OpenSim.Region.PhysicsModules.ConvexDecompositionDotNet; using OpenMetaverse; using OpenMetaverse.StructuredData; using System.Drawing; -using System.Drawing.Imaging; +using System.Threading; using System.IO.Compression; using PrimMesher; using log4net; @@ -56,15 +56,15 @@ namespace OpenSim.Region.PhysicsModule.ubODEMeshing // Setting baseDir to a path will enable the dumping of raw files // raw files can be imported by blender so a visual inspection of the results can be done + private static string cacheControlFilename = "cntr"; private bool m_Enabled = false; public static object diskLock = new object(); public bool doMeshFileCache = true; - + public bool doCacheExpire = true; public string cachePath = "MeshCache"; public TimeSpan CacheExpire; - public bool doCacheExpire = true; // const string baseDir = "rawFiles"; private const string baseDir = null; //"rawFiles"; @@ -101,10 +101,8 @@ namespace OpenSim.Region.PhysicsModule.ubODEMeshing if (mesh_config != null) { useMeshiesPhysicsMesh = mesh_config.GetBoolean("UseMeshiesPhysicsMesh", useMeshiesPhysicsMesh); - doConvexPrims = mesh_config.GetBoolean("ConvexPrims",doConvexPrims); doConvexSculpts = mesh_config.GetBoolean("ConvexSculpts",doConvexPrims); - doMeshFileCache = mesh_config.GetBoolean("MeshFileCache", doMeshFileCache); cachePath = mesh_config.GetString("MeshFileCachePath", cachePath); fcache = mesh_config.GetFloat("MeshFileCacheExpireHours", fcache); @@ -115,22 +113,19 @@ namespace OpenSim.Region.PhysicsModule.ubODEMeshing CacheExpire = TimeSpan.FromHours(fcache); - lock (diskLock) + if(String.IsNullOrEmpty(cachePath)) + doMeshFileCache = false; + + if(doMeshFileCache) { - if(doMeshFileCache && cachePath != "") + if(!checkCache()) { - try - { - if (!Directory.Exists(cachePath)) - Directory.CreateDirectory(cachePath); - } - catch - { - doMeshFileCache = false; - doCacheExpire = false; - } + doMeshFileCache = false; + doCacheExpire = false; } } + else + doCacheExpire = false; } } @@ -283,7 +278,7 @@ namespace OpenSim.Region.PhysicsModule.ubODEMeshing { List convexcoords; List convexfaces; - if(CreateHull(coords, out convexcoords, out convexfaces) && convexcoords != null && convexfaces != null) + if(CreateBoundingHull(coords, out convexcoords, out convexfaces) && convexcoords != null && convexfaces != null) { coords.Clear(); coords = convexcoords; @@ -565,45 +560,7 @@ namespace OpenSim.Region.PhysicsModule.ubODEMeshing vs.Clear(); continue; } - /* - if (!HullUtils.ComputeHull(vs, ref hullr, 0, 0.0f)) - { - vs.Clear(); - continue; - } - - nverts = hullr.Vertices.Count; - nindexs = hullr.Indices.Count; - - if (nindexs % 3 != 0) - { - vs.Clear(); - continue; - } - for (i = 0; i < nverts; i++) - { - c.X = hullr.Vertices[i].x; - c.Y = hullr.Vertices[i].y; - c.Z = hullr.Vertices[i].z; - coords.Add(c); - } - - for (i = 0; i < nindexs; i += 3) - { - t1 = hullr.Indices[i]; - if (t1 > nverts) - break; - t2 = hullr.Indices[i + 1]; - if (t2 > nverts) - break; - t3 = hullr.Indices[i + 2]; - if (t3 > nverts) - break; - f = new Face(vertsoffset + t1, vertsoffset + t2, vertsoffset + t3); - faces.Add(f); - } - */ List indices; if (!HullUtils.ComputeHull(vs, out indices)) { @@ -709,38 +666,7 @@ namespace OpenSim.Region.PhysicsModule.ubODEMeshing vs.Clear(); return true; } -/* - if (!HullUtils.ComputeHull(vs, ref hullr, 0, 0.0f)) - return false; - - nverts = hullr.Vertices.Count; - nindexs = hullr.Indices.Count; - if (nindexs % 3 != 0) - return false; - - for (i = 0; i < nverts; i++) - { - c.X = hullr.Vertices[i].x; - c.Y = hullr.Vertices[i].y; - c.Z = hullr.Vertices[i].z; - coords.Add(c); - } - for (i = 0; i < nindexs; i += 3) - { - t1 = hullr.Indices[i]; - if (t1 > nverts) - break; - t2 = hullr.Indices[i + 1]; - if (t2 > nverts) - break; - t3 = hullr.Indices[i + 2]; - if (t3 > nverts) - break; - f = new Face(t1, t2, t3); - faces.Add(f); - } -*/ List indices; if (!HullUtils.ComputeHull(vs, out indices)) return false; @@ -1353,7 +1279,7 @@ namespace OpenSim.Region.PhysicsModule.ubODEMeshing } } - public void FileNames(AMeshKey key, out string dir,out string fullFileName) + public void FileNames(AMeshKey key, out string dir, out string fullFileName) { string id = key.ToString(); string init = id.Substring(0, 1); @@ -1470,7 +1396,7 @@ namespace OpenSim.Region.PhysicsModule.ubODEMeshing if (!doCacheExpire) return; - string controlfile = System.IO.Path.Combine(cachePath, "cntr"); + string controlfile = System.IO.Path.Combine(cachePath, cacheControlFilename); lock (diskLock) { @@ -1524,7 +1450,81 @@ namespace OpenSim.Region.PhysicsModule.ubODEMeshing } } - public bool CreateHull(List inputVertices, out List convexcoords, out List newfaces) + public bool checkCache() + { + string controlfile = System.IO.Path.Combine(cachePath, cacheControlFilename); + lock (diskLock) + { + try + { + if (!Directory.Exists(cachePath)) + { + Directory.CreateDirectory(cachePath); + Thread.Sleep(100); + FileStream fs = File.Create(controlfile, 4096, FileOptions.WriteThrough); + fs.Close(); + return true; + } + } + catch + { + doMeshFileCache = false; + doCacheExpire = false; + return false; + } + finally {} + + if (File.Exists(controlfile)) + return true; + + try + { + Directory.Delete(cachePath, true); + while(Directory.Exists(cachePath)) + Thread.Sleep(100); + } + catch(Exception e) + { + m_log.Error("[MESH CACHE]: failed to delete old version of the cache: " + e.Message); + doMeshFileCache = false; + doCacheExpire = false; + return false; + } + finally {} + try + { + Directory.CreateDirectory(cachePath); + while(!Directory.Exists(cachePath)) + Thread.Sleep(100); + } + catch(Exception e) + { + m_log.Error("[MESH CACHE]: failed to create new cache folder: " + e.Message); + doMeshFileCache = false; + doCacheExpire = false; + return false; + } + finally {} + + try + { + FileStream fs = File.Create(controlfile, 4096, FileOptions.WriteThrough); + fs.Close(); + } + catch(Exception e) + { + m_log.Error("[MESH CACHE]: failed to create new control file: " + e.Message); + doMeshFileCache = false; + doCacheExpire = false; + return false; + } + finally {} + + return true; + } + } + + public bool CreateBoundingHull(List inputVertices, out List convexcoords, out List newfaces) { convexcoords = null; newfaces = null; -- cgit v1.1 From 6bf96f83c5cd9a87989ea6b89892833120314b07 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sun, 23 Jul 2017 14:29:11 +0100 Subject: mantis 8212 fix sqlite parameter prefixing --- OpenSim/Data/SQLite/SQLiteXInventoryData.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Data/SQLite/SQLiteXInventoryData.cs b/OpenSim/Data/SQLite/SQLiteXInventoryData.cs index 7cce5e4..4ef1f30 100644 --- a/OpenSim/Data/SQLite/SQLiteXInventoryData.cs +++ b/OpenSim/Data/SQLite/SQLiteXInventoryData.cs @@ -305,7 +305,7 @@ namespace OpenSim.Data.SQLite using (SqliteCommand cmd = new SqliteCommand()) { - cmd.CommandText = "update inventoryfolders set version=version+1 where folderID = ?folderID"; + cmd.CommandText = "update inventoryfolders set version=version+1 where folderID = :folderID"; cmd.Parameters.Add(new SqliteParameter(":folderID", folderID)); if(ExecuteNonQuery(cmd, m_Connection) == 0) -- cgit v1.1 From 13564aa984636aab12b8d4694051b21c557fe77a Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Mon, 24 Jul 2017 22:04:36 +0100 Subject: only hide parcel info from banned avatars --- OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index a2c7c83..221670e 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs @@ -1292,7 +1292,7 @@ namespace OpenSim.Region.CoreModules.World.Land { if (!temp.Contains(currentParcel)) { - if (!currentParcel.IsEitherBannedOrRestricted(remote_client.AgentId)) + if (!currentParcel.IsBannedFromLand(remote_client.AgentId)) { currentParcel.ForceUpdateLandInfo(); temp.Add(currentParcel); -- cgit v1.1 From 81d1ebc5105c6fb163c6687826dc557313309b12 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Tue, 25 Jul 2017 01:30:35 +0100 Subject: add first code to process parcel buy pass. Still testing, and still no kick on expire ( does expire on entry ) --- .../CoreModules/World/Land/LandManagementModule.cs | 90 +++++++++++++++++++++- 1 file changed, 89 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index 221670e..54e9e59 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs @@ -41,6 +41,7 @@ using OpenSim.Framework; using OpenSim.Framework.Capabilities; using OpenSim.Framework.Console; using OpenSim.Framework.Servers; +using OpenSim.Framework.Monitoring; using OpenSim.Framework.Servers.HttpServer; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; @@ -216,6 +217,7 @@ namespace OpenSim.Region.CoreModules.World.Land client.OnParcelEjectUser += ClientOnParcelEjectUser; client.OnParcelFreezeUser += ClientOnParcelFreezeUser; client.OnSetStartLocationRequest += ClientOnSetHome; + client.OnParcelBuyPass += ClientParcelBuyPass; } public void EventMakeChildAgent(ScenePresence avatar) @@ -537,6 +539,92 @@ namespace OpenSim.Region.CoreModules.World.Land } } + public void ClientParcelBuyPass(IClientAPI remote_client, UUID targetID, int landLocalID) + { + ILandObject land; + lock (m_landList) + { + m_landList.TryGetValue(landLocalID, out land); + } + // trivial checks + if(land == null) + return; + + LandData ldata = land.LandData; + + if(ldata == null) + return; + + if(ldata.OwnerID == targetID) + return; + + if(ldata.PassHours == 0) + return; + + if((ldata.Flags & (uint)ParcelFlags.UsePassList) == 0) + return; + + int cost = ldata.PassPrice; + + int idx = land.LandData.ParcelAccessList.FindIndex( + delegate(LandAccessEntry e) + { + if (e.AgentID == targetID && e.Flags == AccessList.Access) + return true; + return false; + }); + + int expires = Util.UnixTimeSinceEpoch() + (int)(3600.0 * ldata.PassHours); + if (idx != -1) + { + if(ldata.ParcelAccessList[idx].Expires == 0) + { + remote_client.SendAgentAlertMessage("You already have access to parcel", false); + return; + } + + if(expires < land.LandData.ParcelAccessList[idx].Expires - 300f) + { + remote_client.SendAgentAlertMessage("Your pass to parcel is still valid for 5 minutes", false); + return; + } + } + + LandAccessEntry entry = new LandAccessEntry(); + entry.AgentID = targetID; + entry.Flags = AccessList.Access; + entry.Expires = expires; + + IMoneyModule mm = m_scene.RequestModuleInterface(); + if(cost != 0 && mm != null) + { + WorkManager.RunInThreadPool( + delegate + { + if (!mm.AmountCovered(remote_client.AgentId, cost)) + { + remote_client.SendAgentAlertMessage("Insufficient funds", true); + return; + } + + mm.ApplyCharge(remote_client.AgentId, cost, MoneyTransactionType.LandPassSale); + + if (idx != -1) + ldata.ParcelAccessList.RemoveAt(idx); + ldata.ParcelAccessList.Add(entry); + m_scene.EventManager.TriggerLandObjectUpdated((uint)land.LandData.LocalID, land); + return; + }, null, "ParcelBuyPass"); + } + else + { + if (idx != -1) + ldata.ParcelAccessList.RemoveAt(idx); + ldata.ParcelAccessList.Add(entry); + m_scene.EventManager.TriggerLandObjectUpdated((uint)land.LandData.LocalID, land); + } + } + public void ClientOnParcelAccessListRequest(UUID agentID, UUID sessionID, uint flags, int sequenceID, int landLocalID, IClientAPI remote_client) { @@ -1769,7 +1857,7 @@ namespace OpenSim.Region.CoreModules.World.Land land_update.MusicURL = properties.MusicURL; land_update.Name = properties.Name; land_update.ParcelFlags = (uint) properties.ParcelFlags; - land_update.PassHours = (int) properties.PassHours; + land_update.PassHours = properties.PassHours; land_update.PassPrice = (int) properties.PassPrice; land_update.SalePrice = (int) properties.SalePrice; land_update.SnapshotID = properties.SnapshotID; -- cgit v1.1 From c5b34a51fd81091493f9160b618ecbae9e9e78eb Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Tue, 25 Jul 2017 02:39:12 +0100 Subject: Ooops.. pay to land owner, not grid. group owned parcel not suported for now. (the pass already expired with kick action) --- OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index 54e9e59..377f243 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs @@ -561,6 +561,12 @@ namespace OpenSim.Region.CoreModules.World.Land if(ldata.PassHours == 0) return; + if(ldata.IsGroupOwned) + { + remote_client.SendAgentAlertMessage("pass to group owned parcel not suported", false); + return; + } + if((ldata.Flags & (uint)ParcelFlags.UsePassList) == 0) return; @@ -607,7 +613,7 @@ namespace OpenSim.Region.CoreModules.World.Land return; } - mm.ApplyCharge(remote_client.AgentId, cost, MoneyTransactionType.LandPassSale); + mm.MoveMoney(remote_client.AgentId, ldata.OwnerID, cost, String.Format("Parcel '{0}' pass sell",ldata.Name)); if (idx != -1) ldata.ParcelAccessList.RemoveAt(idx); -- cgit v1.1 From 86c9c86eebdad234520461f61f925eb60f965312 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Tue, 25 Jul 2017 03:13:03 +0100 Subject: allow pass recharge with no loss of current time up to 1/4 of parcel pass time. --- .../CoreModules/World/Land/LandManagementModule.cs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index 377f243..a3146c1 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs @@ -579,8 +579,9 @@ namespace OpenSim.Region.CoreModules.World.Land return true; return false; }); - - int expires = Util.UnixTimeSinceEpoch() + (int)(3600.0 * ldata.PassHours); + int now = Util.UnixTimeSinceEpoch(); + int expires = (int)(3600.0 * ldata.PassHours + 0.5f); + int currenttime = -1; if (idx != -1) { if(ldata.ParcelAccessList[idx].Expires == 0) @@ -589,18 +590,17 @@ namespace OpenSim.Region.CoreModules.World.Land return; } - if(expires < land.LandData.ParcelAccessList[idx].Expires - 300f) - { - remote_client.SendAgentAlertMessage("Your pass to parcel is still valid for 5 minutes", false); - return; - } + currenttime = ldata.ParcelAccessList[idx].Expires - now; + if(currenttime > (int)(0.25f * expires + 0.5f)) + currenttime = (int)(0.25f * expires + 0.5f); } LandAccessEntry entry = new LandAccessEntry(); entry.AgentID = targetID; entry.Flags = AccessList.Access; - entry.Expires = expires; - + entry.Expires = now + expires; + if(currenttime > 0) + entry.Expires += currenttime; IMoneyModule mm = m_scene.RequestModuleInterface(); if(cost != 0 && mm != null) { -- cgit v1.1 From 1071c92bb03775d393f0134e540f54f7cb38d38a Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Tue, 25 Jul 2017 03:44:52 +0100 Subject: fix lsl group role powers to change parcel passes --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index c13e8b2..75b6b0e 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -7851,7 +7851,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api UUID key; ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition); - if (World.Permissions.CanEditParcelProperties(m_host.OwnerID, land, GroupPowers.LandManageBanned, false)) + if (World.Permissions.CanEditParcelProperties(m_host.OwnerID, land, GroupPowers.LandManagePasses, false)) { int expires = 0; if (hours != 0) @@ -13073,7 +13073,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api m_host.AddScriptLPS(1); UUID key; ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition); - if (World.Permissions.CanEditParcelProperties(m_host.OwnerID, land, GroupPowers.LandManageAllowed, false)) + if (World.Permissions.CanEditParcelProperties(m_host.OwnerID, land, GroupPowers.LandManagePasses, false)) { if (UUID.TryParse(avatar, out key)) { -- cgit v1.1 From 1557b78d67b579958931976e58f3a023911bcb5d Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Tue, 25 Jul 2017 04:04:55 +0100 Subject: add missing session ID verification --- OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 861b79e..a1c8b22 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -6447,6 +6447,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP { ParcelBuyPassPacket ParcelBuyPass = (ParcelBuyPassPacket)Packet; + + if(SessionId != ParcelBuyPass.AgentData.SessionID) + return false; ParcelBuyPass ParcelBuyPassHandler = OnParcelBuyPass; if (ParcelBuyPassHandler != null) -- cgit v1.1 From 35b1166ba85cfa2016194a6822c76e00f3faa108 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Tue, 25 Jul 2017 04:10:22 +0100 Subject: add a few more... --- OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index a1c8b22..6dd3885 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -6399,6 +6399,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP ParcelGodMarkAsContentPacket ParcelGodMarkAsContent = (ParcelGodMarkAsContentPacket)Packet; + if(SessionId != ParcelGodMarkAsContent.AgentData.SessionID || AgentId != ParcelGodMarkAsContent.AgentData.AgentID) + return false; + ParcelGodMark ParcelGodMarkAsContentHandler = OnParcelGodMark; if (ParcelGodMarkAsContentHandler != null) { @@ -6414,6 +6417,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP { FreezeUserPacket FreezeUser = (FreezeUserPacket)Packet; + if(SessionId != FreezeUser.AgentData.SessionID || AgentId != FreezeUser.AgentData.AgentID) + return false; + FreezeUserUpdate FreezeUserHandler = OnParcelFreezeUser; if (FreezeUserHandler != null) { @@ -6431,6 +6437,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP EjectUserPacket EjectUser = (EjectUserPacket)Packet; + if(SessionId != EjectUser.AgentData.SessionID || AgentId != EjectUser.AgentData.AgentID) + return false; + EjectUserUpdate EjectUserHandler = OnParcelEjectUser; if (EjectUserHandler != null) { @@ -6447,8 +6456,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP { ParcelBuyPassPacket ParcelBuyPass = (ParcelBuyPassPacket)Packet; - - if(SessionId != ParcelBuyPass.AgentData.SessionID) + + if(SessionId != ParcelBuyPass.AgentData.SessionID || AgentId != ParcelBuyPass.AgentData.AgentID) return false; ParcelBuyPass ParcelBuyPassHandler = OnParcelBuyPass; -- cgit v1.1 From 8739ceb00f34c618634983b25330a21f60eafe6d Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Tue, 25 Jul 2017 04:18:38 +0100 Subject: lets try using older EventManager.TriggerMoneyTransfer to pay parcel passes --- OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index a3146c1..4123c07 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs @@ -613,8 +613,12 @@ namespace OpenSim.Region.CoreModules.World.Land return; } - mm.MoveMoney(remote_client.AgentId, ldata.OwnerID, cost, String.Format("Parcel '{0}' pass sell",ldata.Name)); +// mm.MoveMoney(remote_client.AgentId, ldata.OwnerID, cost, String.Format("Parcel '{0}' pass sell",ldata.Name)); + // lets try older method + EventManager.MoneyTransferArgs args = new EventManager.MoneyTransferArgs(remote_client.AgentId, ldata.OwnerID, + cost,(int)MoneyTransactionType.LandPassSale , String.Format("Parcel '{0}' pass sell",ldata.Name)); + m_scene.EventManager.TriggerMoneyTransfer(this, args); if (idx != -1) ldata.ParcelAccessList.RemoveAt(idx); ldata.ParcelAccessList.Add(entry); -- cgit v1.1 From d52a64c7a33a419853f351619e149c444d12db8f Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 26 Jul 2017 12:53:12 +0100 Subject: avoid leasing issues on lsl_list on domain crossings. This will make their use even more slow. AppDomainLoading just needs to be set false to have acceptable scripts performance --- OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs index 8780e49..a65f71f 100644 --- a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs +++ b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs @@ -525,7 +525,7 @@ namespace OpenSim.Region.ScriptEngine.Shared } [Serializable] - public class list: MarshalByRefObject + public class list { private object[] m_data; -- cgit v1.1 From 74389c74cba24b3369ccb6908785d030758940b0 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 26 Jul 2017 12:58:47 +0100 Subject: only allow pass renovation on the last quarter of parcel pass time. go back to MoneyMove charging method --- .../Region/CoreModules/World/Land/LandManagementModule.cs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index 4123c07..879d3d6 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs @@ -592,7 +592,10 @@ namespace OpenSim.Region.CoreModules.World.Land currenttime = ldata.ParcelAccessList[idx].Expires - now; if(currenttime > (int)(0.25f * expires + 0.5f)) - currenttime = (int)(0.25f * expires + 0.5f); + { + remote_client.SendAgentAlertMessage("You already have pass valid for " + string.Format("{0:0.##} minutes", currenttime/60.0f), false); + return; + } } LandAccessEntry entry = new LandAccessEntry(); @@ -613,12 +616,12 @@ namespace OpenSim.Region.CoreModules.World.Land return; } -// mm.MoveMoney(remote_client.AgentId, ldata.OwnerID, cost, String.Format("Parcel '{0}' pass sell",ldata.Name)); + mm.MoveMoney(remote_client.AgentId, ldata.OwnerID, cost, String.Format("Parcel '{0}' pass sell",ldata.Name)); // lets try older method - EventManager.MoneyTransferArgs args = new EventManager.MoneyTransferArgs(remote_client.AgentId, ldata.OwnerID, - cost,(int)MoneyTransactionType.LandPassSale , String.Format("Parcel '{0}' pass sell",ldata.Name)); +// EventManager.MoneyTransferArgs args = new EventManager.MoneyTransferArgs(remote_client.AgentId, ldata.OwnerID, +// cost,(int)MoneyTransactionType.LandPassSale , String.Format("Parcel '{0}' pass sell",ldata.Name)); - m_scene.EventManager.TriggerMoneyTransfer(this, args); +// m_scene.EventManager.TriggerMoneyTransfer(this, args); if (idx != -1) ldata.ParcelAccessList.RemoveAt(idx); ldata.ParcelAccessList.Add(entry); -- cgit v1.1 From 025e82341f4299065b4b726a576cdf86c477ac1f Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 26 Jul 2017 14:24:21 +0100 Subject: do not allow setting land passes on group owned land, because currently we cant give money to the group --- OpenSim/Region/CoreModules/World/Land/LandObject.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs index 74b10ed..f947ea2 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs @@ -540,7 +540,7 @@ namespace OpenSim.Region.CoreModules.World.Land ParcelFlags.UseEstateVoiceChan); } - if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId,this, GroupPowers.LandManagePasses, false)) + if (!newData.IsGroupOwned && m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId,this, GroupPowers.LandManagePasses, false)) { newData.PassHours = args.PassHours; newData.PassPrice = args.PassPrice; -- cgit v1.1 From a91ceae8264edde864a383080660d6eea698b3d9 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 26 Jul 2017 14:26:28 +0100 Subject: add comments to make that more clear --- OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | 1 + OpenSim/Region/CoreModules/World/Land/LandObject.cs | 1 + 2 files changed, 2 insertions(+) diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index 879d3d6..e0152a3 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs @@ -561,6 +561,7 @@ namespace OpenSim.Region.CoreModules.World.Land if(ldata.PassHours == 0) return; + // don't allow passes on group owned until we can give money to groups if(ldata.IsGroupOwned) { remote_client.SendAgentAlertMessage("pass to group owned parcel not suported", false); diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs index f947ea2..07d11f9 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs @@ -540,6 +540,7 @@ namespace OpenSim.Region.CoreModules.World.Land ParcelFlags.UseEstateVoiceChan); } + // don't allow passes on group owned until we can give money to groups if (!newData.IsGroupOwned && m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId,this, GroupPowers.LandManagePasses, false)) { newData.PassHours = args.PassHours; -- cgit v1.1 From 0bbe7bab7bb60c39b0defeff173287fc66430c26 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 26 Jul 2017 19:00:49 +0100 Subject: add new funtion bool MoveMoney(UUID fromUser, UUID toUser, int amount, MoneyTransactionType type, string text). this should be called async allowing time for money module to process it. If returns true, the transation did sucess, so if its use was to pay something, the payed item/service must be provided without fail, otherwise another method is needed so a refund is possible --- OpenSim/Framework/IMoneyModule.cs | 1 + .../Region/CoreModules/World/Land/LandManagementModule.cs | 13 ++++++++----- .../OptionalModules/World/MoneyModule/SampleMoneyModule.cs | 7 ++++++- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/OpenSim/Framework/IMoneyModule.cs b/OpenSim/Framework/IMoneyModule.cs index be45438..c72c742 100644 --- a/OpenSim/Framework/IMoneyModule.cs +++ b/OpenSim/Framework/IMoneyModule.cs @@ -41,6 +41,7 @@ namespace OpenSim.Framework void ApplyCharge(UUID agentID, int amount, MoneyTransactionType type, string extraData = ""); void ApplyUploadCharge(UUID agentID, int amount, string text); void MoveMoney(UUID fromUser, UUID toUser, int amount, string text); + bool MoveMoney(UUID fromUser, UUID toUser, int amount, MoneyTransactionType type, string text); int UploadCharge { get; } int GroupCreationCharge { get; } diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index e0152a3..1fc4609 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs @@ -617,12 +617,15 @@ namespace OpenSim.Region.CoreModules.World.Land return; } - mm.MoveMoney(remote_client.AgentId, ldata.OwnerID, cost, String.Format("Parcel '{0}' pass sell",ldata.Name)); - // lets try older method -// EventManager.MoneyTransferArgs args = new EventManager.MoneyTransferArgs(remote_client.AgentId, ldata.OwnerID, -// cost,(int)MoneyTransactionType.LandPassSale , String.Format("Parcel '{0}' pass sell",ldata.Name)); + string regionName = m_scene.RegionInfo.RegionName; + string payDescription = String.Format("Parcel '{0}' at region '{1} {2:0.###} hours access pass", ldata.Name, regionName, ldata.PassHours); + + if(!mm.MoveMoney(remote_client.AgentId, ldata.OwnerID, cost,MoneyTransactionType.LandPassSale, payDescription)) + { + remote_client.SendAgentAlertMessage("Sorry pass payment processing failed, please try again later", true); + return; + } -// m_scene.EventManager.TriggerMoneyTransfer(this, args); if (idx != -1) ldata.ParcelAccessList.RemoveAt(idx); ldata.ParcelAccessList.Add(entry); diff --git a/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs b/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs index 47edeb9..3666c3f 100644 --- a/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs +++ b/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs @@ -844,9 +844,14 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule module.BuyObject(remoteClient, categoryID, localID, saleType, salePrice); } - public void MoveMoney(UUID fromAgentID, UUID toAgentID, int amount, string text) + public void MoveMoney(UUID fromUser, UUID toUser, int amount, string text) { } + + public bool MoveMoney(UUID fromUser, UUID toUser, int amount, MoneyTransactionType type, string text) + { + return true; + } } public enum TransactionType : int -- cgit v1.1 From 0b239643491b893463700add93184b5f8f7d9394 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 26 Jul 2017 19:12:12 +0100 Subject: change buypass insuficent funds to make clear that its on that region money system (buypass now uses the new MoveMoney) --- OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index 1fc4609..64411e6 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs @@ -611,13 +611,14 @@ namespace OpenSim.Region.CoreModules.World.Land WorkManager.RunInThreadPool( delegate { + string regionName = m_scene.RegionInfo.RegionName; + if (!mm.AmountCovered(remote_client.AgentId, cost)) { - remote_client.SendAgentAlertMessage("Insufficient funds", true); + remote_client.SendAgentAlertMessage(String.Format("Insufficient funds in region '{0}' money system", regionName), true); return; } - string regionName = m_scene.RegionInfo.RegionName; string payDescription = String.Format("Parcel '{0}' at region '{1} {2:0.###} hours access pass", ldata.Name, regionName, ldata.PassHours); if(!mm.MoveMoney(remote_client.AgentId, ldata.OwnerID, cost,MoneyTransactionType.LandPassSale, payDescription)) -- cgit v1.1 From 6996bab4a154a7c6936c35af65e439e5a42c84b5 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 26 Jul 2017 20:13:30 +0100 Subject: display remaining pass time in hours, mins or seconds acording to value --- OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index 64411e6..f422708 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs @@ -594,7 +594,15 @@ namespace OpenSim.Region.CoreModules.World.Land currenttime = ldata.ParcelAccessList[idx].Expires - now; if(currenttime > (int)(0.25f * expires + 0.5f)) { - remote_client.SendAgentAlertMessage("You already have pass valid for " + string.Format("{0:0.##} minutes", currenttime/60.0f), false); + if(currenttime > 3600) + remote_client.SendAgentAlertMessage(string.Format("You already have a pass valid for {0:0.###} hours", + currenttime/3600f), false); + else if(currenttime > 60) + remote_client.SendAgentAlertMessage(string.Format("You already have a pass valid for {0:0.##} minutes", + currenttime/60f), false); + else + remote_client.SendAgentAlertMessage(string.Format("You already have a pass valid for {0:0.#} seconds", + currenttime), false); return; } } -- cgit v1.1 From 324bda8ab96f4c6b17c221ea73842ca599270c00 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 27 Jul 2017 16:23:08 +0100 Subject: mantis 8218 make Meshmerizer UseMeshiesPhysicsMesh defualt to true, to match stated on ini files. --- OpenSim/Region/PhysicsModules/Meshing/Meshmerizer/Meshmerizer.cs | 2 +- bin/OpenSimDefaults.ini | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/PhysicsModules/Meshing/Meshmerizer/Meshmerizer.cs b/OpenSim/Region/PhysicsModules/Meshing/Meshmerizer/Meshmerizer.cs index 4f95554..0d4b6b9 100644 --- a/OpenSim/Region/PhysicsModules/Meshing/Meshmerizer/Meshmerizer.cs +++ b/OpenSim/Region/PhysicsModules/Meshing/Meshmerizer/Meshmerizer.cs @@ -66,7 +66,7 @@ namespace OpenSim.Region.PhysicsModule.Meshing private bool cacheSculptMaps = true; private string decodedSculptMapPath = null; - private bool useMeshiesPhysicsMesh = false; + private bool useMeshiesPhysicsMesh = true; private float minSizeForComplexMesh = 0.2f; // prims with all dimensions smaller than this will have a bounding box mesh diff --git a/bin/OpenSimDefaults.ini b/bin/OpenSimDefaults.ini index 164eae6..3747fcf 100644 --- a/bin/OpenSimDefaults.ini +++ b/bin/OpenSimDefaults.ini @@ -943,7 +943,7 @@ ; Minimum user level required to upload meshes ;LevelUpload = 0 - ; support meshs on physics + ; support meshes on physics ;UseMeshiesPhysicsMesh = true ;support convex shape type on normal prims -- cgit v1.1 From 21b71ff1d857239c919ad275db5aacbf0cb6331e Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 28 Jul 2017 17:36:40 +0100 Subject: partial mantis 8219; on creating or updating items (animationsets, wearables) that reference assets, and user does not have permissions on those, abort and warn, instead of silent invalition of the references to those assets, creating a broken item --- OpenSim/Framework/AnimationSet.cs | 22 +++- .../Agent/AssetTransaction/AssetXferUploader.cs | 120 ++++++++++++--------- .../InventoryAccess/InventoryAccessModule.cs | 15 +-- 3 files changed, 99 insertions(+), 58 deletions(-) diff --git a/OpenSim/Framework/AnimationSet.cs b/OpenSim/Framework/AnimationSet.cs index 87c4a78..8753088 100644 --- a/OpenSim/Framework/AnimationSet.cs +++ b/OpenSim/Framework/AnimationSet.cs @@ -31,7 +31,8 @@ using OpenMetaverse; namespace OpenSim.Framework { - public delegate bool AnimationSetValidator(UUID animID); +// public delegate bool AnimationSetValidator(UUID animID); + public delegate uint AnimationSetValidator(UUID animID); public class AnimationSet { @@ -141,7 +142,7 @@ namespace OpenSim.Framework assetData += String.Format("{0} {1} {2}\n", kvp.Key, kvp.Value.Value.ToString(), kvp.Value.Key); return System.Text.Encoding.ASCII.GetBytes(assetData); } - +/* public bool Validate(AnimationSetValidator val) { if (m_parseError) @@ -164,5 +165,22 @@ namespace OpenSim.Framework return allOk; } +*/ + public uint Validate(AnimationSetValidator val) + { + if (m_parseError) + return 0; + + uint ret = 0x7fffffff; + uint t; + foreach (KeyValuePair> kvp in m_animations) + { + t = val(kvp.Value.Value); + if (t == 0) + return 0; + ret &= t; + } + return ret; + } } } diff --git a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs index d2aa177..9f15531 100644 --- a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs +++ b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs @@ -258,24 +258,24 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction { m_uploadState = UploadState.Complete; - ourClient.SendAssetUploadCompleteMessage(m_asset.Type, true, m_asset.FullID); - + bool sucess = true; if (m_createItem) { - CompleteCreateItem(m_createItemCallback); + sucess = CompleteCreateItem(m_createItemCallback); } else if (m_updateItem) { - CompleteItemUpdate(m_updateItemData); + sucess = CompleteItemUpdate(m_updateItemData); } else if (m_updateTaskItem) { - CompleteTaskItemUpdate(m_updateTaskItemData); + sucess = CompleteTaskItemUpdate(m_updateTaskItemData); } else if (m_asset.Local) { m_Scene.AssetService.Store(m_asset); } + ourClient.SendAssetUploadCompleteMessage(m_asset.Type, sucess, m_asset.FullID); } m_log.DebugFormat( @@ -411,46 +411,70 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction /// Store the asset for the given item when it has been uploaded. /// /// - private void CompleteItemUpdate(InventoryItemBase item) + private bool CompleteItemUpdate(InventoryItemBase item) { // m_log.DebugFormat( // "[ASSET XFER UPLOADER]: Storing asset {0} for earlier item update for {1} for {2}", // m_asset.FullID, item.Name, ourClient.Name); - ValidateAssets(); - m_Scene.AssetService.Store(m_asset); - if (m_asset.FullID != UUID.Zero) + uint perms = ValidateAssets(); + if(perms == 0) { - item.AssetID = m_asset.FullID; - m_Scene.InventoryService.UpdateItem(item); + string error = string.Format("Not enought permissions on asset(s) referenced by item '{0}', update failed", item.Name); + ourClient.SendAlertMessage(error); + m_transactions.RemoveXferUploader(m_transactionID); + ourClient.SendBulkUpdateInventory(item); // invalid the change item on viewer cache + } + else + { + m_Scene.AssetService.Store(m_asset); + if (m_asset.FullID != UUID.Zero) + { + item.AssetID = m_asset.FullID; + m_Scene.InventoryService.UpdateItem(item); + } + ourClient.SendInventoryItemCreateUpdate(item, m_transactionID, 0); + m_transactions.RemoveXferUploader(m_transactionID); + m_Scene.EventManager.TriggerOnNewInventoryItemUploadComplete(item, 0); } - ourClient.SendInventoryItemCreateUpdate(item, m_transactionID, 0); - - m_transactions.RemoveXferUploader(m_transactionID); - - m_Scene.EventManager.TriggerOnNewInventoryItemUploadComplete(item, 0); + return perms != 0; } /// /// Store the asset for the given task item when it has been uploaded. /// /// - private void CompleteTaskItemUpdate(TaskInventoryItem taskItem) + private bool CompleteTaskItemUpdate(TaskInventoryItem taskItem) { // m_log.DebugFormat( // "[ASSET XFER UPLOADER]: Storing asset {0} for earlier task item update for {1} for {2}", // m_asset.FullID, taskItem.Name, ourClient.Name); - ValidateAssets(); - m_Scene.AssetService.Store(m_asset); + if(ValidateAssets() == 0) + { + m_transactions.RemoveXferUploader(m_transactionID); + string error = string.Format("Not enought permissions on asset(s) referenced by task item '{0}', update failed", taskItem.Name); + ourClient.SendAlertMessage(error); + // force old asset to viewers ?? + return false; + } + m_Scene.AssetService.Store(m_asset); m_transactions.RemoveXferUploader(m_transactionID); + return true; } - private void CompleteCreateItem(uint callbackID) + private bool CompleteCreateItem(uint callbackID) { - ValidateAssets(); + if(ValidateAssets() == 0) + { + m_transactions.RemoveXferUploader(m_transactionID); + string error = string.Format("Not enought permissions on asset(s) referenced by item '{0}', creation failed", m_name); + ourClient.SendAlertMessage(error); + return false; + } + m_Scene.AssetService.Store(m_asset); InventoryItemBase item = new InventoryItemBase(); @@ -480,35 +504,40 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction ourClient.SendAlertMessage("Unable to create inventory item"); m_transactions.RemoveXferUploader(m_transactionID); + return true; } - - private void ValidateAssets() + private uint ValidateAssets() { + uint retPerms = 0x7fffffff; +// if(m_Scene.Permissions.BypassPermissions()) +// return retPerms; + if (m_asset.Type == (sbyte)CustomAssetType.AnimationSet) { + AnimationSet animSet = new AnimationSet(m_asset.Data); - bool allOk = animSet.Validate(x => { - int perms = m_Scene.InventoryService.GetAssetPermissions(ourClient.AgentId, x); - int required = (int)(PermissionMask.Transfer | PermissionMask.Copy); + retPerms &= animSet.Validate(x => { + const uint required = (uint)(PermissionMask.Transfer | PermissionMask.Copy); + uint perms = (uint)m_Scene.InventoryService.GetAssetPermissions(ourClient.AgentId, x); + // currrent yes/no rule if ((perms & required) != required) - return false; - return true; + return 0; + return perms; }); - if (!allOk) - m_asset.Data = animSet.ToBytes(); + return retPerms; } if (m_asset.Type == (sbyte)AssetType.Clothing || m_asset.Type == (sbyte)AssetType.Bodypart) { + const uint texturesfullPermMask = (uint)(PermissionMask.Modify | PermissionMask.Transfer | PermissionMask.Copy); string content = System.Text.Encoding.ASCII.GetString(m_asset.Data); string[] lines = content.Split(new char[] {'\n'}); - List validated = new List(); - + // on current requiriment of full rigths assume old assets where accepted Dictionary allowed = ExtractTexturesFromOldData(); int textures = 0; @@ -518,10 +547,8 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction try { if (line.StartsWith("textures ")) - { textures = Convert.ToInt32(line.Substring(9)); - validated.Add(line); - } + else if (textures > 0) { string[] parts = line.Split(new char[] {' '}); @@ -532,42 +559,35 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction if (defaultIDs.Contains(tx) || tx == UUID.Zero || (allowed.ContainsKey(id) && allowed[id] == tx)) { - validated.Add(parts[0] + " " + tx.ToString()); + continue; } else { - int perms = m_Scene.InventoryService.GetAssetPermissions(ourClient.AgentId, tx); - int full = (int)(PermissionMask.Modify | PermissionMask.Transfer | PermissionMask.Copy); + uint perms = (uint)m_Scene.InventoryService.GetAssetPermissions(ourClient.AgentId, tx); - if ((perms & full) != full) + if ((perms & texturesfullPermMask) != texturesfullPermMask) { m_log.ErrorFormat("[ASSET UPLOADER]: REJECTED update with texture {0} from {1} because they do not own the texture", tx, ourClient.AgentId); - validated.Add(parts[0] + " " + UUID.Zero.ToString()); + return 0; } else { - validated.Add(line); + retPerms &= perms; } } textures--; } - else - { - validated.Add(line); - } } catch { // If it's malformed, skip it } } - - string final = String.Join("\n", validated.ToArray()); - - m_asset.Data = System.Text.Encoding.ASCII.GetBytes(final); } + return retPerms; } +/* not in use /// /// Get the asset data uploaded in this transfer. /// @@ -582,7 +602,7 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction return null; } - +*/ public void SetOldData(byte[] d) { m_oldData = d; diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs index f1409bb..788ed1c 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs @@ -299,15 +299,18 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess else if ((CustomInventoryType)item.InvType == CustomInventoryType.AnimationSet) { AnimationSet animSet = new AnimationSet(data); - if (!animSet.Validate(x => { + uint res = animSet.Validate(x => { + const int required = (int)(PermissionMask.Transfer | PermissionMask.Copy); int perms = m_Scene.InventoryService.GetAssetPermissions(remoteClient.AgentId, x); - int required = (int)(PermissionMask.Transfer | PermissionMask.Copy); + // enforce previus perm rule if ((perms & required) != required) - return false; - return true; - })) + return 0; + return (uint) perms; + }); + if(res == 0) { - data = animSet.ToBytes(); + remoteClient.SendAgentAlertMessage("Not enought permissions on asset(s) referenced by animation set '{0}', update failed", false); + return UUID.Zero; } } -- cgit v1.1 From ad930f8e41d2f58074e825d48ec43ff0cc4482c2 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 28 Jul 2017 19:01:07 +0100 Subject: fix typo --- .../Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs index 9f15531..52b9d0e 100644 --- a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs +++ b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs @@ -420,7 +420,7 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction uint perms = ValidateAssets(); if(perms == 0) { - string error = string.Format("Not enought permissions on asset(s) referenced by item '{0}', update failed", item.Name); + string error = string.Format("Not enough permissions on asset(s) referenced by item '{0}', update failed", item.Name); ourClient.SendAlertMessage(error); m_transactions.RemoveXferUploader(m_transactionID); ourClient.SendBulkUpdateInventory(item); // invalid the change item on viewer cache @@ -454,7 +454,7 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction if(ValidateAssets() == 0) { m_transactions.RemoveXferUploader(m_transactionID); - string error = string.Format("Not enought permissions on asset(s) referenced by task item '{0}', update failed", taskItem.Name); + string error = string.Format("Not enough permissions on asset(s) referenced by task item '{0}', update failed", taskItem.Name); ourClient.SendAlertMessage(error); // force old asset to viewers ?? return false; @@ -470,7 +470,7 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction if(ValidateAssets() == 0) { m_transactions.RemoveXferUploader(m_transactionID); - string error = string.Format("Not enought permissions on asset(s) referenced by item '{0}', creation failed", m_name); + string error = string.Format("Not enough permissions on asset(s) referenced by item '{0}', creation failed", m_name); ourClient.SendAlertMessage(error); return false; } -- cgit v1.1 From 169a50286bfd113e29623ab6ed88ca66acb842bf Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 29 Jul 2017 00:08:40 +0100 Subject: upload ODE lib for linux. Plz keep previus version in case something goes wrong. Thanks jakdaniels for the compilation --- bin/lib32/libode.so | Bin 4401180 -> 4386269 bytes bin/lib64/libode-x86_64.so | Bin 5802413 -> 5813749 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/bin/lib32/libode.so b/bin/lib32/libode.so index 47991ae..35cb027 100755 Binary files a/bin/lib32/libode.so and b/bin/lib32/libode.so differ diff --git a/bin/lib64/libode-x86_64.so b/bin/lib64/libode-x86_64.so index 17502c5..663ff5d 100755 Binary files a/bin/lib64/libode-x86_64.so and b/bin/lib64/libode-x86_64.so differ -- cgit v1.1 From fc4212bc81150cb12aca1d209a089eb8febce5d5 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 29 Jul 2017 17:54:18 +0100 Subject: mantis 8222 --- OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs index 7f56b6f..f4ba02f 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs @@ -1827,7 +1827,7 @@ namespace OpenSim.Framework.Servers.HttpServer Hashtable headerdata = (Hashtable)responsedata["headers"]; foreach (string header in headerdata.Keys) - response.AddHeader(header, (string)headerdata[header]); + response.AddHeader(header, headerdata[header].ToString()); } byte[] buffer; -- cgit v1.1 From cf855c3842aa2e223ad84eec8f9d8cfdc36746f9 Mon Sep 17 00:00:00 2001 From: Kevin Cozens Date: Sun, 30 Jul 2017 12:24:51 -0400 Subject: Corrected index number in ErrorFormat based Exception message --- OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs index a367426..8d4e561 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs @@ -455,7 +455,7 @@ namespace OpenSim.Region.ClientStack.Linden catch (Exception e) { m_log.ErrorFormat( - "[INVENTORY]: Failed to process queued inventory request {0} for {1}. Exception {3}", + "[INVENTORY]: Failed to process queued inventory request {0} for {1}. Exception {2}", poolreq.reqID, poolreq.presence != null ? poolreq.presence.Name : "unknown", e); } } -- cgit v1.1 From 1830387840796547c1c09aba38d0c850ba5f7d48 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 2 Aug 2017 03:47:53 +0100 Subject: Oops fix also default UseMeshiesPhysicsMesh also on ubOde --- OpenSim/Region/PhysicsModules/ubOdeMeshing/Meshmerizer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Region/PhysicsModules/ubOdeMeshing/Meshmerizer.cs b/OpenSim/Region/PhysicsModules/ubOdeMeshing/Meshmerizer.cs index 1233d48..a2a3f79 100644 --- a/OpenSim/Region/PhysicsModules/ubOdeMeshing/Meshmerizer.cs +++ b/OpenSim/Region/PhysicsModules/ubOdeMeshing/Meshmerizer.cs @@ -69,7 +69,7 @@ namespace OpenSim.Region.PhysicsModule.ubODEMeshing // const string baseDir = "rawFiles"; private const string baseDir = null; //"rawFiles"; - private bool useMeshiesPhysicsMesh = false; + private bool useMeshiesPhysicsMesh = true; private bool doConvexPrims = true; private bool doConvexSculpts = true; -- cgit v1.1 From f658b68181c6161520cfdf9537005c7415ea545a Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 3 Aug 2017 17:59:30 +0100 Subject: add a few locks --- .../Inventory/HGInventoryBroker.cs | 24 ++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs index 5efdd9b..7a4f981 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs @@ -250,7 +250,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory if (inventoryURL != null && inventoryURL != string.Empty) { inventoryURL = inventoryURL.Trim(new char[] { '/' }); - m_InventoryURLs[userID] = inventoryURL; + lock (m_InventoryURLs) + m_InventoryURLs[userID] = inventoryURL; m_log.DebugFormat("[HG INVENTORY CONNECTOR]: Added {0} to the cache of inventory URLs", inventoryURL); return; } @@ -268,35 +269,42 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory if (!string.IsNullOrEmpty(inventoryURL)) { inventoryURL = inventoryURL.Trim(new char[] { '/' }); - m_InventoryURLs.Add(userID, inventoryURL); + lock (m_InventoryURLs) + m_InventoryURLs[userID] = inventoryURL; m_log.DebugFormat("[HG INVENTORY CONNECTOR]: Added {0} to the cache of inventory URLs", inventoryURL); } - } - } } private void DropInventoryServiceURL(UUID userID) { lock (m_InventoryURLs) + { if (m_InventoryURLs.ContainsKey(userID)) { string url = m_InventoryURLs[userID]; m_InventoryURLs.Remove(userID); m_log.DebugFormat("[HG INVENTORY CONNECTOR]: Removed {0} from the cache of inventory URLs", url); } + } } public string GetInventoryServiceURL(UUID userID) { - if (m_InventoryURLs.ContainsKey(userID)) - return m_InventoryURLs[userID]; + lock (m_InventoryURLs) + { + if (m_InventoryURLs.ContainsKey(userID)) + return m_InventoryURLs[userID]; + } CacheInventoryServiceURL(userID); - if (m_InventoryURLs.ContainsKey(userID)) - return m_InventoryURLs[userID]; + lock (m_InventoryURLs) + { + if (m_InventoryURLs.ContainsKey(userID)) + return m_InventoryURLs[userID]; + } return null; //it means that the methods should forward to local grid's inventory -- cgit v1.1 From a4e7ab6fcfed3e40bf322010550671e480a363c9 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 3 Aug 2017 18:09:26 +0100 Subject: avoid a null ref --- OpenSim/Services/HypergridService/GatekeeperService.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/OpenSim/Services/HypergridService/GatekeeperService.cs b/OpenSim/Services/HypergridService/GatekeeperService.cs index 8e3cf0e..5c6abd2 100644 --- a/OpenSim/Services/HypergridService/GatekeeperService.cs +++ b/OpenSim/Services/HypergridService/GatekeeperService.cs @@ -395,9 +395,10 @@ namespace OpenSim.Services.HypergridService { if(SendAgentGodKillToRegion(UUID.Zero, agentID, guinfo)) { - m_log.InfoFormat( - "[GATEKEEPER SERVICE]: Login failed for {0} {1}, reason: already logged in", - account.FirstName, account.LastName); + if(account != null) + m_log.InfoFormat( + "[GATEKEEPER SERVICE]: Login failed for {0} {1}, reason: already logged in", + account.FirstName, account.LastName); reason = "You appear to be already logged in on the destination grid " + "Please wait a a minute or two and retry. " + "If this takes longer than a few minutes please contact the grid owner."; -- cgit v1.1 From e9b79719291567b92a9d5111b5939df20137469c Mon Sep 17 00:00:00 2001 From: Kevin Cozens Date: Sat, 5 Aug 2017 14:52:56 -0400 Subject: Remove profile from basic configuration --- bin/config-include/GridHypergrid.ini | 3 --- 1 file changed, 3 deletions(-) diff --git a/bin/config-include/GridHypergrid.ini b/bin/config-include/GridHypergrid.ini index 68f2eb1..709c462 100644 --- a/bin/config-include/GridHypergrid.ini +++ b/bin/config-include/GridHypergrid.ini @@ -36,9 +36,6 @@ SimulationServiceInConnector = true LibraryModule = true -[Profile] - Module = "BasicProfileModule" - [SimulationDataStore] LocalServiceModule = "OpenSim.Services.SimulationService.dll:SimulationDataService" -- cgit v1.1 From 2afd158b1de8668fe9bf1db46b885fd954c61a24 Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Wed, 9 Aug 2017 13:43:44 -0700 Subject: Update BulletSim with Bullet V2.86. Should be no functional changes. --- bin/lib32/BulletSim.dll | Bin 1338880 -> 1483776 bytes bin/lib32/libBulletSim.so | Bin 2312132 -> 2367998 bytes bin/lib64/BulletSim.dll | Bin 1547264 -> 1651712 bytes bin/lib64/libBulletSim.so | Bin 2475617 -> 2535591 bytes 4 files changed, 0 insertions(+), 0 deletions(-) diff --git a/bin/lib32/BulletSim.dll b/bin/lib32/BulletSim.dll index 6d006bf..71e1b16 100755 Binary files a/bin/lib32/BulletSim.dll and b/bin/lib32/BulletSim.dll differ diff --git a/bin/lib32/libBulletSim.so b/bin/lib32/libBulletSim.so index ec29f58..b623929 100755 Binary files a/bin/lib32/libBulletSim.so and b/bin/lib32/libBulletSim.so differ diff --git a/bin/lib64/BulletSim.dll b/bin/lib64/BulletSim.dll index 82774a2..85834b0 100755 Binary files a/bin/lib64/BulletSim.dll and b/bin/lib64/BulletSim.dll differ diff --git a/bin/lib64/libBulletSim.so b/bin/lib64/libBulletSim.so index 8b09275..d78fd58 100755 Binary files a/bin/lib64/libBulletSim.so and b/bin/lib64/libBulletSim.so differ -- cgit v1.1 From 82e2e1e00c13f0dec8dc5d6f19d9a0595a02faac Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sun, 13 Aug 2017 06:04:39 +0100 Subject: change locking on sop updates --- .../Region/Framework/Scenes/SceneObjectGroup.cs | 6 +- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 349 +++++++++++---------- 2 files changed, 186 insertions(+), 169 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 6f46a92..f0364db 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -657,6 +657,9 @@ namespace OpenSim.Region.Framework.Scenes } } + if(!m_scene.IsRunning) + return sog; + if (root.KeyframeMotion != null) root.KeyframeMotion.StartCrossingCheck(); @@ -3018,12 +3021,13 @@ namespace OpenSim.Region.Framework.Scenes // If we somehow got here to updating the SOG and its root part is not scheduled for update, // check to see if the physical position or rotation warrant an update. +/* if (m_rootPart.UpdateFlag == UpdateRequired.NONE) { // rootpart SendScheduledUpdates will check if a update is needed m_rootPart.UpdateFlag = UpdateRequired.TERSE; } - +*/ if (IsAttachment) { ScenePresence sp = m_scene.GetScenePresence(AttachedAvatar); diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 0bf3c1d..0370c41 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -238,12 +238,6 @@ namespace OpenSim.Region.Framework.Scenes /// public bool SoundQueueing { get; set; } - public uint TimeStampFull; - - public uint TimeStampLastActivity; // Will be used for AutoReturn - - public uint TimeStampTerse; - [XmlIgnore] public Quaternion AttachRotation = Quaternion.Identity; @@ -1219,6 +1213,7 @@ namespace OpenSim.Region.Framework.Scenes } public UpdateRequired UpdateFlag { get; set; } + private object UpdateFlagLock = new object(); /// /// Used for media on a prim. @@ -1641,8 +1636,10 @@ namespace OpenSim.Region.Framework.Scenes PhysActor.SetMaterial((int)value); } if(ParentGroup != null) + { ParentGroup.HasGroupChanged = true; - ScheduleFullUpdateIfNone(); + ScheduleFullUpdate(); + } } } } @@ -1730,7 +1727,12 @@ namespace OpenSim.Region.Framework.Scenes public byte PhysicsShapeType { - get { return m_physicsShapeType; } + get + { +// if (PhysActor != null) +// m_physicsShapeType = PhysActor.PhysicsShapeType; + return m_physicsShapeType; + } set { byte oldv = m_physicsShapeType; @@ -1781,10 +1783,12 @@ namespace OpenSim.Region.Framework.Scenes { m_density = value; - ScheduleFullUpdateIfNone(); if (ParentGroup != null) + { ParentGroup.HasGroupChanged = true; + ScheduleFullUpdate(); + } PhysicsActor pa = PhysActor; if (pa != null) @@ -1802,10 +1806,11 @@ namespace OpenSim.Region.Framework.Scenes { m_gravitymod = value; - ScheduleFullUpdateIfNone(); - if (ParentGroup != null) + { ParentGroup.HasGroupChanged = true; + ScheduleFullUpdate(); + } PhysicsActor pa = PhysActor; if (pa != null) @@ -1823,10 +1828,11 @@ namespace OpenSim.Region.Framework.Scenes { m_friction = value; - ScheduleFullUpdateIfNone(); - if (ParentGroup != null) + { ParentGroup.HasGroupChanged = true; + ScheduleFullUpdate(); + } PhysicsActor pa = PhysActor; if (pa != null) @@ -1844,10 +1850,11 @@ namespace OpenSim.Region.Framework.Scenes { m_bounce = value; - ScheduleFullUpdateIfNone(); - if (ParentGroup != null) + { ParentGroup.HasGroupChanged = true; + ScheduleFullUpdate(); + } PhysicsActor pa = PhysActor; if (pa != null) @@ -1876,7 +1883,8 @@ namespace OpenSim.Region.Framework.Scenes /// public void ClearUpdateSchedule() { - UpdateFlag = UpdateRequired.NONE; + lock(UpdateFlagLock) + UpdateFlag = UpdateRequired.NONE; } /// @@ -3239,17 +3247,6 @@ namespace OpenSim.Region.Framework.Scenes APIDActive = false; } - public void ScheduleFullUpdateIfNone() - { - if (ParentGroup == null) - return; - -// ??? ParentGroup.HasGroupChanged = true; - - if (UpdateFlag != UpdateRequired.FULL) - ScheduleFullUpdate(); - } - /// /// Schedules this prim for a full update /// @@ -3260,30 +3257,21 @@ namespace OpenSim.Region.Framework.Scenes if (ParentGroup == null) return; - ParentGroup.QueueForUpdateCheck(); - - int timeNow = Util.UnixTimeSinceEpoch(); - - // If multiple updates are scheduled on the same second, we still need to perform all of them - // So we'll force the issue by bumping up the timestamp so that later processing sees these need - // to be performed. - if (timeNow <= TimeStampFull) + lock(UpdateFlagLock) { - TimeStampFull += 1; - } - else - { - TimeStampFull = (uint)timeNow; - } - - UpdateFlag = UpdateRequired.FULL; + ParentGroup.QueueForUpdateCheck(); // just in case + if(UpdateFlag != UpdateRequired.FULL) + { + UpdateFlag = UpdateRequired.FULL; - // m_log.DebugFormat( - // "[SCENE OBJECT PART]: Scheduling full update for {0}, {1} at {2}", - // UUID, Name, TimeStampFull); + // m_log.DebugFormat( + // "[SCENE OBJECT PART]: Scheduling full update for {0}, {1} at {2}", + // UUID, Name, TimeStampFull); - if (ParentGroup.Scene != null) - ParentGroup.Scene.EventManager.TriggerSceneObjectPartUpdated(this, true); + if (ParentGroup.Scene != null) + ParentGroup.Scene.EventManager.TriggerSceneObjectPartUpdated(this, true); + } + } } /// @@ -3304,21 +3292,23 @@ namespace OpenSim.Region.Framework.Scenes return; } - if (UpdateFlag == UpdateRequired.NONE) + lock(UpdateFlagLock) { - ParentGroup.HasGroupChanged = true; - ParentGroup.QueueForUpdateCheck(); + if (UpdateFlag == UpdateRequired.NONE) + { + ParentGroup.HasGroupChanged = true; + ParentGroup.QueueForUpdateCheck(); - TimeStampTerse = (uint) Util.UnixTimeSinceEpoch(); - UpdateFlag = UpdateRequired.TERSE; + UpdateFlag = UpdateRequired.TERSE; - // m_log.DebugFormat( - // "[SCENE OBJECT PART]: Scheduling terse update for {0}, {1} at {2}", - // UUID, Name, TimeStampTerse); - } + // m_log.DebugFormat( + // "[SCENE OBJECT PART]: Scheduling terse update for {0}, {1} at {2}", + // UUID, Name, TimeStampTerse); + } - if (ParentGroup.Scene != null) - ParentGroup.Scene.EventManager.TriggerSceneObjectPartUpdated(this, false); + if (ParentGroup.Scene != null) + ParentGroup.Scene.EventManager.TriggerSceneObjectPartUpdated(this, false); + } } public void ScriptSetPhysicsStatus(bool UsePhysics) @@ -3362,12 +3352,15 @@ namespace OpenSim.Region.Framework.Scenes return; // Update the "last" values - m_lastPosition = AbsolutePosition; - m_lastRotation = RotationOffset; - m_lastVelocity = Velocity; - m_lastAcceleration = Acceleration; - m_lastAngularVelocity = AngularVelocity; - m_lastUpdateSentTime = Util.GetTimeStampMS(); + lock(UpdateFlagLock) + { + m_lastPosition = AbsolutePosition; + m_lastRotation = RotationOffset; + m_lastVelocity = Velocity; + m_lastAcceleration = Acceleration; + m_lastAngularVelocity = AngularVelocity; + m_lastUpdateSentTime = Util.GetTimeStampMS(); + } ParentGroup.Scene.ForEachScenePresence(delegate(ScenePresence avatar) { @@ -3381,12 +3374,15 @@ namespace OpenSim.Region.Framework.Scenes return; // Update the "last" values - m_lastPosition = AbsolutePosition; - m_lastRotation = RotationOffset; - m_lastVelocity = Velocity; - m_lastAcceleration = Acceleration; - m_lastAngularVelocity = AngularVelocity; - m_lastUpdateSentTime = Util.GetTimeStampMS(); + lock(UpdateFlagLock) + { + m_lastPosition = AbsolutePosition; + m_lastRotation = RotationOffset; + m_lastVelocity = Velocity; + m_lastAcceleration = Acceleration; + m_lastAngularVelocity = AngularVelocity; + m_lastUpdateSentTime = Util.GetTimeStampMS(); + } if (ParentGroup.IsAttachment) { @@ -3442,108 +3438,118 @@ namespace OpenSim.Region.Framework.Scenes /// Tell all the prims which have had updates scheduled /// public void SendScheduledUpdates() - { - switch (UpdateFlag) + { + UpdateRequired currentUpdate; + lock(UpdateFlagLock) + { + currentUpdate = UpdateFlag; + ClearUpdateSchedule(); + } + + switch (currentUpdate) { case UpdateRequired.NONE: - ClearUpdateSchedule(); break; case UpdateRequired.TERSE: - - ClearUpdateSchedule(); bool needupdate = true; - double now = Util.GetTimeStampMS(); - Vector3 curvel = Velocity; - Vector3 curacc = Acceleration; - Vector3 angvel = AngularVelocity; - - while(true) // just to avoid ugly goto + lock(UpdateFlagLock) { - double elapsed = now - m_lastUpdateSentTime; - if (elapsed > TIME_MS_TOLERANCE) - break; + double now = Util.GetTimeStampMS(); + Vector3 curvel = Velocity; + Vector3 curacc = Acceleration; + Vector3 angvel = AngularVelocity; - if( Math.Abs(curacc.X - m_lastAcceleration.X) > VELOCITY_TOLERANCE || - Math.Abs(curacc.Y - m_lastAcceleration.Y) > VELOCITY_TOLERANCE || - Math.Abs(curacc.Z - m_lastAcceleration.Z) > VELOCITY_TOLERANCE) - break; + while(true) // just to avoid ugly goto + { + double elapsed = now - m_lastUpdateSentTime; + if (elapsed > TIME_MS_TOLERANCE) + break; - // velocity change is also direction not only norm) - if( Math.Abs(curvel.X - m_lastVelocity.X) > VELOCITY_TOLERANCE || - Math.Abs(curvel.Y - m_lastVelocity.Y) > VELOCITY_TOLERANCE || - Math.Abs(curvel.Z - m_lastVelocity.Z) > VELOCITY_TOLERANCE) - break; - - float vx = Math.Abs(curvel.X); - if(vx > 128.0) - break; - float vy = Math.Abs(curvel.Y); - if(vy > 128.0) - break; - float vz = Math.Abs(curvel.Z); - if(vz > 128.0) - break; + if( Math.Abs(curacc.X - m_lastAcceleration.X) > VELOCITY_TOLERANCE || + Math.Abs(curacc.Y - m_lastAcceleration.Y) > VELOCITY_TOLERANCE || + Math.Abs(curacc.Z - m_lastAcceleration.Z) > VELOCITY_TOLERANCE) + break; - if ( - vx < VELOCITY_TOLERANCE && - vy < VELOCITY_TOLERANCE && - vz < VELOCITY_TOLERANCE - ) - { - if(!AbsolutePosition.ApproxEquals(m_lastPosition, POSITION_TOLERANCE)) + // velocity change is also direction not only norm) + if( Math.Abs(curvel.X - m_lastVelocity.X) > VELOCITY_TOLERANCE || + Math.Abs(curvel.Y - m_lastVelocity.Y) > VELOCITY_TOLERANCE || + Math.Abs(curvel.Z - m_lastVelocity.Z) > VELOCITY_TOLERANCE) break; + + float vx = Math.Abs(curvel.X); + if(vx > 128.0) + break; + float vy = Math.Abs(curvel.Y); + if(vy > 128.0) + break; + float vz = Math.Abs(curvel.Z); + if(vz > 128.0) + break; + + if ( + vx < VELOCITY_TOLERANCE && + vy < VELOCITY_TOLERANCE && + vz < VELOCITY_TOLERANCE + ) + { + if(!AbsolutePosition.ApproxEquals(m_lastPosition, POSITION_TOLERANCE)) + break; - if (vx < 1e-4 && - vy < 1e-4 && - vz < 1e-4 && - ( - Math.Abs(m_lastVelocity.X) > 1e-4 || - Math.Abs(m_lastVelocity.Y) > 1e-4 || - Math.Abs(m_lastVelocity.Z) > 1e-4 - )) + if (vx < 1e-4 && + vy < 1e-4 && + vz < 1e-4 && + ( + Math.Abs(m_lastVelocity.X) > 1e-4 || + Math.Abs(m_lastVelocity.Y) > 1e-4 || + Math.Abs(m_lastVelocity.Z) > 1e-4 + )) + break; + } + + if( Math.Abs(angvel.X - m_lastAngularVelocity.X) > VELOCITY_TOLERANCE || + Math.Abs(angvel.Y - m_lastAngularVelocity.Y) > VELOCITY_TOLERANCE || + Math.Abs(angvel.Z - m_lastAngularVelocity.Z) > VELOCITY_TOLERANCE) break; - } - if( Math.Abs(angvel.X - m_lastAngularVelocity.X) > VELOCITY_TOLERANCE || - Math.Abs(angvel.Y - m_lastAngularVelocity.Y) > VELOCITY_TOLERANCE || - Math.Abs(angvel.Z - m_lastAngularVelocity.Z) > VELOCITY_TOLERANCE) - break; + // viewer interpolators have a limit of 128m/s + float ax = Math.Abs(angvel.X); + if(ax > 64.0) + break; + float ay = Math.Abs(angvel.Y); + if(ay > 64.0) + break; + float az = Math.Abs(angvel.Z); + if(az > 64.0) + break; - // viewer interpolators have a limit of 128m/s - float ax = Math.Abs(angvel.X); - if(ax > 64.0) - break; - float ay = Math.Abs(angvel.Y); - if(ay > 64.0) - break; - float az = Math.Abs(angvel.Z); - if(az > 64.0) + if ( + ax < VELOCITY_TOLERANCE && + ay < VELOCITY_TOLERANCE && + az < VELOCITY_TOLERANCE && + !RotationOffset.ApproxEquals(m_lastRotation, ROTATION_TOLERANCE) + ) + break; + + needupdate = false; break; + } - if ( - ax < VELOCITY_TOLERANCE && - ay < VELOCITY_TOLERANCE && - az < VELOCITY_TOLERANCE && - !RotationOffset.ApproxEquals(m_lastRotation, ROTATION_TOLERANCE) - ) - break; + if(needupdate) + { - needupdate = false; - break; + // Update the "last" values + m_lastPosition = AbsolutePosition; + m_lastRotation = RotationOffset; + m_lastVelocity = curvel; + m_lastAcceleration = curacc; + m_lastAngularVelocity = angvel; + m_lastUpdateSentTime = now; + } } if(needupdate) { - - // Update the "last" values - m_lastPosition = AbsolutePosition; - m_lastRotation = RotationOffset; - m_lastVelocity = curvel; - m_lastAcceleration = curacc; - m_lastAngularVelocity = angvel; - m_lastUpdateSentTime = now; - ParentGroup.Scene.ForEachClient(delegate(IClientAPI client) { SendTerseUpdateToClient(client); @@ -3552,7 +3558,6 @@ namespace OpenSim.Region.Framework.Scenes break; case UpdateRequired.FULL: - ClearUpdateSchedule(); SendFullUpdateToAllClientsInternal(); break; } @@ -3567,15 +3572,19 @@ namespace OpenSim.Region.Framework.Scenes if (ParentGroup == null || ParentGroup.Scene == null) return; - ClearUpdateSchedule(); + lock(UpdateFlagLock) + { + if(UpdateFlag != UpdateRequired.NONE) + return; - // Update the "last" values - m_lastPosition = AbsolutePosition; - m_lastRotation = RotationOffset; - m_lastVelocity = Velocity; - m_lastAcceleration = Acceleration; - m_lastAngularVelocity = AngularVelocity; - m_lastUpdateSentTime = Util.GetTimeStampMS(); + // Update the "last" values + m_lastPosition = AbsolutePosition; + m_lastRotation = RotationOffset; + m_lastVelocity = Velocity; + m_lastAcceleration = Acceleration; + m_lastAngularVelocity = AngularVelocity; + m_lastUpdateSentTime = Util.GetTimeStampMS(); + } ParentGroup.Scene.ForEachClient(delegate(IClientAPI client) { @@ -3588,15 +3597,19 @@ namespace OpenSim.Region.Framework.Scenes if (ParentGroup == null || ParentGroup.Scene == null) return; - ClearUpdateSchedule(); + lock(UpdateFlagLock) + { + if(UpdateFlag != UpdateRequired.NONE) + return; - // Update the "last" values - m_lastPosition = AbsolutePosition; - m_lastRotation = RotationOffset; - m_lastVelocity = Velocity; - m_lastAcceleration = Acceleration; - m_lastAngularVelocity = AngularVelocity; - m_lastUpdateSentTime = Util.GetTimeStampMS(); + // Update the "last" values + m_lastPosition = AbsolutePosition; + m_lastRotation = RotationOffset; + m_lastVelocity = Velocity; + m_lastAcceleration = Acceleration; + m_lastAngularVelocity = AngularVelocity; + m_lastUpdateSentTime = Util.GetTimeStampMS(); + } if (ParentGroup.IsAttachment) { -- cgit v1.1 From 1dbf3215b067d1f001fc2920db79342ec811c157 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sun, 13 Aug 2017 06:34:52 +0100 Subject: jenkins tests still don't set scene.IsRunning --- OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index f0364db..53b7ced 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -657,8 +657,8 @@ namespace OpenSim.Region.Framework.Scenes } } - if(!m_scene.IsRunning) - return sog; +// if(!m_scene.IsRunning) +// return sog; if (root.KeyframeMotion != null) root.KeyframeMotion.StartCrossingCheck(); -- cgit v1.1 From 3052c7080a5978b78774be1b846d7a881fe3e5f0 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 14 Aug 2017 14:48:38 -0700 Subject: Added comment just to trigger jenkins --- OpenSim/Tests/Permissions/IndirectTransferTests.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/OpenSim/Tests/Permissions/IndirectTransferTests.cs b/OpenSim/Tests/Permissions/IndirectTransferTests.cs index 7d8027f..d5a36cc 100644 --- a/OpenSim/Tests/Permissions/IndirectTransferTests.cs +++ b/OpenSim/Tests/Permissions/IndirectTransferTests.cs @@ -74,6 +74,7 @@ namespace OpenSim.Tests.Permissions // Try A2 takes copies of objects that cannot be copied. for (int i = 0; i < 6; i++) TakeOneBox(Common.TheScene.GetSceneObjectGroups(), names[i], perms[i]); + // Ad-hoc. Enough time to let the take work. Thread.Sleep(5000); List items = Common.TheScene.InventoryService.GetFolderItems(Common.TheAvatars[1].UUID, objsFolder.ID); -- cgit v1.1 From af5573728a1c139607fe189d5a532db1e16d0f8b Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 14 Aug 2017 15:01:19 -0700 Subject: Another comment for testing jenkins --- OpenSim/Tests/Permissions/IndirectTransferTests.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/OpenSim/Tests/Permissions/IndirectTransferTests.cs b/OpenSim/Tests/Permissions/IndirectTransferTests.cs index d5a36cc..b2c6e76 100644 --- a/OpenSim/Tests/Permissions/IndirectTransferTests.cs +++ b/OpenSim/Tests/Permissions/IndirectTransferTests.cs @@ -87,6 +87,7 @@ namespace OpenSim.Tests.Permissions // Try A2 takes copies of objects that can be copied. for (int i = 0; i < 6; i++) TakeOneBox(Common.TheScene.GetSceneObjectGroups(), names[i], perms[i]); + // Ad-hoc. Enough time to let the take work. Thread.Sleep(5000); items = Common.TheScene.InventoryService.GetFolderItems(Common.TheAvatars[1].UUID, objsFolder.ID); -- cgit v1.1 From 5e9b09084557a5a80f838786eef7f37d3fa0e010 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 14 Aug 2017 15:13:32 -0700 Subject: Listed new testable dll in THIS file --- .nant/local.include | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.nant/local.include b/.nant/local.include index 5ff9644..7a1f1c6 100644 --- a/.nant/local.include +++ b/.nant/local.include @@ -145,7 +145,12 @@ - + + + + + + @@ -271,6 +276,7 @@ + -- cgit v1.1 From ea448d9d6b7c2fdae91b23e440c9c0c3b3fff552 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 14 Aug 2017 15:26:06 -0700 Subject: Forgot to add this too (nant auto tests) --- .nant/local.include | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.nant/local.include b/.nant/local.include index 7a1f1c6..2bc2be6 100644 --- a/.nant/local.include +++ b/.nant/local.include @@ -265,6 +265,11 @@ + + + + + -- cgit v1.1 From 856d218f99e30868789f4f765f1113554d02155a Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 14 Aug 2017 15:58:42 -0700 Subject: Comment that test dll for now. It's making jenkins fail. --- .nant/local.include | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.nant/local.include b/.nant/local.include index 2bc2be6..c4a056c 100644 --- a/.nant/local.include +++ b/.nant/local.include @@ -145,11 +145,13 @@ + + @@ -265,11 +267,13 @@ + + @@ -281,7 +285,7 @@ - + -- cgit v1.1 From 26a4c5ff85562cde2fd84286d3d486f868c8ce55 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 14 Aug 2017 16:15:08 -0700 Subject: Comment to trigger jenkins --- OpenSim/Tests/Permissions/IndirectTransferTests.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/OpenSim/Tests/Permissions/IndirectTransferTests.cs b/OpenSim/Tests/Permissions/IndirectTransferTests.cs index b2c6e76..66a228a 100644 --- a/OpenSim/Tests/Permissions/IndirectTransferTests.cs +++ b/OpenSim/Tests/Permissions/IndirectTransferTests.cs @@ -103,6 +103,7 @@ namespace OpenSim.Tests.Permissions private void TakeOneBox(List objs, string name, PermissionMask mask) { + // Find the object inworld SceneObjectGroup box = objs.Find(sog => sog.Name == name && sog.OwnerID == Common.TheAvatars[0].UUID); Assert.That(box, Is.Not.Null, name); -- cgit v1.1 From 40f4b30361d10db4ac35bcec5e172e8f6ae012c4 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 14 Aug 2017 16:33:21 -0700 Subject: Strengthen the tests for the possibility that SetUpFixture does not run in the beginning. --- .nant/local.include | 6 +----- OpenSim/Tests/Permissions/DirectTransferTests.cs | 7 +++++++ OpenSim/Tests/Permissions/IndirectTransferTests.cs | 6 ++++++ 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/.nant/local.include b/.nant/local.include index c4a056c..be79d1c 100644 --- a/.nant/local.include +++ b/.nant/local.include @@ -145,12 +145,10 @@ - @@ -267,12 +265,10 @@ - @@ -285,7 +281,7 @@ - + diff --git a/OpenSim/Tests/Permissions/DirectTransferTests.cs b/OpenSim/Tests/Permissions/DirectTransferTests.cs index c68bbdf..c3dfa6c 100644 --- a/OpenSim/Tests/Permissions/DirectTransferTests.cs +++ b/OpenSim/Tests/Permissions/DirectTransferTests.cs @@ -44,6 +44,13 @@ namespace OpenSim.Tests.Permissions [SetUp] public void SetUp() { + // In case we're dealing with some older version of nunit + if (Common.TheInstance == null) + { + Common c = new Common(); + c.SetUp(); + } + Common.TheInstance.DeleteObjectsFolders(); } diff --git a/OpenSim/Tests/Permissions/IndirectTransferTests.cs b/OpenSim/Tests/Permissions/IndirectTransferTests.cs index 66a228a..e33332a 100644 --- a/OpenSim/Tests/Permissions/IndirectTransferTests.cs +++ b/OpenSim/Tests/Permissions/IndirectTransferTests.cs @@ -46,6 +46,12 @@ namespace OpenSim.Tests.Permissions [SetUp] public void SetUp() { + // In case we're dealing with some older version of nunit + if (Common.TheInstance == null) + { + Common c = new Common(); + c.SetUp(); + } Common.TheInstance.DeleteObjectsFolders(); } -- cgit v1.1 From 6a0b7a607f13fcee447c9d10224d5ea77db4f355 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 14 Aug 2017 16:40:36 -0700 Subject: This is the correct work around. Jenkins is confuzzled. --- OpenSim/Tests/Permissions/DirectTransferTests.cs | 4 ++-- OpenSim/Tests/Permissions/IndirectTransferTests.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/OpenSim/Tests/Permissions/DirectTransferTests.cs b/OpenSim/Tests/Permissions/DirectTransferTests.cs index c3dfa6c..0f251db 100644 --- a/OpenSim/Tests/Permissions/DirectTransferTests.cs +++ b/OpenSim/Tests/Permissions/DirectTransferTests.cs @@ -47,8 +47,8 @@ namespace OpenSim.Tests.Permissions // In case we're dealing with some older version of nunit if (Common.TheInstance == null) { - Common c = new Common(); - c.SetUp(); + Common.TheInstance = new Common(); + Common.TheInstance.SetUp(); } Common.TheInstance.DeleteObjectsFolders(); diff --git a/OpenSim/Tests/Permissions/IndirectTransferTests.cs b/OpenSim/Tests/Permissions/IndirectTransferTests.cs index e33332a..fb96b8b 100644 --- a/OpenSim/Tests/Permissions/IndirectTransferTests.cs +++ b/OpenSim/Tests/Permissions/IndirectTransferTests.cs @@ -49,8 +49,8 @@ namespace OpenSim.Tests.Permissions // In case we're dealing with some older version of nunit if (Common.TheInstance == null) { - Common c = new Common(); - c.SetUp(); + Common.TheInstance = new Common(); + Common.TheInstance.SetUp(); } Common.TheInstance.DeleteObjectsFolders(); } -- cgit v1.1 From 8b6557e377f7bac1bdb38f3e6dd22c797417d09c Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 14 Aug 2017 16:49:11 -0700 Subject: Let's try giving Common a default constructor instead of the workaround --- OpenSim/Tests/Permissions/Common.cs | 4 ++++ OpenSim/Tests/Permissions/DirectTransferTests.cs | 7 ------- OpenSim/Tests/Permissions/IndirectTransferTests.cs | 6 ------ 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/OpenSim/Tests/Permissions/Common.cs b/OpenSim/Tests/Permissions/Common.cs index 4ecce38..cf4d2bd 100644 --- a/OpenSim/Tests/Permissions/Common.cs +++ b/OpenSim/Tests/Permissions/Common.cs @@ -60,6 +60,10 @@ namespace OpenSim.Tests.Permissions private TestScene m_Scene; private ScenePresence[] m_Avatars = new ScenePresence[3]; + public Common() + { + } + [SetUp] public override void SetUp() { diff --git a/OpenSim/Tests/Permissions/DirectTransferTests.cs b/OpenSim/Tests/Permissions/DirectTransferTests.cs index 0f251db..c68bbdf 100644 --- a/OpenSim/Tests/Permissions/DirectTransferTests.cs +++ b/OpenSim/Tests/Permissions/DirectTransferTests.cs @@ -44,13 +44,6 @@ namespace OpenSim.Tests.Permissions [SetUp] public void SetUp() { - // In case we're dealing with some older version of nunit - if (Common.TheInstance == null) - { - Common.TheInstance = new Common(); - Common.TheInstance.SetUp(); - } - Common.TheInstance.DeleteObjectsFolders(); } diff --git a/OpenSim/Tests/Permissions/IndirectTransferTests.cs b/OpenSim/Tests/Permissions/IndirectTransferTests.cs index fb96b8b..66a228a 100644 --- a/OpenSim/Tests/Permissions/IndirectTransferTests.cs +++ b/OpenSim/Tests/Permissions/IndirectTransferTests.cs @@ -46,12 +46,6 @@ namespace OpenSim.Tests.Permissions [SetUp] public void SetUp() { - // In case we're dealing with some older version of nunit - if (Common.TheInstance == null) - { - Common.TheInstance = new Common(); - Common.TheInstance.SetUp(); - } Common.TheInstance.DeleteObjectsFolders(); } -- cgit v1.1 From eb837defdf7d9f260603fe400b3a482258605f43 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 14 Aug 2017 16:55:50 -0700 Subject: Revert "Let's try giving Common a default constructor instead of the workaround" This reverts commit 8b6557e377f7bac1bdb38f3e6dd22c797417d09c. --- OpenSim/Tests/Permissions/Common.cs | 4 ---- OpenSim/Tests/Permissions/DirectTransferTests.cs | 7 +++++++ OpenSim/Tests/Permissions/IndirectTransferTests.cs | 6 ++++++ 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/OpenSim/Tests/Permissions/Common.cs b/OpenSim/Tests/Permissions/Common.cs index cf4d2bd..4ecce38 100644 --- a/OpenSim/Tests/Permissions/Common.cs +++ b/OpenSim/Tests/Permissions/Common.cs @@ -60,10 +60,6 @@ namespace OpenSim.Tests.Permissions private TestScene m_Scene; private ScenePresence[] m_Avatars = new ScenePresence[3]; - public Common() - { - } - [SetUp] public override void SetUp() { diff --git a/OpenSim/Tests/Permissions/DirectTransferTests.cs b/OpenSim/Tests/Permissions/DirectTransferTests.cs index c68bbdf..0f251db 100644 --- a/OpenSim/Tests/Permissions/DirectTransferTests.cs +++ b/OpenSim/Tests/Permissions/DirectTransferTests.cs @@ -44,6 +44,13 @@ namespace OpenSim.Tests.Permissions [SetUp] public void SetUp() { + // In case we're dealing with some older version of nunit + if (Common.TheInstance == null) + { + Common.TheInstance = new Common(); + Common.TheInstance.SetUp(); + } + Common.TheInstance.DeleteObjectsFolders(); } diff --git a/OpenSim/Tests/Permissions/IndirectTransferTests.cs b/OpenSim/Tests/Permissions/IndirectTransferTests.cs index 66a228a..fb96b8b 100644 --- a/OpenSim/Tests/Permissions/IndirectTransferTests.cs +++ b/OpenSim/Tests/Permissions/IndirectTransferTests.cs @@ -46,6 +46,12 @@ namespace OpenSim.Tests.Permissions [SetUp] public void SetUp() { + // In case we're dealing with some older version of nunit + if (Common.TheInstance == null) + { + Common.TheInstance = new Common(); + Common.TheInstance.SetUp(); + } Common.TheInstance.DeleteObjectsFolders(); } -- cgit v1.1 From 76c29cb106b54bcb8a4c6bdb6f37a80676b17892 Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Mon, 14 Aug 2017 18:46:16 -0700 Subject: Update BulletSim with corrected collision computations. A fix for Mantis 8010. --- bin/lib32/BulletSim.dll | Bin 1483776 -> 1483776 bytes bin/lib32/libBulletSim.so | Bin 2367998 -> 2368603 bytes bin/lib64/BulletSim.dll | Bin 1651712 -> 1651712 bytes bin/lib64/libBulletSim.so | Bin 2535591 -> 2536668 bytes 4 files changed, 0 insertions(+), 0 deletions(-) diff --git a/bin/lib32/BulletSim.dll b/bin/lib32/BulletSim.dll index 71e1b16..5c3ccd0 100755 Binary files a/bin/lib32/BulletSim.dll and b/bin/lib32/BulletSim.dll differ diff --git a/bin/lib32/libBulletSim.so b/bin/lib32/libBulletSim.so index b623929..97dd73c 100755 Binary files a/bin/lib32/libBulletSim.so and b/bin/lib32/libBulletSim.so differ diff --git a/bin/lib64/BulletSim.dll b/bin/lib64/BulletSim.dll index 85834b0..eea1020 100755 Binary files a/bin/lib64/BulletSim.dll and b/bin/lib64/BulletSim.dll differ diff --git a/bin/lib64/libBulletSim.so b/bin/lib64/libBulletSim.so index d78fd58..3987835 100755 Binary files a/bin/lib64/libBulletSim.so and b/bin/lib64/libBulletSim.so differ -- cgit v1.1 From 36ee8e39411c1eedf72ba082b159528dec8c7880 Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Mon, 14 Aug 2017 21:20:59 -0700 Subject: BUlletSim: return better terrain height in BSTerrainHeightMap.GetTerrainHeightAtXYZ(). Partial fix for Mantis 8011. Problem is that computed terrain height is different than mesh height in the physics engine. For small shapes, they would have their position corrected to above terrain so they would never collide. --- .../PhysicsModules/BulletS/BSTerrainHeightmap.cs | 24 ++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/OpenSim/Region/PhysicsModules/BulletS/BSTerrainHeightmap.cs b/OpenSim/Region/PhysicsModules/BulletS/BSTerrainHeightmap.cs index 42fc11b..efdf479 100755 --- a/OpenSim/Region/PhysicsModules/BulletS/BSTerrainHeightmap.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/BSTerrainHeightmap.cs @@ -141,14 +141,30 @@ public sealed class BSTerrainHeightmap : BSTerrainPhys } // The passed position is relative to the base of the region. + // There are many assumptions herein that the heightmap increment is 1. public override float GetTerrainHeightAtXYZ(Vector3 pos) { float ret = BSTerrainManager.HEIGHT_GETHEIGHT_RET; - int mapIndex = (int)pos.Y * (int)m_mapInfo.sizeY + (int)pos.X; - try - { - ret = m_mapInfo.heightMap[mapIndex]; + try { + int baseX = (int)pos.X; + int baseY = (int)pos.Y; + int maxX = (int)m_mapInfo.sizeX; + int maxY = (int)m_mapInfo.sizeY; + float diffX = pos.X - (float)baseX; + float diffY = pos.Y - (float)baseY; + + float mapHeight1 = m_mapInfo.heightMap[baseY * maxY + baseX]; + float mapHeight2 = m_mapInfo.heightMap[Math.Min(baseY + 1, maxY - 1) * maxY + baseX]; + float mapHeight3 = m_mapInfo.heightMap[baseY * maxY + Math.Min(baseX + 1, maxX - 1)]; + float mapHeight4 = m_mapInfo.heightMap[Math.Min(baseY + 1, maxY - 1) * maxY + Math.Min(baseX + 1, maxX - 1)]; + + float Xrise = (mapHeight4 - mapHeight3) * diffX; + float Yrise = (mapHeight2 - mapHeight1) * diffY; + + ret = mapHeight1 + ((Xrise + Yrise) / 2f); + m_physicsScene.DetailLog("{0},BSTerrainHeightMap,GetTerrainHeightAtXYZ,pos={1},{2}/{3}/{4}/{5},ret={6}", + BSScene.DetailLogZero, pos, mapHeight1, mapHeight2, mapHeight3, mapHeight4, ret); } catch { -- cgit v1.1 From a754ab0e4f40e502aac55b8f117b2bfe4054ccfc Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Mon, 14 Aug 2017 21:27:53 -0700 Subject: Refactor archive loading to optionally start script engine after loading. --- .../World/Archiver/ArchiveReadRequest.cs | 32 ++++++++++++++-------- 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs index 6ba8cec..99ff9b5 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs @@ -286,6 +286,11 @@ namespace OpenSim.Region.CoreModules.World.Archiver /// public void DearchiveRegion() { + DearchiveRegion(true); + } + + public void DearchiveRegion(bool shouldStartScripts) + { int successfulAssetRestores = 0; int failedAssetRestores = 0; @@ -425,22 +430,25 @@ namespace OpenSim.Region.CoreModules.World.Archiver // Start the scripts. We delayed this because we want the OAR to finish loading ASAP, so // that users can enter the scene. If we allow the scripts to start in the loop above // then they significantly increase the time until the OAR finishes loading. - WorkManager.RunInThread(o => + if (shouldStartScripts) { - Thread.Sleep(15000); - m_log.Info("[ARCHIVER]: Starting scripts in scene objects"); - - foreach (DearchiveContext sceneContext in sceneContexts.Values) + WorkManager.RunInThread(o => { - foreach (SceneObjectGroup sceneObject in sceneContext.SceneObjects) + Thread.Sleep(15000); + m_log.Info("[ARCHIVER]: Starting scripts in scene objects"); + + foreach (DearchiveContext sceneContext in sceneContexts.Values) { - sceneObject.CreateScriptInstances(0, false, sceneContext.Scene.DefaultScriptEngine, 0); // StateSource.RegionStart - sceneObject.ResumeScripts(); - } + foreach (SceneObjectGroup sceneObject in sceneContext.SceneObjects) + { + sceneObject.CreateScriptInstances(0, false, sceneContext.Scene.DefaultScriptEngine, 0); // StateSource.RegionStart + sceneObject.ResumeScripts(); + } - sceneContext.SceneObjects.Clear(); - } - }, null, string.Format("ReadArchiveStartScripts (request {0})", m_requestId)); + sceneContext.SceneObjects.Clear(); + } + }, null, string.Format("ReadArchiveStartScripts (request {0})", m_requestId)); + } m_log.InfoFormat("[ARCHIVER]: Successfully loaded archive"); -- cgit v1.1 From 9e86721d7075bbab75eeb6493951382f2a1d4d23 Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Mon, 14 Aug 2017 21:33:26 -0700 Subject: BulletSim: remove chatty debug message. --- OpenSim/Region/PhysicsModules/BulletS/BSTerrainHeightmap.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/PhysicsModules/BulletS/BSTerrainHeightmap.cs b/OpenSim/Region/PhysicsModules/BulletS/BSTerrainHeightmap.cs index efdf479..f72ad28 100755 --- a/OpenSim/Region/PhysicsModules/BulletS/BSTerrainHeightmap.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/BSTerrainHeightmap.cs @@ -163,8 +163,8 @@ public sealed class BSTerrainHeightmap : BSTerrainPhys float Yrise = (mapHeight2 - mapHeight1) * diffY; ret = mapHeight1 + ((Xrise + Yrise) / 2f); - m_physicsScene.DetailLog("{0},BSTerrainHeightMap,GetTerrainHeightAtXYZ,pos={1},{2}/{3}/{4}/{5},ret={6}", - BSScene.DetailLogZero, pos, mapHeight1, mapHeight2, mapHeight3, mapHeight4, ret); + // m_physicsScene.DetailLog("{0},BSTerrainHeightMap,GetTerrainHeightAtXYZ,pos={1},{2}/{3}/{4}/{5},ret={6}", + // BSScene.DetailLogZero, pos, mapHeight1, mapHeight2, mapHeight3, mapHeight4, ret); } catch { -- cgit v1.1 From bf84e46c59a91e48b39c8d78a2c244acae33829d Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Tue, 15 Aug 2017 16:01:56 +0100 Subject: update libode for MAC, thanks again Gavin Hird --- bin/lib32/libode.dylib | Bin 2632228 -> 2490468 bytes bin/lib64/libode.dylib | Bin 2632228 -> 2490468 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/bin/lib32/libode.dylib b/bin/lib32/libode.dylib index fa3c070..49e205e 100755 Binary files a/bin/lib32/libode.dylib and b/bin/lib32/libode.dylib differ diff --git a/bin/lib64/libode.dylib b/bin/lib64/libode.dylib index fa3c070..49e205e 100755 Binary files a/bin/lib64/libode.dylib and b/bin/lib64/libode.dylib differ -- cgit v1.1