When saving an OAR in "Publish" mode, also discard Group information

bullet-2.82
Oren Hurvitz 2014-05-26 15:19:20 +03:00
parent 5aeaa7fcdd
commit 33cc847c4a
4 changed files with 23 additions and 14 deletions

View File

@ -213,8 +213,13 @@ namespace OpenSim.Framework.Serialization.External
xtw.WriteElementString("ClaimDate", Convert.ToString(landData.ClaimDate));
xtw.WriteElementString("ClaimPrice", Convert.ToString(landData.ClaimPrice));
xtw.WriteElementString("GlobalID", landData.GlobalID.ToString());
xtw.WriteElementString("GroupID", landData.GroupID.ToString());
xtw.WriteElementString("IsGroupOwned", Convert.ToString(landData.IsGroupOwned));
UUID groupID = options.ContainsKey("wipe-owners") ? UUID.Zero : landData.GroupID;
xtw.WriteElementString("GroupID", groupID.ToString());
bool isGroupOwned = options.ContainsKey("wipe-owners") ? false : landData.IsGroupOwned;
xtw.WriteElementString("IsGroupOwned", Convert.ToString(isGroupOwned));
xtw.WriteElementString("Bitmap", Convert.ToBase64String(landData.Bitmap));
xtw.WriteElementString("Description", landData.Description);
xtw.WriteElementString("Flags", Convert.ToString((uint)landData.Flags));
@ -227,13 +232,8 @@ namespace OpenSim.Framework.Serialization.External
xtw.WriteElementString("MediaURL", landData.MediaURL);
xtw.WriteElementString("MusicURL", landData.MusicURL);
UUID ownerIdToWrite;
if (options != null && options.ContainsKey("wipe-owners"))
ownerIdToWrite = UUID.Zero;
else
ownerIdToWrite = landData.OwnerID;
xtw.WriteElementString("OwnerID", ownerIdToWrite.ToString());
UUID ownerID = options.ContainsKey("wipe-owners") ? UUID.Zero : landData.OwnerID;
xtw.WriteElementString("OwnerID", ownerID.ToString());
xtw.WriteStartElement("ParcelAccessList");
foreach (LandAccessEntry pal in landData.ParcelAccessList)

View File

@ -121,7 +121,8 @@ namespace OpenSim.Framework.Serialization.Tests
TestHelpers.InMethod();
// log4net.Config.XmlConfigurator.Configure();
LandData ld = LandDataSerializer.Deserialize(LandDataSerializer.Serialize(this.land, null));
Dictionary<string, object> options = new Dictionary<string, object>();
LandData ld = LandDataSerializer.Deserialize(LandDataSerializer.Serialize(this.land, options));
Assert.That(ld, Is.Not.Null, "Deserialize(string) returned null");
// Assert.That(ld.AABBMax, Is.EqualTo(land.AABBMax));
// Assert.That(ld.AABBMin, Is.EqualTo(land.AABBMin));

View File

@ -585,7 +585,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
ld.GlobalID = landID;
string ldPath = ArchiveConstants.CreateOarLandDataPath(ld);
tar.WriteFile(ldPath, LandDataSerializer.Serialize(ld, null));
Dictionary<string, object> options = new Dictionary<string, object>();
tar.WriteFile(ldPath, LandDataSerializer.Serialize(ld, options));
tar.Close();
oarStream = new MemoryStream(oarStream.ToArray());

View File

@ -1343,7 +1343,9 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
writer.WriteElementString("SalePrice", sop.SalePrice.ToString());
writer.WriteElementString("ObjectSaleType", sop.ObjectSaleType.ToString());
writer.WriteElementString("OwnershipCost", sop.OwnershipCost.ToString());
WriteUUID(writer, "GroupID", sop.GroupID, options);
UUID groupID = options.ContainsKey("wipe-owners") ? UUID.Zero : sop.GroupID;
WriteUUID(writer, "GroupID", groupID, options);
UUID ownerID = options.ContainsKey("wipe-owners") ? UUID.Zero : sop.OwnerID;
WriteUUID(writer, "OwnerID", ownerID, options);
@ -1469,7 +1471,10 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
writer.WriteElementString("Description", item.Description);
writer.WriteElementString("EveryonePermissions", item.EveryonePermissions.ToString());
writer.WriteElementString("Flags", item.Flags.ToString());
WriteUUID(writer, "GroupID", item.GroupID, options);
UUID groupID = options.ContainsKey("wipe-owners") ? UUID.Zero : item.GroupID;
WriteUUID(writer, "GroupID", groupID, options);
writer.WriteElementString("GroupPermissions", item.GroupPermissions.ToString());
writer.WriteElementString("InvType", item.InvType.ToString());
WriteUUID(writer, "ItemID", item.ItemID, options);
@ -1490,7 +1495,9 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
WriteUUID(writer, "PermsGranter", item.PermsGranter, options);
writer.WriteElementString("PermsMask", item.PermsMask.ToString());
writer.WriteElementString("Type", item.Type.ToString());
writer.WriteElementString("OwnerChanged", item.OwnerChanged.ToString().ToLower());
bool ownerChanged = options.ContainsKey("wipe-owners") ? false : item.OwnerChanged;
writer.WriteElementString("OwnerChanged", ownerChanged.ToString().ToLower());
writer.WriteEndElement(); // TaskInventoryItem
}