Correctly handle group owned land in the Datasnapshot module. Will return

owner uuid = grou uuid ans owner name = group anme for group land now.
Group name is now filled in
0.6.5-rc1
Melanie Thielker 2009-04-28 00:37:23 +00:00
parent c856f21231
commit 1fdebf361f
1 changed files with 29 additions and 17 deletions

View File

@ -220,6 +220,8 @@ namespace OpenSim.Region.DataSnapshot.Providers
xmlparcel.AppendChild(textureuuid); xmlparcel.AppendChild(textureuuid);
} }
string groupName = String.Empty;
//attached user and group //attached user and group
if (parcel.GroupID != UUID.Zero) if (parcel.GroupID != UUID.Zero)
{ {
@ -228,14 +230,21 @@ namespace OpenSim.Region.DataSnapshot.Providers
groupuuid.InnerText = parcel.GroupID.ToString(); groupuuid.InnerText = parcel.GroupID.ToString();
groupblock.AppendChild(groupuuid); groupblock.AppendChild(groupuuid);
//No name yet, there's no way to get a group name since they don't exist yet. IGroupsModule gm = m_scene.RequestModuleInterface<IGroupsModule>();
//TODO: When groups are supported, add the group handling code. if (gm != null)
{
GroupRecord g = gm.GetGroupRecord(parcel.GroupID);
if (g != null)
groupName = g.GroupName;
}
XmlNode groupname = nodeFactory.CreateNode(XmlNodeType.Element, "groupname", "");
groupname.InnerText = groupName;
groupblock.AppendChild(groupname);
xmlparcel.AppendChild(groupblock); xmlparcel.AppendChild(groupblock);
} }
if (!parcel.IsGroupOwned)
{
XmlNode userblock = nodeFactory.CreateNode(XmlNodeType.Element, "owner", ""); XmlNode userblock = nodeFactory.CreateNode(XmlNodeType.Element, "owner", "");
UUID userOwnerUUID = parcel.OwnerID; UUID userOwnerUUID = parcel.OwnerID;
@ -244,6 +253,8 @@ namespace OpenSim.Region.DataSnapshot.Providers
useruuid.InnerText = userOwnerUUID.ToString(); useruuid.InnerText = userOwnerUUID.ToString();
userblock.AppendChild(useruuid); userblock.AppendChild(useruuid);
if (!parcel.IsGroupOwned)
{
try try
{ {
XmlNode username = nodeFactory.CreateNode(XmlNodeType.Element, "name", ""); XmlNode username = nodeFactory.CreateNode(XmlNodeType.Element, "name", "");
@ -256,14 +267,15 @@ namespace OpenSim.Region.DataSnapshot.Providers
//m_log.Info("[DATASNAPSHOT]: Cannot find owner name; ignoring this parcel"); //m_log.Info("[DATASNAPSHOT]: Cannot find owner name; ignoring this parcel");
} }
xmlparcel.AppendChild(userblock);
} }
//else else
//{ {
// XmlAttribute type = (XmlAttribute)nodeFactory.CreateNode(XmlNodeType.Attribute, "type", ""); XmlNode username = nodeFactory.CreateNode(XmlNodeType.Element, "name", "");
// type.InnerText = "owner"; username.InnerText = groupName;
// groupblock.Attributes.Append(type); userblock.AppendChild(username);
//} }
xmlparcel.AppendChild(userblock);
parent.AppendChild(xmlparcel); parent.AppendChild(xmlparcel);
} }