* Add extra backup parameter to InnerScene.AddRestoredSceneObject()

0.6.0-stable
Justin Clarke Casey 2008-06-27 14:15:14 +00:00
parent 63a1a2739a
commit c9b41bdc4e
5 changed files with 25 additions and 11 deletions

View File

@ -181,7 +181,7 @@ namespace OpenSim.Region.Environment.Scenes
{ {
SceneObjectGroup obj = new SceneObjectGroup(xmlData); SceneObjectGroup obj = new SceneObjectGroup(xmlData);
scene.AddSceneObjectFromStorage(obj); scene.AddRestoredSceneObject(obj, true);
} }
public static void SavePrimsToXml2(Scene scene, string fileName) public static void SavePrimsToXml2(Scene scene, string fileName)

View File

@ -192,7 +192,11 @@ namespace OpenSim.Region.Environment.Scenes
/// Add an object into the scene that has come from storage /// Add an object into the scene that has come from storage
/// </summary> /// </summary>
/// <param name="sceneObject"></param> /// <param name="sceneObject"></param>
protected internal void AddSceneObjectFromStorage(SceneObjectGroup sceneObject) /// <param name="attachToBackup">
/// If true, changes to the object will be reflected in its persisted data
/// If false, the persisted data will not be changed even if the object in the scene is changed
/// </param>
protected internal void AddRestoredSceneObject(SceneObjectGroup sceneObject, bool attachToBackup)
{ {
sceneObject.RegionHandle = m_regInfo.RegionHandle; sceneObject.RegionHandle = m_regInfo.RegionHandle;
sceneObject.SetScene(m_parentScene); sceneObject.SetScene(m_parentScene);
@ -204,7 +208,7 @@ namespace OpenSim.Region.Environment.Scenes
sceneObject.UpdateParentIDs(); sceneObject.UpdateParentIDs();
AddSceneObject(sceneObject, true); AddSceneObject(sceneObject, attachToBackup);
} }
/// <summary> /// <summary>

View File

@ -1470,7 +1470,7 @@ namespace OpenSim.Region.Environment.Scenes
List<SceneObjectGroup> PrimsFromDB = m_storageManager.DataStore.LoadObjects(regionID); List<SceneObjectGroup> PrimsFromDB = m_storageManager.DataStore.LoadObjects(regionID);
foreach (SceneObjectGroup group in PrimsFromDB) foreach (SceneObjectGroup group in PrimsFromDB)
{ {
AddSceneObjectFromStorage(group); AddRestoredSceneObject(group, true);
SceneObjectPart rootPart = group.GetChildPart(group.UUID); SceneObjectPart rootPart = group.GetChildPart(group.UUID);
rootPart.ObjectFlags &= ~(uint)LLObject.ObjectFlags.Scripted; rootPart.ObjectFlags &= ~(uint)LLObject.ObjectFlags.Scripted;
rootPart.TrimPermissions(); rootPart.TrimPermissions();
@ -1651,9 +1651,9 @@ namespace OpenSim.Region.Environment.Scenes
/// Add an object into the scene that has come from storage /// Add an object into the scene that has come from storage
/// </summary> /// </summary>
/// <param name="sceneObject"></param> /// <param name="sceneObject"></param>
public void AddSceneObjectFromStorage(SceneObjectGroup sceneObject) public void AddRestoredSceneObject(SceneObjectGroup sceneObject, bool attachToBackup)
{ {
m_innerScene.AddSceneObjectFromStorage(sceneObject); m_innerScene.AddRestoredSceneObject(sceneObject, attachToBackup);
} }
/// <summary> /// <summary>

View File

@ -94,6 +94,7 @@ namespace OpenSim.Region.Environment.Scenes
/// since the group's last persistent backup /// since the group's last persistent backup
/// </summary> /// </summary>
public bool HasGroupChanged = false; public bool HasGroupChanged = false;
public float scriptScore = 0f; public float scriptScore = 0f;
private LLVector3 lastPhysGroupPos; private LLVector3 lastPhysGroupPos;
@ -1530,7 +1531,7 @@ namespace OpenSim.Region.Environment.Scenes
} }
/// <summary> /// <summary>
/// Schedule a full update for every part in this object /// Schedule a full update for this scene object
/// </summary> /// </summary>
public void ScheduleGroupForFullUpdate() public void ScheduleGroupForFullUpdate()
{ {
@ -1546,7 +1547,7 @@ namespace OpenSim.Region.Environment.Scenes
} }
/// <summary> /// <summary>
/// /// Schedule a terse update for this scene object
/// </summary> /// </summary>
public void ScheduleGroupForTerseUpdate() public void ScheduleGroupForTerseUpdate()
{ {
@ -1562,7 +1563,7 @@ namespace OpenSim.Region.Environment.Scenes
} }
/// <summary> /// <summary>
/// /// Immediately send a full update for this scene object.
/// </summary> /// </summary>
public void SendGroupFullUpdate() public void SendGroupFullUpdate()
{ {
@ -1583,7 +1584,7 @@ namespace OpenSim.Region.Environment.Scenes
} }
/// <summary> /// <summary>
/// /// Immediately send a terse update for this scene object.
/// </summary> /// </summary>
public void SendGroupTerseUpdate() public void SendGroupTerseUpdate()
{ {
@ -2100,7 +2101,7 @@ namespace OpenSim.Region.Environment.Scenes
#region Resize #region Resize
/// <summary> /// <summary>
/// /// Resize the given part
/// </summary> /// </summary>
/// <param name="scale"></param> /// <param name="scale"></param>
/// <param name="localID"></param> /// <param name="localID"></param>
@ -2531,6 +2532,12 @@ namespace OpenSim.Region.Environment.Scenes
} }
} }
} }
/// <summary>
/// Set the user group to which this scene object belongs.
/// </summary>
/// <param name="GroupID"></param>
/// <param name="client"></param>
public void SetGroup(LLUUID GroupID, IClientAPI client) public void SetGroup(LLUUID GroupID, IClientAPI client)
{ {
lock (m_parts) lock (m_parts)
@ -2540,6 +2547,7 @@ namespace OpenSim.Region.Environment.Scenes
part.SetGroup(GroupID, client); part.SetGroup(GroupID, client);
} }
} }
ScheduleGroupForFullUpdate(); ScheduleGroupForFullUpdate();
} }
} }

View File

@ -3125,12 +3125,14 @@ namespace OpenSim.Region.Environment.Scenes
ParentGroup.RootPart.BaseMask); ParentGroup.RootPart.BaseMask);
} }
public void SetGroup(LLUUID groupID, IClientAPI client) public void SetGroup(LLUUID groupID, IClientAPI client)
{ {
GroupID = groupID; GroupID = groupID;
GetProperties(client); GetProperties(client);
m_updateFlag = 2; m_updateFlag = 2;
} }
private void handleTimerAccounting(uint localID, double interval) private void handleTimerAccounting(uint localID, double interval)
{ {
if (localID == LocalId) if (localID == LocalId)