diff options
author | Melanie Thielker | 2008-09-17 23:08:46 +0000 |
---|---|---|
committer | Melanie Thielker | 2008-09-17 23:08:46 +0000 |
commit | 386c3e41f0e92737f0478cf789438e8fb3c3c1e3 (patch) | |
tree | 0c59cfa1bcd57fb2c03029bf0a549fc248a1baf6 /OpenSim/Region/DataSnapshot/EstateSnapshot.cs | |
parent | Kan-Ed fix series. Fix llTakeControls to behave as documented. (diff) | |
download | opensim-SC_OLD-386c3e41f0e92737f0478cf789438e8fb3c3c1e3.zip opensim-SC_OLD-386c3e41f0e92737f0478cf789438e8fb3c3c1e3.tar.gz opensim-SC_OLD-386c3e41f0e92737f0478cf789438e8fb3c3c1e3.tar.bz2 opensim-SC_OLD-386c3e41f0e92737f0478cf789438e8fb3c3c1e3.tar.xz |
Add various XML elements to the data snapshot. Changes by Fly-Man and
myself. Fix a crash in DataSnapshot when no master avatar and no
estate owner is set (e.g. "Mainland").
Diffstat (limited to 'OpenSim/Region/DataSnapshot/EstateSnapshot.cs')
-rw-r--r-- | OpenSim/Region/DataSnapshot/EstateSnapshot.cs | 64 |
1 files changed, 47 insertions, 17 deletions
diff --git a/OpenSim/Region/DataSnapshot/EstateSnapshot.cs b/OpenSim/Region/DataSnapshot/EstateSnapshot.cs index f25aad4..dea5cb1 100644 --- a/OpenSim/Region/DataSnapshot/EstateSnapshot.cs +++ b/OpenSim/Region/DataSnapshot/EstateSnapshot.cs | |||
@@ -58,30 +58,60 @@ namespace OpenSim.Region.DataSnapshot.Providers | |||
58 | if (m_scene.RegionInfo.EstateSettings.EstateOwner != UUID.Zero) | 58 | if (m_scene.RegionInfo.EstateSettings.EstateOwner != UUID.Zero) |
59 | ownerid = m_scene.RegionInfo.EstateSettings.EstateOwner; | 59 | ownerid = m_scene.RegionInfo.EstateSettings.EstateOwner; |
60 | 60 | ||
61 | // Can't fail because if it weren't in cache, we wouldn't be here | ||
62 | // | ||
63 | UserProfileData userProfile = m_scene.CommsManager.UserService.GetUserProfile(ownerid); | 61 | UserProfileData userProfile = m_scene.CommsManager.UserService.GetUserProfile(ownerid); |
64 | 62 | ||
65 | //TODO: Change to query userserver about the master avatar UUID ? | 63 | //TODO: Change to query userserver about the master avatar UUID ? |
66 | String firstname = userProfile.FirstName; | 64 | String firstname; |
67 | String lastname = userProfile.SurName; | 65 | String lastname; |
66 | |||
67 | if (userProfile != null) | ||
68 | { | ||
69 | firstname = userProfile.FirstName; | ||
70 | lastname = userProfile.SurName; | ||
71 | |||
72 | //TODO: Fix the marshalling system to have less copypasta gruntwork | ||
73 | XmlNode user = factory.CreateNode(XmlNodeType.Element, "user", ""); | ||
74 | XmlAttribute type = (XmlAttribute)factory.CreateNode(XmlNodeType.Attribute, "type", ""); | ||
75 | type.Value = "owner"; | ||
76 | user.Attributes.Append(type); | ||
77 | |||
78 | //TODO: Create more TODOs | ||
79 | XmlNode username = factory.CreateNode(XmlNodeType.Element, "name", ""); | ||
80 | username.InnerText = firstname + " " + lastname; | ||
81 | user.AppendChild(username); | ||
82 | |||
83 | XmlNode useruuid = factory.CreateNode(XmlNodeType.Element, "uuid", ""); | ||
84 | useruuid.InnerText = ownerid.ToString(); | ||
85 | user.AppendChild(useruuid); | ||
86 | |||
87 | estatedata.AppendChild(user); | ||
88 | } | ||
89 | |||
90 | XmlNode estatename = factory.CreateNode(XmlNodeType.Element, "name", ""); | ||
91 | estatename.InnerText = m_scene.RegionInfo.EstateSettings.EstateName.ToString(); | ||
92 | estatedata.AppendChild(estatename); | ||
93 | |||
94 | XmlNode estateid = factory.CreateNode(XmlNodeType.Element, "id", ""); | ||
95 | estateid.InnerText = m_scene.RegionInfo.EstateSettings.EstateID.ToString(); | ||
96 | estatedata.AppendChild(estateid); | ||
97 | |||
98 | XmlNode parentid = factory.CreateNode(XmlNodeType.Element, "parentid", ""); | ||
99 | parentid.InnerText = m_scene.RegionInfo.EstateSettings.ParentEstateID.ToString(); | ||
100 | estatedata.AppendChild(parentid); | ||
101 | |||
102 | XmlNode flags = factory.CreateNode(XmlNodeType.Element, "flags", ""); | ||
103 | |||
104 | XmlAttribute teleport = (XmlAttribute)factory.CreateNode(XmlNodeType.Attribute, "teleport", ""); | ||
105 | teleport.Value = m_scene.RegionInfo.EstateSettings.AllowDirectTeleport.ToString(); | ||
106 | flags.Attributes.Append(teleport); | ||
68 | 107 | ||
69 | //TODO: Fix the marshalling system to have less copypasta gruntwork | 108 | XmlAttribute publicaccess = (XmlAttribute)factory.CreateNode(XmlNodeType.Attribute, "public", ""); |
70 | XmlNode user = factory.CreateNode(XmlNodeType.Element, "user", ""); | 109 | publicaccess.Value = m_scene.RegionInfo.EstateSettings.PublicAccess.ToString(); |
71 | XmlAttribute type = (XmlAttribute)factory.CreateNode(XmlNodeType.Attribute, "type", ""); | 110 | flags.Attributes.Append(publicaccess); |
72 | type.Value = "owner"; | ||
73 | user.Attributes.Append(type); | ||
74 | 111 | ||
75 | //TODO: Create more TODOs | ||
76 | XmlNode username = factory.CreateNode(XmlNodeType.Element, "name", ""); | ||
77 | username.InnerText = firstname + " " + lastname; | ||
78 | user.AppendChild(username); | ||
79 | 112 | ||
80 | XmlNode useruuid = factory.CreateNode(XmlNodeType.Element, "uuid", ""); | 113 | estatedata.AppendChild(flags); |
81 | useruuid.InnerText = ownerid.ToString(); | ||
82 | user.AppendChild(useruuid); | ||
83 | 114 | ||
84 | estatedata.AppendChild(user); | ||
85 | 115 | ||
86 | this.Stale = false; | 116 | this.Stale = false; |
87 | return estatedata; | 117 | return estatedata; |