Merge branch 'master' into careminster-presence-refactor

This commit is contained in:
Melanie
2010-03-04 11:02:01 +00:00
26 changed files with 958 additions and 318 deletions

View File

@@ -488,8 +488,8 @@ namespace OpenSim.Region.Framework.Scenes
private List<SceneObjectPart> m_PlaySoundSlavePrims = new List<SceneObjectPart>();
public List<SceneObjectPart> PlaySoundSlavePrims
{
get { return m_LoopSoundSlavePrims; }
set { m_LoopSoundSlavePrims = value; }
get { return m_PlaySoundSlavePrims; }
set { m_PlaySoundSlavePrims = value; }
}
private SceneObjectPart m_LoopSoundMasterPrim = null;
@@ -641,8 +641,10 @@ namespace OpenSim.Region.Framework.Scenes
}
ApplyPhysics(m_scene.m_physicalPrim);
ScheduleGroupForFullUpdate();
// Don't trigger the update here - otherwise some client issues occur when multiple updates are scheduled
// for the same object with very different properties. The caller must schedule the update.
//ScheduleGroupForFullUpdate();
}
public Vector3 GroupScale()
@@ -1044,10 +1046,11 @@ namespace OpenSim.Region.Framework.Scenes
// don't attach attachments to child agents
if (avatar.IsChildAgent) return;
// m_log.DebugFormat("[SOG]: Adding attachment {0} to avatar {1}", Name, avatar.Name);
DetachFromBackup();
// Remove from database and parcel prim count
//
m_scene.DeleteFromStorage(UUID);
m_scene.EventManager.TriggerParcelPrimCountTainted();
@@ -1073,7 +1076,6 @@ namespace OpenSim.Region.Framework.Scenes
SetAttachmentPoint(Convert.ToByte(attachmentpoint));
avatar.AddAttachment(this);
m_log.Debug("[SOG]: Added attachment " + UUID + " to avatar " + avatar.UUID);
if (!silent)
{
@@ -1090,6 +1092,12 @@ namespace OpenSim.Region.Framework.Scenes
ScheduleGroupForFullUpdate();
}
}
else
{
m_log.WarnFormat(
"[SOG]: Tried to add attachment {0} to avatar with UUID {1} in region {2} but the avatar is not present",
UUID, agentID, Scene.RegionInfo.RegionName);
}
}
public byte GetAttachmentPoint()
@@ -1596,11 +1604,10 @@ namespace OpenSim.Region.Framework.Scenes
#endregion
#region Client Updating
public void SendFullUpdateToClient(IClientAPI remoteClient)
{
SendPartFullUpdate(remoteClient, RootPart, m_scene.Permissions.GenerateClientFlags(remoteClient.AgentId, RootPart.UUID));
RootPart.SendFullUpdate(
remoteClient, m_scene.Permissions.GenerateClientFlags(remoteClient.AgentId, RootPart.UUID));
lockPartsForRead(true);
{
@@ -1608,42 +1615,12 @@ namespace OpenSim.Region.Framework.Scenes
{
if (part != RootPart)
SendPartFullUpdate(remoteClient, part, m_scene.Permissions.GenerateClientFlags(remoteClient.AgentId, part.UUID));
part.SendFullUpdate(
remoteClient, m_scene.Permissions.GenerateClientFlags(remoteClient.AgentId, part.UUID));
}
}
lockPartsForRead(false);
}
/// <summary>
/// Send a full update to the client for the given part
/// </summary>
/// <param name="remoteClient"></param>
/// <param name="part"></param>
internal void SendPartFullUpdate(IClientAPI remoteClient, SceneObjectPart part, uint clientFlags)
{
// m_log.DebugFormat(
// "[SOG]: Sendinging part full update to {0} for {1} {2}", remoteClient.Name, part.Name, part.LocalId);
if (m_rootPart.UUID == part.UUID)
{
if (IsAttachment)
{
part.SendFullUpdateToClient(remoteClient, m_rootPart.AttachedPos, clientFlags);
}
else
{
part.SendFullUpdateToClient(remoteClient, AbsolutePosition, clientFlags);
}
}
else
{
part.SendFullUpdateToClient(remoteClient, clientFlags);
}
}
#endregion
#region Copying
/// <summary>
@@ -2108,6 +2085,8 @@ namespace OpenSim.Region.Framework.Scenes
public void ScheduleFullUpdateToAvatar(ScenePresence presence)
{
// m_log.DebugFormat("[SOG]: Scheduling full update for {0} {1} just to avatar {2}", Name, UUID, presence.Name);
RootPart.AddFullUpdateToAvatar(presence);
lockPartsForRead(true);
@@ -2126,14 +2105,12 @@ namespace OpenSim.Region.Framework.Scenes
public void ScheduleTerseUpdateToAvatar(ScenePresence presence)
{
lockPartsForRead(true);
foreach (SceneObjectPart part in m_parts.Values)
{
foreach (SceneObjectPart part in m_parts.Values)
{
part.AddTerseUpdateToAvatar(presence);
}
part.AddTerseUpdateToAvatar(presence);
}
lockPartsForRead(false);
}
@@ -2142,6 +2119,8 @@ namespace OpenSim.Region.Framework.Scenes
/// </summary>
public void ScheduleGroupForFullUpdate()
{
// m_log.DebugFormat("[SOG]: Scheduling full update for {0} {1}", Name, UUID);
checkAtTargets();
RootPart.ScheduleFullUpdate();
@@ -2164,14 +2143,12 @@ namespace OpenSim.Region.Framework.Scenes
public void ScheduleGroupForTerseUpdate()
{
lockPartsForRead(true);
foreach (SceneObjectPart part in m_parts.Values)
{
foreach (SceneObjectPart part in m_parts.Values)
{
part.ScheduleTerseUpdate();
}
part.ScheduleTerseUpdate();
}
lockPartsForRead(false);
}
@@ -2179,9 +2156,11 @@ namespace OpenSim.Region.Framework.Scenes
/// Immediately send a full update for this scene object.
/// </summary>
public void SendGroupFullUpdate()
{
{
if (IsDeleted)
return;
// m_log.DebugFormat("[SOG]: Sending immediate full group update for {0} {1}", Name, UUID);
RootPart.SendFullUpdateToAllClients();
@@ -2201,7 +2180,7 @@ namespace OpenSim.Region.Framework.Scenes
/// <summary>
/// Immediately send an update for this scene object's root prim only.
/// This is for updates regarding the object as a whole, and none of its parts in particular.
/// Note: this may not be cused by opensim (it probably should) but it's used by
/// Note: this may not be used by opensim (it probably should) but it's used by
/// external modules.
/// </summary>
public void SendGroupRootTerseUpdate()
@@ -2216,6 +2195,7 @@ namespace OpenSim.Region.Framework.Scenes
{
if (m_scene == null) // Need to check here as it's null during object creation
return;
m_scene.SceneGraph.AddToUpdateList(this);
}
@@ -3718,7 +3698,10 @@ namespace OpenSim.Region.Framework.Scenes
HasGroupChanged = true;
}
lockPartsForRead(false);
ScheduleGroupForFullUpdate();
// Don't trigger the update here - otherwise some client issues occur when multiple updates are scheduled
// for the same object with very different properties. The caller must schedule the update.
//ScheduleGroupForFullUpdate();
}
public void TriggerScriptChangedEvent(Changed val)