aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorMelanie Thielker2008-11-29 01:33:10 +0000
committerMelanie Thielker2008-11-29 01:33:10 +0000
commit287c724b5585b87822da4ba92f8a1c55b7d33a67 (patch)
tree56e869fe4d9f152c9926ff50f6f1b7ad02c3a442 /OpenSim
parent* minor: Stop startup complaining about a missing MyAssetSet.xml all the time... (diff)
downloadopensim-SC-287c724b5585b87822da4ba92f8a1c55b7d33a67.zip
opensim-SC-287c724b5585b87822da4ba92f8a1c55b7d33a67.tar.gz
opensim-SC-287c724b5585b87822da4ba92f8a1c55b7d33a67.tar.bz2
opensim-SC-287c724b5585b87822da4ba92f8a1c55b7d33a67.tar.xz
A try to better attachment crossing.
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs2
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs109
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs8
3 files changed, 66 insertions, 53 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index 1823ccf..5dd7dd2 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -2414,6 +2414,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2414 2414
2415 if (AttachPoint > 30 && ownerID != AgentId) // Someone else's HUD 2415 if (AttachPoint > 30 && ownerID != AgentId) // Someone else's HUD
2416 return; 2416 return;
2417 if (parentID == 0)
2418 return;
2417 2419
2418 if (rotation.X == rotation.Y && rotation.Y == rotation.Z && rotation.Z == rotation.W && rotation.W == 0) 2420 if (rotation.X == rotation.Y && rotation.Y == rotation.Z && rotation.Z == rotation.W && rotation.W == 0)
2419 rotation = Quaternion.Identity; 2421 rotation = Quaternion.Identity;
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index 97442fd..c67d994 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -2145,84 +2145,93 @@ namespace OpenSim.Region.Environment.Scenes
2145 { 2145 {
2146 SceneObjectGroup sceneObject = m_serialiser.DeserializeGroupFromXml2(objXMLData); 2146 SceneObjectGroup sceneObject = m_serialiser.DeserializeGroupFromXml2(objXMLData);
2147 2147
2148 // If the user is banned, we won't let any of their objects
2149 // enter. Period.
2150 //
2151 if (m_regInfo.EstateSettings.IsBanned(sceneObject.OwnerID))
2152 {
2153 m_log.Info("[INTERREGION]: Denied prim crossing for "+
2154 "banned avatar");
2155
2156 return false;
2157 }
2158
2148 // Force allocation of new LocalId 2159 // Force allocation of new LocalId
2149 // 2160 //
2150 foreach (SceneObjectPart p in sceneObject.Children.Values) 2161 foreach (SceneObjectPart p in sceneObject.Children.Values)
2151 p.LocalId = 0; 2162 p.LocalId = 0;
2152 2163
2153 AddRestoredSceneObject(sceneObject, true, false); 2164 if (sceneObject.RootPart.Shape.PCode == (byte)PCode.Prim)
2154
2155 SceneObjectPart RootPrim = GetSceneObjectPart(primID);
2156 if (RootPrim != null)
2157 { 2165 {
2158 if (m_regInfo.EstateSettings.IsBanned(RootPrim.OwnerID)) 2166 if(sceneObject.RootPart.Shape.State != 0)
2159 { 2167 {
2160 SceneObjectGroup grp = RootPrim.ParentGroup; 2168 // Fix up attachment Parent Local ID
2161 if (grp != null) 2169 //
2162 DeleteSceneObject(grp, false); 2170 ScenePresence sp = GetScenePresence(sceneObject.OwnerID);
2163 2171
2164 m_log.Info("[INTERREGION]: Denied prim crossing for banned avatar"); 2172 uint parentLocalID = 0;
2173 if (sp != null)
2174 parentLocalID = sp.LocalId;
2165 2175
2166 return false; 2176 sceneObject.RootPart.SetParentLocalId(parentLocalID);
2167 }
2168 if (RootPrim.Shape.PCode == (byte)PCode.Prim)
2169 {
2170 SceneObjectGroup grp = RootPrim.ParentGroup;
2171 if((RootPrim.Shape.State == 0) &&
2172 (!Permissions.CanObjectEntry(RootPrim.UUID,
2173 true, RootPrim.AbsolutePosition)))
2174 {
2175 if (grp != null)
2176 {
2177 DeleteSceneObject(grp, false);
2178 }
2179 2177
2180 m_log.Info("[INTERREGION]: Denied prim crossing because of parcel settings"); 2178 AddRestoredSceneObject(sceneObject, false, false);
2181 2179
2182 return false; 2180 // Handle attachment special case
2183 } 2181 //
2184 if (grp != null) 2182 SceneObjectPart RootPrim = GetSceneObjectPart(primID);
2185 {
2186 if (RootPrim.Shape.State != 0)
2187 {
2188 // Never persist
2189 2183
2190 m_log.DebugFormat("[ATTACHMENT]: Received attachment {0}, inworld asset id {1}", grp.RootPart.LastOwnerID.ToString(), grp.UUID.ToString()); 2184 RootPrim.SetParentLocalId(parentLocalID);
2191 2185
2192 grp.DetachFromBackup(); 2186 if (RootPrim != null)
2187 {
2188 SceneObjectGroup grp = RootPrim.ParentGroup;
2189
2190 if (grp != null)
2191 {
2192 m_log.DebugFormat("[ATTACHMENT]: Received "+
2193 "attachment {0}, inworld asset id {1}",
2194 grp.RootPart.LastOwnerID.ToString(),
2195 grp.UUID.ToString());
2193 2196
2194 // Attachment
2195 ScenePresence sp = GetScenePresence(grp.OwnerID);
2196 if (sp != null) 2197 if (sp != null)
2197 { 2198 {
2198 // hack assetID until we get assetID into the XML format.
2199 // LastOwnerID is used for group deeding, so when you do stuff
2200 // with the deeded object, it goes back to them
2201
2202 grp.SetFromAssetID(grp.RootPart.LastOwnerID); 2199 grp.SetFromAssetID(grp.RootPart.LastOwnerID);
2203 m_log.DebugFormat("[ATTACHMENT]: Attach to avatar {0}", sp.UUID.ToString()); 2200 m_log.DebugFormat("[ATTACHMENT]: Attach "+
2204 AttachObject(sp.ControllingClient, grp.LocalId, (uint)0, grp.GroupRotation, grp.AbsolutePosition, false); 2201 "to avatar {0}",
2202 sp.UUID.ToString());
2203 AttachObject(sp.ControllingClient,
2204 grp.LocalId, (uint)0,
2205 grp.GroupRotation,
2206 grp.AbsolutePosition, false);
2205 } 2207 }
2206 else 2208 else
2207 { 2209 {
2208 // Remove, then add, to ensure the expire
2209 // time is refreshed. Wouldn't do to
2210 // have it poof before the avatar gets
2211 // there.
2212 //
2213 RootPrim.RemFlag(PrimFlags.TemporaryOnRez); 2210 RootPrim.RemFlag(PrimFlags.TemporaryOnRez);
2214 RootPrim.AddFlag(PrimFlags.TemporaryOnRez); 2211 RootPrim.AddFlag(PrimFlags.TemporaryOnRez);
2215 } 2212 }
2216 } 2213 }
2217 } 2214 }
2218 } 2215 }
2216 else
2217 {
2218 if (!Permissions.CanObjectEntry(sceneObject.UUID,
2219 true, sceneObject.AbsolutePosition))
2220 {
2221 // Deny non attachments based on parcel settings
2222 //
2223 m_log.Info("[INTERREGION]: Denied prim crossing "+
2224 "because of parcel settings");
2225
2226 return false;
2227 }
2228 }
2229
2230 AddRestoredSceneObject(sceneObject, true, false);
2219 } 2231 }
2220 return true;
2221 }
2222 else
2223 {
2224 return false;
2225 } 2232 }
2233
2234 return true;
2226 } 2235 }
2227 2236
2228 #endregion 2237 #endregion
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
index 8a6f06c..fabf276 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
@@ -592,7 +592,8 @@ namespace OpenSim.Region.Environment.Scenes
592 m_scene = scene; 592 m_scene = scene;
593 RegionHandle = m_scene.RegionInfo.RegionHandle; 593 RegionHandle = m_scene.RegionInfo.RegionHandle;
594 594
595 m_rootPart.ParentID = 0; 595 if (m_rootPart.Shape.PCode != 9 || m_rootPart.Shape.State == 0)
596 m_rootPart.ParentID = 0;
596 if (m_rootPart.LocalId==0) 597 if (m_rootPart.LocalId==0)
597 m_rootPart.LocalId = m_scene.AllocateLocalId(); 598 m_rootPart.LocalId = m_scene.AllocateLocalId();
598 599
@@ -921,9 +922,10 @@ namespace OpenSim.Region.Environment.Scenes
921 public void SetRootPart(SceneObjectPart part) 922 public void SetRootPart(SceneObjectPart part)
922 { 923 {
923 part.SetParent(this); 924 part.SetParent(this);
924 part.ParentID = 0;
925 part.LinkNum = 0;
926 m_rootPart = part; 925 m_rootPart = part;
926 if (!IsAttachment)
927 part.ParentID = 0;
928 part.LinkNum = 0;
927 929
928 // No locking required since the SOG should not be in the scene yet - one can't change root parts after 930 // No locking required since the SOG should not be in the scene yet - one can't change root parts after
929 // the scene object has been attached to the scene 931 // the scene object has been attached to the scene