aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/DataSnapshot/EstateSnapshot.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/DataSnapshot/EstateSnapshot.cs68
1 files changed, 68 insertions, 0 deletions
diff --git a/OpenSim/Region/DataSnapshot/EstateSnapshot.cs b/OpenSim/Region/DataSnapshot/EstateSnapshot.cs
new file mode 100644
index 0000000..76fed59
--- /dev/null
+++ b/OpenSim/Region/DataSnapshot/EstateSnapshot.cs
@@ -0,0 +1,68 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using System.Xml;
5using OpenSim.Region.Environment.Scenes;
6using OpenSim.Region.Environment.Modules.LandManagement;
7using OpenSim.Framework;
8using OpenSim.Framework.Console;
9using OpenSim.Framework.Communications;
10using libsecondlife;
11using libsecondlife.Packets;
12
13namespace OpenSim.Region.DataSnapshot
14{
15 public class EstateSnapshot : IDataSnapshotProvider
16 {
17 private Scene m_scene = null;
18 private DataSnapshotManager m_parent = null;
19
20 #region IDataSnapshotProvider Members
21
22 public XmlNode RequestSnapshotData(XmlDocument factory)
23 {
24 //Estate data section - contains who owns a set of sims and the name of the set.
25 //In Opensim all the estate names are the same as the Master Avatar (owner of the sim)
26 //Now in DataSnapshotProvider module form!
27 XmlNode estatedata = factory.CreateNode(XmlNodeType.Element, "estate", "");
28
29 LLUUID ownerid = m_scene.RegionInfo.MasterAvatarAssignedUUID;
30
31 //TODO: Change to query userserver about the master avatar UUID ?
32 String firstname = m_scene.RegionInfo.MasterAvatarFirstName;
33 String lastname = m_scene.RegionInfo.MasterAvatarLastName;
34
35 //TODO: Fix the marshalling system to have less copypasta gruntwork
36 XmlNode user = factory.CreateNode(XmlNodeType.Element, "user", "");
37 XmlAttribute type = (XmlAttribute)factory.CreateNode(XmlNodeType.Attribute, "type", "");
38 type.Value = "owner";
39 user.Attributes.Append(type);
40
41 //TODO: Create more TODOs
42 XmlNode username = factory.CreateNode(XmlNodeType.Element, "name", "");
43 username.InnerText = firstname + " " + lastname;
44 user.AppendChild(username);
45
46 XmlNode useruuid = factory.CreateNode(XmlNodeType.Element, "uuid", "");
47 useruuid.InnerText = ownerid.ToString();
48 user.AppendChild(useruuid);
49
50 estatedata.AppendChild(user);
51
52 return estatedata;
53 }
54
55 public void Initialize(Scene scene, DataSnapshotManager parent)
56 {
57 m_scene = scene;
58 m_parent = parent;
59 }
60
61 public Scene GetParentScene
62 {
63 get { return m_scene; }
64 }
65
66 #endregion
67 }
68}