aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/Scene.cs
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/Region/Environment/Scenes/Scene.cs
parent* minor: Stop startup complaining about a missing MyAssetSet.xml all the time... (diff)
downloadopensim-SC_OLD-287c724b5585b87822da4ba92f8a1c55b7d33a67.zip
opensim-SC_OLD-287c724b5585b87822da4ba92f8a1c55b7d33a67.tar.gz
opensim-SC_OLD-287c724b5585b87822da4ba92f8a1c55b7d33a67.tar.bz2
opensim-SC_OLD-287c724b5585b87822da4ba92f8a1c55b7d33a67.tar.xz
A try to better attachment crossing.
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/Scene.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs109
1 files changed, 59 insertions, 50 deletions
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