mirror of
https://github.com/opensim/opensim.git
synced 2026-08-07 17:55:48 +08:00
Add naive implementation of controlled incoming HG attachments to manage load.
Instead of processing all incoming attachment scene object concurrently, process them consecutively to eliminate potential overload from this source. This is a naive implementation because it does not currently account for slow foreign asset services. Although it may take longer, this approach may also improve attachment visibility for HG avatars since the scene object is now always added to the scene after receiving assets from the foreign service and not before.
This commit is contained in:
@@ -98,6 +98,8 @@ namespace OpenSim.Region.Framework.Interfaces
|
||||
void Cross(SceneObjectGroup sog, Vector3 position, bool silent);
|
||||
|
||||
ScenePresence CrossAgentToNewRegionAsync(ScenePresence agent, Vector3 pos, GridRegion neighbourRegion, bool isFlying, string version);
|
||||
|
||||
bool HandleIncomingSceneObject(SceneObjectGroup so, Vector3 newPosition);
|
||||
}
|
||||
|
||||
public interface IUserAgentVerificationModule
|
||||
|
||||
@@ -2623,48 +2623,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
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;
|
||||
}
|
||||
|
||||
if (newPosition != Vector3.Zero)
|
||||
newObject.RootPart.GroupPosition = newPosition;
|
||||
|
||||
if (!AddSceneObject(newObject))
|
||||
{
|
||||
m_log.DebugFormat(
|
||||
"[INTERREGION]: Problem adding scene object {0} in {1} ", newObject.UUID, RegionInfo.RegionName);
|
||||
return false;
|
||||
}
|
||||
|
||||
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.ResumeScripts();
|
||||
|
||||
if (newObject.RootPart.KeyframeMotion != null)
|
||||
newObject.RootPart.KeyframeMotion.UpdateSceneObject(newObject);
|
||||
}
|
||||
if (!EntityTransferModule.HandleIncomingSceneObject(newObject, newPosition))
|
||||
return false;
|
||||
|
||||
// Do this as late as possible so that listeners have full access to the incoming object
|
||||
EventManager.TriggerOnIncomingSceneObject(newObject);
|
||||
@@ -2733,16 +2693,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
return true;
|
||||
}
|
||||
|
||||
private int GetStateSource(SceneObjectGroup sog)
|
||||
{
|
||||
ScenePresence sp = GetScenePresence(sog.OwnerID);
|
||||
|
||||
if (sp != null)
|
||||
return sp.GetStateSource();
|
||||
|
||||
return 2; // StateSource.PrimCrossing
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Add/Remove Avatar Methods
|
||||
|
||||
Reference in New Issue
Block a user