diff --git a/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs b/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs index 5b228ee6d4..a97c9b4a5b 100644 --- a/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs @@ -169,6 +169,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles void HandleOnMakeRootAgent (ScenePresence obj) { + if(obj.PresenceType == PresenceType.Npc) + return; + GetImageAssets(((IScenePresence)obj).UUID); } @@ -326,14 +329,17 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles string name = m["name"].AsString(); classifieds[cid] = name; - + if(!classifiedCache.ContainsKey(cid)) { - classifiedCache.Add(cid,creatorId); - classifiedInterest.Add(cid, 0); + lock(classifiedCache) + classifiedCache.Add(cid,creatorId); + lock(classifiedInterest) + classifiedInterest.Add(cid, 0); } - classifiedInterest[cid] ++; + lock(classifiedInterest) + classifiedInterest[cid] ++; } remoteClient.SendAvatarClassifiedReply(new UUID(args[0]), classifieds); @@ -346,22 +352,20 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles ad.ClassifiedId = queryClassifiedID; if(classifiedCache.ContainsKey(queryClassifiedID)) - { + { target = classifiedCache[queryClassifiedID]; - if(classifiedInterest[queryClassifiedID] -- == 0) - { - lock(classifiedCache) - { - lock(classifiedInterest) - { - classifiedInterest.Remove(queryClassifiedID); - } - classifiedCache.Remove(queryClassifiedID); - } - } - } + lock(classifiedInterest) + classifiedInterest[queryClassifiedID] --; + if(classifiedInterest[queryClassifiedID] == 0) + { + lock(classifiedInterest) + classifiedInterest.Remove(queryClassifiedID); + lock(classifiedCache) + classifiedCache.Remove(queryClassifiedID); + } + } string serverURI = string.Empty; bool foreign = GetUserProfileServerURI(target, out serverURI); diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs b/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs index afd547a088..aad1108cbc 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs @@ -360,7 +360,7 @@ public static class BSParam new ParameterDefn("UseSeparatePhysicsThread", "If 'true', the physics engine runs independent from the simulator heartbeat", false ), new ParameterDefn("PhysicsTimeStep", "If separate thread, seconds to simulate each interval", - 0.1f ), + 0.089f ), new ParameterDefn("MeshSculptedPrim", "Whether to create meshes for sculpties", true, diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSShapes.cs b/OpenSim/Region/Physics/BulletSPlugin/BSShapes.cs index 395dbe3386..326fc9ee2d 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSShapes.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSShapes.cs @@ -389,9 +389,21 @@ public class BSShapeMesh : BSShape } public override BSShape GetReference(BSScene pPhysicsScene, BSPhysObject pPrim) { - // Another reference to this shape is just counted. - IncrementReference(); - return this; + BSShape ret = null; + // If the underlying shape is native, the actual shape has not been build (waiting for asset) + // and we must create a copy of the native shape since they are never shared. + if (physShapeInfo.HasPhysicalShape && physShapeInfo.isNativeShape) + { + // TODO: decide when the native shapes should be freed. Check in Dereference? + ret = BSShapeNative.GetReference(pPhysicsScene, pPrim, BSPhysicsShapeType.SHAPE_BOX, FixedShapeKey.KEY_BOX); + } + else + { + // Another reference to this shape is just counted. + IncrementReference(); + ret = this; + } + return ret; } public override void Dereference(BSScene physicsScene) { @@ -562,9 +574,21 @@ public class BSShapeHull : BSShape } public override BSShape GetReference(BSScene pPhysicsScene, BSPhysObject pPrim) { - // Another reference to this shape is just counted. - IncrementReference(); - return this; + BSShape ret = null; + // If the underlying shape is native, the actual shape has not been build (waiting for asset) + // and we must create a copy of the native shape since they are never shared. + if (physShapeInfo.HasPhysicalShape && physShapeInfo.isNativeShape) + { + // TODO: decide when the native shapes should be freed. Check in Dereference? + ret = BSShapeNative.GetReference(pPhysicsScene, pPrim, BSPhysicsShapeType.SHAPE_BOX, FixedShapeKey.KEY_BOX); + } + else + { + // Another reference to this shape is just counted. + IncrementReference(); + ret = this; + } + return ret; } public override void Dereference(BSScene physicsScene) { @@ -1077,12 +1101,23 @@ public class BSShapeGImpact : BSShape (w, iC, i, vC, v) => physicsScene.PE.CreateGImpactShape(w, iC, i, vC, v) ); } - public override BSShape GetReference(BSScene physicsScene, BSPhysObject prim) + public override BSShape GetReference(BSScene pPhysicsScene, BSPhysObject pPrim) { - // Calling this reference means we want another handle to an existing shape - // (usually linksets) so return this copy. - IncrementReference(); - return this; + BSShape ret = null; + // If the underlying shape is native, the actual shape has not been build (waiting for asset) + // and we must create a copy of the native shape since they are never shared. + if (physShapeInfo.HasPhysicalShape && physShapeInfo.isNativeShape) + { + // TODO: decide when the native shapes should be freed. Check in Dereference? + ret = BSShapeNative.GetReference(pPhysicsScene, pPrim, BSPhysicsShapeType.SHAPE_BOX, FixedShapeKey.KEY_BOX); + } + else + { + // Another reference to this shape is just counted. + IncrementReference(); + ret = this; + } + return ret; } // Dereferencing a compound shape releases the hold on all the child shapes. public override void Dereference(BSScene physicsScene) diff --git a/OpenSim/Server/Handlers/Profiles/UserProfilesConnector.cs b/OpenSim/Server/Handlers/Profiles/UserProfilesConnector.cs index 5a24ee323e..f9a520a907 100644 --- a/OpenSim/Server/Handlers/Profiles/UserProfilesConnector.cs +++ b/OpenSim/Server/Handlers/Profiles/UserProfilesConnector.cs @@ -106,11 +106,6 @@ namespace OpenSim.Server.Handlers.Profiles Server.AddJsonRPCHandler("avatar_properties_update", handler.AvatarPropertiesUpdate); Server.AddJsonRPCHandler("avatar_interests_update", handler.AvatarInterestsUpdate); Server.AddJsonRPCHandler("image_assets_request", handler.AvatarImageAssetsRequest); -// Server.AddJsonRPCHandler("user_preferences_request", handler.UserPreferencesRequest); -// Server.AddJsonRPCHandler("user_preferences_update", handler.UserPreferencesUpdate); -// Server.AddJsonRPCHandler("user_account_create", handler.UserAccountCreate); -// Server.AddJsonRPCHandler("user_account_auth", handler.UserAccountAuth); -// Server.AddJsonRPCHandler("user_account_test", handler.UserAccountTest); Server.AddJsonRPCHandler("user_data_request", handler.RequestUserAppData); Server.AddJsonRPCHandler("user_data_update", handler.UpdateUserAppData); }