mirror of
https://github.com/opensim/opensim.git
synced 2026-08-06 17:32:42 +08:00
Merge branch 'master' into careminster-presence-refactor
This was rather conflicted. Please test linking.
This commit is contained in:
@@ -121,16 +121,19 @@ namespace OpenSim.Region.OptionalModules.ContentManagement
|
||||
continue;
|
||||
temp = (SceneObjectGroup) currObj;
|
||||
|
||||
if (m_CMEntityHash.ContainsKey(temp.UUID))
|
||||
lock (temp.Children)
|
||||
{
|
||||
foreach (SceneObjectPart part in temp.Children.Values)
|
||||
if (!((ContentManagementEntity)m_CMEntityHash[temp.UUID]).HasChildPrim(part.UUID))
|
||||
if (m_CMEntityHash.ContainsKey(temp.UUID))
|
||||
{
|
||||
foreach (SceneObjectPart part in temp.Children.Values)
|
||||
if (!((ContentManagementEntity)m_CMEntityHash[temp.UUID]).HasChildPrim(part.UUID))
|
||||
missingList.Add(part);
|
||||
}
|
||||
else //Entire group is missing from revision. (and is a new part in region)
|
||||
{
|
||||
foreach (SceneObjectPart part in temp.Children.Values)
|
||||
missingList.Add(part);
|
||||
}
|
||||
else //Entire group is missing from revision. (and is a new part in region)
|
||||
{
|
||||
foreach (SceneObjectPart part in temp.Children.Values)
|
||||
missingList.Add(part);
|
||||
}
|
||||
}
|
||||
}
|
||||
return missingList;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* Copyright (c) Contributors, http://opensimulator.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
@@ -167,9 +167,12 @@ namespace OpenSim.Region.OptionalModules.ContentManagement
|
||||
public void RemoveOrUpdateDeletedEntity(SceneObjectGroup group)
|
||||
{
|
||||
// Deal with new parts not revisioned that have been deleted.
|
||||
foreach (SceneObjectPart part in group.Children.Values)
|
||||
if (m_MetaEntityCollection.Auras.ContainsKey(part.UUID))
|
||||
m_MetaEntityCollection.RemoveNewlyCreatedEntityAura(part.UUID);
|
||||
lock (group.Children)
|
||||
{
|
||||
foreach (SceneObjectPart part in group.Children.Values)
|
||||
if (m_MetaEntityCollection.Auras.ContainsKey(part.UUID))
|
||||
m_MetaEntityCollection.RemoveNewlyCreatedEntityAura(part.UUID);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -207,8 +210,13 @@ namespace OpenSim.Region.OptionalModules.ContentManagement
|
||||
{
|
||||
temp = SceneObjectSerializer.FromXml2Format(xml);
|
||||
temp.SetScene(scene);
|
||||
foreach (SceneObjectPart part in temp.Children.Values)
|
||||
part.RegionHandle = scene.RegionInfo.RegionHandle;
|
||||
|
||||
lock (temp.Children)
|
||||
{
|
||||
foreach (SceneObjectPart part in temp.Children.Values)
|
||||
part.RegionHandle = scene.RegionInfo.RegionHandle;
|
||||
}
|
||||
|
||||
ReplacementList.Add(temp.UUID, (EntityBase)temp);
|
||||
}
|
||||
catch (Exception e)
|
||||
@@ -338,15 +346,20 @@ namespace OpenSim.Region.OptionalModules.ContentManagement
|
||||
System.Collections.ArrayList auraList = new System.Collections.ArrayList();
|
||||
if (group == null)
|
||||
return null;
|
||||
foreach (SceneObjectPart part in group.Children.Values)
|
||||
|
||||
lock (group.Children)
|
||||
{
|
||||
if (m_MetaEntityCollection.Auras.ContainsKey(part.UUID))
|
||||
foreach (SceneObjectPart part in group.Children.Values)
|
||||
{
|
||||
((AuraMetaEntity)m_MetaEntityCollection.Auras[part.UUID]).SetAura(new Vector3(0,254,0), part.Scale);
|
||||
((AuraMetaEntity)m_MetaEntityCollection.Auras[part.UUID]).RootPart.GroupPosition = part.GetWorldPosition();
|
||||
auraList.Add((AuraMetaEntity)m_MetaEntityCollection.Auras[part.UUID]);
|
||||
if (m_MetaEntityCollection.Auras.ContainsKey(part.UUID))
|
||||
{
|
||||
((AuraMetaEntity)m_MetaEntityCollection.Auras[part.UUID]).SetAura(new Vector3(0,254,0), part.Scale);
|
||||
((AuraMetaEntity)m_MetaEntityCollection.Auras[part.UUID]).RootPart.GroupPosition = part.GetWorldPosition();
|
||||
auraList.Add((AuraMetaEntity)m_MetaEntityCollection.Auras[part.UUID]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return auraList;
|
||||
}
|
||||
|
||||
|
||||
@@ -186,9 +186,12 @@ namespace OpenSim.Region.OptionalModules.ContentManagement
|
||||
((ContentManagementEntity)m_model.MetaEntityCollection.Entities[group.UUID]).SendFullDiffUpdateToAll();
|
||||
|
||||
// Deal with new parts not revisioned that have been deleted.
|
||||
foreach (SceneObjectPart part in group.Children.Values)
|
||||
if (m_model.MetaEntityCollection.Auras.ContainsKey(part.UUID))
|
||||
((AuraMetaEntity)m_model.MetaEntityCollection.Auras[part.UUID]).HideFromAll();
|
||||
lock (group.Children)
|
||||
{
|
||||
foreach (SceneObjectPart part in group.Children.Values)
|
||||
if (m_model.MetaEntityCollection.Auras.ContainsKey(part.UUID))
|
||||
((AuraMetaEntity)m_model.MetaEntityCollection.Auras[part.UUID]).HideFromAll();
|
||||
}
|
||||
}
|
||||
|
||||
public void SendMetaEntitiesToNewClient(IClientAPI client)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* Copyright (c) Contributors, http://opensimulator.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
@@ -132,30 +132,33 @@ namespace OpenSim.Region.OptionalModules.ContentManagement
|
||||
// if group is not contained in scene's list
|
||||
if (!ContainsKey(sceneEntityList, m_UnchangedEntity.UUID))
|
||||
{
|
||||
foreach (SceneObjectPart part in m_UnchangedEntity.Children.Values)
|
||||
lock (m_UnchangedEntity.Children)
|
||||
{
|
||||
// if scene list no longer contains this part, display translucent part and mark with red aura
|
||||
if (!ContainsKey(sceneEntityList, part.UUID))
|
||||
foreach (SceneObjectPart part in m_UnchangedEntity.Children.Values)
|
||||
{
|
||||
// if already displaying a red aura over part, make sure its red
|
||||
if (m_AuraEntities.ContainsKey(part.UUID))
|
||||
// if scene list no longer contains this part, display translucent part and mark with red aura
|
||||
if (!ContainsKey(sceneEntityList, part.UUID))
|
||||
{
|
||||
m_AuraEntities[part.UUID].SetAura(new Vector3(254,0,0), part.Scale);
|
||||
// if already displaying a red aura over part, make sure its red
|
||||
if (m_AuraEntities.ContainsKey(part.UUID))
|
||||
{
|
||||
m_AuraEntities[part.UUID].SetAura(new Vector3(254,0,0), part.Scale);
|
||||
}
|
||||
else
|
||||
{
|
||||
AuraMetaEntity auraGroup = new AuraMetaEntity(m_Entity.Scene,
|
||||
part.GetWorldPosition(),
|
||||
MetaEntity.TRANSLUCENT,
|
||||
new Vector3(254,0,0),
|
||||
part.Scale
|
||||
);
|
||||
m_AuraEntities.Add(part.UUID, auraGroup);
|
||||
}
|
||||
SceneObjectPart metaPart = m_Entity.GetLinkNumPart(part.LinkNum);
|
||||
SetPartTransparency(metaPart, MetaEntity.TRANSLUCENT);
|
||||
}
|
||||
else
|
||||
{
|
||||
AuraMetaEntity auraGroup = new AuraMetaEntity(m_Entity.Scene,
|
||||
part.GetWorldPosition(),
|
||||
MetaEntity.TRANSLUCENT,
|
||||
new Vector3(254,0,0),
|
||||
part.Scale
|
||||
);
|
||||
m_AuraEntities.Add(part.UUID, auraGroup);
|
||||
}
|
||||
SceneObjectPart metaPart = m_Entity.GetLinkNumPart(part.LinkNum);
|
||||
SetPartTransparency(metaPart, MetaEntity.TRANSLUCENT);
|
||||
// otherwise, scene will not contain the part. note: a group can not remove a part without changing group id
|
||||
}
|
||||
// otherwise, scene will not contain the part. note: a group can not remove a part without changing group id
|
||||
}
|
||||
|
||||
// a deleted part has no where to point a beam particle system,
|
||||
@@ -180,8 +183,10 @@ namespace OpenSim.Region.OptionalModules.ContentManagement
|
||||
/// </summary>
|
||||
public bool HasChildPrim(UUID uuid)
|
||||
{
|
||||
if (m_UnchangedEntity.Children.ContainsKey(uuid))
|
||||
return true;
|
||||
lock (m_UnchangedEntity.Children)
|
||||
if (m_UnchangedEntity.Children.ContainsKey(uuid))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -190,9 +195,13 @@ namespace OpenSim.Region.OptionalModules.ContentManagement
|
||||
/// </summary>
|
||||
public bool HasChildPrim(uint localID)
|
||||
{
|
||||
foreach (SceneObjectPart part in m_UnchangedEntity.Children.Values)
|
||||
if (part.LocalId == localID)
|
||||
return true;
|
||||
lock (m_UnchangedEntity.Children)
|
||||
{
|
||||
foreach (SceneObjectPart part in m_UnchangedEntity.Children.Values)
|
||||
if (part.LocalId == localID)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -228,37 +237,72 @@ namespace OpenSim.Region.OptionalModules.ContentManagement
|
||||
// Use "UnchangedEntity" to do comparisons because its text, transparency, and other attributes will be just as the user
|
||||
// had originally saved.
|
||||
// m_Entity will NOT necessarily be the same entity as the user had saved.
|
||||
foreach (SceneObjectPart UnchangedPart in m_UnchangedEntity.Children.Values)
|
||||
lock (m_UnchangedEntity.Children)
|
||||
{
|
||||
//This is the part that we use to show changes.
|
||||
metaEntityPart = m_Entity.GetLinkNumPart(UnchangedPart.LinkNum);
|
||||
if (sceneEntityGroup.Children.ContainsKey(UnchangedPart.UUID))
|
||||
foreach (SceneObjectPart UnchangedPart in m_UnchangedEntity.Children.Values)
|
||||
{
|
||||
sceneEntityPart = sceneEntityGroup.Children[UnchangedPart.UUID];
|
||||
differences = Difference.FindDifferences(UnchangedPart, sceneEntityPart);
|
||||
if (differences != Diff.NONE)
|
||||
metaEntityPart.Text = "CHANGE: " + differences.ToString();
|
||||
if (differences != 0)
|
||||
//This is the part that we use to show changes.
|
||||
metaEntityPart = m_Entity.GetLinkNumPart(UnchangedPart.LinkNum);
|
||||
if (sceneEntityGroup.Children.ContainsKey(UnchangedPart.UUID))
|
||||
{
|
||||
// Root Part that has been modified
|
||||
if ((differences&Diff.POSITION) > 0)
|
||||
sceneEntityPart = sceneEntityGroup.Children[UnchangedPart.UUID];
|
||||
differences = Difference.FindDifferences(UnchangedPart, sceneEntityPart);
|
||||
if (differences != Diff.NONE)
|
||||
metaEntityPart.Text = "CHANGE: " + differences.ToString();
|
||||
if (differences != 0)
|
||||
{
|
||||
// Root Part that has been modified
|
||||
if ((differences&Diff.POSITION) > 0)
|
||||
{
|
||||
// If the position of any part has changed, make sure the RootPart of the
|
||||
// meta entity is pointing with a beam particle system
|
||||
if (m_BeamEntities.ContainsKey(m_UnchangedEntity.RootPart.UUID))
|
||||
{
|
||||
m_BeamEntities[m_UnchangedEntity.RootPart.UUID].HideFromAll();
|
||||
m_BeamEntities.Remove(m_UnchangedEntity.RootPart.UUID);
|
||||
}
|
||||
BeamMetaEntity beamGroup = new BeamMetaEntity(m_Entity.Scene,
|
||||
m_UnchangedEntity.RootPart.GetWorldPosition(),
|
||||
MetaEntity.TRANSLUCENT,
|
||||
sceneEntityPart,
|
||||
new Vector3(0,0,254)
|
||||
);
|
||||
m_BeamEntities.Add(m_UnchangedEntity.RootPart.UUID, beamGroup);
|
||||
}
|
||||
|
||||
if (m_AuraEntities.ContainsKey(UnchangedPart.UUID))
|
||||
{
|
||||
m_AuraEntities[UnchangedPart.UUID].HideFromAll();
|
||||
m_AuraEntities.Remove(UnchangedPart.UUID);
|
||||
}
|
||||
AuraMetaEntity auraGroup = new AuraMetaEntity(m_Entity.Scene,
|
||||
UnchangedPart.GetWorldPosition(),
|
||||
MetaEntity.TRANSLUCENT,
|
||||
new Vector3(0,0,254),
|
||||
UnchangedPart.Scale
|
||||
);
|
||||
m_AuraEntities.Add(UnchangedPart.UUID, auraGroup);
|
||||
SetPartTransparency(metaEntityPart, MetaEntity.TRANSLUCENT);
|
||||
|
||||
DiffersFromSceneGroup = true;
|
||||
}
|
||||
else // no differences between scene part and meta part
|
||||
{
|
||||
// If the position of any part has changed, make sure the RootPart of the
|
||||
// meta entity is pointing with a beam particle system
|
||||
if (m_BeamEntities.ContainsKey(m_UnchangedEntity.RootPart.UUID))
|
||||
{
|
||||
m_BeamEntities[m_UnchangedEntity.RootPart.UUID].HideFromAll();
|
||||
m_BeamEntities.Remove(m_UnchangedEntity.RootPart.UUID);
|
||||
}
|
||||
BeamMetaEntity beamGroup = new BeamMetaEntity(m_Entity.Scene,
|
||||
m_UnchangedEntity.RootPart.GetWorldPosition(),
|
||||
MetaEntity.TRANSLUCENT,
|
||||
sceneEntityPart,
|
||||
new Vector3(0,0,254)
|
||||
);
|
||||
m_BeamEntities.Add(m_UnchangedEntity.RootPart.UUID, beamGroup);
|
||||
if (m_AuraEntities.ContainsKey(UnchangedPart.UUID))
|
||||
{
|
||||
m_AuraEntities[UnchangedPart.UUID].HideFromAll();
|
||||
m_AuraEntities.Remove(UnchangedPart.UUID);
|
||||
}
|
||||
SetPartTransparency(metaEntityPart, MetaEntity.NONE);
|
||||
}
|
||||
|
||||
}
|
||||
else //The entity currently in the scene is missing parts from the metaentity saved, so mark parts red as deleted.
|
||||
{
|
||||
if (m_AuraEntities.ContainsKey(UnchangedPart.UUID))
|
||||
{
|
||||
m_AuraEntities[UnchangedPart.UUID].HideFromAll();
|
||||
@@ -267,48 +311,17 @@ namespace OpenSim.Region.OptionalModules.ContentManagement
|
||||
AuraMetaEntity auraGroup = new AuraMetaEntity(m_Entity.Scene,
|
||||
UnchangedPart.GetWorldPosition(),
|
||||
MetaEntity.TRANSLUCENT,
|
||||
new Vector3(0,0,254),
|
||||
new Vector3(254,0,0),
|
||||
UnchangedPart.Scale
|
||||
);
|
||||
m_AuraEntities.Add(UnchangedPart.UUID, auraGroup);
|
||||
SetPartTransparency(metaEntityPart, MetaEntity.TRANSLUCENT);
|
||||
|
||||
|
||||
DiffersFromSceneGroup = true;
|
||||
}
|
||||
else // no differences between scene part and meta part
|
||||
{
|
||||
if (m_BeamEntities.ContainsKey(m_UnchangedEntity.RootPart.UUID))
|
||||
{
|
||||
m_BeamEntities[m_UnchangedEntity.RootPart.UUID].HideFromAll();
|
||||
m_BeamEntities.Remove(m_UnchangedEntity.RootPart.UUID);
|
||||
}
|
||||
if (m_AuraEntities.ContainsKey(UnchangedPart.UUID))
|
||||
{
|
||||
m_AuraEntities[UnchangedPart.UUID].HideFromAll();
|
||||
m_AuraEntities.Remove(UnchangedPart.UUID);
|
||||
}
|
||||
SetPartTransparency(metaEntityPart, MetaEntity.NONE);
|
||||
}
|
||||
}
|
||||
else //The entity currently in the scene is missing parts from the metaentity saved, so mark parts red as deleted.
|
||||
{
|
||||
if (m_AuraEntities.ContainsKey(UnchangedPart.UUID))
|
||||
{
|
||||
m_AuraEntities[UnchangedPart.UUID].HideFromAll();
|
||||
m_AuraEntities.Remove(UnchangedPart.UUID);
|
||||
}
|
||||
AuraMetaEntity auraGroup = new AuraMetaEntity(m_Entity.Scene,
|
||||
UnchangedPart.GetWorldPosition(),
|
||||
MetaEntity.TRANSLUCENT,
|
||||
new Vector3(254,0,0),
|
||||
UnchangedPart.Scale
|
||||
);
|
||||
m_AuraEntities.Add(UnchangedPart.UUID, auraGroup);
|
||||
SetPartTransparency(metaEntityPart, MetaEntity.TRANSLUCENT);
|
||||
|
||||
DiffersFromSceneGroup = true;
|
||||
}
|
||||
}
|
||||
|
||||
return changed;
|
||||
}
|
||||
|
||||
|
||||
@@ -150,15 +150,19 @@ namespace OpenSim.Region.OptionalModules.ContentManagement
|
||||
{
|
||||
//make new uuids
|
||||
Dictionary<UUID, SceneObjectPart> parts = new Dictionary<UUID, SceneObjectPart>();
|
||||
foreach (SceneObjectPart part in m_Entity.Children.Values)
|
||||
|
||||
lock (m_Entity.Children)
|
||||
{
|
||||
part.ResetIDs(part.LinkNum);
|
||||
parts.Add(part.UUID, part);
|
||||
foreach (SceneObjectPart part in m_Entity.Children.Values)
|
||||
{
|
||||
part.ResetIDs(part.LinkNum);
|
||||
parts.Add(part.UUID, part);
|
||||
}
|
||||
|
||||
//finalize
|
||||
m_Entity.RootPart.PhysActor = null;
|
||||
m_Entity.Children = parts;
|
||||
}
|
||||
|
||||
//finalize
|
||||
m_Entity.RootPart.PhysActor = null;
|
||||
m_Entity.Children = parts;
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
@@ -173,8 +177,11 @@ namespace OpenSim.Region.OptionalModules.ContentManagement
|
||||
//This deletes the group without removing from any databases.
|
||||
//This is important because we are not IN any database.
|
||||
//m_Entity.FakeDeleteGroup();
|
||||
foreach (SceneObjectPart part in m_Entity.Children.Values)
|
||||
client.SendKillObject(m_Entity.RegionHandle, part.LocalId);
|
||||
lock (m_Entity.Children)
|
||||
{
|
||||
foreach (SceneObjectPart part in m_Entity.Children.Values)
|
||||
client.SendKillObject(m_Entity.RegionHandle, part.LocalId);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -182,12 +189,15 @@ namespace OpenSim.Region.OptionalModules.ContentManagement
|
||||
/// </summary>
|
||||
public virtual void HideFromAll()
|
||||
{
|
||||
foreach (SceneObjectPart part in m_Entity.Children.Values)
|
||||
lock (m_Entity.Children)
|
||||
{
|
||||
m_Entity.Scene.ForEachClient(
|
||||
delegate(IClientAPI controller)
|
||||
{ controller.SendKillObject(m_Entity.RegionHandle, part.LocalId); }
|
||||
);
|
||||
foreach (SceneObjectPart part in m_Entity.Children.Values)
|
||||
{
|
||||
m_Entity.Scene.ForEachClient(
|
||||
delegate(IClientAPI controller)
|
||||
{ controller.SendKillObject(m_Entity.RegionHandle, part.LocalId); }
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -185,14 +185,19 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||
get
|
||||
{
|
||||
SceneObjectPart my = GetSOP();
|
||||
int total = my.ParentGroup.Children.Count;
|
||||
|
||||
IObject[] rets = new IObject[total];
|
||||
|
||||
int i = 0;
|
||||
foreach (KeyValuePair<UUID, SceneObjectPart> pair in my.ParentGroup.Children)
|
||||
IObject[] rets = null;
|
||||
|
||||
lock (my.ParentGroup.Children)
|
||||
{
|
||||
rets[i++] = new SOPObject(m_rootScene, pair.Value.LocalId, m_security);
|
||||
int total = my.ParentGroup.Children.Count;
|
||||
|
||||
rets = new IObject[total];
|
||||
|
||||
int i = 0;
|
||||
foreach (KeyValuePair<UUID, SceneObjectPart> pair in my.ParentGroup.Children)
|
||||
{
|
||||
rets[i++] = new SOPObject(m_rootScene, pair.Value.LocalId, m_security);
|
||||
}
|
||||
}
|
||||
|
||||
return rets;
|
||||
|
||||
Reference in New Issue
Block a user