* Implemented LIBOMV-418: Add SetObjectSaleInfo() function to ObjectManager

* Cleaned up locking in KillObjectHandler
* Fixed an xml param name in Simulator.SendPacketUnqueued

git-svn-id: http://libopenmetaverse.googlecode.com/svn/libopenmetaverse/trunk@2337 52acb1d6-8a22-11de-b505-999d5b087335
This commit is contained in:
2008-11-09 18:51:38 +00:00
parent 7ecdfa97bc
commit ae2f5ce1b3
2 changed files with 50 additions and 7 deletions

View File

@@ -478,6 +478,49 @@ namespace OpenMetaverse
Client.Network.SendPacket(select, simulator);
}
/// <summary>
/// Sets an object's sale information
/// </summary>
/// <param name="localID"></param>
/// <param name="saleType"></param>
/// <param name="price"></param>
public void SetObjectSaleInfo(uint localID, SaleType saleType, int price)
{
ObjectSaleInfoPacket sale = new ObjectSaleInfoPacket();
sale.AgentData.AgentID = Client.Self.AgentID;
sale.AgentData.SessionID = Client.Self.SessionID;
sale.ObjectData = new ObjectSaleInfoPacket.ObjectDataBlock[1];
sale.ObjectData[0] = new ObjectSaleInfoPacket.ObjectDataBlock();
sale.ObjectData[0].LocalID = localID;
sale.ObjectData[0].SalePrice = price;
sale.ObjectData[0].SaleType = (byte)saleType;
Client.Network.SendPacket(sale);
}
/// <summary>
/// Sets sale info for multiple objects
/// </summary>
/// <param name="localIDs"></param>
/// <param name="saleType"></param>
/// <param name="price"></param>
public void SetObjectSaleInfo(List<uint> localIDs, SaleType saleType, int price)
{
ObjectSaleInfoPacket sale = new ObjectSaleInfoPacket();
sale.AgentData.AgentID = Client.Self.AgentID;
sale.AgentData.SessionID = Client.Self.SessionID;
sale.ObjectData = new ObjectSaleInfoPacket.ObjectDataBlock[localIDs.Count];
for (int i = 0; i < localIDs.Count; i++)
{
sale.ObjectData[i] = new ObjectSaleInfoPacket.ObjectDataBlock();
sale.ObjectData[i].LocalID = localIDs[i];
sale.ObjectData[i].SalePrice = price;
sale.ObjectData[i].SaleType = (byte)saleType;
}
Client.Network.SendPacket(sale);
}
/// <summary>
/// Deselect an object
/// </summary>
@@ -2124,16 +2167,16 @@ namespace OpenMetaverse
}
}
}
//Do the actual removing outside of the loops but still inside the lock.
//This safely prevents the collection from being modified during a loop.
foreach (uint removeID in removeAvatars)
simulator.ObjectsAvatars.Dictionary.Remove(removeID);
}
}
//Do the actual removing outside of the loops but still inside the lock.
//This safely prevents the collection from being modified during a loop.
foreach (uint removeID in removeAvatars)
simulator.ObjectsAvatars.Remove(removeID);
foreach (uint removeID in removePrims)
simulator.ObjectsPrimitives.Remove(removeID);
simulator.ObjectsPrimitives.Dictionary.Remove(removeID);
}
}