diff --git a/.gitignore b/.gitignore index 36a1757338..bf3ac37e0c 100644 --- a/.gitignore +++ b/.gitignore @@ -26,6 +26,7 @@ bin/Debug/*.dll bin/*.dll.mdb bin/*.db +bin/*.db-journal bin/addin-db-* bin/*.dll bin/OpenSim.vshost.exe.config diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 7e31d60650..675c64dabe 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs @@ -1943,6 +1943,9 @@ namespace OpenSim.Region.Framework.Scenes deleteIDs.Add(localID); deleteGroups.Add(grp); + // If child prims have invalid perms, fix them + grp.AdjustChildPrimPermissions(); + if (remoteClient == null) { // Autoreturn has a null client. Nothing else does. So diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index f6c725ba50..b4a155e940 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -2131,6 +2131,9 @@ namespace OpenSim.Region.Framework.Scenes // Can't do this yet since backup still makes use of the root part without any synchronization // objectGroup.m_rootPart = null; + // If linking prims with different permissions, fix them + AdjustChildPrimPermissions(); + AttachToBackup(); // Here's the deal, this is ABSOLUTELY CRITICAL so the physics scene gets the update about the @@ -2622,12 +2625,21 @@ namespace OpenSim.Region.Framework.Scenes } } + public void AdjustChildPrimPermissions() + { + ForEachPart(part => + { + if (part != RootPart) + part.ClonePermissions(RootPart); + }); + } + public void UpdatePermissions(UUID AgentID, byte field, uint localID, uint mask, byte addRemTF) { - SceneObjectPart[] parts = m_parts.GetArray(); - for (int i = 0; i < parts.Length; i++) - parts[i].UpdatePermissions(AgentID, field, localID, mask, addRemTF); + RootPart.UpdatePermissions(AgentID, field, localID, mask, addRemTF); + + AdjustChildPrimPermissions(); HasGroupChanged = true; diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 2a9ee3a5d4..411dcc774e 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -3890,6 +3890,27 @@ namespace OpenSim.Region.Framework.Scenes } } + public void ClonePermissions(SceneObjectPart source) + { + bool update = false; + + if (BaseMask != source.BaseMask || + OwnerMask != source.OwnerMask || + GroupMask != source.GroupMask || + EveryoneMask != source.EveryoneMask || + NextOwnerMask != source.NextOwnerMask) + update = true; + + BaseMask = source.BaseMask; + OwnerMask = source.OwnerMask; + GroupMask = source.GroupMask; + EveryoneMask = source.EveryoneMask; + NextOwnerMask = source.NextOwnerMask; + + if (update) + SendFullUpdateToAllClients(); + } + public bool IsHingeJoint() { // For now, we use the NINJA naming scheme for identifying joints. diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 0d275f7424..2bfb9b3e40 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -5165,25 +5165,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// separated list. There is a space after /// each comma. /// - public LSL_String llList2CSV(LSL_List src) { - - string ret = String.Empty; - int x = 0; - m_host.AddScriptLPS(1); - if (src.Data.Length > 0) - { - ret = src.Data[x++].ToString(); - for (; x < src.Data.Length; x++) - { - ret += ", "+src.Data[x].ToString(); - } - } - - return ret; + return string.Join(", ", + (new List(src.Data)).ConvertAll(o => + { + return o.ToString(); + }).ToArray()); } /// diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 1e8b51be80..5e7c2d98ab 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -2895,6 +2895,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } }); } + + public LSL_Float osGetHealth(string avatar) + { + CheckThreatLevel(ThreatLevel.None, "osGetHealth"); + m_host.AddScriptLPS(1); + + LSL_Float health = new LSL_Float(-1); + ScenePresence presence = World.GetScenePresence(new UUID(avatar)); + if (presence != null) health = presence.Health; + return health; + } public void osCauseDamage(string avatar, double damage) { diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs index 1f000a3e77..9ad1c22bd1 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs @@ -258,6 +258,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces int osGetSimulatorMemory(); void osKickAvatar(string FirstName,string SurName,string alert); void osSetSpeed(string UUID, LSL_Float SpeedModifier); + LSL_Float osGetHealth(string avatar); void osCauseHealing(string avatar, double healing); void osCauseDamage(string avatar, double damage); LSL_List osGetPrimitiveParams(LSL_Key prim, LSL_List rules); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs index 94405d2b5d..e9131e4655 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs @@ -865,7 +865,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase { m_OSSL_Functions.osSetSpeed(UUID, SpeedModifier); } - + + public LSL_Float osGetHealth(string avatar) + { + return m_OSSL_Functions.osGetHealth(avatar); + } + public void osCauseDamage(string avatar, double damage) { m_OSSL_Functions.osCauseDamage(avatar, damage); diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index 53f899abcd..5a3f002c53 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs @@ -589,7 +589,19 @@ namespace OpenSim.Region.ScriptEngine.XEngine if (m_Assemblies.ContainsKey(instance.AssetID)) { string assembly = m_Assemblies[instance.AssetID]; - instance.SaveState(assembly); + + try + { + instance.SaveState(assembly); + } + catch (Exception e) + { + m_log.Error( + string.Format( + "[XEngine]: Failed final state save for script {0}.{1}, item UUID {2}, prim UUID {3} in {4}. Exception ", + instance.PrimName, instance.ScriptName, instance.ItemID, instance.ObjectID, World.Name) + , e); + } } // Clear the event queue and abort the instance thread @@ -707,7 +719,18 @@ namespace OpenSim.Region.ScriptEngine.XEngine assembly = m_Assemblies[i.AssetID]; } - i.SaveState(assembly); + try + { + i.SaveState(assembly); + } + catch (Exception e) + { + m_log.Error( + string.Format( + "[XEngine]: Failed to save state of script {0}.{1}, item UUID {2}, prim UUID {3} in {4}. Exception ", + i.PrimName, i.ScriptName, i.ItemID, i.ObjectID, World.Name) + , e); + } } instances.Clear(); diff --git a/bin/config-include/storage/SQLiteStandalone.ini b/bin/config-include/storage/SQLiteStandalone.ini index c1de71aa21..67d98fff69 100644 --- a/bin/config-include/storage/SQLiteStandalone.ini +++ b/bin/config-include/storage/SQLiteStandalone.ini @@ -7,6 +7,16 @@ [AssetService] ConnectionString = "URI=file:Asset.db,version=3" +; The HGAssetService section controls the connection given to the AssetService in a Hypergrid configuration. +; This has to be separate from [AssetService] because the Hypergrid facing connector uses [HGAssetService] for its config data instead. +; However, the internal asset service will still use the [AssetService] section. +; Therefore, you will almost certainly want the ConnectionString in [HGAssetService] to be the same as in [AssetService] +; so that they both access the same database. +; This issue does not apply to normal MySQL/MSSQL configurations, since by default they use the settings in [DatabaseService] and +; do not have separate connection strings for different services. +[HGAssetService] + ConnectionString = "URI=file:Asset.db,version=3" + [InventoryService] ;ConnectionString = "URI=file:inventory.db,version=3" ; if you have a legacy inventory store use the connection string below