diff options
author | Melanie Thielker | 2009-04-28 00:37:23 +0000 |
---|---|---|
committer | Melanie Thielker | 2009-04-28 00:37:23 +0000 |
commit | 1fdebf361f9286796b10d25d2ca0d6c8df1d87cd (patch) | |
tree | b558759eaa1430d3c618a011c92e214311fe546c /OpenSim/Region/DataSnapshot | |
parent | Thank you, Fly-Man, for a patch that fixes propagating the group (diff) | |
download | opensim-SC-1fdebf361f9286796b10d25d2ca0d6c8df1d87cd.zip opensim-SC-1fdebf361f9286796b10d25d2ca0d6c8df1d87cd.tar.gz opensim-SC-1fdebf361f9286796b10d25d2ca0d6c8df1d87cd.tar.bz2 opensim-SC-1fdebf361f9286796b10d25d2ca0d6c8df1d87cd.tar.xz |
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
Diffstat (limited to 'OpenSim/Region/DataSnapshot')
-rw-r--r-- | OpenSim/Region/DataSnapshot/LandSnapshot.cs | 44 |
1 files changed, 28 insertions, 16 deletions
diff --git a/OpenSim/Region/DataSnapshot/LandSnapshot.cs b/OpenSim/Region/DataSnapshot/LandSnapshot.cs index bc88a45..7235f2b 100644 --- a/OpenSim/Region/DataSnapshot/LandSnapshot.cs +++ b/OpenSim/Region/DataSnapshot/LandSnapshot.cs | |||
@@ -220,6 +220,8 @@ namespace OpenSim.Region.DataSnapshot.Providers | |||
220 | xmlparcel.AppendChild(textureuuid); | 220 | xmlparcel.AppendChild(textureuuid); |
221 | } | 221 | } |
222 | 222 | ||
223 | string groupName = String.Empty; | ||
224 | |||
223 | //attached user and group | 225 | //attached user and group |
224 | if (parcel.GroupID != UUID.Zero) | 226 | if (parcel.GroupID != UUID.Zero) |
225 | { | 227 | { |
@@ -228,22 +230,31 @@ namespace OpenSim.Region.DataSnapshot.Providers | |||
228 | groupuuid.InnerText = parcel.GroupID.ToString(); | 230 | groupuuid.InnerText = parcel.GroupID.ToString(); |
229 | groupblock.AppendChild(groupuuid); | 231 | groupblock.AppendChild(groupuuid); |
230 | 232 | ||
231 | //No name yet, there's no way to get a group name since they don't exist yet. | 233 | IGroupsModule gm = m_scene.RequestModuleInterface<IGroupsModule>(); |
232 | //TODO: When groups are supported, add the group handling code. | 234 | if (gm != null) |
235 | { | ||
236 | GroupRecord g = gm.GetGroupRecord(parcel.GroupID); | ||
237 | if (g != null) | ||
238 | groupName = g.GroupName; | ||
239 | } | ||
240 | |||
241 | XmlNode groupname = nodeFactory.CreateNode(XmlNodeType.Element, "groupname", ""); | ||
242 | groupname.InnerText = groupName; | ||
243 | groupblock.AppendChild(groupname); | ||
233 | 244 | ||
234 | xmlparcel.AppendChild(groupblock); | 245 | xmlparcel.AppendChild(groupblock); |
235 | } | 246 | } |
236 | 247 | ||
237 | if (!parcel.IsGroupOwned) | 248 | XmlNode userblock = nodeFactory.CreateNode(XmlNodeType.Element, "owner", ""); |
238 | { | ||
239 | XmlNode userblock = nodeFactory.CreateNode(XmlNodeType.Element, "owner", ""); | ||
240 | 249 | ||
241 | UUID userOwnerUUID = parcel.OwnerID; | 250 | UUID userOwnerUUID = parcel.OwnerID; |
242 | 251 | ||
243 | XmlNode useruuid = nodeFactory.CreateNode(XmlNodeType.Element, "uuid", ""); | 252 | XmlNode useruuid = nodeFactory.CreateNode(XmlNodeType.Element, "uuid", ""); |
244 | useruuid.InnerText = userOwnerUUID.ToString(); | 253 | useruuid.InnerText = userOwnerUUID.ToString(); |
245 | userblock.AppendChild(useruuid); | 254 | userblock.AppendChild(useruuid); |
246 | 255 | ||
256 | if (!parcel.IsGroupOwned) | ||
257 | { | ||
247 | try | 258 | try |
248 | { | 259 | { |
249 | XmlNode username = nodeFactory.CreateNode(XmlNodeType.Element, "name", ""); | 260 | XmlNode username = nodeFactory.CreateNode(XmlNodeType.Element, "name", ""); |
@@ -256,14 +267,15 @@ namespace OpenSim.Region.DataSnapshot.Providers | |||
256 | //m_log.Info("[DATASNAPSHOT]: Cannot find owner name; ignoring this parcel"); | 267 | //m_log.Info("[DATASNAPSHOT]: Cannot find owner name; ignoring this parcel"); |
257 | } | 268 | } |
258 | 269 | ||
259 | xmlparcel.AppendChild(userblock); | ||
260 | } | 270 | } |
261 | //else | 271 | else |
262 | //{ | 272 | { |
263 | // XmlAttribute type = (XmlAttribute)nodeFactory.CreateNode(XmlNodeType.Attribute, "type", ""); | 273 | XmlNode username = nodeFactory.CreateNode(XmlNodeType.Element, "name", ""); |
264 | // type.InnerText = "owner"; | 274 | username.InnerText = groupName; |
265 | // groupblock.Attributes.Append(type); | 275 | userblock.AppendChild(username); |
266 | //} | 276 | } |
277 | |||
278 | xmlparcel.AppendChild(userblock); | ||
267 | 279 | ||
268 | parent.AppendChild(xmlparcel); | 280 | parent.AppendChild(xmlparcel); |
269 | } | 281 | } |