Ditto...More work on the AllNewSceneObject* classes.

afrisby
MW 2007-08-03 12:00:24 +00:00
parent dde8aafb8a
commit ad21cb2ea8
2 changed files with 75 additions and 6 deletions

View File

@ -19,7 +19,6 @@ namespace OpenSim.Region.Environment.Scenes
protected Dictionary<LLUUID, AllNewSceneObjectPart2> m_parts = new Dictionary<LLUUID, AllNewSceneObjectPart2>();
protected ulong m_regionHandle;
protected Scene m_scene;
public event PrimCountTaintedDelegate OnPrimCountTainted;
@ -54,8 +53,10 @@ namespace OpenSim.Region.Environment.Scenes
m_scene = world;
this.Pos = pos;
this.m_rootPart = new AllNewSceneObjectPart2(m_regionHandle, this, ownerID, localID, shape, pos);
this.m_parts.Add(this.m_rootPart.UUID, this.m_rootPart);
LLVector3 rootOffset = new LLVector3(0, 0, 0);
AllNewSceneObjectPart2 newPart = new AllNewSceneObjectPart2(m_regionHandle, this, ownerID, localID, shape, rootOffset);
this.m_parts.Add(newPart.UUID, newPart);
this.SetPartAsRoot(newPart);
}
/// <summary>
@ -63,7 +64,10 @@ namespace OpenSim.Region.Environment.Scenes
/// </summary>
public void FlagGroupForFullUpdate()
{
foreach (AllNewSceneObjectPart2 part in this.m_parts.Values)
{
part.SendFullUpdateToAllClients();
}
}
/// <summary>
@ -71,7 +75,10 @@ namespace OpenSim.Region.Environment.Scenes
/// </summary>
public void FlagGroupForTerseUpdate()
{
foreach (AllNewSceneObjectPart2 part in this.m_parts.Values)
{
part.SendTerseUpdateToALLClients();
}
}
/// <summary>
@ -413,5 +420,14 @@ namespace OpenSim.Region.Environment.Scenes
{
}
/// <summary>
///
/// </summary>
/// <returns></returns>
public List<ScenePresence> RequestSceneAvatars()
{
return m_scene.RequestAvatarList();
}
}
}

View File

@ -316,16 +316,25 @@ namespace OpenSim.Region.Environment.Scenes
#endregion
#region Update Scheduling
/// <summary>
///
/// </summary>
private void ClearUpdateSchedule()
{
m_updateFlag = 0;
}
/// <summary>
///
/// </summary>
private void ScheduleFullUpdate()
{
m_updateFlag = 2;
}
/// <summary>
///
/// </summary>
private void ScheduleTerseUpdate()
{
if (m_updateFlag < 1)
@ -333,6 +342,26 @@ namespace OpenSim.Region.Environment.Scenes
m_updateFlag = 1;
}
}
/// <summary>
///
/// </summary>
public void SendScheduledUpdates()
{
if (m_updateFlag == 1) //some change has been made so update the clients
{
SendTerseUpdateToALLClients();
ClearUpdateSchedule();
}
else
{
if (m_updateFlag == 2) // is a new prim just been created/reloaded or has major changes
{
SendFullUpdateToAllClients();
ClearUpdateSchedule();
}
}
}
#endregion
#region Shape
@ -389,7 +418,7 @@ namespace OpenSim.Region.Environment.Scenes
this.m_Shape.ExtraParams[i++] = (byte)((length >> 24) % 256);
Array.Copy(data, 0, this.m_Shape.ExtraParams, i, data.Length);
//this.ScheduleFullUpdate();
this.ScheduleFullUpdate();
}
#endregion
@ -442,6 +471,18 @@ namespace OpenSim.Region.Environment.Scenes
#endregion
#region Client Update Methods
/// <summary>
///
/// </summary>
public void SendFullUpdateToAllClients()
{
List<ScenePresence> avatars = this.m_parentGroup.RequestSceneAvatars();
for (int i = 0; i < avatars.Count; i++)
{
SendFullUpdateToClient(avatars[i].ControllingClient);
}
}
/// <summary>
///
/// </summary>
@ -457,6 +498,18 @@ namespace OpenSim.Region.Environment.Scenes
OwnerID, m_text, ParentID, this.m_particleSystem);
}
/// <summary>
///
/// </summary>
public void SendTerseUpdateToALLClients()
{
List<ScenePresence> avatars = this.m_parentGroup.RequestSceneAvatars();
for (int i = 0; i < avatars.Count; i++)
{
SendTerseUpdateToClient(avatars[i].ControllingClient);
}
}
/// <summary>
///
/// </summary>