* Make it possible to store creator strings in user inventory items as well as UUIDs

* All existing functionality should be unaffected.
* Database schemas have not been changed.
0.6.5-rc1
Justin Clarke Casey 2009-04-08 17:50:57 +00:00
parent 8d8c45b659
commit f3c7298fc5
21 changed files with 98 additions and 75 deletions

View File

@ -1293,7 +1293,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
rdata.writer.WriteAttributeString("uuid", String.Empty, i.ID.ToString()); rdata.writer.WriteAttributeString("uuid", String.Empty, i.ID.ToString());
rdata.writer.WriteAttributeString("folder", String.Empty, i.Folder.ToString()); rdata.writer.WriteAttributeString("folder", String.Empty, i.Folder.ToString());
rdata.writer.WriteAttributeString("owner", String.Empty, i.Owner.ToString()); rdata.writer.WriteAttributeString("owner", String.Empty, i.Owner.ToString());
rdata.writer.WriteAttributeString("creator", String.Empty, i.Creator.ToString()); rdata.writer.WriteAttributeString("creator", String.Empty, i.CreatorId);
rdata.writer.WriteAttributeString("creationdate", String.Empty, i.CreationDate.ToString()); rdata.writer.WriteAttributeString("creationdate", String.Empty, i.CreationDate.ToString());
rdata.writer.WriteAttributeString("invtype", String.Empty, i.InvType.ToString()); rdata.writer.WriteAttributeString("invtype", String.Empty, i.InvType.ToString());
rdata.writer.WriteAttributeString("assettype", String.Empty, i.AssetType.ToString()); rdata.writer.WriteAttributeString("assettype", String.Empty, i.AssetType.ToString());
@ -1392,7 +1392,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|| newf.Folder != oldf.Folder || newf.Folder != oldf.Folder
|| newf.Description != oldf.Description || newf.Description != oldf.Description
|| newf.Owner != oldf.Owner || newf.Owner != oldf.Owner
|| newf.Creator != oldf.Creator || newf.CreatorId != oldf.CreatorId
|| newf.AssetID != oldf.AssetID || newf.AssetID != oldf.AssetID
|| newf.GroupID != oldf.GroupID || newf.GroupID != oldf.GroupID
|| newf.GroupOwned != oldf.GroupOwned || newf.GroupOwned != oldf.GroupOwned
@ -1676,7 +1676,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
result.ID = UUID.Zero; result.ID = UUID.Zero;
result.Folder = UUID.Zero; result.Folder = UUID.Zero;
result.Owner = ic.UserID; result.Owner = ic.UserID;
result.Creator = ic.UserID; result.CreatorId = ic.UserID.ToString();
result.AssetID = UUID.Zero; result.AssetID = UUID.Zero;
result.GroupID = UUID.Zero; result.GroupID = UUID.Zero;
result.GroupOwned = false; result.GroupOwned = false;
@ -1710,7 +1710,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
result.InvType = Int32.Parse(ic.xml.Value); result.InvType = Int32.Parse(ic.xml.Value);
break; break;
case "creator": case "creator":
result.Creator = new UUID(ic.xml.Value); result.CreatorId = ic.xml.Value;
break; break;
case "assettype": case "assettype":
result.AssetType = Int32.Parse(ic.xml.Value); result.AssetType = Int32.Parse(ic.xml.Value);

View File

@ -181,7 +181,7 @@ namespace OpenSim.Data.MSSQL
} }
} }
} }
m_log.InfoFormat("[INVENTORY DB] : FOund no inventory folder with ID : {0}", folderID); m_log.InfoFormat("[INVENTORY DB] : Found no inventory folder with ID : {0}", folderID);
return null; return null;
} }
@ -244,7 +244,7 @@ namespace OpenSim.Data.MSSQL
} }
catch (Exception e) catch (Exception e)
{ {
m_log.ErrorFormat("[ASSET DB] Error : {0}", e.Message); m_log.ErrorFormat("[INVENTORY DB]: Error : {0}", e.Message);
} }
} }
} }
@ -277,7 +277,7 @@ namespace OpenSim.Data.MSSQL
} }
catch (Exception e) catch (Exception e)
{ {
m_log.ErrorFormat("[ASSET DB] Error : {0}", e.Message); m_log.ErrorFormat("[INVENTORY DB]: Error : {0}", e.Message);
} }
} }
} }
@ -300,7 +300,7 @@ namespace OpenSim.Data.MSSQL
} }
catch (Exception e) catch (Exception e)
{ {
m_log.ErrorFormat("[ASSET DB] Error : {0}", e.Message); m_log.ErrorFormat("[INVENTORY DB]: Error : {0}", e.Message);
} }
} }
} }
@ -385,7 +385,8 @@ namespace OpenSim.Data.MSSQL
} }
} }
} }
m_log.InfoFormat("[INVENTORY DB] : Found no inventory item with ID : {0}", itemID);
m_log.InfoFormat("[INVENTORY DB]: Found no inventory item with ID : {0}", itemID);
return null; return null;
} }
@ -424,7 +425,7 @@ namespace OpenSim.Data.MSSQL
command.Parameters.Add(database.CreateParameter("inventoryNextPermissions", item.NextPermissions)); command.Parameters.Add(database.CreateParameter("inventoryNextPermissions", item.NextPermissions));
command.Parameters.Add(database.CreateParameter("inventoryCurrentPermissions", item.CurrentPermissions)); command.Parameters.Add(database.CreateParameter("inventoryCurrentPermissions", item.CurrentPermissions));
command.Parameters.Add(database.CreateParameter("invType", item.InvType)); command.Parameters.Add(database.CreateParameter("invType", item.InvType));
command.Parameters.Add(database.CreateParameter("creatorID", item.Creator)); command.Parameters.Add(database.CreateParameter("creatorID", item.CreatorId));
command.Parameters.Add(database.CreateParameter("inventoryBasePermissions", item.BasePermissions)); command.Parameters.Add(database.CreateParameter("inventoryBasePermissions", item.BasePermissions));
command.Parameters.Add(database.CreateParameter("inventoryEveryOnePermissions", item.EveryOnePermissions)); command.Parameters.Add(database.CreateParameter("inventoryEveryOnePermissions", item.EveryOnePermissions));
command.Parameters.Add(database.CreateParameter("inventoryGroupPermissions", item.GroupPermissions)); command.Parameters.Add(database.CreateParameter("inventoryGroupPermissions", item.GroupPermissions));
@ -441,7 +442,7 @@ namespace OpenSim.Data.MSSQL
} }
catch (Exception e) catch (Exception e)
{ {
m_log.Error("[INVENTORY DB] Error inserting item :" + e.Message); m_log.Error("[INVENTORY DB]: Error inserting item :" + e.Message);
} }
} }
@ -498,7 +499,7 @@ namespace OpenSim.Data.MSSQL
command.Parameters.Add(database.CreateParameter("inventoryNextPermissions", item.NextPermissions)); command.Parameters.Add(database.CreateParameter("inventoryNextPermissions", item.NextPermissions));
command.Parameters.Add(database.CreateParameter("inventoryCurrentPermissions", item.CurrentPermissions)); command.Parameters.Add(database.CreateParameter("inventoryCurrentPermissions", item.CurrentPermissions));
command.Parameters.Add(database.CreateParameter("invType", item.InvType)); command.Parameters.Add(database.CreateParameter("invType", item.InvType));
command.Parameters.Add(database.CreateParameter("creatorID", item.Creator)); command.Parameters.Add(database.CreateParameter("creatorID", item.CreatorIdAsUuid));
command.Parameters.Add(database.CreateParameter("inventoryBasePermissions", item.BasePermissions)); command.Parameters.Add(database.CreateParameter("inventoryBasePermissions", item.BasePermissions));
command.Parameters.Add(database.CreateParameter("inventoryEveryOnePermissions", item.EveryOnePermissions)); command.Parameters.Add(database.CreateParameter("inventoryEveryOnePermissions", item.EveryOnePermissions));
command.Parameters.Add(database.CreateParameter("salePrice", item.SalePrice)); command.Parameters.Add(database.CreateParameter("salePrice", item.SalePrice));
@ -515,7 +516,7 @@ namespace OpenSim.Data.MSSQL
} }
catch (Exception e) catch (Exception e)
{ {
m_log.Error("[INVENTORY DB] Error updating item :" + e.Message); m_log.Error("[INVENTORY DB]: Error updating item :" + e.Message);
} }
} }
} }
@ -538,7 +539,7 @@ namespace OpenSim.Data.MSSQL
} }
catch (Exception e) catch (Exception e)
{ {
m_log.Error("[INVENTORY DB] Error deleting item :" + e.Message); m_log.Error("[INVENTORY DB]: Error deleting item :" + e.Message);
} }
} }
} }
@ -725,7 +726,7 @@ namespace OpenSim.Data.MSSQL
item.NextPermissions = Convert.ToUInt32(reader["inventoryNextPermissions"]); item.NextPermissions = Convert.ToUInt32(reader["inventoryNextPermissions"]);
item.CurrentPermissions = Convert.ToUInt32(reader["inventoryCurrentPermissions"]); item.CurrentPermissions = Convert.ToUInt32(reader["inventoryCurrentPermissions"]);
item.InvType = Convert.ToInt32(reader["invType"].ToString()); item.InvType = Convert.ToInt32(reader["invType"].ToString());
item.Creator = new UUID((Guid)reader["creatorID"]); item.CreatorId = ((Guid)reader["creatorID"]).ToString();
item.BasePermissions = Convert.ToUInt32(reader["inventoryBasePermissions"]); item.BasePermissions = Convert.ToUInt32(reader["inventoryBasePermissions"]);
item.EveryOnePermissions = Convert.ToUInt32(reader["inventoryEveryOnePermissions"]); item.EveryOnePermissions = Convert.ToUInt32(reader["inventoryEveryOnePermissions"]);
item.GroupPermissions = Convert.ToUInt32(reader["inventoryGroupPermissions"]); item.GroupPermissions = Convert.ToUInt32(reader["inventoryGroupPermissions"]);
@ -740,7 +741,7 @@ namespace OpenSim.Data.MSSQL
} }
catch (SqlException e) catch (SqlException e)
{ {
m_log.Error("[INVENTORY DB] Error reading inventory item :" + e.Message); m_log.Error("[INVENTORY DB]: Error reading inventory item :" + e.Message);
} }
return null; return null;
@ -764,7 +765,7 @@ namespace OpenSim.Data.MSSQL
} }
catch (SqlException e) catch (SqlException e)
{ {
m_log.Error("[INVENTORY DB] Error deleting folder :" + e.Message); m_log.Error("[INVENTORY DB]: Error deleting folder :" + e.Message);
} }
} }

View File

@ -306,19 +306,17 @@ namespace OpenSim.Data.MySQL
try try
{ {
InventoryItemBase item = new InventoryItemBase(); InventoryItemBase item = new InventoryItemBase();
item.CreatorId = (string)reader["creatorID"];
// Be a bit safer in parsing these because the // Be a bit safer in parsing these because the
// database doesn't enforce them to be not null, and // database doesn't enforce them to be not null, and
// the inventory still works if these are weird in the // the inventory still works if these are weird in the
// db // db
UUID Owner = UUID.Zero; UUID Owner = UUID.Zero;
UUID Creator = UUID.Zero;
UUID GroupID = UUID.Zero; UUID GroupID = UUID.Zero;
UUID.TryParse((string)reader["avatarID"], out Owner); UUID.TryParse((string)reader["avatarID"], out Owner);
UUID.TryParse((string)reader["creatorID"], out Creator);
UUID.TryParse((string)reader["groupID"], out GroupID); UUID.TryParse((string)reader["groupID"], out GroupID);
item.Owner = Owner; item.Owner = Owner;
item.Creator = Creator;
item.GroupID = GroupID; item.GroupID = GroupID;
// Rest of the parsing. If these UUID's fail, we're dead anyway // Rest of the parsing. If these UUID's fail, we're dead anyway
@ -480,7 +478,7 @@ namespace OpenSim.Data.MySQL
result.Parameters.AddWithValue("?inventoryCurrentPermissions", result.Parameters.AddWithValue("?inventoryCurrentPermissions",
item.CurrentPermissions.ToString()); item.CurrentPermissions.ToString());
result.Parameters.AddWithValue("?invType", item.InvType); result.Parameters.AddWithValue("?invType", item.InvType);
result.Parameters.AddWithValue("?creatorID", item.Creator.ToString()); result.Parameters.AddWithValue("?creatorID", item.CreatorId);
result.Parameters.AddWithValue("?inventoryBasePermissions", item.BasePermissions); result.Parameters.AddWithValue("?inventoryBasePermissions", item.BasePermissions);
result.Parameters.AddWithValue("?inventoryEveryOnePermissions", item.EveryOnePermissions); result.Parameters.AddWithValue("?inventoryEveryOnePermissions", item.EveryOnePermissions);
result.Parameters.AddWithValue("?inventoryGroupPermissions", item.GroupPermissions); result.Parameters.AddWithValue("?inventoryGroupPermissions", item.GroupPermissions);

View File

@ -143,7 +143,7 @@ namespace OpenSim.Data.SQLite
item.InvType = Convert.ToInt32(row["invType"]); item.InvType = Convert.ToInt32(row["invType"]);
item.Folder = new UUID((string) row["parentFolderID"]); item.Folder = new UUID((string) row["parentFolderID"]);
item.Owner = new UUID((string) row["avatarID"]); item.Owner = new UUID((string) row["avatarID"]);
item.Creator = new UUID((string) row["creatorsID"]); item.CreatorId = (string)row["creatorsID"];
item.Name = (string) row["inventoryName"]; item.Name = (string) row["inventoryName"];
item.Description = (string) row["inventoryDescription"]; item.Description = (string) row["inventoryDescription"];
@ -176,7 +176,7 @@ namespace OpenSim.Data.SQLite
} }
/// <summary> /// <summary>
/// /// Fill a database row with item data
/// </summary> /// </summary>
/// <param name="row"></param> /// <param name="row"></param>
/// <param name="item"></param> /// <param name="item"></param>
@ -188,7 +188,7 @@ namespace OpenSim.Data.SQLite
row["invType"] = item.InvType; row["invType"] = item.InvType;
row["parentFolderID"] = Util.ToRawUuidString(item.Folder); row["parentFolderID"] = Util.ToRawUuidString(item.Folder);
row["avatarID"] = Util.ToRawUuidString(item.Owner); row["avatarID"] = Util.ToRawUuidString(item.Owner);
row["creatorsID"] = Util.ToRawUuidString(item.Creator); row["creatorsID"] = Util.ToRawUuidString(item.CreatorIdAsUuid);
row["inventoryName"] = item.Name; row["inventoryName"] = item.Name;
row["inventoryDescription"] = item.Description; row["inventoryDescription"] = item.Description;
@ -281,7 +281,7 @@ namespace OpenSim.Data.SQLite
DataRow inventoryRow = inventoryItemTable.Rows.Find(Util.ToRawUuidString(item.ID)); DataRow inventoryRow = inventoryItemTable.Rows.Find(Util.ToRawUuidString(item.ID));
if (inventoryRow == null) if (inventoryRow == null)
{ {
if (! add) if (!add)
m_log.ErrorFormat("[INVENTORY DB]: Interface Misuse: Attempting to Update non-existant inventory item: {0}", item.ID); m_log.ErrorFormat("[INVENTORY DB]: Interface Misuse: Attempting to Update non-existant inventory item: {0}", item.ID);
inventoryRow = inventoryItemTable.NewRow(); inventoryRow = inventoryItemTable.NewRow();

View File

@ -271,7 +271,7 @@ namespace OpenSim.Data.Tests
i.ID = id; i.ID = id;
i.Folder = parent; i.Folder = parent;
i.Owner = owner; i.Owner = owner;
i.Creator = owner; i.CreatorId = owner.ToString();
i.Name = name; i.Name = name;
i.Description = name; i.Description = name;
i.AssetID = asset; i.AssetID = asset;

View File

@ -606,7 +606,7 @@ namespace OpenSim.Data.Tests
UUID owner = UUID.Random(); UUID owner = UUID.Random();
i.Owner = owner; i.Owner = owner;
UUID creator = UUID.Random(); UUID creator = UUID.Random();
i.Creator = creator; i.CreatorId = creator.ToString();
string name = RandomName(); string name = RandomName();
i.Name = name; i.Name = name;
i.Description = name; i.Description = name;
@ -982,7 +982,7 @@ namespace OpenSim.Data.Tests
i.ID = id; i.ID = id;
i.Folder = parent; i.Folder = parent;
i.Owner = owner; i.Owner = owner;
i.Creator = owner; i.CreatorId = owner.ToString();
i.Name = name; i.Name = name;
i.Description = name; i.Description = name;
i.AssetID = asset; i.AssetID = asset;

View File

@ -72,7 +72,7 @@ namespace OpenSim.Framework.Communications.Cache
{ {
InventoryItemBase item = new InventoryItemBase(); InventoryItemBase item = new InventoryItemBase();
item.Owner = libOwner; item.Owner = libOwner;
item.Creator = libOwner; item.CreatorId = libOwner.ToString();
item.ID = inventoryID; item.ID = inventoryID;
item.AssetID = assetID; item.AssetID = assetID;
item.Description = description; item.Description = description;
@ -159,7 +159,7 @@ namespace OpenSim.Framework.Communications.Cache
{ {
InventoryItemBase item = new InventoryItemBase(); InventoryItemBase item = new InventoryItemBase();
item.Owner = libOwner; item.Owner = libOwner;
item.Creator = libOwner; item.CreatorId = libOwner.ToString();
item.ID = new UUID(config.GetString("inventoryID", ID.ToString())); item.ID = new UUID(config.GetString("inventoryID", ID.ToString()));
item.AssetID = new UUID(config.GetString("assetID", item.ID.ToString())); item.AssetID = new UUID(config.GetString("assetID", item.ID.ToString()));
item.Folder = new UUID(config.GetString("folderID", ID.ToString())); item.Folder = new UUID(config.GetString("folderID", ID.ToString()));

View File

@ -440,7 +440,7 @@ namespace OpenSim.Framework.Communications.Capabilities
llsdItem.type = Enum.GetName(typeof(AssetType), invItem.AssetType).ToLower(); llsdItem.type = Enum.GetName(typeof(AssetType), invItem.AssetType).ToLower();
llsdItem.inv_type = Enum.GetName(typeof(InventoryType), invItem.InvType).ToLower(); llsdItem.inv_type = Enum.GetName(typeof(InventoryType), invItem.InvType).ToLower();
llsdItem.permissions = new LLSDPermissions(); llsdItem.permissions = new LLSDPermissions();
llsdItem.permissions.creator_id = invItem.Creator; llsdItem.permissions.creator_id = invItem.CreatorIdAsUuid;
llsdItem.permissions.base_mask = (int)invItem.CurrentPermissions; llsdItem.permissions.base_mask = (int)invItem.CurrentPermissions;
llsdItem.permissions.everyone_mask = (int)invItem.EveryOnePermissions; llsdItem.permissions.everyone_mask = (int)invItem.EveryOnePermissions;
llsdItem.permissions.group_id = UUID.Zero; llsdItem.permissions.group_id = UUID.Zero;
@ -789,7 +789,7 @@ namespace OpenSim.Framework.Communications.Capabilities
InventoryItemBase item = new InventoryItemBase(); InventoryItemBase item = new InventoryItemBase();
item.Owner = m_agentID; item.Owner = m_agentID;
item.Creator = m_agentID; item.CreatorId = m_agentID.ToString();
item.ID = inventoryItem; item.ID = inventoryItem;
item.AssetID = asset.FullID; item.AssetID = asset.FullID;
item.Description = assetDescription; item.Description = assetDescription;

View File

@ -53,8 +53,16 @@ namespace OpenSim.Framework
/// <summary> /// <summary>
/// The creator of this item /// The creator of this item
/// </summary> /// </summary>
private UUID _creator; private string m_creatorId = String.Empty;
/// <summary>
/// The creator of this item expressed as a UUID
/// </summary>
private UUID m_creatorIdAsUuid = UUID.Zero;
/// <summary>
///
/// </summary>
private uint _nextPermissions; private uint _nextPermissions;
/// <summary> /// <summary>
@ -129,10 +137,27 @@ namespace OpenSim.Framework
set { _folder = value; } set { _folder = value; }
} }
public UUID Creator /// <value>
/// The creator ID
/// </value>
public string CreatorId
{ {
get { return _creator; } get { return m_creatorId; }
set { _creator = value; } set
{
m_creatorId = value;
// For now, all IDs are UUIDs
UUID.TryParse(m_creatorId, out m_creatorIdAsUuid);
}
}
/// <value>
/// The creator ID expressed as a UUID
/// </value>
public UUID CreatorIdAsUuid
{
get { return m_creatorIdAsUuid; }
} }
public string Description public string Description

View File

@ -216,7 +216,7 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins
writer.WriteString(item.InvType.ToString()); writer.WriteString(item.InvType.ToString());
writer.WriteEndElement(); writer.WriteEndElement();
writer.WriteStartElement("CreatorUUID"); writer.WriteStartElement("CreatorUUID");
writer.WriteString(item.Creator.ToString()); writer.WriteString(item.CreatorId);
writer.WriteEndElement(); writer.WriteEndElement();
writer.WriteStartElement("CreationDate"); writer.WriteStartElement("CreationDate");
writer.WriteString(item.CreationDate.ToString()); writer.WriteString(item.CreationDate.ToString());

View File

@ -598,7 +598,6 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins.OpenSim
{ {
InventoryItemBase item = new InventoryItemBase(); InventoryItemBase item = new InventoryItemBase();
try try
{ {
using (XmlReader reader = XmlReader.Create(stream)) using (XmlReader reader = XmlReader.Create(stream))
@ -624,9 +623,8 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins.OpenSim
ReadUUID(reader, "Folder", out dummyUUID); ReadUUID(reader, "Folder", out dummyUUID);
item.Folder = dummyUUID; item.Folder = dummyUUID;
ReadUUID(reader, "Creator", out dummyUUID);
item.Creator = dummyUUID;
item.CreatorId = reader.ReadElementContentAsString("Creator", String.Empty);
item.Description = reader.ReadElementContentAsString("Description", String.Empty); item.Description = reader.ReadElementContentAsString("Description", String.Empty);
uint dummyUInt; uint dummyUInt;
@ -757,7 +755,7 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins.OpenSim
writer.WriteElementString("InvType", XmlConvert.ToString(item.InvType)); writer.WriteElementString("InvType", XmlConvert.ToString(item.InvType));
WriteUUID(writer, "Folder", item.Folder); WriteUUID(writer, "Folder", item.Folder);
WriteUUID(writer, "Owner", item.Owner); WriteUUID(writer, "Owner", item.Owner);
WriteUUID(writer, "Creator", item.Creator); writer.WriteElementString("Creator", item.CreatorId);
writer.WriteElementString("Name", item.Name); writer.WriteElementString("Name", item.Name);
writer.WriteElementString("Description", item.Description); writer.WriteElementString("Description", item.Description);
writer.WriteElementString("NextPermissions", XmlConvert.ToString(item.NextPermissions)); writer.WriteElementString("NextPermissions", XmlConvert.ToString(item.NextPermissions));

View File

@ -515,7 +515,7 @@ namespace OpenSim.Grid.AssetInventoryServer
else if (Reader.LocalName == "Creator" && Reader.NamespaceURI == "" && !b13) else if (Reader.LocalName == "Creator" && Reader.NamespaceURI == "" && !b13)
{ {
b13 = true; b13 = true;
ob.@Creator = ReadObject_UUID(false, true); ob.@CreatorId = Reader.ReadElementString();
} }
else if (Reader.LocalName == "Owner" && Reader.NamespaceURI == "" && !b12) else if (Reader.LocalName == "Owner" && Reader.NamespaceURI == "" && !b12)
{ {
@ -876,7 +876,7 @@ namespace OpenSim.Grid.AssetInventoryServer
WriteElementString("InvType", "", ob.@InvType.ToString(CultureInfo.InvariantCulture)); WriteElementString("InvType", "", ob.@InvType.ToString(CultureInfo.InvariantCulture));
WriteObject_UUID(ob.@Folder, "Folder", "", false, false, true); WriteObject_UUID(ob.@Folder, "Folder", "", false, false, true);
WriteObject_UUID(ob.@Owner, "Owner", "", false, false, true); WriteObject_UUID(ob.@Owner, "Owner", "", false, false, true);
WriteObject_UUID(ob.@Creator, "Creator", "", false, false, true); WriteElementString("Creator", "", ob.@CreatorId);
WriteElementString("Name", "", ob.@Name); WriteElementString("Name", "", ob.@Name);
WriteElementString("Description", "", ob.@Description); WriteElementString("Description", "", ob.@Description);
WriteElementString("NextPermissions", "", ob.@NextPermissions.ToString(CultureInfo.InvariantCulture)); WriteElementString("NextPermissions", "", ob.@NextPermissions.ToString(CultureInfo.InvariantCulture));

View File

@ -1729,7 +1729,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
descend.ItemData[i] = new InventoryDescendentsPacket.ItemDataBlock(); descend.ItemData[i] = new InventoryDescendentsPacket.ItemDataBlock();
descend.ItemData[i].ItemID = item.ID; descend.ItemData[i].ItemID = item.ID;
descend.ItemData[i].AssetID = item.AssetID; descend.ItemData[i].AssetID = item.AssetID;
descend.ItemData[i].CreatorID = item.Creator; descend.ItemData[i].CreatorID = item.CreatorIdAsUuid;
descend.ItemData[i].BaseMask = item.BasePermissions; descend.ItemData[i].BaseMask = item.BasePermissions;
descend.ItemData[i].Description = LLUtil.StringToPacketBytes(item.Description); descend.ItemData[i].Description = LLUtil.StringToPacketBytes(item.Description);
descend.ItemData[i].EveryoneMask = item.EveryOnePermissions; descend.ItemData[i].EveryoneMask = item.EveryOnePermissions;
@ -1928,7 +1928,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
inventoryReply.InventoryData[0] = new FetchInventoryReplyPacket.InventoryDataBlock(); inventoryReply.InventoryData[0] = new FetchInventoryReplyPacket.InventoryDataBlock();
inventoryReply.InventoryData[0].ItemID = item.ID; inventoryReply.InventoryData[0].ItemID = item.ID;
inventoryReply.InventoryData[0].AssetID = item.AssetID; inventoryReply.InventoryData[0].AssetID = item.AssetID;
inventoryReply.InventoryData[0].CreatorID = item.Creator; inventoryReply.InventoryData[0].CreatorID = item.CreatorIdAsUuid;
inventoryReply.InventoryData[0].BaseMask = item.BasePermissions; inventoryReply.InventoryData[0].BaseMask = item.BasePermissions;
inventoryReply.InventoryData[0].CreationDate = item.CreationDate; inventoryReply.InventoryData[0].CreationDate = item.CreationDate;
@ -1950,13 +1950,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
inventoryReply.InventoryData[0].SaleType = item.SaleType; inventoryReply.InventoryData[0].SaleType = item.SaleType;
inventoryReply.InventoryData[0].CRC = inventoryReply.InventoryData[0].CRC =
Helpers.InventoryCRC(1000, 0, inventoryReply.InventoryData[0].InvType, Helpers.InventoryCRC(
inventoryReply.InventoryData[0].Type, inventoryReply.InventoryData[0].AssetID, 1000, 0, inventoryReply.InventoryData[0].InvType,
inventoryReply.InventoryData[0].GroupID, 100, inventoryReply.InventoryData[0].Type, inventoryReply.InventoryData[0].AssetID,
inventoryReply.InventoryData[0].OwnerID, inventoryReply.InventoryData[0].CreatorID, inventoryReply.InventoryData[0].GroupID, 100,
inventoryReply.InventoryData[0].ItemID, inventoryReply.InventoryData[0].FolderID, inventoryReply.InventoryData[0].OwnerID, inventoryReply.InventoryData[0].CreatorID,
FULL_MASK_PERMISSIONS, 1, FULL_MASK_PERMISSIONS, FULL_MASK_PERMISSIONS, inventoryReply.InventoryData[0].ItemID, inventoryReply.InventoryData[0].FolderID,
FULL_MASK_PERMISSIONS); FULL_MASK_PERMISSIONS, 1, FULL_MASK_PERMISSIONS, FULL_MASK_PERMISSIONS,
FULL_MASK_PERMISSIONS);
inventoryReply.Header.Zerocoded = true; inventoryReply.Header.Zerocoded = true;
OutPacket(inventoryReply, ThrottleOutPacketType.Asset); OutPacket(inventoryReply, ThrottleOutPacketType.Asset);
} }
@ -2075,7 +2076,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
itemBlock.ItemID = item.ID; itemBlock.ItemID = item.ID;
itemBlock.AssetID = item.AssetID; itemBlock.AssetID = item.AssetID;
itemBlock.CreatorID = item.Creator; itemBlock.CreatorID = item.CreatorIdAsUuid;
itemBlock.BaseMask = item.BasePermissions; itemBlock.BaseMask = item.BasePermissions;
itemBlock.Description = LLUtil.StringToPacketBytes(item.Description); itemBlock.Description = LLUtil.StringToPacketBytes(item.Description);
itemBlock.EveryoneMask = item.EveryOnePermissions; itemBlock.EveryoneMask = item.EveryOnePermissions;
@ -2138,7 +2139,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
bulkUpdate.ItemData[0] = new BulkUpdateInventoryPacket.ItemDataBlock(); bulkUpdate.ItemData[0] = new BulkUpdateInventoryPacket.ItemDataBlock();
bulkUpdate.ItemData[0].ItemID = item.ID; bulkUpdate.ItemData[0].ItemID = item.ID;
bulkUpdate.ItemData[0].AssetID = item.AssetID; bulkUpdate.ItemData[0].AssetID = item.AssetID;
bulkUpdate.ItemData[0].CreatorID = item.Creator; bulkUpdate.ItemData[0].CreatorID = item.CreatorIdAsUuid;
bulkUpdate.ItemData[0].BaseMask = item.BasePermissions; bulkUpdate.ItemData[0].BaseMask = item.BasePermissions;
bulkUpdate.ItemData[0].CreationDate = item.CreationDate; bulkUpdate.ItemData[0].CreationDate = item.CreationDate;
bulkUpdate.ItemData[0].Description = LLUtil.StringToPacketBytes(item.Description); bulkUpdate.ItemData[0].Description = LLUtil.StringToPacketBytes(item.Description);
@ -2186,7 +2187,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
InventoryReply.InventoryData[0] = new UpdateCreateInventoryItemPacket.InventoryDataBlock(); InventoryReply.InventoryData[0] = new UpdateCreateInventoryItemPacket.InventoryDataBlock();
InventoryReply.InventoryData[0].ItemID = Item.ID; InventoryReply.InventoryData[0].ItemID = Item.ID;
InventoryReply.InventoryData[0].AssetID = Item.AssetID; InventoryReply.InventoryData[0].AssetID = Item.AssetID;
InventoryReply.InventoryData[0].CreatorID = Item.Creator; InventoryReply.InventoryData[0].CreatorID = Item.CreatorIdAsUuid;
InventoryReply.InventoryData[0].BaseMask = Item.BasePermissions; InventoryReply.InventoryData[0].BaseMask = Item.BasePermissions;
InventoryReply.InventoryData[0].Description = LLUtil.StringToPacketBytes(Item.Description); InventoryReply.InventoryData[0].Description = LLUtil.StringToPacketBytes(Item.Description);
InventoryReply.InventoryData[0].EveryoneMask = Item.EveryOnePermissions; InventoryReply.InventoryData[0].EveryoneMask = Item.EveryOnePermissions;
@ -6746,7 +6747,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
InventoryItemBase item = new InventoryItemBase(); InventoryItemBase item = new InventoryItemBase();
item.ID = rezScriptx.InventoryBlock.ItemID; item.ID = rezScriptx.InventoryBlock.ItemID;
item.Folder = rezScriptx.InventoryBlock.FolderID; item.Folder = rezScriptx.InventoryBlock.FolderID;
item.Creator = rezScriptx.InventoryBlock.CreatorID; item.CreatorId = rezScriptx.InventoryBlock.CreatorID.ToString();
item.Owner = rezScriptx.InventoryBlock.OwnerID; item.Owner = rezScriptx.InventoryBlock.OwnerID;
item.BasePermissions = rezScriptx.InventoryBlock.BaseMask; item.BasePermissions = rezScriptx.InventoryBlock.BaseMask;
item.CurrentPermissions = rezScriptx.InventoryBlock.OwnerMask; item.CurrentPermissions = rezScriptx.InventoryBlock.OwnerMask;

View File

@ -211,7 +211,6 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
} }
} }
private void DoCreateItem(uint callbackID) private void DoCreateItem(uint callbackID)
{ {
m_userTransactions.Manager.MyScene.CommsManager.AssetCache.AddAsset(m_asset); m_userTransactions.Manager.MyScene.CommsManager.AssetCache.AddAsset(m_asset);
@ -223,7 +222,7 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
{ {
InventoryItemBase item = new InventoryItemBase(); InventoryItemBase item = new InventoryItemBase();
item.Owner = ourClient.AgentId; item.Owner = ourClient.AgentId;
item.Creator = ourClient.AgentId; item.CreatorId = ourClient.AgentId.ToString();
item.ID = UUID.Random(); item.ID = UUID.Random();
item.AssetID = m_asset.FullID; item.AssetID = m_asset.FullID;
item.Description = m_description; item.Description = m_description;

View File

@ -819,7 +819,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
item.AssetType = (int)AssetType.CallingCard; item.AssetType = (int)AssetType.CallingCard;
item.BasePermissions = (uint)PermissionMask.Copy; item.BasePermissions = (uint)PermissionMask.Copy;
item.CreationDate = Util.UnixTimeSinceEpoch(); item.CreationDate = Util.UnixTimeSinceEpoch();
item.Creator = creator; item.CreatorId = creator.ToString();
item.CurrentPermissions = item.BasePermissions; item.CurrentPermissions = item.BasePermissions;
item.Description = ""; item.Description = "";
item.EveryOnePermissions = (uint)PermissionMask.None; item.EveryOnePermissions = (uint)PermissionMask.None;

View File

@ -97,7 +97,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
item.InvType = Convert.ToInt32(reader.ReadString()); item.InvType = Convert.ToInt32(reader.ReadString());
reader.ReadEndElement(); reader.ReadEndElement();
reader.ReadStartElement("CreatorUUID"); reader.ReadStartElement("CreatorUUID");
item.Creator = UUID.Parse(reader.ReadString()); item.CreatorId = reader.ReadString();
reader.ReadEndElement(); reader.ReadEndElement();
reader.ReadStartElement("CreationDate"); reader.ReadStartElement("CreationDate");
item.CreationDate = Convert.ToInt32(reader.ReadString()); item.CreationDate = Convert.ToInt32(reader.ReadString());
@ -329,7 +329,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
// Don't use the item ID that's in the file // Don't use the item ID that's in the file
item.ID = UUID.Random(); item.ID = UUID.Random();
item.Creator = m_userInfo.UserProfile.ID; item.CreatorId = m_userInfo.UserProfile.ID.ToString();
item.Owner = m_userInfo.UserProfile.ID; item.Owner = m_userInfo.UserProfile.ID;
// Reset folder ID to the one in which we want to load it // Reset folder ID to the one in which we want to load it

View File

@ -140,7 +140,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
writer.WriteString(inventoryItem.InvType.ToString()); writer.WriteString(inventoryItem.InvType.ToString());
writer.WriteEndElement(); writer.WriteEndElement();
writer.WriteStartElement("CreatorUUID"); writer.WriteStartElement("CreatorUUID");
writer.WriteString(inventoryItem.Creator.ToString()); writer.WriteString(inventoryItem.CreatorId);
writer.WriteEndElement(); writer.WriteEndElement();
writer.WriteStartElement("CreationDate"); writer.WriteStartElement("CreationDate");
writer.WriteString(inventoryItem.CreationDate.ToString()); writer.WriteString(inventoryItem.CreationDate.ToString());
@ -189,7 +189,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
m_archive.WriteFile(filename, sw.ToString()); m_archive.WriteFile(filename, sw.ToString());
UUID creatorId = inventoryItem.Creator; UUID creatorId = inventoryItem.CreatorIdAsUuid;
// Record the creator of this item // Record the creator of this item
m_userUuids[creatorId] = 1; m_userUuids[creatorId] = 1;

View File

@ -24,6 +24,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
using System; using System;
using System.Collections; using System.Collections;
using System.IO; using System.IO;

View File

@ -478,7 +478,7 @@ namespace OpenSim.Region.Framework.Scenes
// Insert a copy of the item into the recipient // Insert a copy of the item into the recipient
InventoryItemBase itemCopy = new InventoryItemBase(); InventoryItemBase itemCopy = new InventoryItemBase();
itemCopy.Owner = recipient; itemCopy.Owner = recipient;
itemCopy.Creator = item.Creator; itemCopy.CreatorId = item.CreatorId;
itemCopy.ID = UUID.Random(); itemCopy.ID = UUID.Random();
itemCopy.AssetID = item.AssetID; itemCopy.AssetID = item.AssetID;
itemCopy.Description = item.Description; itemCopy.Description = item.Description;
@ -836,7 +836,7 @@ namespace OpenSim.Region.Framework.Scenes
{ {
InventoryItemBase item = new InventoryItemBase(); InventoryItemBase item = new InventoryItemBase();
item.Owner = remoteClient.AgentId; item.Owner = remoteClient.AgentId;
item.Creator = remoteClient.AgentId; item.CreatorId = remoteClient.AgentId.ToString();
item.ID = UUID.Random(); item.ID = UUID.Random();
item.AssetID = asset.FullID; item.AssetID = asset.FullID;
item.Description = asset.Description; item.Description = asset.Description;
@ -1086,7 +1086,7 @@ namespace OpenSim.Region.Framework.Scenes
InventoryItemBase agentItem = new InventoryItemBase(); InventoryItemBase agentItem = new InventoryItemBase();
agentItem.ID = UUID.Random(); agentItem.ID = UUID.Random();
agentItem.Creator = taskItem.CreatorID; agentItem.CreatorId = taskItem.CreatorID.ToString();
agentItem.Owner = destAgent; agentItem.Owner = destAgent;
agentItem.AssetID = taskItem.AssetID; agentItem.AssetID = taskItem.AssetID;
agentItem.Description = taskItem.Description; agentItem.Description = taskItem.Description;
@ -1549,7 +1549,7 @@ namespace OpenSim.Region.Framework.Scenes
taskItem.Type = itemBase.AssetType; taskItem.Type = itemBase.AssetType;
taskItem.InvType = itemBase.InvType; taskItem.InvType = itemBase.InvType;
taskItem.OwnerID = itemBase.Owner; taskItem.OwnerID = itemBase.Owner;
taskItem.CreatorID = itemBase.Creator; taskItem.CreatorID = itemBase.CreatorIdAsUuid;
taskItem.BasePermissions = itemBase.BasePermissions; taskItem.BasePermissions = itemBase.BasePermissions;
taskItem.CurrentPermissions = itemBase.CurrentPermissions; taskItem.CurrentPermissions = itemBase.CurrentPermissions;
taskItem.EveryonePermissions = itemBase.EveryOnePermissions; taskItem.EveryonePermissions = itemBase.EveryOnePermissions;
@ -1946,12 +1946,11 @@ namespace OpenSim.Region.Framework.Scenes
} }
item = new InventoryItemBase(); item = new InventoryItemBase();
item.Creator = objectGroup.RootPart.CreatorID; item.CreatorId = objectGroup.RootPart.CreatorID.ToString();
item.ID = UUID.Random(); item.ID = UUID.Random();
item.InvType = (int)InventoryType.Object; item.InvType = (int)InventoryType.Object;
item.Folder = folder.ID; item.Folder = folder.ID;
item.Owner = userInfo.UserProfile.ID; item.Owner = userInfo.UserProfile.ID;
} }
AssetBase asset = CreateAsset( AssetBase asset = CreateAsset(
@ -2115,6 +2114,7 @@ namespace OpenSim.Region.Framework.Scenes
CachedUserInfo userInfo = CachedUserInfo userInfo =
CommsManager.UserProfileCacheService.GetUserDetails(AgentId); CommsManager.UserProfileCacheService.GetUserDetails(AgentId);
if (userInfo != null) if (userInfo != null)
{ {
AssetBase asset = CreateAsset( AssetBase asset = CreateAsset(
@ -2125,7 +2125,7 @@ namespace OpenSim.Region.Framework.Scenes
CommsManager.AssetCache.AddAsset(asset); CommsManager.AssetCache.AddAsset(asset);
InventoryItemBase item = new InventoryItemBase(); InventoryItemBase item = new InventoryItemBase();
item.Creator = grp.RootPart.CreatorID; item.CreatorId = grp.RootPart.CreatorID.ToString();
item.Owner = remoteClient.AgentId; item.Owner = remoteClient.AgentId;
item.ID = UUID.Random(); item.ID = UUID.Random();
item.AssetID = asset.FullID; item.AssetID = asset.FullID;

View File

@ -3368,7 +3368,7 @@ namespace OpenSim.Region.Framework.Scenes
CommsManager.AssetCache.AddAsset(asset); CommsManager.AssetCache.AddAsset(asset);
InventoryItemBase item = new InventoryItemBase(); InventoryItemBase item = new InventoryItemBase();
item.Creator = part.CreatorID; item.CreatorId = part.CreatorID.ToString();
item.ID = UUID.Random(); item.ID = UUID.Random();
item.Owner = remoteClient.AgentId; item.Owner = remoteClient.AgentId;

View File

@ -151,7 +151,7 @@ namespace OpenSim.Region.Framework.Scenes
taskItem.Name = item.Name; taskItem.Name = item.Name;
taskItem.Description = item.Description; taskItem.Description = item.Description;
taskItem.OwnerID = part.OwnerID; // Transfer ownership taskItem.OwnerID = part.OwnerID; // Transfer ownership
taskItem.CreatorID = item.Creator; taskItem.CreatorID = item.CreatorIdAsUuid;
taskItem.Type = item.AssetType; taskItem.Type = item.AssetType;
taskItem.InvType = item.InvType; taskItem.InvType = item.InvType;