diff options
author | root | 2019-03-11 23:41:26 +0000 |
---|---|---|
committer | root | 2019-03-11 23:41:26 +0000 |
commit | c7a02dc058018429fca8fb0c979785be34bebaf6 (patch) | |
tree | a364249657222c201c9880ec355dafbcb7f99d9a /OpenSim/Region/Framework/Scenes | |
parent | Should have been in the last commit (diff) | |
parent | errr use invariantculture compare not current (diff) | |
download | opensim-SC-c7a02dc058018429fca8fb0c979785be34bebaf6.zip opensim-SC-c7a02dc058018429fca8fb0c979785be34bebaf6.tar.gz opensim-SC-c7a02dc058018429fca8fb0c979785be34bebaf6.tar.bz2 opensim-SC-c7a02dc058018429fca8fb0c979785be34bebaf6.tar.xz |
Merge branch 'master' of brain.opensimulator.org:/var/git/opensim
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
9 files changed, 136 insertions, 145 deletions
diff --git a/OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs b/OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs index 7509686..eae6d6f 100644 --- a/OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs +++ b/OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs | |||
@@ -94,19 +94,15 @@ namespace OpenSim.Region.Framework.Scenes | |||
94 | m_inventoryDeletes.Enqueue(dtis); | 94 | m_inventoryDeletes.Enqueue(dtis); |
95 | } | 95 | } |
96 | 96 | ||
97 | if (Enabled) | ||
98 | lock (m_inventoryTicker) | ||
99 | m_inventoryTicker.Start(); | ||
100 | |||
101 | // Visually remove it, even if it isnt really gone yet. This means that if we crash before the object | ||
102 | // has gone to inventory, it will reappear in the region again on restart instead of being lost. | ||
103 | // This is not ideal since the object will still be available for manipulation when it should be, but it's | ||
104 | // better than losing the object for now. | ||
105 | if (permissionToDelete) | 97 | if (permissionToDelete) |
106 | { | 98 | { |
107 | foreach (SceneObjectGroup g in objectGroups) | 99 | foreach (SceneObjectGroup g in objectGroups) |
108 | g.DeleteGroupFromScene(false); | 100 | g.DeleteGroupFromScene(false); |
109 | } | 101 | } |
102 | |||
103 | if (Enabled) | ||
104 | lock (m_inventoryTicker) | ||
105 | m_inventoryTicker.Start(); | ||
110 | } | 106 | } |
111 | 107 | ||
112 | private void InventoryRunDeleteTimer(object sender, ElapsedEventArgs e) | 108 | private void InventoryRunDeleteTimer(object sender, ElapsedEventArgs e) |
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index f76f882..edc8886 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs | |||
@@ -539,7 +539,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
539 | /// <see cref="SceneObjectPart.TriggerScriptChangedEvent"/> | 539 | /// <see cref="SceneObjectPart.TriggerScriptChangedEvent"/> |
540 | /// </remarks> | 540 | /// </remarks> |
541 | public event ScriptChangedEvent OnScriptChangedEvent; | 541 | public event ScriptChangedEvent OnScriptChangedEvent; |
542 | public delegate void ScriptChangedEvent(uint localID, uint change); | 542 | public delegate void ScriptChangedEvent(uint localID, uint change, object data); |
543 | 543 | ||
544 | public delegate void ScriptControlEvent(UUID item, UUID avatarID, uint held, uint changed); | 544 | public delegate void ScriptControlEvent(UUID item, UUID avatarID, uint held, uint changed); |
545 | 545 | ||
@@ -1185,7 +1185,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1185 | } | 1185 | } |
1186 | } | 1186 | } |
1187 | 1187 | ||
1188 | public void TriggerOnScriptChangedEvent(uint localID, uint change) | 1188 | public void TriggerOnScriptChangedEvent(uint localID, uint change, object parameter = null) |
1189 | { | 1189 | { |
1190 | ScriptChangedEvent handlerScriptChangedEvent = OnScriptChangedEvent; | 1190 | ScriptChangedEvent handlerScriptChangedEvent = OnScriptChangedEvent; |
1191 | if (handlerScriptChangedEvent != null) | 1191 | if (handlerScriptChangedEvent != null) |
@@ -1194,7 +1194,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1194 | { | 1194 | { |
1195 | try | 1195 | try |
1196 | { | 1196 | { |
1197 | d(localID, change); | 1197 | d(localID, change, parameter); |
1198 | } | 1198 | } |
1199 | catch (Exception e) | 1199 | catch (Exception e) |
1200 | { | 1200 | { |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index e6e0354..debcad3 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |||
@@ -2110,7 +2110,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2110 | // build a list of eligible objects | 2110 | // build a list of eligible objects |
2111 | List<uint> deleteIDs = new List<uint>(); | 2111 | List<uint> deleteIDs = new List<uint>(); |
2112 | List<SceneObjectGroup> deleteGroups = new List<SceneObjectGroup>(); | 2112 | List<SceneObjectGroup> deleteGroups = new List<SceneObjectGroup>(); |
2113 | List<SceneObjectGroup> takeGroups = new List<SceneObjectGroup>(); | 2113 | List<SceneObjectGroup> takeCopyGroups = new List<SceneObjectGroup>(); |
2114 | List<SceneObjectGroup> takeDeleteGroups = new List<SceneObjectGroup>(); | 2114 | List<SceneObjectGroup> takeDeleteGroups = new List<SceneObjectGroup>(); |
2115 | 2115 | ||
2116 | ScenePresence sp = null; | 2116 | ScenePresence sp = null; |
@@ -2119,11 +2119,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
2119 | else if(action != DeRezAction.Return) | 2119 | else if(action != DeRezAction.Return) |
2120 | return; // only Return can be called without a client | 2120 | return; // only Return can be called without a client |
2121 | 2121 | ||
2122 | // Start with true for both, then remove the flags if objects | 2122 | // this is not as 0.8x code |
2123 | // that we can't derez are part of the selection | 2123 | // 0.8x did refuse all operation is not allowed on all objects |
2124 | bool permissionToTake = true; | 2124 | // this will do it on allowed objects |
2125 | bool permissionToTakeCopy = true; | 2125 | // current viewers only ask if all allowed |
2126 | bool permissionToDelete = true; | ||
2127 | 2126 | ||
2128 | foreach (uint localID in localIDs) | 2127 | foreach (uint localID in localIDs) |
2129 | { | 2128 | { |
@@ -2136,8 +2135,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
2136 | continue; | 2135 | continue; |
2137 | } | 2136 | } |
2138 | 2137 | ||
2139 | // Already deleted by someone else | 2138 | SceneObjectGroup grp = part.ParentGroup; |
2140 | if (part.ParentGroup.IsDeleted) | 2139 | if (grp == null || grp.IsDeleted) |
2141 | { | 2140 | { |
2142 | //Client still thinks the object exists, kill it | 2141 | //Client still thinks the object exists, kill it |
2143 | deleteIDs.Add(localID); | 2142 | deleteIDs.Add(localID); |
@@ -2145,132 +2144,105 @@ namespace OpenSim.Region.Framework.Scenes | |||
2145 | } | 2144 | } |
2146 | 2145 | ||
2147 | // Can't delete child prims | 2146 | // Can't delete child prims |
2148 | if (part != part.ParentGroup.RootPart) | 2147 | if (part != grp.RootPart) |
2149 | continue; | 2148 | continue; |
2150 | 2149 | ||
2151 | SceneObjectGroup grp = part.ParentGroup; | ||
2152 | if (grp.IsAttachment) | 2150 | if (grp.IsAttachment) |
2153 | continue; | 2151 | { |
2152 | if(!sp.IsGod || action != DeRezAction.Return || action != DeRezAction.Delete) | ||
2153 | continue; | ||
2154 | // this may break the attachment, but its a security action | ||
2155 | // viewers don't allow it anyways | ||
2156 | } | ||
2154 | 2157 | ||
2155 | // If child prims have invalid perms, fix them | 2158 | // If child prims have invalid perms, fix them |
2156 | grp.AdjustChildPrimPermissions(false); | 2159 | grp.AdjustChildPrimPermissions(false); |
2157 | 2160 | ||
2158 | if (remoteClient == null) | 2161 | switch (action) |
2159 | { | 2162 | { |
2160 | // Autoreturn has a null client. Nothing else does. So | 2163 | case DeRezAction.SaveToExistingUserInventoryItem: |
2161 | // allow only returns | ||
2162 | if (action != DeRezAction.Return) | ||
2163 | { | 2164 | { |
2164 | m_log.WarnFormat( | 2165 | if (Permissions.CanTakeCopyObject(grp, sp)) |
2165 | "[AGENT INVENTORY]: Ignoring attempt to {0} {1} {2} without a client", | 2166 | takeCopyGroups.Add(grp); |
2166 | action, grp.Name, grp.UUID); | 2167 | break; |
2167 | return; | ||
2168 | } | 2168 | } |
2169 | 2169 | ||
2170 | permissionToTakeCopy = false; | 2170 | case DeRezAction.TakeCopy: |
2171 | } | ||
2172 | else | ||
2173 | { | ||
2174 | if (action == DeRezAction.TakeCopy) | ||
2175 | { | 2171 | { |
2176 | if (!Permissions.CanTakeCopyObject(grp, sp)) | 2172 | if (Permissions.CanTakeCopyObject(grp, sp)) |
2177 | permissionToTakeCopy = false; | 2173 | takeCopyGroups.Add(grp); |
2174 | break; | ||
2178 | } | 2175 | } |
2179 | else | 2176 | |
2177 | case DeRezAction.Take: | ||
2180 | { | 2178 | { |
2181 | permissionToTakeCopy = false; | 2179 | if (Permissions.CanTakeObject(grp, sp)) |
2180 | takeDeleteGroups.Add(grp); | ||
2181 | break; | ||
2182 | } | 2182 | } |
2183 | if (!Permissions.CanTakeObject(grp, sp)) | ||
2184 | permissionToTake = false; | ||
2185 | |||
2186 | if (!Permissions.CanDeleteObject(grp, remoteClient)) | ||
2187 | permissionToDelete = false; | ||
2188 | } | ||
2189 | |||
2190 | // Handle god perms | ||
2191 | if ((remoteClient != null) && Permissions.IsGod(remoteClient.AgentId)) | ||
2192 | { | ||
2193 | permissionToTake = true; | ||
2194 | permissionToTakeCopy = true; | ||
2195 | permissionToDelete = true; | ||
2196 | } | ||
2197 | |||
2198 | // If we're re-saving, we don't even want to delete | ||
2199 | if (action == DeRezAction.SaveToExistingUserInventoryItem) | ||
2200 | permissionToDelete = false; | ||
2201 | 2183 | ||
2202 | // if we want to take a copy, we also don't want to delete | 2184 | case DeRezAction.GodTakeCopy: |
2203 | // Note: after this point, the permissionToTakeCopy flag | ||
2204 | // becomes irrelevant. It already includes the permissionToTake | ||
2205 | // permission and after excluding no copy items here, we can | ||
2206 | // just use that. | ||
2207 | if (action == DeRezAction.TakeCopy) | ||
2208 | { | ||
2209 | // If we don't have permission, stop right here | ||
2210 | if (!permissionToTakeCopy) | ||
2211 | { | 2185 | { |
2212 | remoteClient.SendAlertMessage("You don't have permission to take the object"); | 2186 | if((remoteClient != null) && Permissions.IsGod(remoteClient.AgentId)) |
2213 | return; | 2187 | takeCopyGroups.Add(grp); |
2188 | break; | ||
2214 | } | 2189 | } |
2215 | 2190 | ||
2216 | permissionToTake = true; | 2191 | case DeRezAction.Delete: |
2217 | // Don't delete | ||
2218 | permissionToDelete = false; | ||
2219 | } | ||
2220 | |||
2221 | if (action == DeRezAction.Return) | ||
2222 | { | ||
2223 | if (remoteClient != null) | ||
2224 | { | 2192 | { |
2225 | if (Permissions.CanReturnObjects( | 2193 | if (Permissions.CanDeleteObject(grp, remoteClient)) |
2226 | null, | ||
2227 | remoteClient, | ||
2228 | new List<SceneObjectGroup>() {grp})) | ||
2229 | { | 2194 | { |
2230 | permissionToTake = true; | 2195 | if(m_useTrashOnDelete || (sp.IsGod && grp.OwnerID != sp.UUID)) |
2231 | permissionToDelete = true; | 2196 | takeDeleteGroups.Add(grp); |
2232 | if(AddToReturns) | 2197 | else |
2233 | AddReturn(grp.OwnerID == grp.GroupID ? grp.LastOwnerID : grp.OwnerID, grp.Name, grp.AbsolutePosition, | 2198 | deleteGroups.Add(grp); |
2234 | "parcel owner return"); | ||
2235 | } | 2199 | } |
2200 | break; | ||
2236 | } | 2201 | } |
2237 | else // Auto return passes through here with null agent | 2202 | |
2203 | case DeRezAction.Return: | ||
2238 | { | 2204 | { |
2239 | permissionToTake = true; | 2205 | if (remoteClient != null) |
2240 | permissionToDelete = true; | 2206 | { |
2207 | if (Permissions.CanReturnObjects( null, remoteClient, new List<SceneObjectGroup>() {grp})) | ||
2208 | { | ||
2209 | takeDeleteGroups.Add(grp); | ||
2210 | if (AddToReturns) | ||
2211 | AddReturn(grp.OwnerID == grp.GroupID ? grp.LastOwnerID : grp.OwnerID, grp.Name, grp.AbsolutePosition, | ||
2212 | "parcel owner return"); | ||
2213 | } | ||
2214 | } | ||
2215 | else // Auto return passes through here with null agent | ||
2216 | { | ||
2217 | takeDeleteGroups.Add(grp); | ||
2218 | } | ||
2219 | break; | ||
2241 | } | 2220 | } |
2242 | } | ||
2243 | 2221 | ||
2244 | if (permissionToDelete) | 2222 | default: |
2245 | { | 2223 | break; |
2246 | if (permissionToTake) | ||
2247 | takeDeleteGroups.Add(grp); | ||
2248 | else | ||
2249 | deleteGroups.Add(grp); | ||
2250 | deleteIDs.Add(grp.LocalId); | ||
2251 | } | 2224 | } |
2252 | else if(permissionToTake) | ||
2253 | takeGroups.Add(grp); | ||
2254 | } | 2225 | } |
2255 | 2226 | ||
2256 | SendKillObject(deleteIDs); | 2227 | if(deleteIDs.Count > 0) |
2228 | SendKillObject(deleteIDs); | ||
2257 | 2229 | ||
2258 | if (takeDeleteGroups.Count > 0) | 2230 | if (takeDeleteGroups.Count > 0) |
2259 | { | 2231 | { |
2260 | m_asyncSceneObjectDeleter.DeleteToInventory( | 2232 | m_asyncSceneObjectDeleter.DeleteToInventory(action, destinationID, takeDeleteGroups, |
2261 | action, destinationID, takeDeleteGroups, remoteClient, | 2233 | remoteClient, true); |
2262 | true); | ||
2263 | } | 2234 | } |
2264 | if (takeGroups.Count > 0) | 2235 | |
2236 | if (takeCopyGroups.Count > 0) | ||
2265 | { | 2237 | { |
2266 | m_asyncSceneObjectDeleter.DeleteToInventory( | 2238 | m_asyncSceneObjectDeleter.DeleteToInventory(action, destinationID, takeCopyGroups, |
2267 | action, destinationID, takeGroups, remoteClient, | 2239 | remoteClient, false); |
2268 | false); | ||
2269 | } | 2240 | } |
2241 | |||
2270 | if (deleteGroups.Count > 0) | 2242 | if (deleteGroups.Count > 0) |
2271 | { | 2243 | { |
2272 | foreach (SceneObjectGroup g in deleteGroups) | 2244 | foreach (SceneObjectGroup g in deleteGroups) |
2273 | DeleteSceneObject(g, true); | 2245 | DeleteSceneObject(g, false); |
2274 | } | 2246 | } |
2275 | } | 2247 | } |
2276 | 2248 | ||
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index b526fe9..ea037be 100755 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs | |||
@@ -1913,9 +1913,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
1913 | { | 1913 | { |
1914 | if (parentGroup.OwnerID == child.OwnerID) | 1914 | if (parentGroup.OwnerID == child.OwnerID) |
1915 | { | 1915 | { |
1916 | parentGroup.LinkToGroup(child); | ||
1917 | |||
1918 | child.DetachFromBackup(); | 1916 | child.DetachFromBackup(); |
1917 | parentGroup.LinkToGroup(child); | ||
1919 | 1918 | ||
1920 | // this is here so physics gets updated! | 1919 | // this is here so physics gets updated! |
1921 | // Don't remove! Bad juju! Stay away! or fix physics! | 1920 | // Don't remove! Bad juju! Stay away! or fix physics! |
@@ -1943,7 +1942,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
1943 | */ | 1942 | */ |
1944 | parentGroup.AdjustChildPrimPermissions(false); | 1943 | parentGroup.AdjustChildPrimPermissions(false); |
1945 | parentGroup.HasGroupChanged = true; | 1944 | parentGroup.HasGroupChanged = true; |
1946 | parentGroup.ProcessBackup(m_parentScene.SimulationDataService, true); | ||
1947 | parentGroup.ScheduleGroupForFullAnimUpdate(); | 1945 | parentGroup.ScheduleGroupForFullAnimUpdate(); |
1948 | Monitor.Exit(m_linkLock); | 1946 | Monitor.Exit(m_linkLock); |
1949 | } | 1947 | } |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs index bf217a5..8899e96 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs | |||
@@ -154,7 +154,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
154 | // We're adding this to a prim we don't own. Force | 154 | // We're adding this to a prim we don't own. Force |
155 | // owner change | 155 | // owner change |
156 | taskItem.Flags |= (uint)InventoryItemFlags.ObjectSlamPerm; | 156 | taskItem.Flags |= (uint)InventoryItemFlags.ObjectSlamPerm; |
157 | 157 | taskItem.LastOwnerID = item.Owner; | |
158 | } | 158 | } |
159 | else | 159 | else |
160 | { | 160 | { |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index a23ebbf..312ce26 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -3242,8 +3242,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
3242 | if (ParentGroup.Scene.GetNumberOfClients() == 0) | 3242 | if (ParentGroup.Scene.GetNumberOfClients() == 0) |
3243 | return; | 3243 | return; |
3244 | 3244 | ||
3245 | ParentGroup.QueueForUpdateCheck(); | ||
3246 | |||
3247 | bool isfull = false; | 3245 | bool isfull = false; |
3248 | if (ParentGroup.IsAttachment) | 3246 | if (ParentGroup.IsAttachment) |
3249 | { | 3247 | { |
@@ -3254,6 +3252,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
3254 | lock (UpdateFlagLock) | 3252 | lock (UpdateFlagLock) |
3255 | UpdateFlag |= update; | 3253 | UpdateFlag |= update; |
3256 | 3254 | ||
3255 | ParentGroup.QueueForUpdateCheck(); | ||
3256 | |||
3257 | ParentGroup.Scene.EventManager.TriggerSceneObjectPartUpdated(this, isfull); | 3257 | ParentGroup.Scene.EventManager.TriggerSceneObjectPartUpdated(this, isfull); |
3258 | } | 3258 | } |
3259 | 3259 | ||
@@ -4439,10 +4439,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
4439 | SceneObjectSerializer.SOPToXml2(xmlWriter, this, new Dictionary<string, object>()); | 4439 | SceneObjectSerializer.SOPToXml2(xmlWriter, this, new Dictionary<string, object>()); |
4440 | } | 4440 | } |
4441 | 4441 | ||
4442 | public void TriggerScriptChangedEvent(Changed val) | 4442 | public void TriggerScriptChangedEvent(Changed val, object data = null) |
4443 | { | 4443 | { |
4444 | if (ParentGroup != null && ParentGroup.Scene != null) | 4444 | if (ParentGroup != null && ParentGroup.Scene != null) |
4445 | ParentGroup.Scene.EventManager.TriggerOnScriptChangedEvent(LocalId, (uint)val); | 4445 | ParentGroup.Scene.EventManager.TriggerOnScriptChangedEvent(LocalId, (uint)val, data); |
4446 | } | 4446 | } |
4447 | 4447 | ||
4448 | public void TrimPermissions() | 4448 | public void TrimPermissions() |
@@ -5130,11 +5130,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
5130 | 5130 | ||
5131 | if (changeFlags == 0) | 5131 | if (changeFlags == 0) |
5132 | return; | 5132 | return; |
5133 | m_shape.TextureEntry = newTex.GetBytes(); | 5133 | m_shape.TextureEntry = newTex.GetBytes(9); |
5134 | TriggerScriptChangedEvent(changeFlags); | 5134 | TriggerScriptChangedEvent(changeFlags); |
5135 | ParentGroup.HasGroupChanged = true; | 5135 | ParentGroup.HasGroupChanged = true; |
5136 | ScheduleFullUpdate(); | 5136 | ScheduleUpdate(PrimUpdateFlags.Textures); |
5137 | |||
5138 | } | 5137 | } |
5139 | 5138 | ||
5140 | /// <summary> | 5139 | /// <summary> |
@@ -5160,10 +5159,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
5160 | if (changeFlags == 0) | 5159 | if (changeFlags == 0) |
5161 | return; | 5160 | return; |
5162 | 5161 | ||
5163 | m_shape.TextureEntry = newTex.GetBytes(); | 5162 | m_shape.TextureEntry = newTex.GetBytes(9); |
5164 | TriggerScriptChangedEvent(changeFlags); | 5163 | TriggerScriptChangedEvent(changeFlags); |
5165 | ParentGroup.HasGroupChanged = true; | 5164 | ParentGroup.HasGroupChanged = true; |
5166 | ScheduleFullUpdate(); | 5165 | ScheduleUpdate(PrimUpdateFlags.Textures); |
5167 | } | 5166 | } |
5168 | 5167 | ||
5169 | internal void UpdatePhysicsSubscribedEvents() | 5168 | internal void UpdatePhysicsSubscribedEvents() |
@@ -5575,20 +5574,26 @@ namespace OpenSim.Region.Framework.Scenes | |||
5575 | // handle osVolumeDetect | 5574 | // handle osVolumeDetect |
5576 | public void ScriptSetVolumeDetect(bool makeVolumeDetect) | 5575 | public void ScriptSetVolumeDetect(bool makeVolumeDetect) |
5577 | { | 5576 | { |
5577 | if(ParentGroup.IsDeleted) | ||
5578 | return; | ||
5579 | |||
5578 | if(_parentID == 0) | 5580 | if(_parentID == 0) |
5579 | { | 5581 | { |
5580 | // if root prim do it via SOG | 5582 | // if root prim do it is like llVolumeDetect |
5581 | ParentGroup.ScriptSetVolumeDetect(makeVolumeDetect); | 5583 | ParentGroup.ScriptSetVolumeDetect(makeVolumeDetect); |
5582 | return; | 5584 | return; |
5583 | } | 5585 | } |
5584 | 5586 | ||
5585 | bool wasUsingPhysics = ((Flags & PrimFlags.Physics) != 0); | 5587 | if(ParentGroup.IsVolumeDetect) |
5586 | bool wasTemporary = ((Flags & PrimFlags.TemporaryOnRez) != 0); | 5588 | return; // entire linkset is phantom already |
5587 | bool wasPhantom = ((Flags & PrimFlags.Phantom) != 0); | 5589 | |
5590 | bool wasUsingPhysics = ParentGroup.UsesPhysics; | ||
5591 | bool wasTemporary = ParentGroup.IsTemporary; | ||
5592 | bool wasPhantom = ParentGroup.IsPhantom; | ||
5588 | 5593 | ||
5589 | if(PhysActor != null) | 5594 | if(PhysActor != null) |
5590 | PhysActor.Building = true; | 5595 | PhysActor.Building = true; |
5591 | UpdatePrimFlags(wasUsingPhysics,wasTemporary,wasPhantom,makeVolumeDetect,false); | 5596 | UpdatePrimFlags(wasUsingPhysics, wasTemporary, wasPhantom, makeVolumeDetect, false); |
5592 | } | 5597 | } |
5593 | 5598 | ||
5594 | protected static int m_animationSequenceNumber = (int)(Util.GetTimeStampTicks() & 0x5fffafL); | 5599 | protected static int m_animationSequenceNumber = (int)(Util.GetTimeStampTicks() & 0x5fffafL); |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs index 4934b83..a0f8959 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | |||
@@ -815,10 +815,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
815 | m_items.LockItemsForWrite(true); | 815 | m_items.LockItemsForWrite(true); |
816 | m_items.Add(item.ItemID, item); | 816 | m_items.Add(item.ItemID, item); |
817 | m_items.LockItemsForWrite(false); | 817 | m_items.LockItemsForWrite(false); |
818 | if (allowedDrop) | 818 | if (allowedDrop) |
819 | m_part.TriggerScriptChangedEvent(Changed.ALLOWED_DROP); | 819 | m_part.TriggerScriptChangedEvent(Changed.ALLOWED_DROP, item.ItemID); |
820 | else | 820 | else |
821 | m_part.TriggerScriptChangedEvent(Changed.INVENTORY); | 821 | m_part.TriggerScriptChangedEvent(Changed.INVENTORY); |
822 | 822 | ||
823 | m_part.AggregateInnerPerms(); | 823 | m_part.AggregateInnerPerms(); |
824 | m_inventorySerial++; | 824 | m_inventorySerial++; |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index cfb1be4..1c5d23d 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -507,7 +507,19 @@ namespace OpenSim.Region.Framework.Scenes | |||
507 | /// <summary> | 507 | /// <summary> |
508 | /// Physical scene representation of this Avatar. | 508 | /// Physical scene representation of this Avatar. |
509 | /// </summary> | 509 | /// </summary> |
510 | public PhysicsActor PhysicsActor { get; private set; } | 510 | |
511 | PhysicsActor m_physActor; | ||
512 | public PhysicsActor PhysicsActor | ||
513 | { | ||
514 | get | ||
515 | { | ||
516 | return m_physActor; | ||
517 | } | ||
518 | private set | ||
519 | { | ||
520 | m_physActor = value; | ||
521 | } | ||
522 | } | ||
511 | 523 | ||
512 | /// <summary> | 524 | /// <summary> |
513 | /// Record user movement inputs. | 525 | /// Record user movement inputs. |
@@ -523,7 +535,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
523 | 535 | ||
524 | public bool Invulnerable | 536 | public bool Invulnerable |
525 | { | 537 | { |
526 | set { m_invulnerable = value; } | 538 | set |
539 | { | ||
540 | m_invulnerable = value; | ||
541 | if(value && Health != 100.0f) | ||
542 | Health = 100.0f; | ||
543 | } | ||
527 | get { return m_invulnerable; } | 544 | get { return m_invulnerable; } |
528 | } | 545 | } |
529 | 546 | ||
@@ -1636,15 +1653,15 @@ namespace OpenSim.Region.Framework.Scenes | |||
1636 | /// </summary> | 1653 | /// </summary> |
1637 | public void RemoveFromPhysicalScene() | 1654 | public void RemoveFromPhysicalScene() |
1638 | { | 1655 | { |
1639 | if (PhysicsActor != null) | 1656 | PhysicsActor pa = Interlocked.Exchange(ref m_physActor, null); |
1657 | if (pa != null) | ||
1640 | { | 1658 | { |
1641 | // PhysicsActor.OnRequestTerseUpdate -= SendTerseUpdateToAllClients; | 1659 | // PhysicsActor.OnRequestTerseUpdate -= SendTerseUpdateToAllClients; |
1642 | 1660 | ||
1643 | PhysicsActor.OnOutOfBounds -= OutOfBoundsCall; | 1661 | pa.OnOutOfBounds -= OutOfBoundsCall; |
1644 | PhysicsActor.OnCollisionUpdate -= PhysicsCollisionUpdate; | 1662 | pa.OnCollisionUpdate -= PhysicsCollisionUpdate; |
1645 | PhysicsActor.UnSubscribeEvents(); | 1663 | pa.UnSubscribeEvents(); |
1646 | m_scene.PhysicsScene.RemoveAvatar(PhysicsActor); | 1664 | m_scene.PhysicsScene.RemoveAvatar(pa); |
1647 | PhysicsActor = null; | ||
1648 | } | 1665 | } |
1649 | // else | 1666 | // else |
1650 | // { | 1667 | // { |
@@ -2537,7 +2554,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2537 | m_pos.X = 127f; | 2554 | m_pos.X = 127f; |
2538 | m_pos.Y = 127f; | 2555 | m_pos.Y = 127f; |
2539 | m_pos.Z = 127f; | 2556 | m_pos.Z = 127f; |
2540 | m_log.Error("[AVATAR]: NonFinite Avatar position detected... Reset Position. Mantis this please. Error #9999903"); | 2557 | m_log.Error("[AVATAR]: NonFinite Avatar on lastFiniteposition also. Reset Position. Mantis this please. Error #9999903"); |
2541 | } | 2558 | } |
2542 | 2559 | ||
2543 | if(isphysical) | 2560 | if(isphysical) |
@@ -5007,16 +5024,17 @@ namespace OpenSim.Region.Framework.Scenes | |||
5007 | PhysicsScene scene = m_scene.PhysicsScene; | 5024 | PhysicsScene scene = m_scene.PhysicsScene; |
5008 | Vector3 pVec = AbsolutePosition; | 5025 | Vector3 pVec = AbsolutePosition; |
5009 | 5026 | ||
5010 | PhysicsActor = scene.AddAvatar( | 5027 | PhysicsActor pa = scene.AddAvatar( |
5011 | LocalId, Firstname + "." + Lastname, pVec, | 5028 | LocalId, Firstname + "." + Lastname, pVec, |
5012 | Appearance.AvatarBoxSize,Appearance.AvatarFeetOffset, isFlying); | 5029 | Appearance.AvatarBoxSize,Appearance.AvatarFeetOffset, isFlying); |
5013 | PhysicsActor.Orientation = m_bodyRot; | 5030 | pa.Orientation = m_bodyRot; |
5014 | //PhysicsActor.OnRequestTerseUpdate += SendTerseUpdateToAllClients; | 5031 | //PhysicsActor.OnRequestTerseUpdate += SendTerseUpdateToAllClients; |
5015 | PhysicsActor.OnCollisionUpdate += PhysicsCollisionUpdate; | 5032 | pa.OnCollisionUpdate += PhysicsCollisionUpdate; |
5016 | PhysicsActor.OnOutOfBounds += OutOfBoundsCall; // Called for PhysicsActors when there's something wrong | 5033 | pa.OnOutOfBounds += OutOfBoundsCall; // Called for PhysicsActors when there's something wrong |
5017 | PhysicsActor.SubscribeEvents(100); | 5034 | pa.SubscribeEvents(100); |
5018 | PhysicsActor.LocalID = LocalId; | 5035 | pa.LocalID = LocalId; |
5019 | PhysicsActor.SetAlwaysRun = m_setAlwaysRun; | 5036 | pa.SetAlwaysRun = m_setAlwaysRun; |
5037 | PhysicsActor = pa; | ||
5020 | } | 5038 | } |
5021 | 5039 | ||
5022 | private void OutOfBoundsCall(Vector3 pos) | 5040 | private void OutOfBoundsCall(Vector3 pos) |
diff --git a/OpenSim/Region/Framework/Scenes/TerrainCompressor.cs b/OpenSim/Region/Framework/Scenes/TerrainCompressor.cs index a60381a..020c7be 100644 --- a/OpenSim/Region/Framework/Scenes/TerrainCompressor.cs +++ b/OpenSim/Region/Framework/Scenes/TerrainCompressor.cs | |||
@@ -155,6 +155,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
155 | return iout; | 155 | return iout; |
156 | } | 156 | } |
157 | 157 | ||
158 | /* | ||
158 | // new using terrain data and patchs indexes | 159 | // new using terrain data and patchs indexes |
159 | public static List<LayerDataPacket> CreateLayerDataPackets(TerrainData terrData, int[] map) | 160 | public static List<LayerDataPacket> CreateLayerDataPackets(TerrainData terrData, int[] map) |
160 | { | 161 | { |
@@ -213,6 +214,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
213 | 214 | ||
214 | return ret; | 215 | return ret; |
215 | } | 216 | } |
217 | */ | ||
216 | 218 | ||
217 | public static void CreatePatchFromTerrainData(BitPack output, TerrainData terrData, int patchX, int patchY) | 219 | public static void CreatePatchFromTerrainData(BitPack output, TerrainData terrData, int patchX, int patchY) |
218 | { | 220 | { |