Pull prim crossing/teleport checks up into Scene.IncomingCreateObject() from Scene.AddObject()
Only IncomingCreateObject() needs these checks. General object adding does not need to perform crossing perm checks0.7.3-extended
parent
0aaf935333
commit
6bcb5baab6
|
@ -2447,7 +2447,16 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
m_log.WarnFormat("[SCENE]: Problem casting object, exception {0}{1}", e.Message, e.StackTrace);
|
m_log.WarnFormat("[INTERREGION]: Problem casting object, exception {0}{1}", e.Message, e.StackTrace);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// If the user is banned, we won't let any of their objects
|
||||||
|
// enter. Period.
|
||||||
|
//
|
||||||
|
if (RegionInfo.EstateSettings.IsBanned(newObject.OwnerID))
|
||||||
|
{
|
||||||
|
m_log.InfoFormat("[INTERREGION]: Denied prim crossing for banned avatar {0}", newObject.OwnerID);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2456,14 +2465,28 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
if (!AddSceneObject(newObject))
|
if (!AddSceneObject(newObject))
|
||||||
{
|
{
|
||||||
m_log.DebugFormat("[SCENE]: Problem adding scene object {0} in {1} ", sog.UUID, RegionInfo.RegionName);
|
m_log.DebugFormat(
|
||||||
|
"[INTERREGION]: Problem adding scene object {0} in {1} ", newObject.UUID, RegionInfo.RegionName);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// For attachments, we need to wait until the agent is root
|
|
||||||
// before we restart the scripts, or else some functions won't work.
|
|
||||||
if (!newObject.IsAttachment)
|
if (!newObject.IsAttachment)
|
||||||
{
|
{
|
||||||
|
// FIXME: It would be better to never add the scene object at all rather than add it and then delete
|
||||||
|
// it
|
||||||
|
if (!Permissions.CanObjectEntry(newObject.UUID, true, newObject.AbsolutePosition))
|
||||||
|
{
|
||||||
|
// Deny non attachments based on parcel settings
|
||||||
|
//
|
||||||
|
m_log.Info("[INTERREGION]: Denied prim crossing because of parcel settings");
|
||||||
|
|
||||||
|
DeleteSceneObject(newObject, false);
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// For attachments, we need to wait until the agent is root
|
||||||
|
// before we restart the scripts, or else some functions won't work.
|
||||||
newObject.RootPart.ParentGroup.CreateScriptInstances(0, false, DefaultScriptEngine, GetStateSource(newObject));
|
newObject.RootPart.ParentGroup.CreateScriptInstances(0, false, DefaultScriptEngine, GetStateSource(newObject));
|
||||||
newObject.ResumeScripts();
|
newObject.ResumeScripts();
|
||||||
}
|
}
|
||||||
|
@ -2483,16 +2506,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// <returns>True if the SceneObjectGroup was added, False if it was not</returns>
|
/// <returns>True if the SceneObjectGroup was added, False if it was not</returns>
|
||||||
public bool AddSceneObject(SceneObjectGroup sceneObject)
|
public bool AddSceneObject(SceneObjectGroup sceneObject)
|
||||||
{
|
{
|
||||||
// If the user is banned, we won't let any of their objects
|
|
||||||
// enter. Period.
|
|
||||||
//
|
|
||||||
if (RegionInfo.EstateSettings.IsBanned(sceneObject.OwnerID))
|
|
||||||
{
|
|
||||||
m_log.InfoFormat("[INTERREGION]: Denied prim crossing for banned avatar {0}", sceneObject.OwnerID);
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
sceneObject.SetScene(this);
|
sceneObject.SetScene(this);
|
||||||
|
|
||||||
// Force allocation of new LocalId
|
// Force allocation of new LocalId
|
||||||
|
|
Loading…
Reference in New Issue