Committing the LCO database layer. Native MySQL, no ADO. New reconnect

mechanism to prevent prim loss. Preserve link order on sim restart
and drag copy. Fix drag-copied prims' inventories. Fix persistence
of child prim inventories.
0.6.1-post-fixes
Melanie Thielker 2008-11-26 07:34:38 +00:00
parent 3e42cca2c0
commit 3efdccbb12
6 changed files with 802 additions and 1503 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,6 @@
BEGIN;
ALTER TABLE prims ADD COLUMN LinkNumber integer not null default 0;
COMMIT;

View File

@ -329,6 +329,7 @@ namespace OpenSim.Framework
{ {
_itemID = UUID.Random(); _itemID = UUID.Random();
_parentPartID = partID; _parentPartID = partID;
_parentID = partID;
} }
public TaskInventoryItem() public TaskInventoryItem()

View File

@ -1336,6 +1336,8 @@ namespace OpenSim.Region.Environment.Scenes
dupe.CopyRootPart(m_rootPart, OwnerID, GroupID, userExposed); dupe.CopyRootPart(m_rootPart, OwnerID, GroupID, userExposed);
dupe.m_rootPart.LinkNum = m_rootPart.LinkNum;
if (userExposed) if (userExposed)
dupe.m_rootPart.TrimPermissions(); dupe.m_rootPart.TrimPermissions();
@ -1368,16 +1370,25 @@ namespace OpenSim.Region.Environment.Scenes
} }
List<SceneObjectPart> partList = new List<SceneObjectPart>(m_parts.Values); List<SceneObjectPart> partList = new List<SceneObjectPart>(m_parts.Values);
partList.Sort(delegate(SceneObjectPart p1, SceneObjectPart p2)
{
return p1.LinkNum.CompareTo(p2.LinkNum);
}
);
foreach (SceneObjectPart part in partList) foreach (SceneObjectPart part in partList)
{ {
if (part.UUID != m_rootPart.UUID) if (part.UUID != m_rootPart.UUID)
{ {
dupe.CopyPart(part, OwnerID, GroupID, userExposed); SceneObjectPart newPart =
dupe.CopyPart(part, OwnerID, GroupID, userExposed);
newPart.LinkNum = part.LinkNum;
if (userExposed) if (userExposed)
{ {
SetPartOwner(part, cAgentID, cGroupID); SetPartOwner(newPart, cAgentID, cGroupID);
part.ScheduleFullUpdate(); newPart.ScheduleFullUpdate();
} }
} }
} }
@ -1507,7 +1518,7 @@ namespace OpenSim.Region.Environment.Scenes
/// <param name="part"></param> /// <param name="part"></param>
/// <param name="cAgentID"></param> /// <param name="cAgentID"></param>
/// <param name="cGroupID"></param> /// <param name="cGroupID"></param>
public void CopyPart(SceneObjectPart part, UUID cAgentID, UUID cGroupID, bool userExposed) public SceneObjectPart CopyPart(SceneObjectPart part, UUID cAgentID, UUID cGroupID, bool userExposed)
{ {
SceneObjectPart newPart = part.Copy(m_scene.AllocateLocalId(), OwnerID, GroupID, m_parts.Count, userExposed); SceneObjectPart newPart = part.Copy(m_scene.AllocateLocalId(), OwnerID, GroupID, m_parts.Count, userExposed);
newPart.SetParent(this); newPart.SetParent(this);
@ -1519,6 +1530,7 @@ namespace OpenSim.Region.Environment.Scenes
SetPartAsNonRoot(newPart); SetPartAsNonRoot(newPart);
return newPart;
} }
/// <summary> /// <summary>

View File

@ -1263,10 +1263,18 @@ if (m_shape != null) {
dupe._category = _category; dupe._category = _category;
dupe.m_rezzed = m_rezzed; dupe.m_rezzed = m_rezzed;
dupe.m_inventory.Items = (TaskInventoryDictionary)dupe.m_inventory.Items.Clone(); dupe.m_inventory = new SceneObjectPartInventory(dupe);
dupe.m_inventory.Items = (TaskInventoryDictionary)m_inventory.Items.Clone();
if (userExposed) if (userExposed)
{
dupe.ResetIDs(linkNum); dupe.ResetIDs(linkNum);
dupe.m_inventory.HasInventoryChanged = true;
}
else
{
dupe.m_inventory.HasInventoryChanged = m_inventory.HasInventoryChanged;
}
// Move afterwards ResetIDs as it clears the localID // Move afterwards ResetIDs as it clears the localID
dupe.LocalId = localID; dupe.LocalId = localID;

View File

@ -64,7 +64,7 @@ namespace OpenSim.Region.Environment.Scenes
/// <summary> /// <summary>
/// Tracks whether inventory has changed since the last persistent backup /// Tracks whether inventory has changed since the last persistent backup
/// </summary> /// </summary>
protected bool HasInventoryChanged; internal bool HasInventoryChanged;
/// <value> /// <value>
/// Inventory serial number /// Inventory serial number
@ -81,7 +81,11 @@ namespace OpenSim.Region.Environment.Scenes
protected internal TaskInventoryDictionary Items protected internal TaskInventoryDictionary Items
{ {
get { return m_items; } get { return m_items; }
set { m_items = value; } set
{
m_items = value;
m_inventorySerial++;
}
} }
/// <summary> /// <summary>