aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMelanie2010-12-03 02:36:13 +0000
committerMelanie2010-12-03 02:36:13 +0000
commit342dc532ec64642d5997f23050a9776f663facdf (patch)
treeb0be3997967aa6e4d79873281f535ad436b841e4
parentChange the way sim health reporting reports sim startup (diff)
parentOnly force prim persistence before delete if the prim is the result of an unp... (diff)
downloadopensim-SC_OLD-342dc532ec64642d5997f23050a9776f663facdf.zip
opensim-SC_OLD-342dc532ec64642d5997f23050a9776f663facdf.tar.gz
opensim-SC_OLD-342dc532ec64642d5997f23050a9776f663facdf.tar.bz2
opensim-SC_OLD-342dc532ec64642d5997f23050a9776f663facdf.tar.xz
Merge branch 'master' into careminster-presence-refactor
Also prevent god takes from ending up in Lost and Found
-rw-r--r--OpenSim/Framework/Communications/Osp/OspInventoryWrapperPlugin.cs104
-rw-r--r--OpenSim/Framework/Serialization/External/ExternalRepresentationUtils.cs99
-rw-r--r--OpenSim/Framework/Serialization/External/OspResolver.cs (renamed from OpenSim/Framework/Communications/Osp/OspResolver.cs)8
-rw-r--r--OpenSim/Framework/Serialization/External/UserInventoryItemSerializer.cs225
-rw-r--r--OpenSim/Framework/Util.cs81
-rw-r--r--OpenSim/Region/Application/OpenSim.cs6
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs20
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs15
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs22
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs13
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs28
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs64
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs16
-rw-r--r--OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs83
-rw-r--r--OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs12
-rw-r--r--OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs30
-rw-r--r--OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs5
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsIn/Asset/AssetServiceInConnectorModule.cs5
-rw-r--r--OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs11
-rw-r--r--OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs26
-rw-r--r--OpenSim/Region/Framework/Interfaces/IUserManagement.cs1
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs4
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs12
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs15
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs5
-rw-r--r--OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs164
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs8
-rw-r--r--OpenSim/Server/Handlers/Asset/AssetServerConnector.cs5
-rw-r--r--OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs6
-rw-r--r--OpenSim/Services/AssetService/AssetService.cs73
-rw-r--r--OpenSim/Services/HypergridService/HGAssetService.cs145
-rw-r--r--OpenSim/Services/HypergridService/HGInventoryService.cs (renamed from OpenSim/Services/InventoryService/HGInventoryService.cs)54
-rw-r--r--OpenSim/Services/HypergridService/UserAccountCache.cs105
-rw-r--r--OpenSim/Services/LLLoginService/LLLoginService.cs16
-rw-r--r--bin/OpenSim.Grid.GridServer.addin.xml9
-rw-r--r--bin/OpenSim.Grid.GridServer.exe.config28
-rw-r--r--bin/OpenSim.Grid.MessagingServer.exe.config28
-rw-r--r--bin/OpenSim.Grid.ScriptServer.exe.config28
-rw-r--r--bin/OpenSim.Grid.UserServer.exe.config28
-rwxr-xr-xbin/OpenSim.exe.config2
-rw-r--r--bin/Robust.HG.ini.example29
-rw-r--r--bin/config-include/GridCommon.ini.example8
-rw-r--r--bin/config-include/StandaloneCommon.ini.example18
-rw-r--r--bin/config-include/StandaloneHypergrid.ini8
-rw-r--r--prebuild.xml61
45 files changed, 1185 insertions, 548 deletions
diff --git a/OpenSim/Framework/Communications/Osp/OspInventoryWrapperPlugin.cs b/OpenSim/Framework/Communications/Osp/OspInventoryWrapperPlugin.cs
deleted file mode 100644
index bcd1eee..0000000
--- a/OpenSim/Framework/Communications/Osp/OspInventoryWrapperPlugin.cs
+++ /dev/null
@@ -1,104 +0,0 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System.Collections.Generic;
29using OpenSim.Data;
30using OpenMetaverse;
31using OpenSim.Services.Interfaces;
32
33namespace OpenSim.Framework.Communications.Osp
34{
35 /// <summary>
36 /// Wrap other inventory data plugins so that we can perform OSP related post processing for items
37 /// </summary>
38 public class OspInventoryWrapperPlugin : IInventoryDataPlugin
39 {
40 protected IInventoryDataPlugin m_wrappedPlugin;
41 //protected CommunicationsManager m_commsManager;
42 protected IUserAccountService m_userAccountService;
43
44 public OspInventoryWrapperPlugin(IInventoryDataPlugin wrappedPlugin, IUserAccountService userService)
45 {
46 m_wrappedPlugin = wrappedPlugin;
47 m_userAccountService = userService;
48 }
49
50 public string Name { get { return "OspInventoryWrapperPlugin"; } }
51 public string Version { get { return "0.1"; } }
52 public void Initialise() {}
53 public void Initialise(string connect) {}
54 public void Dispose() {}
55
56 public InventoryItemBase getInventoryItem(UUID item)
57 {
58 return PostProcessItem(m_wrappedPlugin.getInventoryItem(item));
59 }
60
61 // XXX: Why on earth does this exist as it appears to duplicate getInventoryItem?
62 public InventoryItemBase queryInventoryItem(UUID item)
63 {
64 return PostProcessItem(m_wrappedPlugin.queryInventoryItem(item));
65 }
66
67 public List<InventoryItemBase> getInventoryInFolder(UUID folderID)
68 {
69 List<InventoryItemBase> items = m_wrappedPlugin.getInventoryInFolder(folderID);
70
71 foreach (InventoryItemBase item in items)
72 PostProcessItem(item);
73
74 return items;
75 }
76
77 public List<InventoryItemBase> fetchActiveGestures(UUID avatarID)
78 {
79 return m_wrappedPlugin.fetchActiveGestures(avatarID);
80
81 // Presuming that no post processing is needed here as gestures don't refer to creator information (?)
82 }
83
84 protected InventoryItemBase PostProcessItem(InventoryItemBase item)
85 {
86 item.CreatorIdAsUuid = OspResolver.ResolveOspa(item.CreatorId, m_userAccountService);
87 return item;
88 }
89
90 public List<InventoryFolderBase> getFolderHierarchy(UUID parentID) { return m_wrappedPlugin.getFolderHierarchy(parentID); }
91 public List<InventoryFolderBase> getUserRootFolders(UUID user) { return m_wrappedPlugin.getUserRootFolders(user); }
92 public InventoryFolderBase getUserRootFolder(UUID user) { return m_wrappedPlugin.getUserRootFolder(user); }
93 public List<InventoryFolderBase> getInventoryFolders(UUID parentID) { return m_wrappedPlugin.getInventoryFolders(parentID); }
94 public InventoryFolderBase getInventoryFolder(UUID folder) { return m_wrappedPlugin.getInventoryFolder(folder); }
95 public void addInventoryItem(InventoryItemBase item) { m_wrappedPlugin.addInventoryItem(item); }
96 public void updateInventoryItem(InventoryItemBase item) { m_wrappedPlugin.updateInventoryItem(item); }
97 public void deleteInventoryItem(UUID item) { m_wrappedPlugin.deleteInventoryItem(item); }
98 public InventoryFolderBase queryInventoryFolder(UUID folder) { return m_wrappedPlugin.queryInventoryFolder(folder); }
99 public void addInventoryFolder(InventoryFolderBase folder) { m_wrappedPlugin.addInventoryFolder(folder); }
100 public void updateInventoryFolder(InventoryFolderBase folder) { m_wrappedPlugin.updateInventoryFolder(folder); }
101 public void moveInventoryFolder(InventoryFolderBase folder) { m_wrappedPlugin.moveInventoryFolder(folder); }
102 public void deleteInventoryFolder(UUID folder) { m_wrappedPlugin.deleteInventoryFolder(folder); }
103 }
104}
diff --git a/OpenSim/Framework/Serialization/External/ExternalRepresentationUtils.cs b/OpenSim/Framework/Serialization/External/ExternalRepresentationUtils.cs
new file mode 100644
index 0000000..6e8c2ee
--- /dev/null
+++ b/OpenSim/Framework/Serialization/External/ExternalRepresentationUtils.cs
@@ -0,0 +1,99 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27using System;
28using System.Collections.Generic;
29using System.IO;
30using System.Xml;
31
32using OpenMetaverse;
33using OpenSim.Services.Interfaces;
34
35namespace OpenSim.Framework.Serialization.External
36{
37 /// <summary>
38 /// Utilities for manipulating external representations of data structures in OpenSim
39 /// </summary>
40 public class ExternalRepresentationUtils
41 {
42 /// <summary>
43 /// Takes a XML representation of a SceneObjectPart and returns another XML representation
44 /// with creator data added to it.
45 /// </summary>
46 /// <param name="xml">The SceneObjectPart represented in XML2</param>
47 /// <param name="profileURL">The URL of the profile service for the creator</param>
48 /// <param name="userService">The service for retrieving user account information</param>
49 /// <param name="scopeID">The scope of the user account information (Grid ID)</param>
50 /// <returns>The SceneObjectPart represented in XML2</returns>
51 public static string RewriteSOP(string xml, string profileURL, IUserAccountService userService, UUID scopeID)
52 {
53 if (xml == string.Empty || profileURL == string.Empty || userService == null)
54 return xml;
55
56 XmlDocument doc = new XmlDocument();
57 doc.LoadXml(xml);
58 XmlNodeList sops = doc.GetElementsByTagName("SceneObjectPart");
59
60 foreach (XmlNode sop in sops)
61 {
62 UserAccount creator = null;
63 bool hasCreatorData = false;
64 XmlNodeList nodes = sop.ChildNodes;
65 foreach (XmlNode node in nodes)
66 {
67 if (node.Name == "CreatorID")
68 {
69 UUID uuid = UUID.Zero;
70 UUID.TryParse(node.InnerText, out uuid);
71 creator = userService.GetUserAccount(scopeID, uuid);
72 }
73 if (node.Name == "CreatorData" && node.InnerText != null && node.InnerText != string.Empty)
74 hasCreatorData = true;
75
76 //if (node.Name == "OwnerID")
77 //{
78 // UserAccount owner = GetUser(node.InnerText);
79 // if (owner != null)
80 // node.InnerText = m_ProfileServiceURL + "/" + node.InnerText + "/" + owner.FirstName + " " + owner.LastName;
81 //}
82 }
83 if (!hasCreatorData && creator != null)
84 {
85 XmlElement creatorData = doc.CreateElement("CreatorData");
86 creatorData.InnerText = profileURL + "/" + creator.PrincipalID + ";" + creator.FirstName + " " + creator.LastName;
87 sop.AppendChild(creatorData);
88 }
89 }
90
91 using (StringWriter wr = new StringWriter())
92 {
93 doc.Save(wr);
94 return wr.ToString();
95 }
96
97 }
98 }
99}
diff --git a/OpenSim/Framework/Communications/Osp/OspResolver.cs b/OpenSim/Framework/Serialization/External/OspResolver.cs
index 24ea64d..7e3dd1b 100644
--- a/OpenSim/Framework/Communications/Osp/OspResolver.cs
+++ b/OpenSim/Framework/Serialization/External/OspResolver.cs
@@ -32,7 +32,7 @@ using OpenMetaverse;
32using OpenSim.Framework; 32using OpenSim.Framework;
33using OpenSim.Services.Interfaces; 33using OpenSim.Services.Interfaces;
34 34
35namespace OpenSim.Framework.Communications.Osp 35namespace OpenSim.Framework.Serialization
36{ 36{
37 /// <summary> 37 /// <summary>
38 /// Resolves OpenSim Profile Anchors (OSPA). An OSPA is a string used to provide information for 38 /// Resolves OpenSim Profile Anchors (OSPA). An OSPA is a string used to provide information for
@@ -57,6 +57,12 @@ namespace OpenSim.Framework.Communications.Osp
57 /// <returns>The OSPA. Null if a user with the given UUID could not be found.</returns> 57 /// <returns>The OSPA. Null if a user with the given UUID could not be found.</returns>
58 public static string MakeOspa(UUID userId, IUserAccountService userService) 58 public static string MakeOspa(UUID userId, IUserAccountService userService)
59 { 59 {
60 if (userService == null)
61 {
62 m_log.Warn("[OSP RESOLVER]: UserService is null");
63 return userId.ToString();
64 }
65
60 UserAccount account = userService.GetUserAccount(UUID.Zero, userId); 66 UserAccount account = userService.GetUserAccount(UUID.Zero, userId);
61 if (account != null) 67 if (account != null)
62 return MakeOspa(account.FirstName, account.LastName); 68 return MakeOspa(account.FirstName, account.LastName);
diff --git a/OpenSim/Framework/Serialization/External/UserInventoryItemSerializer.cs b/OpenSim/Framework/Serialization/External/UserInventoryItemSerializer.cs
index 862cc72..d5e84c7 100644
--- a/OpenSim/Framework/Serialization/External/UserInventoryItemSerializer.cs
+++ b/OpenSim/Framework/Serialization/External/UserInventoryItemSerializer.cs
@@ -26,11 +26,16 @@
26 */ 26 */
27 27
28using System; 28using System;
29using System.Collections.Generic;
29using System.IO; 30using System.IO;
31using System.Reflection;
30using System.Text; 32using System.Text;
31using System.Xml; 33using System.Xml;
34
35using log4net;
32using OpenMetaverse; 36using OpenMetaverse;
33using OpenSim.Framework; 37using OpenSim.Framework;
38using OpenSim.Services.Interfaces;
34 39
35namespace OpenSim.Framework.Serialization.External 40namespace OpenSim.Framework.Serialization.External
36{ 41{
@@ -40,6 +45,141 @@ namespace OpenSim.Framework.Serialization.External
40 /// XXX: Please do not use yet. 45 /// XXX: Please do not use yet.
41 public class UserInventoryItemSerializer 46 public class UserInventoryItemSerializer
42 { 47 {
48 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
49
50 private delegate void InventoryItemXmlProcessor(InventoryItemBase item, XmlTextReader reader);
51 private static Dictionary<string, InventoryItemXmlProcessor> m_InventoryItemXmlProcessors = new Dictionary<string, InventoryItemXmlProcessor>();
52
53 #region InventoryItemBase Processor initialization
54 static UserInventoryItemSerializer()
55 {
56 m_InventoryItemXmlProcessors.Add("Name", ProcessName);
57 m_InventoryItemXmlProcessors.Add("ID", ProcessID);
58 m_InventoryItemXmlProcessors.Add("InvType", ProcessInvType);
59 m_InventoryItemXmlProcessors.Add("CreatorUUID", ProcessCreatorUUID);
60 m_InventoryItemXmlProcessors.Add("CreatorID", ProcessCreatorID);
61 m_InventoryItemXmlProcessors.Add("CreatorData", ProcessCreatorData);
62 m_InventoryItemXmlProcessors.Add("CreationDate", ProcessCreationDate);
63 m_InventoryItemXmlProcessors.Add("Owner", ProcessOwner);
64 m_InventoryItemXmlProcessors.Add("Description", ProcessDescription);
65 m_InventoryItemXmlProcessors.Add("AssetType", ProcessAssetType);
66 m_InventoryItemXmlProcessors.Add("AssetID", ProcessAssetID);
67 m_InventoryItemXmlProcessors.Add("SaleType", ProcessSaleType);
68 m_InventoryItemXmlProcessors.Add("SalePrice", ProcessSalePrice);
69 m_InventoryItemXmlProcessors.Add("BasePermissions", ProcessBasePermissions);
70 m_InventoryItemXmlProcessors.Add("CurrentPermissions", ProcessCurrentPermissions);
71 m_InventoryItemXmlProcessors.Add("EveryOnePermissions", ProcessEveryOnePermissions);
72 m_InventoryItemXmlProcessors.Add("NextPermissions", ProcessNextPermissions);
73 m_InventoryItemXmlProcessors.Add("Flags", ProcessFlags);
74 m_InventoryItemXmlProcessors.Add("GroupID", ProcessGroupID);
75 m_InventoryItemXmlProcessors.Add("GroupOwned", ProcessGroupOwned);
76 }
77 #endregion
78
79 #region InventoryItemBase Processors
80 private static void ProcessName(InventoryItemBase item, XmlTextReader reader)
81 {
82 item.Name = reader.ReadElementContentAsString("Name", String.Empty);
83 }
84
85 private static void ProcessID(InventoryItemBase item, XmlTextReader reader)
86 {
87 item.ID = Util.ReadUUID(reader, "ID");
88 }
89
90 private static void ProcessInvType(InventoryItemBase item, XmlTextReader reader)
91 {
92 item.InvType = reader.ReadElementContentAsInt("InvType", String.Empty);
93 }
94
95 private static void ProcessCreatorUUID(InventoryItemBase item, XmlTextReader reader)
96 {
97 item.CreatorId = reader.ReadElementContentAsString("CreatorUUID", String.Empty);
98 }
99
100 private static void ProcessCreatorID(InventoryItemBase item, XmlTextReader reader)
101 {
102 // when it exists, this overrides the previous
103 item.CreatorId = reader.ReadElementContentAsString("CreatorID", String.Empty);
104 }
105
106 private static void ProcessCreationDate(InventoryItemBase item, XmlTextReader reader)
107 {
108 item.CreationDate = reader.ReadElementContentAsInt("CreationDate", String.Empty);
109 }
110
111 private static void ProcessOwner(InventoryItemBase item, XmlTextReader reader)
112 {
113 item.Owner = Util.ReadUUID(reader, "Owner");
114 }
115
116 private static void ProcessDescription(InventoryItemBase item, XmlTextReader reader)
117 {
118 item.Description = reader.ReadElementContentAsString("Description", String.Empty);
119 }
120
121 private static void ProcessAssetType(InventoryItemBase item, XmlTextReader reader)
122 {
123 item.AssetType = reader.ReadElementContentAsInt("AssetType", String.Empty);
124 }
125
126 private static void ProcessAssetID(InventoryItemBase item, XmlTextReader reader)
127 {
128 item.AssetID = Util.ReadUUID(reader, "AssetID");
129 }
130
131 private static void ProcessSaleType(InventoryItemBase item, XmlTextReader reader)
132 {
133 item.SaleType = (byte)reader.ReadElementContentAsInt("SaleType", String.Empty);
134 }
135
136 private static void ProcessSalePrice(InventoryItemBase item, XmlTextReader reader)
137 {
138 item.SalePrice = reader.ReadElementContentAsInt("SalePrice", String.Empty);
139 }
140
141 private static void ProcessBasePermissions(InventoryItemBase item, XmlTextReader reader)
142 {
143 item.BasePermissions = (uint)reader.ReadElementContentAsInt("BasePermissions", String.Empty);
144 }
145
146 private static void ProcessCurrentPermissions(InventoryItemBase item, XmlTextReader reader)
147 {
148 item.CurrentPermissions = (uint)reader.ReadElementContentAsInt("CurrentPermissions", String.Empty);
149 }
150
151 private static void ProcessEveryOnePermissions(InventoryItemBase item, XmlTextReader reader)
152 {
153 item.EveryOnePermissions = (uint)reader.ReadElementContentAsInt("EveryOnePermissions", String.Empty);
154 }
155
156 private static void ProcessNextPermissions(InventoryItemBase item, XmlTextReader reader)
157 {
158 item.NextPermissions = (uint)reader.ReadElementContentAsInt("NextPermissions", String.Empty);
159 }
160
161 private static void ProcessFlags(InventoryItemBase item, XmlTextReader reader)
162 {
163 item.Flags = (uint)reader.ReadElementContentAsInt("Flags", String.Empty);
164 }
165
166 private static void ProcessGroupID(InventoryItemBase item, XmlTextReader reader)
167 {
168 item.GroupID = Util.ReadUUID(reader, "GroupID");
169 }
170
171 private static void ProcessGroupOwned(InventoryItemBase item, XmlTextReader reader)
172 {
173 item.GroupOwned = Util.ReadBoolean(reader);
174 }
175
176 private static void ProcessCreatorData(InventoryItemBase item, XmlTextReader reader)
177 {
178 item.CreatorData = reader.ReadElementContentAsString("CreatorData", String.Empty);
179 }
180
181 #endregion
182
43 /// <summary> 183 /// <summary>
44 /// Deserialize item 184 /// Deserialize item
45 /// </summary> 185 /// </summary>
@@ -60,40 +200,47 @@ namespace OpenSim.Framework.Serialization.External
60 public static InventoryItemBase Deserialize(string serialization) 200 public static InventoryItemBase Deserialize(string serialization)
61 { 201 {
62 InventoryItemBase item = new InventoryItemBase(); 202 InventoryItemBase item = new InventoryItemBase();
63 203
64 StringReader sr = new StringReader(serialization); 204 using (XmlTextReader reader = new XmlTextReader(new StringReader(serialization)))
65 XmlTextReader xtr = new XmlTextReader(sr); 205 {
66 206 reader.ReadStartElement("InventoryItem");
67 xtr.ReadStartElement("InventoryItem"); 207
68 208 string nodeName = string.Empty;
69 item.Name = xtr.ReadElementString("Name"); 209 while (reader.NodeType != XmlNodeType.EndElement)
70 item.ID = UUID.Parse( xtr.ReadElementString("ID")); 210 {
71 item.InvType = Convert.ToInt32( xtr.ReadElementString("InvType")); 211 nodeName = reader.Name;
72 item.CreatorId = xtr.ReadElementString("CreatorUUID"); 212 InventoryItemXmlProcessor p = null;
73 item.CreationDate = Convert.ToInt32( xtr.ReadElementString("CreationDate")); 213 if (m_InventoryItemXmlProcessors.TryGetValue(reader.Name, out p))
74 item.Owner = UUID.Parse( xtr.ReadElementString("Owner")); 214 {
75 item.Description = xtr.ReadElementString("Description"); 215 //m_log.DebugFormat("[XXX] Processing: {0}", reader.Name);
76 item.AssetType = Convert.ToInt32( xtr.ReadElementString("AssetType")); 216 try
77 item.AssetID = UUID.Parse( xtr.ReadElementString("AssetID")); 217 {
78 item.SaleType = Convert.ToByte( xtr.ReadElementString("SaleType")); 218 p(item, reader);
79 item.SalePrice = Convert.ToInt32( xtr.ReadElementString("SalePrice")); 219 }
80 item.BasePermissions = Convert.ToUInt32( xtr.ReadElementString("BasePermissions")); 220 catch (Exception e)
81 item.CurrentPermissions = Convert.ToUInt32( xtr.ReadElementString("CurrentPermissions")); 221 {
82 item.EveryOnePermissions = Convert.ToUInt32( xtr.ReadElementString("EveryOnePermissions")); 222 m_log.DebugFormat("[InventoryItemSerializer]: exception while parsing {0}: {1}", nodeName, e);
83 item.NextPermissions = Convert.ToUInt32( xtr.ReadElementString("NextPermissions")); 223 if (reader.NodeType == XmlNodeType.EndElement)
84 item.Flags = Convert.ToUInt32( xtr.ReadElementString("Flags")); 224 reader.Read();
85 item.GroupID = UUID.Parse( xtr.ReadElementString("GroupID")); 225 }
86 item.GroupOwned = Convert.ToBoolean(xtr.ReadElementString("GroupOwned")); 226 }
87 227 else
88 xtr.ReadEndElement(); 228 {
89 229 // m_log.DebugFormat("[InventoryItemSerializer]: caught unknown element {0}", nodeName);
90 xtr.Close(); 230 reader.ReadOuterXml(); // ignore
91 sr.Close(); 231 }
92 232
233 }
234
235 reader.ReadEndElement(); // InventoryItem
236 }
237
238 //m_log.DebugFormat("[XXX]: parsed InventoryItemBase {0} - {1}", obj.Name, obj.UUID);
93 return item; 239 return item;
240
94 } 241 }
95 242
96 public static string Serialize(InventoryItemBase inventoryItem) 243 public static string Serialize(InventoryItemBase inventoryItem, Dictionary<string, object> options, IUserAccountService userAccountService)
97 { 244 {
98 StringWriter sw = new StringWriter(); 245 StringWriter sw = new StringWriter();
99 XmlTextWriter writer = new XmlTextWriter(sw); 246 XmlTextWriter writer = new XmlTextWriter(sw);
@@ -112,7 +259,7 @@ namespace OpenSim.Framework.Serialization.External
112 writer.WriteString(inventoryItem.InvType.ToString()); 259 writer.WriteString(inventoryItem.InvType.ToString());
113 writer.WriteEndElement(); 260 writer.WriteEndElement();
114 writer.WriteStartElement("CreatorUUID"); 261 writer.WriteStartElement("CreatorUUID");
115 writer.WriteString(inventoryItem.CreatorId); 262 writer.WriteString(OspResolver.MakeOspa(inventoryItem.CreatorIdAsUuid, userAccountService));
116 writer.WriteEndElement(); 263 writer.WriteEndElement();
117 writer.WriteStartElement("CreationDate"); 264 writer.WriteStartElement("CreationDate");
118 writer.WriteString(inventoryItem.CreationDate.ToString()); 265 writer.WriteString(inventoryItem.CreationDate.ToString());
@@ -156,6 +303,20 @@ namespace OpenSim.Framework.Serialization.External
156 writer.WriteStartElement("GroupOwned"); 303 writer.WriteStartElement("GroupOwned");
157 writer.WriteString(inventoryItem.GroupOwned.ToString()); 304 writer.WriteString(inventoryItem.GroupOwned.ToString());
158 writer.WriteEndElement(); 305 writer.WriteEndElement();
306 if (inventoryItem.CreatorData != null && inventoryItem.CreatorData != string.Empty)
307 writer.WriteElementString("CreatorData", inventoryItem.CreatorData);
308 else if (options.ContainsKey("profile"))
309 {
310 if (userAccountService != null)
311 {
312 UserAccount account = userAccountService.GetUserAccount(UUID.Zero, inventoryItem.CreatorIdAsUuid);
313 if (account != null)
314 {
315 writer.WriteElementString("CreatorData", (string)options["profile"] + "/" + inventoryItem.CreatorIdAsUuid + ";" + account.FirstName + " " + account.LastName);
316 }
317 writer.WriteElementString("CreatorID", inventoryItem.CreatorId);
318 }
319 }
159 320
160 writer.WriteEndElement(); 321 writer.WriteEndElement();
161 322
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs
index 6bee4be..877b0c2 100644
--- a/OpenSim/Framework/Util.cs
+++ b/OpenSim/Framework/Util.cs
@@ -1558,5 +1558,86 @@ namespace OpenSim.Framework
1558 return string.Empty; 1558 return string.Empty;
1559 } 1559 }
1560 1560
1561 #region Xml Serialization Utilities
1562 public static bool ReadBoolean(XmlTextReader reader)
1563 {
1564 reader.ReadStartElement();
1565 bool result = Boolean.Parse(reader.ReadContentAsString().ToLower());
1566 reader.ReadEndElement();
1567
1568 return result;
1569 }
1570
1571 public static UUID ReadUUID(XmlTextReader reader, string name)
1572 {
1573 UUID id;
1574 string idStr;
1575
1576 reader.ReadStartElement(name);
1577
1578 if (reader.Name == "Guid")
1579 idStr = reader.ReadElementString("Guid");
1580 else if (reader.Name == "UUID")
1581 idStr = reader.ReadElementString("UUID");
1582 else // no leading tag
1583 idStr = reader.ReadContentAsString();
1584 UUID.TryParse(idStr, out id);
1585 reader.ReadEndElement();
1586
1587 return id;
1588 }
1589
1590 public static Vector3 ReadVector(XmlTextReader reader, string name)
1591 {
1592 Vector3 vec;
1593
1594 reader.ReadStartElement(name);
1595 vec.X = reader.ReadElementContentAsFloat(reader.Name, String.Empty); // X or x
1596 vec.Y = reader.ReadElementContentAsFloat(reader.Name, String.Empty); // Y or y
1597 vec.Z = reader.ReadElementContentAsFloat(reader.Name, String.Empty); // Z or z
1598 reader.ReadEndElement();
1599
1600 return vec;
1601 }
1602
1603 public static Quaternion ReadQuaternion(XmlTextReader reader, string name)
1604 {
1605 Quaternion quat = new Quaternion();
1606
1607 reader.ReadStartElement(name);
1608 while (reader.NodeType != XmlNodeType.EndElement)
1609 {
1610 switch (reader.Name.ToLower())
1611 {
1612 case "x":
1613 quat.X = reader.ReadElementContentAsFloat(reader.Name, String.Empty);
1614 break;
1615 case "y":
1616 quat.Y = reader.ReadElementContentAsFloat(reader.Name, String.Empty);
1617 break;
1618 case "z":
1619 quat.Z = reader.ReadElementContentAsFloat(reader.Name, String.Empty);
1620 break;
1621 case "w":
1622 quat.W = reader.ReadElementContentAsFloat(reader.Name, String.Empty);
1623 break;
1624 }
1625 }
1626
1627 reader.ReadEndElement();
1628
1629 return quat;
1630 }
1631
1632 public static T ReadEnum<T>(XmlTextReader reader, string name)
1633 {
1634 string value = reader.ReadElementContentAsString(name, String.Empty);
1635 // !!!!! to deal with flags without commas
1636 if (value.Contains(" ") && !value.Contains(","))
1637 value = value.Replace(" ", ", ");
1638
1639 return (T)Enum.Parse(typeof(T), value); ;
1640 }
1641 #endregion
1561 } 1642 }
1562} 1643}
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs
index 493d412..feaea16 100644
--- a/OpenSim/Region/Application/OpenSim.cs
+++ b/OpenSim/Region/Application/OpenSim.cs
@@ -265,10 +265,10 @@ namespace OpenSim
265 LoadOar); 265 LoadOar);
266 266
267 m_console.Commands.AddCommand("region", false, "save oar", 267 m_console.Commands.AddCommand("region", false, "save oar",
268 "save oar [-v|--version=N] [-p|--profile=url] [<OAR path>]", 268 "save oar [-v|--version=<N>] [-p|--profile=<url>] [<OAR path>]",
269 "Save a region's data to an OAR archive.", 269 "Save a region's data to an OAR archive.",
270 "-v|--version=N generates scene objects as per older versions of the serialization (e.g. -v=0)" + Environment.NewLine 270 "-v|--version=<N> generates scene objects as per older versions of the serialization (e.g. -v=0)" + Environment.NewLine
271 + "-p|--profile=url adds the url of the profile service to the saved user information" + Environment.NewLine 271 + "-p|--profile=<url> adds the url of the profile service to the saved user information" + Environment.NewLine
272 + "The OAR path must be a filesystem path." 272 + "The OAR path must be a filesystem path."
273 + " If this is not given then the oar is saved to region.oar in the current directory.", 273 + " If this is not given then the oar is saved to region.oar in the current directory.",
274 SaveOar); 274 SaveOar);
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index f99fa16..9189260 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -3598,14 +3598,30 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3598 EntityUpdate update; 3598 EntityUpdate update;
3599 while (updatesThisCall < maxUpdates && m_entityUpdates.TryDequeue(out update)) 3599 while (updatesThisCall < maxUpdates && m_entityUpdates.TryDequeue(out update))
3600 { 3600 {
3601 // If we have sent a kill packet for this object
3602 // drop any updates on the floor
3603 if (update.Entity is SceneObjectPart) 3601 if (update.Entity is SceneObjectPart)
3604 { 3602 {
3605 SceneObjectPart part = (SceneObjectPart)update.Entity; 3603 SceneObjectPart part = (SceneObjectPart)update.Entity;
3606 if (m_killRecord.Contains(part.ParentGroup.RootPart.LocalId)) 3604 if (m_killRecord.Contains(part.ParentGroup.RootPart.LocalId))
3607 continue; 3605 continue;
3608 3606
3607 // Please do not remove this unless you can demonstrate on the OpenSim mailing list that a client
3608 // will never receive an update after a prim kill. Even then, keeping the kill record may be a good
3609 // safety measure.
3610 //
3611 // If a Linden Lab 1.23.5 client (and possibly later and earlier) receives an object update
3612 // after a kill, it will keep displaying the deleted object until relog. OpenSim currently performs
3613 // updates and kills on different threads with different scheduling strategies, hence this protection.
3614 //
3615 // This doesn't appear to apply to child prims - a client will happily ignore these updates
3616 // after the root prim has been deleted.
3617 if (m_killRecord.Contains(part.LocalId))
3618 {
3619 // m_log.WarnFormat(
3620 // "[CLIENT]: Preventing update for prim with local id {0} after client for user {1} told it was deleted",
3621 // part.LocalId, Name);
3622 continue;
3623 }
3624
3609 if (part.ParentGroup.IsAttachment && m_disableFacelights) 3625 if (part.ParentGroup.IsAttachment && m_disableFacelights)
3610 { 3626 {
3611 if (part.ParentGroup.RootPart.Shape.State != (byte)AttachmentPoint.LeftHand && 3627 if (part.ParentGroup.RootPart.Shape.State != (byte)AttachmentPoint.LeftHand &&
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs
index ed0e60d..5aa9b40 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs
@@ -400,7 +400,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP
400 return data; 400 return data;
401 } 401 }
402 402
403 public bool EnqueueOutgoing(OutgoingPacket packet) 403 /// <summary>
404 /// Queue an outgoing packet if appropriate.
405 /// </summary>
406 /// <param name="packet"></param>
407 /// <param name="forceQueue">Always queue the packet if at all possible.</param>
408 /// <returns>
409 /// true if the packet has been queued,
410 /// false if the packet has not been queued and should be sent immediately.
411 /// </returns>
412 public bool EnqueueOutgoing(OutgoingPacket packet, bool forceQueue)
404 { 413 {
405 int category = (int)packet.Category; 414 int category = (int)packet.Category;
406 415
@@ -416,14 +425,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
416 425
417 TokenBucket bucket = m_throttleCategories[category]; 426 TokenBucket bucket = m_throttleCategories[category];
418 427
419 if (bucket.RemoveTokens(packet.Buffer.DataLength)) 428 if (!forceQueue && bucket.RemoveTokens(packet.Buffer.DataLength))
420 { 429 {
421 // Enough tokens were removed from the bucket, the packet will not be queued 430 // Enough tokens were removed from the bucket, the packet will not be queued
422 return false; 431 return false;
423 } 432 }
424 else 433 else
425 { 434 {
426 // Not enough tokens in the bucket, queue this packet 435 // Force queue specified or not enough tokens in the bucket, queue this packet
427 queue.Enqueue(packet); 436 queue.Enqueue(packet);
428 return true; 437 return true;
429 } 438 }
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs
index ef0a178..6985449 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs
@@ -312,6 +312,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
312 } 312 }
313 } 313 }
314 314
315 /// <summary>
316 /// Start the process of sending a packet to the client.
317 /// </summary>
318 /// <param name="udpClient"></param>
319 /// <param name="packet"></param>
320 /// <param name="category"></param>
321 /// <param name="allowSplitting"></param>
315 public void SendPacket(LLUDPClient udpClient, Packet packet, ThrottleOutPacketType category, bool allowSplitting) 322 public void SendPacket(LLUDPClient udpClient, Packet packet, ThrottleOutPacketType category, bool allowSplitting)
316 { 323 {
317 // CoarseLocationUpdate packets cannot be split in an automated way 324 // CoarseLocationUpdate packets cannot be split in an automated way
@@ -339,6 +346,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
339 } 346 }
340 } 347 }
341 348
349 /// <summary>
350 /// Start the process of sending a packet to the client.
351 /// </summary>
352 /// <param name="udpClient"></param>
353 /// <param name="data"></param>
354 /// <param name="type"></param>
355 /// <param name="category"></param>
342 public void SendPacketData(LLUDPClient udpClient, byte[] data, PacketType type, ThrottleOutPacketType category) 356 public void SendPacketData(LLUDPClient udpClient, byte[] data, PacketType type, ThrottleOutPacketType category)
343 { 357 {
344 int dataLength = data.Length; 358 int dataLength = data.Length;
@@ -396,7 +410,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
396 410
397 OutgoingPacket outgoingPacket = new OutgoingPacket(udpClient, buffer, category); 411 OutgoingPacket outgoingPacket = new OutgoingPacket(udpClient, buffer, category);
398 412
399 if (!outgoingPacket.Client.EnqueueOutgoing(outgoingPacket)) 413 // If a Linden Lab 1.23.5 client receives an update packet after a kill packet for an object, it will
414 // continue to display the deleted object until relog. Therefore, we need to always queue a kill object
415 // packet so that it isn't sent before a queued update packet.
416 bool requestQueue = type == PacketType.KillObject;
417 if (!outgoingPacket.Client.EnqueueOutgoing(outgoingPacket, requestQueue))
400 SendPacketFinal(outgoingPacket); 418 SendPacketFinal(outgoingPacket);
401 419
402 #endregion Queue or Send 420 #endregion Queue or Send
@@ -489,7 +507,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
489 //Interlocked.Increment(ref Stats.ResentPackets); 507 //Interlocked.Increment(ref Stats.ResentPackets);
490 508
491 // Requeue or resend the packet 509 // Requeue or resend the packet
492 if (!outgoingPacket.Client.EnqueueOutgoing(outgoingPacket)) 510 if (!outgoingPacket.Client.EnqueueOutgoing(outgoingPacket, false))
493 SendPacketFinal(outgoingPacket); 511 SendPacketFinal(outgoingPacket);
494 } 512 }
495 } 513 }
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
index 046b05f..acf2c3e 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
@@ -37,12 +37,11 @@ using System.Xml.Linq;
37using log4net; 37using log4net;
38using OpenMetaverse; 38using OpenMetaverse;
39using OpenSim.Framework; 39using OpenSim.Framework;
40using OpenSim.Framework.Communications;
41using OpenSim.Framework.Communications.Osp;
42using OpenSim.Framework.Serialization; 40using OpenSim.Framework.Serialization;
43using OpenSim.Framework.Serialization.External; 41using OpenSim.Framework.Serialization.External;
44using OpenSim.Region.CoreModules.World.Archiver; 42using OpenSim.Region.CoreModules.World.Archiver;
45using OpenSim.Region.Framework.Scenes; 43using OpenSim.Region.Framework.Scenes;
44using OpenSim.Region.Framework.Interfaces;
46using OpenSim.Services.Interfaces; 45using OpenSim.Services.Interfaces;
47 46
48namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver 47namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
@@ -398,20 +397,22 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
398 // Don't use the item ID that's in the file 397 // Don't use the item ID that's in the file
399 item.ID = UUID.Random(); 398 item.ID = UUID.Random();
400 399
401 UUID ospResolvedId = OspResolver.ResolveOspa(item.CreatorId, m_scene.UserAccountService); 400 UUID ospResolvedId = OspResolver.ResolveOspa(item.CreatorId, m_scene.UserAccountService);
402 if (UUID.Zero != ospResolvedId) 401 if (UUID.Zero != ospResolvedId) // The user exists in this grid
403 { 402 {
404 item.CreatorIdAsUuid = ospResolvedId; 403 item.CreatorIdAsUuid = ospResolvedId;
405 404
406 // XXX: For now, don't preserve the OSPA in the creator id (which actually gets persisted to the 405 // XXX: For now, don't preserve the OSPA in the creator id (which actually gets persisted to the
407 // database). Instead, replace with the UUID that we found. 406 // database). Instead, replace with the UUID that we found.
408 item.CreatorId = ospResolvedId.ToString(); 407 item.CreatorId = ospResolvedId.ToString();
408
409 item.CreatorData = string.Empty;
409 } 410 }
410 else 411 else if (item.CreatorData == null || item.CreatorData == String.Empty)
411 { 412 {
412 item.CreatorIdAsUuid = m_userInfo.PrincipalID; 413 item.CreatorIdAsUuid = m_userInfo.PrincipalID;
413 } 414 }
414 415
415 item.Owner = m_userInfo.PrincipalID; 416 item.Owner = m_userInfo.PrincipalID;
416 417
417 // Reset folder ID to the one in which we want to load it 418 // Reset folder ID to the one in which we want to load it
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs
index d81703a..cab341d 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs
@@ -36,8 +36,6 @@ using OpenMetaverse;
36using OpenSim.Framework; 36using OpenSim.Framework;
37using OpenSim.Framework.Serialization; 37using OpenSim.Framework.Serialization;
38using OpenSim.Framework.Serialization.External; 38using OpenSim.Framework.Serialization.External;
39using OpenSim.Framework.Communications;
40using OpenSim.Framework.Communications.Osp;
41using OpenSim.Region.CoreModules.World.Archiver; 39using OpenSim.Region.CoreModules.World.Archiver;
42using OpenSim.Region.Framework.Scenes; 40using OpenSim.Region.Framework.Scenes;
43using OpenSim.Services.Interfaces; 41using OpenSim.Services.Interfaces;
@@ -139,20 +137,17 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
139 m_id, succeeded, m_userInfo, m_invPath, m_saveStream, reportedException); 137 m_id, succeeded, m_userInfo, m_invPath, m_saveStream, reportedException);
140 } 138 }
141 139
142 protected void SaveInvItem(InventoryItemBase inventoryItem, string path) 140 protected void SaveInvItem(InventoryItemBase inventoryItem, string path, Dictionary<string, object> options, IUserAccountService userAccountService)
143 { 141 {
144 string filename = path + CreateArchiveItemName(inventoryItem); 142 string filename = path + CreateArchiveItemName(inventoryItem);
145 143
146 // Record the creator of this item for user record purposes (which might go away soon) 144 // Record the creator of this item for user record purposes (which might go away soon)
147 m_userUuids[inventoryItem.CreatorIdAsUuid] = 1; 145 m_userUuids[inventoryItem.CreatorIdAsUuid] = 1;
148 146
149 InventoryItemBase saveItem = (InventoryItemBase)inventoryItem.Clone(); 147 string serialization = UserInventoryItemSerializer.Serialize(inventoryItem, options, userAccountService);
150 saveItem.CreatorId = OspResolver.MakeOspa(saveItem.CreatorIdAsUuid, m_scene.UserAccountService);
151
152 string serialization = UserInventoryItemSerializer.Serialize(saveItem);
153 m_archiveWriter.WriteFile(filename, serialization); 148 m_archiveWriter.WriteFile(filename, serialization);
154 149
155 m_assetGatherer.GatherAssetUuids(saveItem.AssetID, (AssetType)saveItem.AssetType, m_assetUuids); 150 m_assetGatherer.GatherAssetUuids(inventoryItem.AssetID, (AssetType)inventoryItem.AssetType, m_assetUuids);
156 } 151 }
157 152
158 /// <summary> 153 /// <summary>
@@ -161,7 +156,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
161 /// <param name="inventoryFolder">The inventory folder to save</param> 156 /// <param name="inventoryFolder">The inventory folder to save</param>
162 /// <param name="path">The path to which the folder should be saved</param> 157 /// <param name="path">The path to which the folder should be saved</param>
163 /// <param name="saveThisFolderItself">If true, save this folder itself. If false, only saves contents</param> 158 /// <param name="saveThisFolderItself">If true, save this folder itself. If false, only saves contents</param>
164 protected void SaveInvFolder(InventoryFolderBase inventoryFolder, string path, bool saveThisFolderItself) 159 protected void SaveInvFolder(InventoryFolderBase inventoryFolder, string path, bool saveThisFolderItself, Dictionary<string, object> options, IUserAccountService userAccountService)
165 { 160 {
166 if (saveThisFolderItself) 161 if (saveThisFolderItself)
167 { 162 {
@@ -176,19 +171,19 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
176 171
177 foreach (InventoryFolderBase childFolder in contents.Folders) 172 foreach (InventoryFolderBase childFolder in contents.Folders)
178 { 173 {
179 SaveInvFolder(childFolder, path, true); 174 SaveInvFolder(childFolder, path, true, options, userAccountService);
180 } 175 }
181 176
182 foreach (InventoryItemBase item in contents.Items) 177 foreach (InventoryItemBase item in contents.Items)
183 { 178 {
184 SaveInvItem(item, path); 179 SaveInvItem(item, path, options, userAccountService);
185 } 180 }
186 } 181 }
187 182
188 /// <summary> 183 /// <summary>
189 /// Execute the inventory write request 184 /// Execute the inventory write request
190 /// </summary> 185 /// </summary>
191 public void Execute() 186 public void Execute(Dictionary<string, object> options, IUserAccountService userAccountService)
192 { 187 {
193 try 188 try
194 { 189 {
@@ -266,7 +261,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
266 m_invPath == String.Empty ? InventoryFolderImpl.PATH_DELIMITER : m_invPath); 261 m_invPath == String.Empty ? InventoryFolderImpl.PATH_DELIMITER : m_invPath);
267 262
268 //recurse through all dirs getting dirs and files 263 //recurse through all dirs getting dirs and files
269 SaveInvFolder(inventoryFolder, ArchiveConstants.INVENTORY_PATH, !saveFolderContentsOnly); 264 SaveInvFolder(inventoryFolder, ArchiveConstants.INVENTORY_PATH, !saveFolderContentsOnly, options, userAccountService);
270 } 265 }
271 else if (inventoryItem != null) 266 else if (inventoryItem != null)
272 { 267 {
@@ -274,14 +269,17 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
274 "[INVENTORY ARCHIVER]: Found item {0} {1} at {2}", 269 "[INVENTORY ARCHIVER]: Found item {0} {1} at {2}",
275 inventoryItem.Name, inventoryItem.ID, m_invPath); 270 inventoryItem.Name, inventoryItem.ID, m_invPath);
276 271
277 SaveInvItem(inventoryItem, ArchiveConstants.INVENTORY_PATH); 272 SaveInvItem(inventoryItem, ArchiveConstants.INVENTORY_PATH, options, userAccountService);
278 } 273 }
279 274
280 // Don't put all this profile information into the archive right now. 275 // Don't put all this profile information into the archive right now.
281 //SaveUsers(); 276 //SaveUsers();
282 277
283 new AssetsRequest( 278 new AssetsRequest(
284 new AssetsArchiver(m_archiveWriter), m_assetUuids, m_scene.AssetService, ReceivedAllAssets).Execute(); 279 new AssetsArchiver(m_archiveWriter),
280 m_assetUuids, m_scene.AssetService,
281 m_scene.UserAccountService, m_scene.RegionInfo.ScopeID,
282 options, ReceivedAllAssets).Execute();
285 } 283 }
286 catch (Exception) 284 catch (Exception)
287 { 285 {
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs
index 2eaca49..b33c2b1 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs
@@ -75,6 +75,24 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
75 private Dictionary<UUID, Scene> m_scenes = new Dictionary<UUID, Scene>(); 75 private Dictionary<UUID, Scene> m_scenes = new Dictionary<UUID, Scene>();
76 private Scene m_aScene; 76 private Scene m_aScene;
77 77
78 private IUserAccountService m_UserAccountService;
79 protected IUserAccountService UserAccountService
80 {
81 get
82 {
83 if (m_UserAccountService == null)
84 // What a strange thing to do...
85 foreach (Scene s in m_scenes.Values)
86 {
87 m_UserAccountService = s.RequestModuleInterface<IUserAccountService>();
88 break;
89 }
90
91 return m_UserAccountService;
92 }
93 }
94
95
78 public InventoryArchiverModule() {} 96 public InventoryArchiverModule() {}
79 97
80 public InventoryArchiverModule(bool disablePresenceChecks) 98 public InventoryArchiverModule(bool disablePresenceChecks)
@@ -106,11 +124,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
106 124
107 scene.AddCommand( 125 scene.AddCommand(
108 this, "save iar", 126 this, "save iar",
109 "save iar <first> <last> <inventory path> <password> [<IAR path>]", 127 "save iar <first> <last> <inventory path> <password> [--p|-profile=<url>] [<IAR path>]",
110 "Save user inventory archive (IAR).", 128 "Save user inventory archive (IAR).",
111 "<first> is the user's first name." + Environment.NewLine 129 "<first> is the user's first name." + Environment.NewLine
112 + "<last> is the user's last name." + Environment.NewLine 130 + "<last> is the user's last name." + Environment.NewLine
113 + "<inventory path> is the path inside the user's inventory for the folder/item to be saved." + Environment.NewLine 131 + "<inventory path> is the path inside the user's inventory for the folder/item to be saved." + Environment.NewLine
132 + "-p|--profile=<url> adds the url of the profile service to the saved user information." + Environment.NewLine
114 + "<IAR path> is the filesystem path at which to save the IAR." 133 + "<IAR path> is the filesystem path at which to save the IAR."
115 + string.Format(" If this is not given then the filename {0} in the current directory is used", DEFAULT_INV_BACKUP_FILENAME), 134 + string.Format(" If this is not given then the filename {0} in the current directory is used", DEFAULT_INV_BACKUP_FILENAME),
116 HandleSaveInvConsoleCommand); 135 HandleSaveInvConsoleCommand);
@@ -157,7 +176,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
157 { 176 {
158 try 177 try
159 { 178 {
160 new InventoryArchiveWriteRequest(id, this, m_aScene, userInfo, invPath, saveStream).Execute(); 179 new InventoryArchiveWriteRequest(id, this, m_aScene, userInfo, invPath, saveStream).Execute(options, UserAccountService);
161 } 180 }
162 catch (EntryPointNotFoundException e) 181 catch (EntryPointNotFoundException e)
163 { 182 {
@@ -197,7 +216,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
197 { 216 {
198 try 217 try
199 { 218 {
200 new InventoryArchiveWriteRequest(id, this, m_aScene, userInfo, invPath, savePath).Execute(); 219 new InventoryArchiveWriteRequest(id, this, m_aScene, userInfo, invPath, savePath).Execute(options, UserAccountService);
201 } 220 }
202 catch (EntryPointNotFoundException e) 221 catch (EntryPointNotFoundException e)
203 { 222 {
@@ -235,14 +254,15 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
235 if (m_scenes.Count > 0) 254 if (m_scenes.Count > 0)
236 { 255 {
237 UserAccount userInfo = GetUserInfo(firstName, lastName, pass); 256 UserAccount userInfo = GetUserInfo(firstName, lastName, pass);
238 257
239 if (userInfo != null) 258 if (userInfo != null)
240 { 259 {
241 if (CheckPresence(userInfo.PrincipalID)) 260 if (CheckPresence(userInfo.PrincipalID))
242 { 261 {
262
243 InventoryArchiveReadRequest request; 263 InventoryArchiveReadRequest request;
244 bool merge = (options.ContainsKey("merge") ? (bool)options["merge"] : false); 264 bool merge = (options.ContainsKey("merge") ? (bool)options["merge"] : false);
245 265
246 try 266 try
247 { 267 {
248 request = new InventoryArchiveReadRequest(m_aScene, userInfo, invPath, loadStream, merge); 268 request = new InventoryArchiveReadRequest(m_aScene, userInfo, invPath, loadStream, merge);
@@ -256,7 +276,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
256 276
257 return false; 277 return false;
258 } 278 }
259 279
260 UpdateClientWithLoadedNodes(userInfo, request.Execute()); 280 UpdateClientWithLoadedNodes(userInfo, request.Execute());
261 281
262 return true; 282 return true;
@@ -268,6 +288,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
268 userInfo.FirstName, userInfo.LastName, userInfo.PrincipalID); 288 userInfo.FirstName, userInfo.LastName, userInfo.PrincipalID);
269 } 289 }
270 } 290 }
291 else
292 m_log.ErrorFormat("[INVENTORY ARCHIVER]: User {0} {1} not found",
293 firstName, lastName);
271 } 294 }
272 295
273 return false; 296 return false;
@@ -368,10 +391,18 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
368 protected void HandleSaveInvConsoleCommand(string module, string[] cmdparams) 391 protected void HandleSaveInvConsoleCommand(string module, string[] cmdparams)
369 { 392 {
370 Guid id = Guid.NewGuid(); 393 Guid id = Guid.NewGuid();
371 394
395 Dictionary<string, object> options = new Dictionary<string, object>();
396
397 OptionSet ops = new OptionSet();
398 //ops.Add("v|version=", delegate(string v) { options["version"] = v; });
399 ops.Add("p|profile=", delegate(string v) { options["profile"] = v; });
400
401 List<string> mainParams = ops.Parse(cmdparams);
402
372 try 403 try
373 { 404 {
374 if (cmdparams.Length < 6) 405 if (mainParams.Count < 6)
375 { 406 {
376 m_log.Error( 407 m_log.Error(
377 "[INVENTORY ARCHIVER]: usage is save iar <first name> <last name> <inventory path> <user password> [<save file path>]"); 408 "[INVENTORY ARCHIVER]: usage is save iar <first name> <last name> <inventory path> <user password> [<save file path>]");
@@ -379,18 +410,20 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
379 } 410 }
380 411
381 m_log.Info("[INVENTORY ARCHIVER]: PLEASE NOTE THAT THIS FACILITY IS EXPERIMENTAL. BUG REPORTS WELCOME."); 412 m_log.Info("[INVENTORY ARCHIVER]: PLEASE NOTE THAT THIS FACILITY IS EXPERIMENTAL. BUG REPORTS WELCOME.");
382 413 if (options.ContainsKey("profile"))
383 string firstName = cmdparams[2]; 414 m_log.WarnFormat("[INVENTORY ARCHIVER]: Please be aware that inventory archives with creator information are not compatible with OpenSim 0.7.0.2 and earlier. Do not use the -profile option if you want to produce a compatible IAR");
384 string lastName = cmdparams[3]; 415
385 string invPath = cmdparams[4]; 416 string firstName = mainParams[2];
386 string pass = cmdparams[5]; 417 string lastName = mainParams[3];
387 string savePath = (cmdparams.Length > 6 ? cmdparams[6] : DEFAULT_INV_BACKUP_FILENAME); 418 string invPath = mainParams[4];
419 string pass = mainParams[5];
420 string savePath = (mainParams.Count > 6 ? mainParams[6] : DEFAULT_INV_BACKUP_FILENAME);
388 421
389 m_log.InfoFormat( 422 m_log.InfoFormat(
390 "[INVENTORY ARCHIVER]: Saving archive {0} using inventory path {1} for {2} {3}", 423 "[INVENTORY ARCHIVER]: Saving archive {0} using inventory path {1} for {2} {3}",
391 savePath, invPath, firstName, lastName); 424 savePath, invPath, firstName, lastName);
392 425
393 ArchiveInventory(id, firstName, lastName, invPath, pass, savePath, new Dictionary<string, object>()); 426 ArchiveInventory(id, firstName, lastName, invPath, pass, savePath, options);
394 } 427 }
395 catch (InventoryArchiverException e) 428 catch (InventoryArchiverException e)
396 { 429 {
@@ -518,5 +551,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
518 551
519 return false; 552 return false;
520 } 553 }
554
521 } 555 }
522} 556}
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
index 938886b2..2747e15 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
@@ -38,7 +38,6 @@ using OpenSim.Framework;
38using OpenSim.Framework.Serialization; 38using OpenSim.Framework.Serialization;
39using OpenSim.Framework.Serialization.External; 39using OpenSim.Framework.Serialization.External;
40using OpenSim.Framework.Communications; 40using OpenSim.Framework.Communications;
41using OpenSim.Framework.Communications.Osp;
42using OpenSim.Region.CoreModules.Avatar.Inventory.Archiver; 41using OpenSim.Region.CoreModules.Avatar.Inventory.Archiver;
43using OpenSim.Region.CoreModules.World.Serialiser; 42using OpenSim.Region.CoreModules.World.Serialiser;
44using OpenSim.Region.Framework.Scenes; 43using OpenSim.Region.Framework.Scenes;
@@ -96,14 +95,17 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
96 item1.Name = m_item1Name; 95 item1.Name = m_item1Name;
97 item1.AssetID = UUID.Random(); 96 item1.AssetID = UUID.Random();
98 item1.GroupID = UUID.Random(); 97 item1.GroupID = UUID.Random();
99 item1.CreatorId = OspResolver.MakeOspa(m_ua2.FirstName, m_ua2.LastName); 98 //item1.CreatorId = OspResolver.MakeOspa(m_ua2.FirstName, m_ua2.LastName);
100 //item1.CreatorId = userUuid.ToString(); 99 //item1.CreatorId = userUuid.ToString();
101 //item1.CreatorId = "00000000-0000-0000-0000-000000000444"; 100 item1.CreatorId = m_ua2.PrincipalID.ToString();
102 item1.Owner = UUID.Zero; 101 item1.Owner = UUID.Zero;
103 102
103 Scene scene = SceneSetupHelpers.SetupScene("Inventory");
104 UserProfileTestUtils.CreateUserWithInventory(scene, m_ua2, "hampshire");
105
104 string item1FileName 106 string item1FileName
105 = string.Format("{0}{1}", ArchiveConstants.INVENTORY_PATH, archiveItemName); 107 = string.Format("{0}{1}", ArchiveConstants.INVENTORY_PATH, archiveItemName);
106 tar.WriteFile(item1FileName, UserInventoryItemSerializer.Serialize(item1)); 108 tar.WriteFile(item1FileName, UserInventoryItemSerializer.Serialize(item1, new Dictionary<string, object>(), scene.UserAccountService));
107 tar.Close(); 109 tar.Close();
108 m_iarStream = new MemoryStream(archiveWriteStream.ToArray()); 110 m_iarStream = new MemoryStream(archiveWriteStream.ToArray());
109 } 111 }
@@ -386,7 +388,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
386 Scene scene = SceneSetupHelpers.SetupScene("inventory"); 388 Scene scene = SceneSetupHelpers.SetupScene("inventory");
387 389
388 SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule); 390 SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule);
389 391
390 UserProfileTestUtils.CreateUserWithInventory(scene, m_ua1, "meowfood"); 392 UserProfileTestUtils.CreateUserWithInventory(scene, m_ua1, "meowfood");
391 UserProfileTestUtils.CreateUserWithInventory(scene, m_ua2, "hampshire"); 393 UserProfileTestUtils.CreateUserWithInventory(scene, m_ua2, "hampshire");
392 394
@@ -551,7 +553,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
551 553
552 string item1FileName 554 string item1FileName
553 = string.Format("{0}{1}", ArchiveConstants.INVENTORY_PATH, archiveItemName); 555 = string.Format("{0}{1}", ArchiveConstants.INVENTORY_PATH, archiveItemName);
554 tar.WriteFile(item1FileName, UserInventoryItemSerializer.Serialize(item1)); 556 tar.WriteFile(item1FileName, UserInventoryItemSerializer.Serialize(item1, new Dictionary<string,object>(), null));
555 tar.Close(); 557 tar.Close();
556 558
557 MemoryStream archiveReadStream = new MemoryStream(archiveWriteStream.ToArray()); 559 MemoryStream archiveReadStream = new MemoryStream(archiveWriteStream.ToArray());
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs
index ccb892e..81b65c5 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs
@@ -27,8 +27,11 @@
27 27
28using System; 28using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using System.IO;
30using System.Reflection; 31using System.Reflection;
31using System.Threading; 32using System.Threading;
33using System.Xml;
34
32using log4net; 35using log4net;
33using OpenMetaverse; 36using OpenMetaverse;
34using OpenSim.Framework; 37using OpenSim.Framework;
@@ -52,14 +55,16 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
52// private Dictionary<string, InventoryClient> m_inventoryServers = new Dictionary<string, InventoryClient>(); 55// private Dictionary<string, InventoryClient> m_inventoryServers = new Dictionary<string, InventoryClient>();
53 56
54 private Scene m_scene; 57 private Scene m_scene;
58 private string m_ProfileServerURI;
55 59
56 #endregion 60 #endregion
57 61
58 #region Constructor 62 #region Constructor
59 63
60 public HGAssetMapper(Scene scene) 64 public HGAssetMapper(Scene scene, string profileURL)
61 { 65 {
62 m_scene = scene; 66 m_scene = scene;
67 m_ProfileServerURI = profileURL;
63 } 68 }
64 69
65 #endregion 70 #endregion
@@ -95,16 +100,18 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
95 try 100 try
96 { 101 {
97 asset1.ID = url + "/" + asset.ID; 102 asset1.ID = url + "/" + asset.ID;
98// UUID temp = UUID.Zero;
99 // TODO: if the creator is local, stick this grid's URL in front
100 //if (UUID.TryParse(asset.Metadata.CreatorID, out temp))
101 // asset1.Metadata.CreatorID = ??? + "/" + asset.Metadata.CreatorID;
102 } 103 }
103 catch 104 catch
104 { 105 {
105 m_log.Warn("[HG ASSET MAPPER]: Oops."); 106 m_log.Warn("[HG ASSET MAPPER]: Oops.");
106 } 107 }
107 108
109 AdjustIdentifiers(asset1.Metadata);
110 if (asset1.Metadata.Type == (sbyte)AssetType.Object)
111 asset1.Data = AdjustIdentifiers(asset.Data);
112 else
113 asset1.Data = asset.Data;
114
108 m_scene.AssetService.Store(asset1); 115 m_scene.AssetService.Store(asset1);
109 m_log.DebugFormat("[HG ASSET MAPPER]: Posted copy of asset {0} from local asset server to {1}", asset1.ID, url); 116 m_log.DebugFormat("[HG ASSET MAPPER]: Posted copy of asset {0} from local asset server to {1}", asset1.ID, url);
110 } 117 }
@@ -118,7 +125,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
118 125
119 private void Copy(AssetBase from, AssetBase to) 126 private void Copy(AssetBase from, AssetBase to)
120 { 127 {
121 to.Data = from.Data; 128 //to.Data = from.Data; // don't copy this, it's copied elsewhere
122 to.Description = from.Description; 129 to.Description = from.Description;
123 to.FullID = from.FullID; 130 to.FullID = from.FullID;
124 to.ID = from.ID; 131 to.ID = from.ID;
@@ -129,6 +136,70 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
129 136
130 } 137 }
131 138
139 private void AdjustIdentifiers(AssetMetadata meta)
140 {
141 if (meta.CreatorID != null && meta.CreatorID != string.Empty)
142 {
143 UUID uuid = UUID.Zero;
144 UUID.TryParse(meta.CreatorID, out uuid);
145 UserAccount creator = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, uuid);
146 if (creator != null)
147 meta.CreatorID = m_ProfileServerURI + "/" + meta.CreatorID + ";" + creator.FirstName + " " + creator.LastName;
148 }
149 }
150
151 protected byte[] AdjustIdentifiers(byte[] data)
152 {
153 string xml = Utils.BytesToString(data);
154 return Utils.StringToBytes(RewriteSOP(xml));
155 }
156
157 protected string RewriteSOP(string xml)
158 {
159 XmlDocument doc = new XmlDocument();
160 doc.LoadXml(xml);
161 XmlNodeList sops = doc.GetElementsByTagName("SceneObjectPart");
162
163 foreach (XmlNode sop in sops)
164 {
165 UserAccount creator = null;
166 bool hasCreatorData = false;
167 XmlNodeList nodes = sop.ChildNodes;
168 foreach (XmlNode node in nodes)
169 {
170 if (node.Name == "CreatorID")
171 {
172 UUID uuid = UUID.Zero;
173 UUID.TryParse(node.InnerText, out uuid);
174 creator = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, uuid);
175 }
176 if (node.Name == "CreatorData" && node.InnerText != null && node.InnerText != string.Empty)
177 hasCreatorData = true;
178
179 //if (node.Name == "OwnerID")
180 //{
181 // UserAccount owner = GetUser(node.InnerText);
182 // if (owner != null)
183 // node.InnerText = m_ProfileServiceURL + "/" + node.InnerText + "/" + owner.FirstName + " " + owner.LastName;
184 //}
185 }
186
187 if (!hasCreatorData && creator != null)
188 {
189 XmlElement creatorData = doc.CreateElement("CreatorData");
190 creatorData.InnerText = m_ProfileServerURI + "/" + creator.PrincipalID + ";" + creator.FirstName + " " + creator.LastName;
191 sop.AppendChild(creatorData);
192 }
193 }
194
195 using (StringWriter wr = new StringWriter())
196 {
197 doc.Save(wr);
198 return wr.ToString();
199 }
200
201 }
202
132 // TODO: unused 203 // TODO: unused
133 // private void Dump(Dictionary<UUID, bool> lst) 204 // private void Dump(Dictionary<UUID, bool> lst)
134 // { 205 // {
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs
index 125a397..34b8114 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs
@@ -54,6 +54,8 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
54 get { return m_assMapper; } 54 get { return m_assMapper; }
55 } 55 }
56 56
57 private string m_ProfileServerURI;
58
57// private bool m_Initialized = false; 59// private bool m_Initialized = false;
58 60
59 #region INonSharedRegionModule 61 #region INonSharedRegionModule
@@ -73,6 +75,12 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
73 { 75 {
74 m_Enabled = true; 76 m_Enabled = true;
75 m_log.InfoFormat("[HG INVENTORY ACCESS MODULE]: {0} enabled.", Name); 77 m_log.InfoFormat("[HG INVENTORY ACCESS MODULE]: {0} enabled.", Name);
78
79 IConfig thisModuleConfig = source.Configs["HGInventoryAccessModule"];
80 if (thisModuleConfig != null)
81 m_ProfileServerURI = thisModuleConfig.GetString("ProfileServerURI", string.Empty);
82 else
83 m_log.Warn("[HG INVENTORY ACCESS MODULE]: HGInventoryAccessModule configs not found. ProfileServerURI not set!");
76 } 84 }
77 } 85 }
78 } 86 }
@@ -83,7 +91,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
83 return; 91 return;
84 92
85 base.AddRegion(scene); 93 base.AddRegion(scene);
86 m_assMapper = new HGAssetMapper(scene); 94 m_assMapper = new HGAssetMapper(scene, m_ProfileServerURI);
87 scene.EventManager.OnNewInventoryItemUploadComplete += UploadInventoryItem; 95 scene.EventManager.OnNewInventoryItemUploadComplete += UploadInventoryItem;
88 96
89 } 97 }
@@ -97,7 +105,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
97 string userAssetServer = string.Empty; 105 string userAssetServer = string.Empty;
98 if (IsForeignUser(avatarID, out userAssetServer)) 106 if (IsForeignUser(avatarID, out userAssetServer))
99 { 107 {
100 m_assMapper.Post(assetID, avatarID, userAssetServer); 108 Util.FireAndForget(delegate { m_assMapper.Post(assetID, avatarID, userAssetServer); });
101 } 109 }
102 } 110 }
103 111
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
index 22da665..623cd3a 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
@@ -54,6 +54,17 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
54 54
55 protected bool m_Enabled = false; 55 protected bool m_Enabled = false;
56 protected Scene m_Scene; 56 protected Scene m_Scene;
57 protected IUserManagement m_UserManagement;
58 protected IUserManagement UserManagementModule
59 {
60 get
61 {
62 if (m_UserManagement == null)
63 m_UserManagement = m_Scene.RequestModuleInterface<IUserManagement>();
64 return m_UserManagement;
65 }
66 }
67
57 68
58 #region INonSharedRegionModule 69 #region INonSharedRegionModule
59 70
@@ -416,7 +427,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
416 // 427 //
417 if (action == DeRezAction.Take || action == DeRezAction.TakeCopy) 428 if (action == DeRezAction.Take || action == DeRezAction.TakeCopy)
418 { 429 {
419 if (objlist[0].RootPart.FromFolderID != UUID.Zero) 430 if (objlist[0].RootPart.FromFolderID != UUID.Zero && objlist[0].OwnerID == remoteClient.AgentId)
420 { 431 {
421 InventoryFolderBase f = new InventoryFolderBase(objlist[0].RootPart.FromFolderID, userID); 432 InventoryFolderBase f = new InventoryFolderBase(objlist[0].RootPart.FromFolderID, userID);
422 folder = m_Scene.InventoryService.GetFolder(f); 433 folder = m_Scene.InventoryService.GetFolder(f);
@@ -863,6 +874,13 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
863 return null; 874 return null;
864 } 875 }
865 876
877 protected void AddUserData(SceneObjectGroup sog)
878 {
879 UserManagementModule.AddUser(sog.RootPart.CreatorID, sog.RootPart.CreatorData);
880 foreach (SceneObjectPart sop in sog.Parts)
881 UserManagementModule.AddUser(sop.CreatorID, sop.CreatorData);
882 }
883
866 public virtual void TransferInventoryAssets(InventoryItemBase item, UUID sender, UUID receiver) 884 public virtual void TransferInventoryAssets(InventoryItemBase item, UUID sender, UUID receiver)
867 { 885 {
868 } 886 }
@@ -943,9 +961,13 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
943 protected virtual InventoryItemBase GetItem(UUID agentID, UUID itemID) 961 protected virtual InventoryItemBase GetItem(UUID agentID, UUID itemID)
944 { 962 {
945 IInventoryService invService = m_Scene.RequestModuleInterface<IInventoryService>(); 963 IInventoryService invService = m_Scene.RequestModuleInterface<IInventoryService>();
946 InventoryItemBase assetRequestItem = new InventoryItemBase(itemID, agentID); 964 InventoryItemBase item = new InventoryItemBase(itemID, agentID);
947 assetRequestItem = invService.GetItem(assetRequestItem); 965 item = invService.GetItem(item);
948 return assetRequestItem; 966
967 if (item.CreatorData != null && item.CreatorData != string.Empty)
968 UserManagementModule.AddUser(item.CreatorIdAsUuid, item.CreatorData);
969
970 return item;
949 } 971 }
950 972
951 #endregion 973 #endregion
diff --git a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs
index 0d94baa..bf84100 100644
--- a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs
@@ -275,6 +275,11 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
275 m_log.DebugFormat("[USER MANAGEMENT MODULE]: Added user {0} {1} {2} {3}", user.Id, user.FirstName, user.LastName, user.ProfileURL); 275 m_log.DebugFormat("[USER MANAGEMENT MODULE]: Added user {0} {1} {2} {3}", user.Id, user.FirstName, user.LastName, user.ProfileURL);
276 } 276 }
277 277
278 public void AddUser(UUID uuid, string first, string last, string profileURL)
279 {
280 AddUser(uuid, profileURL + ";" + first + " " + last);
281 }
282
278 //public void AddUser(UUID uuid, string userData) 283 //public void AddUser(UUID uuid, string userData)
279 //{ 284 //{
280 // if (m_UserCache.ContainsKey(uuid)) 285 // if (m_UserCache.ContainsKey(uuid))
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Asset/AssetServiceInConnectorModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Asset/AssetServiceInConnectorModule.cs
index 2324380..e25700d 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Asset/AssetServiceInConnectorModule.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Asset/AssetServiceInConnectorModule.cs
@@ -91,9 +91,10 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Asset
91 { 91 {
92 m_Registered = true; 92 m_Registered = true;
93 93
94 m_log.Info("[RegionAssetService]: Starting..."); 94 m_log.Info("[HGAssetService]: Starting...");
95 95
96 Object[] args = new Object[] { m_Config, MainServer.Instance, string.Empty }; 96
97 Object[] args = new Object[] { m_Config, MainServer.Instance, "HGAssetService" };
97 98
98 ServerUtils.LoadPlugin<IServiceConnector>("OpenSim.Server.Handlers.dll:AssetServiceConnector", args); 99 ServerUtils.LoadPlugin<IServiceConnector>("OpenSim.Server.Handlers.dll:AssetServiceConnector", args);
99 } 100 }
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs
index b987b5a..0699407 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs
@@ -190,7 +190,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver
190 190
191 new AssetsRequest( 191 new AssetsRequest(
192 new AssetsArchiver(archiveWriter), assetUuids, 192 new AssetsArchiver(archiveWriter), assetUuids,
193 m_scene.AssetService, awre.ReceivedAllAssets).Execute(); 193 m_scene.AssetService, m_scene.UserAccountService,
194 m_scene.RegionInfo.ScopeID, options, awre.ReceivedAllAssets).Execute();
194 } 195 }
195 catch (Exception) 196 catch (Exception)
196 { 197 {
@@ -238,10 +239,10 @@ namespace OpenSim.Region.CoreModules.World.Archiver
238 } 239 }
239 240
240 m_log.InfoFormat("[ARCHIVER]: Creating version {0}.{1} OAR", majorVersion, minorVersion); 241 m_log.InfoFormat("[ARCHIVER]: Creating version {0}.{1} OAR", majorVersion, minorVersion);
241 if (majorVersion == 1) 242 //if (majorVersion == 1)
242 { 243 //{
243 m_log.WarnFormat("[ARCHIVER]: Please be aware that version 1.0 OARs are not compatible with OpenSim 0.7.0.2 and earlier. Please use the --version=0 option if you want to produce a compatible OAR"); 244 // m_log.WarnFormat("[ARCHIVER]: Please be aware that version 1.0 OARs are not compatible with OpenSim 0.7.0.2 and earlier. Please use the --version=0 option if you want to produce a compatible OAR");
244 } 245 //}
245 246
246 StringWriter sw = new StringWriter(); 247 StringWriter sw = new StringWriter();
247 XmlTextWriter xtw = new XmlTextWriter(sw); 248 XmlTextWriter xtw = new XmlTextWriter(sw);
diff --git a/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs
index d4a09b4..5da1656 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs
@@ -34,6 +34,7 @@ using log4net;
34using OpenMetaverse; 34using OpenMetaverse;
35using OpenSim.Framework; 35using OpenSim.Framework;
36using OpenSim.Framework.Serialization; 36using OpenSim.Framework.Serialization;
37using OpenSim.Framework.Serialization.External;
37using OpenSim.Services.Interfaces; 38using OpenSim.Services.Interfaces;
38 39
39namespace OpenSim.Region.CoreModules.World.Archiver 40namespace OpenSim.Region.CoreModules.World.Archiver
@@ -100,17 +101,26 @@ namespace OpenSim.Region.CoreModules.World.Archiver
100 /// Asset service used to request the assets 101 /// Asset service used to request the assets
101 /// </value> 102 /// </value>
102 protected IAssetService m_assetService; 103 protected IAssetService m_assetService;
104 protected IUserAccountService m_userAccountService;
105 protected UUID m_scopeID; // the grid ID
103 106
104 protected AssetsArchiver m_assetsArchiver; 107 protected AssetsArchiver m_assetsArchiver;
105 108
109 protected Dictionary<string, object> m_options;
110
106 protected internal AssetsRequest( 111 protected internal AssetsRequest(
107 AssetsArchiver assetsArchiver, IDictionary<UUID, AssetType> uuids, 112 AssetsArchiver assetsArchiver, IDictionary<UUID, AssetType> uuids,
108 IAssetService assetService, AssetsRequestCallback assetsRequestCallback) 113 IAssetService assetService, IUserAccountService userService,
114 UUID scope, Dictionary<string, object> options,
115 AssetsRequestCallback assetsRequestCallback)
109 { 116 {
110 m_assetsArchiver = assetsArchiver; 117 m_assetsArchiver = assetsArchiver;
111 m_uuids = uuids; 118 m_uuids = uuids;
112 m_assetsRequestCallback = assetsRequestCallback; 119 m_assetsRequestCallback = assetsRequestCallback;
113 m_assetService = assetService; 120 m_assetService = assetService;
121 m_userAccountService = userService;
122 m_scopeID = scope;
123 m_options = options;
114 m_repliesRequired = uuids.Count; 124 m_repliesRequired = uuids.Count;
115 125
116 m_requestCallbackTimer = new System.Timers.Timer(TIMEOUT); 126 m_requestCallbackTimer = new System.Timers.Timer(TIMEOUT);
@@ -241,7 +251,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver
241 { 251 {
242// m_log.DebugFormat("[ARCHIVER]: Writing asset {0}", id); 252// m_log.DebugFormat("[ARCHIVER]: Writing asset {0}", id);
243 m_foundAssetUuids.Add(asset.FullID); 253 m_foundAssetUuids.Add(asset.FullID);
244 m_assetsArchiver.WriteAsset(asset); 254
255 m_assetsArchiver.WriteAsset(PostProcess(asset));
245 } 256 }
246 else 257 else
247 { 258 {
@@ -288,5 +299,16 @@ namespace OpenSim.Region.CoreModules.World.Archiver
288 "[ARCHIVER]: Terminating archive creation since asset requster callback failed with {0}", e); 299 "[ARCHIVER]: Terminating archive creation since asset requster callback failed with {0}", e);
289 } 300 }
290 } 301 }
302
303 protected AssetBase PostProcess(AssetBase asset)
304 {
305 if (asset.Type == (sbyte)AssetType.Object && asset.Data != null && m_options.ContainsKey("profile"))
306 {
307 //m_log.DebugFormat("[ARCHIVER]: Rewriting object data for {0}", asset.ID);
308 string xml = ExternalRepresentationUtils.RewriteSOP(Utils.BytesToString(asset.Data), m_options["profile"].ToString(), m_userAccountService, m_scopeID);
309 asset.Data = Utils.StringToBytes(xml);
310 }
311 return asset;
312 }
291 } 313 }
292} 314}
diff --git a/OpenSim/Region/Framework/Interfaces/IUserManagement.cs b/OpenSim/Region/Framework/Interfaces/IUserManagement.cs
index 1a5cb7e..2904ee8 100644
--- a/OpenSim/Region/Framework/Interfaces/IUserManagement.cs
+++ b/OpenSim/Region/Framework/Interfaces/IUserManagement.cs
@@ -9,5 +9,6 @@ namespace OpenSim.Region.Framework.Interfaces
9 { 9 {
10 string GetUserName(UUID uuid); 10 string GetUserName(UUID uuid);
11 void AddUser(UUID uuid, string userData); 11 void AddUser(UUID uuid, string userData);
12 void AddUser(UUID uuid, string firstName, string lastName, string profileURL);
12 } 13 }
13} 14}
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index e6201a8..52e2e83 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -398,6 +398,10 @@ namespace OpenSim.Region.Framework.Scenes
398 398
399 if ((item != null) && (item.Owner == senderId)) 399 if ((item != null) && (item.Owner == senderId))
400 { 400 {
401 IUserManagement uman = RequestModuleInterface<IUserManagement>();
402 if (uman != null)
403 uman.AddUser(item.CreatorIdAsUuid, item.CreatorData);
404
401 if (!Permissions.BypassPermissions()) 405 if (!Permissions.BypassPermissions())
402 { 406 {
403 if ((item.CurrentPermissions & (uint)PermissionMask.Transfer) == 0) 407 if ((item.CurrentPermissions & (uint)PermissionMask.Transfer) == 0)
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 3c2cd9b..0c7b2e8 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -2059,7 +2059,7 @@ namespace OpenSim.Region.Framework.Scenes
2059 /// <param name="group">Object Id</param> 2059 /// <param name="group">Object Id</param>
2060 /// <param name="silent">Suppress broadcasting changes to other clients.</param> 2060 /// <param name="silent">Suppress broadcasting changes to other clients.</param>
2061 public void DeleteSceneObject(SceneObjectGroup group, bool silent) 2061 public void DeleteSceneObject(SceneObjectGroup group, bool silent)
2062 { 2062 {
2063// m_log.DebugFormat("[SCENE]: Deleting scene object {0} {1}", group.Name, group.UUID); 2063// m_log.DebugFormat("[SCENE]: Deleting scene object {0} {1}", group.Name, group.UUID);
2064 2064
2065 //SceneObjectPart rootPart = group.GetChildPart(group.UUID); 2065 //SceneObjectPart rootPart = group.GetChildPart(group.UUID);
@@ -2102,7 +2102,7 @@ namespace OpenSim.Region.Framework.Scenes
2102 if (!silent) 2102 if (!silent)
2103 SendKillObject(new List<uint>() { group.LocalId }); 2103 SendKillObject(new List<uint>() { group.LocalId });
2104 2104
2105// m_log.DebugFormat("[SCENE]: Exit DeleteSceneObject() for {0} {1}", group.Name, group.UUID); 2105// m_log.DebugFormat("[SCENE]: Exit DeleteSceneObject() for {0} {1}", group.Name, group.UUID);
2106 } 2106 }
2107 2107
2108 /// <summary> 2108 /// <summary>
@@ -2121,9 +2121,12 @@ namespace OpenSim.Region.Framework.Scenes
2121 // Force a database update so that the scene object group ID is accurate. It's possible that the 2121 // Force a database update so that the scene object group ID is accurate. It's possible that the
2122 // group has recently been delinked from another group but that this change has not been persisted 2122 // group has recently been delinked from another group but that this change has not been persisted
2123 // to the DB. 2123 // to the DB.
2124 ForceSceneObjectBackup(so); 2124 // This is an expensive thing to do so only do it if absolutely necessary.
2125 if (so.HasGroupChangedDueToDelink)
2126 ForceSceneObjectBackup(so);
2127
2125 so.DetachFromBackup(); 2128 so.DetachFromBackup();
2126 SimulationDataService.RemoveObject(so.UUID, m_regInfo.RegionID); 2129 SimulationDataService.RemoveObject(so.UUID, m_regInfo.RegionID);
2127 } 2130 }
2128 2131
2129 // We need to keep track of this state in case this group is still queued for further backup. 2132 // We need to keep track of this state in case this group is still queued for further backup.
@@ -2650,6 +2653,7 @@ namespace OpenSim.Region.Framework.Scenes
2650 } 2653 }
2651 else 2654 else
2652 m_log.DebugFormat("[SCENE]: User Client Verification for {0} {1} in {2} returned true", aCircuit.firstname, aCircuit.lastname, RegionInfo.RegionName); 2655 m_log.DebugFormat("[SCENE]: User Client Verification for {0} {1} in {2} returned true", aCircuit.firstname, aCircuit.lastname, RegionInfo.RegionName);
2656
2653 } 2657 }
2654 } 2658 }
2655 2659
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index bcb715b..896300f 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -171,10 +171,19 @@ namespace OpenSim.Region.Framework.Scenes
171 } 171 }
172 } 172 }
173 m_hasGroupChanged = value; 173 m_hasGroupChanged = value;
174
175// m_log.DebugFormat(
176// "[SCENE OBJECT GROUP]: HasGroupChanged set to {0} for {1} {2}", m_hasGroupChanged, Name, LocalId);
174 } 177 }
175 178
176 get { return m_hasGroupChanged; } 179 get { return m_hasGroupChanged; }
177 } 180 }
181
182 /// <summary>
183 /// Has the group changed due to an unlink operation? We record this in order to optimize deletion, since
184 /// an unlinked group currently has to be persisted to the database before we can perform an unlink operation.
185 /// </summary>
186 public bool HasGroupChangedDueToDelink { get; private set; }
178 187
179 private bool isTimeToPersist() 188 private bool isTimeToPersist()
180 { 189 {
@@ -1622,6 +1631,7 @@ namespace OpenSim.Region.Framework.Scenes
1622 backup_group.RootPart.AngularVelocity = RootPart.AngularVelocity; 1631 backup_group.RootPart.AngularVelocity = RootPart.AngularVelocity;
1623 backup_group.RootPart.ParticleSystem = RootPart.ParticleSystem; 1632 backup_group.RootPart.ParticleSystem = RootPart.ParticleSystem;
1624 HasGroupChanged = false; 1633 HasGroupChanged = false;
1634 HasGroupChangedDueToDelink = false;
1625 1635
1626 m_scene.EventManager.TriggerOnSceneObjectPreSave(backup_group, this); 1636 m_scene.EventManager.TriggerOnSceneObjectPreSave(backup_group, this);
1627 datastore.StoreObject(backup_group, m_scene.RegionInfo.RegionID); 1637 datastore.StoreObject(backup_group, m_scene.RegionInfo.RegionID);
@@ -2540,8 +2550,9 @@ namespace OpenSim.Region.Framework.Scenes
2540 2550
2541 linkPart.Rezzed = RootPart.Rezzed; 2551 linkPart.Rezzed = RootPart.Rezzed;
2542 2552
2543 //HasGroupChanged = true; 2553 // When we delete a group, we currently have to force persist to the database if the object id has changed
2544 //ScheduleGroupForFullUpdate(); 2554 // (since delete works by deleting all rows which have a given object id)
2555 objectGroup.HasGroupChangedDueToDelink = true;
2545 2556
2546 return objectGroup; 2557 return objectGroup;
2547 } 2558 }
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 8cc2be1..db60ae3 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -459,7 +459,10 @@ namespace OpenSim.Region.Framework.Scenes
459 } 459 }
460 } 460 }
461 461
462 public string CreatorData // = <profile url>;<name> 462 /// <summary>
463 /// Data about the creator in the form profile_url;name
464 /// </summary>
465 public string CreatorData
463 { 466 {
464 get { return m_creatorData; } 467 get { return m_creatorData; }
465 set { m_creatorData = value; } 468 set { m_creatorData = value; }
diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
index 1fe31b0..6c13eb5 100644
--- a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
+++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
@@ -409,12 +409,12 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
409 #region SOPXmlProcessors 409 #region SOPXmlProcessors
410 private static void ProcessAllowedDrop(SceneObjectPart obj, XmlTextReader reader) 410 private static void ProcessAllowedDrop(SceneObjectPart obj, XmlTextReader reader)
411 { 411 {
412 obj.AllowedDrop = reader.ReadElementContentAsBoolean("AllowedDrop", String.Empty); 412 obj.AllowedDrop = Util.ReadBoolean(reader);
413 } 413 }
414 414
415 private static void ProcessCreatorID(SceneObjectPart obj, XmlTextReader reader) 415 private static void ProcessCreatorID(SceneObjectPart obj, XmlTextReader reader)
416 { 416 {
417 obj.CreatorID = ReadUUID(reader, "CreatorID"); 417 obj.CreatorID = Util.ReadUUID(reader, "CreatorID");
418 } 418 }
419 419
420 private static void ProcessCreatorData(SceneObjectPart obj, XmlTextReader reader) 420 private static void ProcessCreatorData(SceneObjectPart obj, XmlTextReader reader)
@@ -424,7 +424,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
424 424
425 private static void ProcessFolderID(SceneObjectPart obj, XmlTextReader reader) 425 private static void ProcessFolderID(SceneObjectPart obj, XmlTextReader reader)
426 { 426 {
427 obj.FolderID = ReadUUID(reader, "FolderID"); 427 obj.FolderID = Util.ReadUUID(reader, "FolderID");
428 } 428 }
429 429
430 private static void ProcessInventorySerial(SceneObjectPart obj, XmlTextReader reader) 430 private static void ProcessInventorySerial(SceneObjectPart obj, XmlTextReader reader)
@@ -439,7 +439,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
439 439
440 private static void ProcessUUID(SceneObjectPart obj, XmlTextReader reader) 440 private static void ProcessUUID(SceneObjectPart obj, XmlTextReader reader)
441 { 441 {
442 obj.UUID = ReadUUID(reader, "UUID"); 442 obj.UUID = Util.ReadUUID(reader, "UUID");
443 } 443 }
444 444
445 private static void ProcessLocalId(SceneObjectPart obj, XmlTextReader reader) 445 private static void ProcessLocalId(SceneObjectPart obj, XmlTextReader reader)
@@ -459,7 +459,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
459 459
460 private static void ProcessPassTouches(SceneObjectPart obj, XmlTextReader reader) 460 private static void ProcessPassTouches(SceneObjectPart obj, XmlTextReader reader)
461 { 461 {
462 obj.PassTouches = reader.ReadElementContentAsBoolean("PassTouches", String.Empty); 462 obj.PassTouches = Util.ReadBoolean(reader);
463 } 463 }
464 464
465 private static void ProcessRegionHandle(SceneObjectPart obj, XmlTextReader reader) 465 private static void ProcessRegionHandle(SceneObjectPart obj, XmlTextReader reader)
@@ -474,32 +474,32 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
474 474
475 private static void ProcessGroupPosition(SceneObjectPart obj, XmlTextReader reader) 475 private static void ProcessGroupPosition(SceneObjectPart obj, XmlTextReader reader)
476 { 476 {
477 obj.GroupPosition = ReadVector(reader, "GroupPosition"); 477 obj.GroupPosition = Util.ReadVector(reader, "GroupPosition");
478 } 478 }
479 479
480 private static void ProcessOffsetPosition(SceneObjectPart obj, XmlTextReader reader) 480 private static void ProcessOffsetPosition(SceneObjectPart obj, XmlTextReader reader)
481 { 481 {
482 obj.OffsetPosition = ReadVector(reader, "OffsetPosition"); ; 482 obj.OffsetPosition = Util.ReadVector(reader, "OffsetPosition"); ;
483 } 483 }
484 484
485 private static void ProcessRotationOffset(SceneObjectPart obj, XmlTextReader reader) 485 private static void ProcessRotationOffset(SceneObjectPart obj, XmlTextReader reader)
486 { 486 {
487 obj.RotationOffset = ReadQuaternion(reader, "RotationOffset"); 487 obj.RotationOffset = Util.ReadQuaternion(reader, "RotationOffset");
488 } 488 }
489 489
490 private static void ProcessVelocity(SceneObjectPart obj, XmlTextReader reader) 490 private static void ProcessVelocity(SceneObjectPart obj, XmlTextReader reader)
491 { 491 {
492 obj.Velocity = ReadVector(reader, "Velocity"); 492 obj.Velocity = Util.ReadVector(reader, "Velocity");
493 } 493 }
494 494
495 private static void ProcessAngularVelocity(SceneObjectPart obj, XmlTextReader reader) 495 private static void ProcessAngularVelocity(SceneObjectPart obj, XmlTextReader reader)
496 { 496 {
497 obj.AngularVelocity = ReadVector(reader, "AngularVelocity"); 497 obj.AngularVelocity = Util.ReadVector(reader, "AngularVelocity");
498 } 498 }
499 499
500 private static void ProcessAcceleration(SceneObjectPart obj, XmlTextReader reader) 500 private static void ProcessAcceleration(SceneObjectPart obj, XmlTextReader reader)
501 { 501 {
502 obj.Acceleration = ReadVector(reader, "Acceleration"); 502 obj.Acceleration = Util.ReadVector(reader, "Acceleration");
503 } 503 }
504 504
505 private static void ProcessDescription(SceneObjectPart obj, XmlTextReader reader) 505 private static void ProcessDescription(SceneObjectPart obj, XmlTextReader reader)
@@ -553,7 +553,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
553 553
554 private static void ProcessScale(SceneObjectPart obj, XmlTextReader reader) 554 private static void ProcessScale(SceneObjectPart obj, XmlTextReader reader)
555 { 555 {
556 obj.Scale = ReadVector(reader, "Scale"); 556 obj.Scale = Util.ReadVector(reader, "Scale");
557 } 557 }
558 558
559 private static void ProcessUpdateFlag(SceneObjectPart obj, XmlTextReader reader) 559 private static void ProcessUpdateFlag(SceneObjectPart obj, XmlTextReader reader)
@@ -563,22 +563,22 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
563 563
564 private static void ProcessSitTargetOrientation(SceneObjectPart obj, XmlTextReader reader) 564 private static void ProcessSitTargetOrientation(SceneObjectPart obj, XmlTextReader reader)
565 { 565 {
566 obj.SitTargetOrientation = ReadQuaternion(reader, "SitTargetOrientation"); 566 obj.SitTargetOrientation = Util.ReadQuaternion(reader, "SitTargetOrientation");
567 } 567 }
568 568
569 private static void ProcessSitTargetPosition(SceneObjectPart obj, XmlTextReader reader) 569 private static void ProcessSitTargetPosition(SceneObjectPart obj, XmlTextReader reader)
570 { 570 {
571 obj.SitTargetPosition = ReadVector(reader, "SitTargetPosition"); 571 obj.SitTargetPosition = Util.ReadVector(reader, "SitTargetPosition");
572 } 572 }
573 573
574 private static void ProcessSitTargetPositionLL(SceneObjectPart obj, XmlTextReader reader) 574 private static void ProcessSitTargetPositionLL(SceneObjectPart obj, XmlTextReader reader)
575 { 575 {
576 obj.SitTargetPositionLL = ReadVector(reader, "SitTargetPositionLL"); 576 obj.SitTargetPositionLL = Util.ReadVector(reader, "SitTargetPositionLL");
577 } 577 }
578 578
579 private static void ProcessSitTargetOrientationLL(SceneObjectPart obj, XmlTextReader reader) 579 private static void ProcessSitTargetOrientationLL(SceneObjectPart obj, XmlTextReader reader)
580 { 580 {
581 obj.SitTargetOrientationLL = ReadQuaternion(reader, "SitTargetOrientationLL"); 581 obj.SitTargetOrientationLL = Util.ReadQuaternion(reader, "SitTargetOrientationLL");
582 } 582 }
583 583
584 private static void ProcessParentID(SceneObjectPart obj, XmlTextReader reader) 584 private static void ProcessParentID(SceneObjectPart obj, XmlTextReader reader)
@@ -614,17 +614,17 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
614 614
615 private static void ProcessGroupID(SceneObjectPart obj, XmlTextReader reader) 615 private static void ProcessGroupID(SceneObjectPart obj, XmlTextReader reader)
616 { 616 {
617 obj.GroupID = ReadUUID(reader, "GroupID"); 617 obj.GroupID = Util.ReadUUID(reader, "GroupID");
618 } 618 }
619 619
620 private static void ProcessOwnerID(SceneObjectPart obj, XmlTextReader reader) 620 private static void ProcessOwnerID(SceneObjectPart obj, XmlTextReader reader)
621 { 621 {
622 obj.OwnerID = ReadUUID(reader, "OwnerID"); 622 obj.OwnerID = Util.ReadUUID(reader, "OwnerID");
623 } 623 }
624 624
625 private static void ProcessLastOwnerID(SceneObjectPart obj, XmlTextReader reader) 625 private static void ProcessLastOwnerID(SceneObjectPart obj, XmlTextReader reader)
626 { 626 {
627 obj.LastOwnerID = ReadUUID(reader, "LastOwnerID"); 627 obj.LastOwnerID = Util.ReadUUID(reader, "LastOwnerID");
628 } 628 }
629 629
630 private static void ProcessBaseMask(SceneObjectPart obj, XmlTextReader reader) 630 private static void ProcessBaseMask(SceneObjectPart obj, XmlTextReader reader)
@@ -654,16 +654,12 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
654 654
655 private static void ProcessFlags(SceneObjectPart obj, XmlTextReader reader) 655 private static void ProcessFlags(SceneObjectPart obj, XmlTextReader reader)
656 { 656 {
657 string value = reader.ReadElementContentAsString("Flags", String.Empty); 657 obj.Flags = Util.ReadEnum<PrimFlags>(reader, "Flags");
658 // !!!!! to deal with flags without commas
659 if (value.Contains(" ") && !value.Contains(","))
660 value = value.Replace(" ", ", ");
661 obj.Flags = (PrimFlags)Enum.Parse(typeof(PrimFlags), value);
662 } 658 }
663 659
664 private static void ProcessCollisionSound(SceneObjectPart obj, XmlTextReader reader) 660 private static void ProcessCollisionSound(SceneObjectPart obj, XmlTextReader reader)
665 { 661 {
666 obj.CollisionSound = ReadUUID(reader, "CollisionSound"); 662 obj.CollisionSound = Util.ReadUUID(reader, "CollisionSound");
667 } 663 }
668 664
669 private static void ProcessCollisionSoundVolume(SceneObjectPart obj, XmlTextReader reader) 665 private static void ProcessCollisionSoundVolume(SceneObjectPart obj, XmlTextReader reader)
@@ -690,7 +686,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
690 #region TaskInventoryXmlProcessors 686 #region TaskInventoryXmlProcessors
691 private static void ProcessTIAssetID(TaskInventoryItem item, XmlTextReader reader) 687 private static void ProcessTIAssetID(TaskInventoryItem item, XmlTextReader reader)
692 { 688 {
693 item.AssetID = ReadUUID(reader, "AssetID"); 689 item.AssetID = Util.ReadUUID(reader, "AssetID");
694 } 690 }
695 691
696 private static void ProcessTIBasePermissions(TaskInventoryItem item, XmlTextReader reader) 692 private static void ProcessTIBasePermissions(TaskInventoryItem item, XmlTextReader reader)
@@ -705,7 +701,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
705 701
706 private static void ProcessTICreatorID(TaskInventoryItem item, XmlTextReader reader) 702 private static void ProcessTICreatorID(TaskInventoryItem item, XmlTextReader reader)
707 { 703 {
708 item.CreatorID = ReadUUID(reader, "CreatorID"); 704 item.CreatorID = Util.ReadUUID(reader, "CreatorID");
709 } 705 }
710 706
711 private static void ProcessTICreatorData(TaskInventoryItem item, XmlTextReader reader) 707 private static void ProcessTICreatorData(TaskInventoryItem item, XmlTextReader reader)
@@ -730,7 +726,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
730 726
731 private static void ProcessTIGroupID(TaskInventoryItem item, XmlTextReader reader) 727 private static void ProcessTIGroupID(TaskInventoryItem item, XmlTextReader reader)
732 { 728 {
733 item.GroupID = ReadUUID(reader, "GroupID"); 729 item.GroupID = Util.ReadUUID(reader, "GroupID");
734 } 730 }
735 731
736 private static void ProcessTIGroupPermissions(TaskInventoryItem item, XmlTextReader reader) 732 private static void ProcessTIGroupPermissions(TaskInventoryItem item, XmlTextReader reader)
@@ -745,20 +741,20 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
745 741
746 private static void ProcessTIItemID(TaskInventoryItem item, XmlTextReader reader) 742 private static void ProcessTIItemID(TaskInventoryItem item, XmlTextReader reader)
747 { 743 {
748 item.ItemID = ReadUUID(reader, "ItemID"); 744 item.ItemID = Util.ReadUUID(reader, "ItemID");
749 } 745 }
750 746
751 private static void ProcessTIOldItemID(TaskInventoryItem item, XmlTextReader reader) 747 private static void ProcessTIOldItemID(TaskInventoryItem item, XmlTextReader reader)
752 { 748 {
753 ReadUUID(reader, "OldItemID"); 749 Util.ReadUUID(reader, "OldItemID");
754 // On deserialization, the old item id MUST BE UUID.Zero!!!!! 750 // On deserialization, the old item id MUST BE UUID.Zero!!!!!
755 // Setting this to the saved value will BREAK script persistence! 751 // Setting this to the saved value will BREAK script persistence!
756 // item.OldItemID = ReadUUID(reader, "OldItemID"); 752 // item.OldItemID = Util.ReadUUID(reader, "OldItemID");
757 } 753 }
758 754
759 private static void ProcessTILastOwnerID(TaskInventoryItem item, XmlTextReader reader) 755 private static void ProcessTILastOwnerID(TaskInventoryItem item, XmlTextReader reader)
760 { 756 {
761 item.LastOwnerID = ReadUUID(reader, "LastOwnerID"); 757 item.LastOwnerID = Util.ReadUUID(reader, "LastOwnerID");
762 } 758 }
763 759
764 private static void ProcessTIName(TaskInventoryItem item, XmlTextReader reader) 760 private static void ProcessTIName(TaskInventoryItem item, XmlTextReader reader)
@@ -773,7 +769,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
773 769
774 private static void ProcessTIOwnerID(TaskInventoryItem item, XmlTextReader reader) 770 private static void ProcessTIOwnerID(TaskInventoryItem item, XmlTextReader reader)
775 { 771 {
776 item.OwnerID = ReadUUID(reader, "OwnerID"); 772 item.OwnerID = Util.ReadUUID(reader, "OwnerID");
777 } 773 }
778 774
779 private static void ProcessTICurrentPermissions(TaskInventoryItem item, XmlTextReader reader) 775 private static void ProcessTICurrentPermissions(TaskInventoryItem item, XmlTextReader reader)
@@ -783,17 +779,17 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
783 779
784 private static void ProcessTIParentID(TaskInventoryItem item, XmlTextReader reader) 780 private static void ProcessTIParentID(TaskInventoryItem item, XmlTextReader reader)
785 { 781 {
786 item.ParentID = ReadUUID(reader, "ParentID"); 782 item.ParentID = Util.ReadUUID(reader, "ParentID");
787 } 783 }
788 784
789 private static void ProcessTIParentPartID(TaskInventoryItem item, XmlTextReader reader) 785 private static void ProcessTIParentPartID(TaskInventoryItem item, XmlTextReader reader)
790 { 786 {
791 item.ParentPartID = ReadUUID(reader, "ParentPartID"); 787 item.ParentPartID = Util.ReadUUID(reader, "ParentPartID");
792 } 788 }
793 789
794 private static void ProcessTIPermsGranter(TaskInventoryItem item, XmlTextReader reader) 790 private static void ProcessTIPermsGranter(TaskInventoryItem item, XmlTextReader reader)
795 { 791 {
796 item.PermsGranter = ReadUUID(reader, "PermsGranter"); 792 item.PermsGranter = Util.ReadUUID(reader, "PermsGranter");
797 } 793 }
798 794
799 private static void ProcessTIPermsMask(TaskInventoryItem item, XmlTextReader reader) 795 private static void ProcessTIPermsMask(TaskInventoryItem item, XmlTextReader reader)
@@ -808,7 +804,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
808 804
809 private static void ProcessTIOwnerChanged(TaskInventoryItem item, XmlTextReader reader) 805 private static void ProcessTIOwnerChanged(TaskInventoryItem item, XmlTextReader reader)
810 { 806 {
811 item.OwnerChanged = reader.ReadElementContentAsBoolean("OwnerChanged", String.Empty); 807 item.OwnerChanged = Util.ReadBoolean(reader);
812 } 808 }
813 809
814 #endregion 810 #endregion
@@ -922,7 +918,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
922 918
923 private static void ProcessShpScale(PrimitiveBaseShape shp, XmlTextReader reader) 919 private static void ProcessShpScale(PrimitiveBaseShape shp, XmlTextReader reader)
924 { 920 {
925 shp.Scale = ReadVector(reader, "Scale"); 921 shp.Scale = Util.ReadVector(reader, "Scale");
926 } 922 }
927 923
928 private static void ProcessShpState(PrimitiveBaseShape shp, XmlTextReader reader) 924 private static void ProcessShpState(PrimitiveBaseShape shp, XmlTextReader reader)
@@ -932,25 +928,17 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
932 928
933 private static void ProcessShpProfileShape(PrimitiveBaseShape shp, XmlTextReader reader) 929 private static void ProcessShpProfileShape(PrimitiveBaseShape shp, XmlTextReader reader)
934 { 930 {
935 string value = reader.ReadElementContentAsString("ProfileShape", String.Empty); 931 shp.ProfileShape = Util.ReadEnum<ProfileShape>(reader, "ProfileShape");
936 // !!!!! to deal with flags without commas
937 if (value.Contains(" ") && !value.Contains(","))
938 value = value.Replace(" ", ", ");
939 shp.ProfileShape = (ProfileShape)Enum.Parse(typeof(ProfileShape), value);
940 } 932 }
941 933
942 private static void ProcessShpHollowShape(PrimitiveBaseShape shp, XmlTextReader reader) 934 private static void ProcessShpHollowShape(PrimitiveBaseShape shp, XmlTextReader reader)
943 { 935 {
944 string value = reader.ReadElementContentAsString("HollowShape", String.Empty); 936 shp.HollowShape = Util.ReadEnum<HollowShape>(reader, "HollowShape");
945 // !!!!! to deal with flags without commas
946 if (value.Contains(" ") && !value.Contains(","))
947 value = value.Replace(" ", ", ");
948 shp.HollowShape = (HollowShape)Enum.Parse(typeof(HollowShape), value);
949 } 937 }
950 938
951 private static void ProcessShpSculptTexture(PrimitiveBaseShape shp, XmlTextReader reader) 939 private static void ProcessShpSculptTexture(PrimitiveBaseShape shp, XmlTextReader reader)
952 { 940 {
953 shp.SculptTexture = ReadUUID(reader, "SculptTexture"); 941 shp.SculptTexture = Util.ReadUUID(reader, "SculptTexture");
954 } 942 }
955 943
956 private static void ProcessShpSculptType(PrimitiveBaseShape shp, XmlTextReader reader) 944 private static void ProcessShpSculptType(PrimitiveBaseShape shp, XmlTextReader reader)
@@ -1045,17 +1033,17 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
1045 1033
1046 private static void ProcessShpFlexiEntry(PrimitiveBaseShape shp, XmlTextReader reader) 1034 private static void ProcessShpFlexiEntry(PrimitiveBaseShape shp, XmlTextReader reader)
1047 { 1035 {
1048 shp.FlexiEntry = reader.ReadElementContentAsBoolean("FlexiEntry", String.Empty); 1036 shp.FlexiEntry = Util.ReadBoolean(reader);
1049 } 1037 }
1050 1038
1051 private static void ProcessShpLightEntry(PrimitiveBaseShape shp, XmlTextReader reader) 1039 private static void ProcessShpLightEntry(PrimitiveBaseShape shp, XmlTextReader reader)
1052 { 1040 {
1053 shp.LightEntry = reader.ReadElementContentAsBoolean("LightEntry", String.Empty); 1041 shp.LightEntry = Util.ReadBoolean(reader);
1054 } 1042 }
1055 1043
1056 private static void ProcessShpSculptEntry(PrimitiveBaseShape shp, XmlTextReader reader) 1044 private static void ProcessShpSculptEntry(PrimitiveBaseShape shp, XmlTextReader reader)
1057 { 1045 {
1058 shp.SculptEntry = reader.ReadElementContentAsBoolean("SculptEntry", String.Empty); 1046 shp.SculptEntry = Util.ReadBoolean(reader);
1059 } 1047 }
1060 1048
1061 private static void ProcessShpMedia(PrimitiveBaseShape shp, XmlTextReader reader) 1049 private static void ProcessShpMedia(PrimitiveBaseShape shp, XmlTextReader reader)
@@ -1220,16 +1208,8 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
1220 1208
1221 static void WriteFlags(XmlTextWriter writer, string name, string flagsStr, Dictionary<string, object> options) 1209 static void WriteFlags(XmlTextWriter writer, string name, string flagsStr, Dictionary<string, object> options)
1222 { 1210 {
1223 // Older versions of serialization can't cope with commas 1211 // Older versions of serialization can't cope with commas, so we eliminate the commas
1224 if (options.ContainsKey("version")) 1212 writer.WriteElementString(name, flagsStr.Replace(",", ""));
1225 {
1226 float version = 0.5F;
1227 float.TryParse(options["version"].ToString(), out version);
1228 if (version < 0.5)
1229 flagsStr = flagsStr.Replace(",", "");
1230 }
1231
1232 writer.WriteElementString(name, flagsStr);
1233 } 1213 }
1234 1214
1235 static void WriteTaskInventory(XmlTextWriter writer, TaskInventoryDictionary tinv, Dictionary<string, object> options, Scene scene) 1215 static void WriteTaskInventory(XmlTextWriter writer, TaskInventoryDictionary tinv, Dictionary<string, object> options, Scene scene)
@@ -1459,66 +1439,6 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
1459 return obj; 1439 return obj;
1460 } 1440 }
1461 1441
1462 static UUID ReadUUID(XmlTextReader reader, string name)
1463 {
1464 UUID id;
1465 string idStr;
1466
1467 reader.ReadStartElement(name);
1468
1469 if (reader.Name == "Guid")
1470 idStr = reader.ReadElementString("Guid");
1471 else // UUID
1472 idStr = reader.ReadElementString("UUID");
1473
1474 UUID.TryParse(idStr, out id);
1475 reader.ReadEndElement();
1476
1477 return id;
1478 }
1479
1480 static Vector3 ReadVector(XmlTextReader reader, string name)
1481 {
1482 Vector3 vec;
1483
1484 reader.ReadStartElement(name);
1485 vec.X = reader.ReadElementContentAsFloat(reader.Name, String.Empty); // X or x
1486 vec.Y = reader.ReadElementContentAsFloat(reader.Name, String.Empty); // Y or y
1487 vec.Z = reader.ReadElementContentAsFloat(reader.Name, String.Empty); // Z or z
1488 reader.ReadEndElement();
1489
1490 return vec;
1491 }
1492
1493 static Quaternion ReadQuaternion(XmlTextReader reader, string name)
1494 {
1495 Quaternion quat = new Quaternion();
1496
1497 reader.ReadStartElement(name);
1498 while (reader.NodeType != XmlNodeType.EndElement)
1499 {
1500 switch (reader.Name.ToLower())
1501 {
1502 case "x":
1503 quat.X = reader.ReadElementContentAsFloat(reader.Name, String.Empty);
1504 break;
1505 case "y":
1506 quat.Y = reader.ReadElementContentAsFloat(reader.Name, String.Empty);
1507 break;
1508 case "z":
1509 quat.Z = reader.ReadElementContentAsFloat(reader.Name, String.Empty);
1510 break;
1511 case "w":
1512 quat.W = reader.ReadElementContentAsFloat(reader.Name, String.Empty);
1513 break;
1514 }
1515 }
1516
1517 reader.ReadEndElement();
1518
1519 return quat;
1520 }
1521
1522 static TaskInventoryDictionary ReadTaskInventory(XmlTextReader reader, string name) 1442 static TaskInventoryDictionary ReadTaskInventory(XmlTextReader reader, string name)
1523 { 1443 {
1524 TaskInventoryDictionary tinv = new TaskInventoryDictionary(); 1444 TaskInventoryDictionary tinv = new TaskInventoryDictionary();
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs
index f57cf98..b84298f 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs
@@ -121,13 +121,14 @@ namespace OpenSim.Region.Framework.Scenes.Tests
121 "Not exactly sure what this is asserting..."); 121 "Not exactly sure what this is asserting...");
122 122
123 // Delink part 2 123 // Delink part 2
124 grp1.DelinkFromGroup(part2.LocalId); 124 SceneObjectGroup grp3 = grp1.DelinkFromGroup(part2.LocalId);
125 125
126 if (debugtest) 126 if (debugtest)
127 m_log.Debug("Group2: Prim2: OffsetPosition:" + part2.AbsolutePosition + ", OffsetRotation:" + part2.RotationOffset); 127 m_log.Debug("Group2: Prim2: OffsetPosition:" + part2.AbsolutePosition + ", OffsetRotation:" + part2.RotationOffset);
128 128
129 Assert.That(grp1.Parts.Length, Is.EqualTo(1), "Group 1 still contained part2 after delink."); 129 Assert.That(grp1.Parts.Length, Is.EqualTo(1), "Group 1 still contained part2 after delink.");
130 Assert.That(part2.AbsolutePosition == Vector3.Zero, "The absolute position should be zero"); 130 Assert.That(part2.AbsolutePosition == Vector3.Zero, "The absolute position should be zero");
131 Assert.That(grp3.HasGroupChangedDueToDelink, Is.True);
131 } 132 }
132 133
133 [Test] 134 [Test]
@@ -325,7 +326,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
325 326
326 SceneObjectGroup sog = new SceneObjectGroup(rootPart); 327 SceneObjectGroup sog = new SceneObjectGroup(rootPart);
327 sog.AddPart(linkPart); 328 sog.AddPart(linkPart);
328 scene.AddNewSceneObject(sog, true); 329 scene.AddNewSceneObject(sog, true);
329 330
330 // In a test, we have to crank the backup handle manually. Normally this would be done by the timer invoked 331 // In a test, we have to crank the backup handle manually. Normally this would be done by the timer invoked
331 // scene backup thread. 332 // scene backup thread.
@@ -333,7 +334,10 @@ namespace OpenSim.Region.Framework.Scenes.Tests
333 334
334 // These changes should occur immediately without waiting for a backup pass 335 // These changes should occur immediately without waiting for a backup pass
335 SceneObjectGroup groupToDelete = sog.DelinkFromGroup(linkPart, false); 336 SceneObjectGroup groupToDelete = sog.DelinkFromGroup(linkPart, false);
337
338 Assert.That(groupToDelete.HasGroupChangedDueToDelink, Is.True);
336 scene.DeleteSceneObject(groupToDelete, false); 339 scene.DeleteSceneObject(groupToDelete, false);
340 Assert.That(groupToDelete.HasGroupChangedDueToDelink, Is.False);
337 341
338 List<SceneObjectGroup> storedObjects = scene.SimulationDataService.LoadObjects(scene.RegionInfo.RegionID); 342 List<SceneObjectGroup> storedObjects = scene.SimulationDataService.LoadObjects(scene.RegionInfo.RegionID);
339 343
diff --git a/OpenSim/Server/Handlers/Asset/AssetServerConnector.cs b/OpenSim/Server/Handlers/Asset/AssetServerConnector.cs
index b6425f4..df571fa 100644
--- a/OpenSim/Server/Handlers/Asset/AssetServerConnector.cs
+++ b/OpenSim/Server/Handlers/Asset/AssetServerConnector.cs
@@ -53,12 +53,15 @@ namespace OpenSim.Server.Handlers.Asset
53 String.Empty); 53 String.Empty);
54 54
55 if (assetService == String.Empty) 55 if (assetService == String.Empty)
56 throw new Exception("No AssetService in config file"); 56 throw new Exception("No LocalServiceModule in config file");
57 57
58 Object[] args = new Object[] { config }; 58 Object[] args = new Object[] { config };
59 m_AssetService = 59 m_AssetService =
60 ServerUtils.LoadPlugin<IAssetService>(assetService, args); 60 ServerUtils.LoadPlugin<IAssetService>(assetService, args);
61 61
62 if (m_AssetService == null)
63 throw new Exception(String.Format("Failed to load AssetService from {0}; config is {1}", assetService, m_ConfigName));
64
62 bool allowDelete = serverConfig.GetBoolean("AllowRemoteDelete", false); 65 bool allowDelete = serverConfig.GetBoolean("AllowRemoteDelete", false);
63 66
64 server.AddStreamHandler(new AssetServerGetHandler(m_AssetService)); 67 server.AddStreamHandler(new AssetServerGetHandler(m_AssetService));
diff --git a/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs b/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs
index ce72c78..edb44ea 100644
--- a/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs
+++ b/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs
@@ -153,7 +153,7 @@ namespace OpenSim.Server.Handlers.Asset
153 } 153 }
154 catch (Exception e) 154 catch (Exception e)
155 { 155 {
156 m_log.Debug("[XINVENTORY HANDLER]: Exception {0}", e); 156 m_log.DebugFormat("[XINVENTORY HANDLER]: Exception {0}", e);
157 } 157 }
158 158
159 return FailureResult(); 159 return FailureResult();
@@ -605,6 +605,10 @@ namespace OpenSim.Server.Handlers.Asset
605 ret["CreatorId"] = item.CreatorId.ToString(); 605 ret["CreatorId"] = item.CreatorId.ToString();
606 else 606 else
607 ret["CreatorId"] = String.Empty; 607 ret["CreatorId"] = String.Empty;
608 if (item.CreatorData != null)
609 ret["CreatorData"] = item.CreatorData;
610 else
611 ret["CreatorData"] = String.Empty;
608 ret["CurrentPermissions"] = item.CurrentPermissions.ToString(); 612 ret["CurrentPermissions"] = item.CurrentPermissions.ToString();
609 ret["Description"] = item.Description.ToString(); 613 ret["Description"] = item.Description.ToString();
610 ret["EveryOnePermissions"] = item.EveryOnePermissions.ToString(); 614 ret["EveryOnePermissions"] = item.EveryOnePermissions.ToString();
diff --git a/OpenSim/Services/AssetService/AssetService.cs b/OpenSim/Services/AssetService/AssetService.cs
index 3122382..81ef225 100644
--- a/OpenSim/Services/AssetService/AssetService.cs
+++ b/OpenSim/Services/AssetService/AssetService.cs
@@ -43,44 +43,51 @@ namespace OpenSim.Services.AssetService
43 LogManager.GetLogger( 43 LogManager.GetLogger(
44 MethodBase.GetCurrentMethod().DeclaringType); 44 MethodBase.GetCurrentMethod().DeclaringType);
45 45
46 protected static AssetService m_RootInstance;
47
46 public AssetService(IConfigSource config) : base(config) 48 public AssetService(IConfigSource config) : base(config)
47 { 49 {
48 MainConsole.Instance.Commands.AddCommand("kfs", false, 50 if (m_RootInstance == null)
49 "show digest",
50 "show digest <ID>",
51 "Show asset digest", HandleShowDigest);
52
53 MainConsole.Instance.Commands.AddCommand("kfs", false,
54 "delete asset",
55 "delete asset <ID>",
56 "Delete asset from database", HandleDeleteAsset);
57
58 if (m_AssetLoader != null)
59 { 51 {
60 IConfig assetConfig = config.Configs["AssetService"]; 52 m_RootInstance = this;
61 if (assetConfig == null)
62 throw new Exception("No AssetService configuration");
63 53
64 string loaderArgs = assetConfig.GetString("AssetLoaderArgs", 54 MainConsole.Instance.Commands.AddCommand("kfs", false,
65 String.Empty); 55 "show digest",
56 "show digest <ID>",
57 "Show asset digest", HandleShowDigest);
66 58
67 bool assetLoaderEnabled = assetConfig.GetBoolean("AssetLoaderEnabled", true); 59 MainConsole.Instance.Commands.AddCommand("kfs", false,
60 "delete asset",
61 "delete asset <ID>",
62 "Delete asset from database", HandleDeleteAsset);
68 63
69 if (assetLoaderEnabled) 64 if (m_AssetLoader != null)
70 { 65 {
71 m_log.InfoFormat("[ASSET]: Loading default asset set from {0}", loaderArgs); 66 IConfig assetConfig = config.Configs["AssetService"];
72 m_AssetLoader.ForEachDefaultXmlAsset(loaderArgs, 67 if (assetConfig == null)
73 delegate(AssetBase a) 68 throw new Exception("No AssetService configuration");
74 { 69
75 Store(a); 70 string loaderArgs = assetConfig.GetString("AssetLoaderArgs",
76 }); 71 String.Empty);
72
73 bool assetLoaderEnabled = assetConfig.GetBoolean("AssetLoaderEnabled", true);
74
75 if (assetLoaderEnabled)
76 {
77 m_log.InfoFormat("[ASSET]: Loading default asset set from {0}", loaderArgs);
78 m_AssetLoader.ForEachDefaultXmlAsset(loaderArgs,
79 delegate(AssetBase a)
80 {
81 Store(a);
82 });
83 }
84
85 m_log.Info("[ASSET SERVICE]: Local asset service enabled");
77 } 86 }
78
79 m_log.Info("[ASSET SERVICE]: Local asset service enabled");
80 } 87 }
81 } 88 }
82 89
83 public AssetBase Get(string id) 90 public virtual AssetBase Get(string id)
84 { 91 {
85 UUID assetID; 92 UUID assetID;
86 93
@@ -93,12 +100,12 @@ namespace OpenSim.Services.AssetService
93 return m_Database.GetAsset(assetID); 100 return m_Database.GetAsset(assetID);
94 } 101 }
95 102
96 public AssetBase GetCached(string id) 103 public virtual AssetBase GetCached(string id)
97 { 104 {
98 return Get(id); 105 return Get(id);
99 } 106 }
100 107
101 public AssetMetadata GetMetadata(string id) 108 public virtual AssetMetadata GetMetadata(string id)
102 { 109 {
103 UUID assetID; 110 UUID assetID;
104 111
@@ -112,7 +119,7 @@ namespace OpenSim.Services.AssetService
112 return null; 119 return null;
113 } 120 }
114 121
115 public byte[] GetData(string id) 122 public virtual byte[] GetData(string id)
116 { 123 {
117 UUID assetID; 124 UUID assetID;
118 125
@@ -123,7 +130,7 @@ namespace OpenSim.Services.AssetService
123 return asset.Data; 130 return asset.Data;
124 } 131 }
125 132
126 public bool Get(string id, Object sender, AssetRetrieved handler) 133 public virtual bool Get(string id, Object sender, AssetRetrieved handler)
127 { 134 {
128 //m_log.DebugFormat("[AssetService]: Get asset async {0}", id); 135 //m_log.DebugFormat("[AssetService]: Get asset async {0}", id);
129 136
@@ -141,7 +148,7 @@ namespace OpenSim.Services.AssetService
141 return true; 148 return true;
142 } 149 }
143 150
144 public string Store(AssetBase asset) 151 public virtual string Store(AssetBase asset)
145 { 152 {
146 //m_log.DebugFormat("[ASSET SERVICE]: Store asset {0} {1}", asset.Name, asset.ID); 153 //m_log.DebugFormat("[ASSET SERVICE]: Store asset {0} {1}", asset.Name, asset.ID);
147 if (!m_Database.StoreAsset(asset)) 154 if (!m_Database.StoreAsset(asset))
@@ -157,7 +164,7 @@ namespace OpenSim.Services.AssetService
157 return false; 164 return false;
158 } 165 }
159 166
160 public bool Delete(string id) 167 public virtual bool Delete(string id)
161 { 168 {
162 m_log.DebugFormat("[ASSET SERVICE]: Deleting asset {0}", id); 169 m_log.DebugFormat("[ASSET SERVICE]: Deleting asset {0}", id);
163 UUID assetID; 170 UUID assetID;
diff --git a/OpenSim/Services/HypergridService/HGAssetService.cs b/OpenSim/Services/HypergridService/HGAssetService.cs
new file mode 100644
index 0000000..a82d0d1
--- /dev/null
+++ b/OpenSim/Services/HypergridService/HGAssetService.cs
@@ -0,0 +1,145 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27using System;
28using System.Collections.Generic;
29using System.IO;
30using System.Reflection;
31using System.Xml;
32
33using Nini.Config;
34using log4net;
35using OpenMetaverse;
36
37using OpenSim.Framework;
38using OpenSim.Framework.Serialization.External;
39using OpenSim.Server.Base;
40using OpenSim.Services.Interfaces;
41using OpenSim.Services.AssetService;
42
43namespace OpenSim.Services.HypergridService
44{
45 /// <summary>
46 /// Hypergrid asset service. It serves the IAssetService interface,
47 /// but implements it in ways that are appropriate for inter-grid
48 /// asset exchanges.
49 /// </summary>
50 public class HGAssetService : OpenSim.Services.AssetService.AssetService, IAssetService
51 {
52 private static readonly ILog m_log =
53 LogManager.GetLogger(
54 MethodBase.GetCurrentMethod().DeclaringType);
55
56 private string m_ProfileServiceURL;
57 private IUserAccountService m_UserAccountService;
58
59 private UserAccountCache m_Cache;
60
61 public HGAssetService(IConfigSource config) : base(config)
62 {
63 m_log.Debug("[HGAsset Service]: Starting");
64 IConfig assetConfig = config.Configs["HGAssetService"];
65 if (assetConfig == null)
66 throw new Exception("No HGAssetService configuration");
67
68 string userAccountsDll = assetConfig.GetString("UserAccountsService", string.Empty);
69 if (userAccountsDll == string.Empty)
70 throw new Exception("Please specify UserAccountsService in HGAssetService configuration");
71
72 Object[] args = new Object[] { config };
73 m_UserAccountService = ServerUtils.LoadPlugin<IUserAccountService>(userAccountsDll, args);
74 if (m_UserAccountService == null)
75 throw new Exception(String.Format("Unable to create UserAccountService from {0}", userAccountsDll));
76
77 m_ProfileServiceURL = assetConfig.GetString("ProfileServerURI", string.Empty);
78
79 m_Cache = UserAccountCache.CreateUserAccountCache(m_UserAccountService);
80 }
81
82 #region IAssetService overrides
83 public override AssetBase Get(string id)
84 {
85 AssetBase asset = base.Get(id);
86
87 if (asset == null)
88 return null;
89
90 if (asset.Metadata.Type == (sbyte)AssetType.Object)
91 asset.Data = AdjustIdentifiers(asset.Data); ;
92
93 AdjustIdentifiers(asset.Metadata);
94
95 return asset;
96 }
97
98 public override AssetMetadata GetMetadata(string id)
99 {
100 AssetMetadata meta = base.GetMetadata(id);
101
102 if (meta == null)
103 return null;
104
105 AdjustIdentifiers(meta);
106
107 return meta;
108 }
109
110 public override byte[] GetData(string id)
111 {
112 byte[] data = base.GetData(id);
113
114 if (data == null)
115 return null;
116
117 return AdjustIdentifiers(data);
118 }
119
120 //public virtual bool Get(string id, Object sender, AssetRetrieved handler)
121
122 public override bool Delete(string id)
123 {
124 // NOGO
125 return false;
126 }
127
128 #endregion
129
130 protected void AdjustIdentifiers(AssetMetadata meta)
131 {
132 UserAccount creator = m_Cache.GetUser(meta.CreatorID);
133 if (creator != null)
134 meta.CreatorID = m_ProfileServiceURL + "/" + meta.CreatorID + ";" + creator.FirstName + " " + creator.LastName;
135 }
136
137 protected byte[] AdjustIdentifiers(byte[] data)
138 {
139 string xml = Utils.BytesToString(data);
140 return Utils.StringToBytes(ExternalRepresentationUtils.RewriteSOP(xml, m_ProfileServiceURL, m_Cache, UUID.Zero));
141 }
142
143 }
144
145}
diff --git a/OpenSim/Services/InventoryService/HGInventoryService.cs b/OpenSim/Services/HypergridService/HGInventoryService.cs
index d62c008..9ee1ae4 100644
--- a/OpenSim/Services/InventoryService/HGInventoryService.cs
+++ b/OpenSim/Services/HypergridService/HGInventoryService.cs
@@ -33,11 +33,20 @@ using Nini.Config;
33using System.Reflection; 33using System.Reflection;
34using OpenSim.Services.Base; 34using OpenSim.Services.Base;
35using OpenSim.Services.Interfaces; 35using OpenSim.Services.Interfaces;
36using OpenSim.Services.InventoryService;
36using OpenSim.Data; 37using OpenSim.Data;
37using OpenSim.Framework; 38using OpenSim.Framework;
39using OpenSim.Server.Base;
38 40
39namespace OpenSim.Services.InventoryService 41namespace OpenSim.Services.HypergridService
40{ 42{
43 /// <summary>
44 /// Hypergrid inventory service. It serves the IInventoryService interface,
45 /// but implements it in ways that are appropriate for inter-grid
46 /// inventory exchanges. Specifically, it does not performs deletions
47 /// and it responds to GetRootFolder requests with the ID of the
48 /// Suitcase folder, not the actual "My Inventory" folder.
49 /// </summary>
41 public class HGInventoryService : XInventoryService, IInventoryService 50 public class HGInventoryService : XInventoryService, IInventoryService
42 { 51 {
43 private static readonly ILog m_log = 52 private static readonly ILog m_log =
@@ -46,9 +55,16 @@ namespace OpenSim.Services.InventoryService
46 55
47 protected new IXInventoryData m_Database; 56 protected new IXInventoryData m_Database;
48 57
58 private string m_ProfileServiceURL;
59 private IUserAccountService m_UserAccountService;
60
61 private UserAccountCache m_Cache;
62
49 public HGInventoryService(IConfigSource config) 63 public HGInventoryService(IConfigSource config)
50 : base(config) 64 : base(config)
51 { 65 {
66 m_log.Debug("[HGInventory Service]: Starting");
67
52 string dllName = String.Empty; 68 string dllName = String.Empty;
53 string connString = String.Empty; 69 string connString = String.Empty;
54 //string realm = "Inventory"; // OSG version doesn't use this 70 //string realm = "Inventory"; // OSG version doesn't use this
@@ -68,12 +84,25 @@ namespace OpenSim.Services.InventoryService
68 // 84 //
69 // Try reading the [InventoryService] section, if it exists 85 // Try reading the [InventoryService] section, if it exists
70 // 86 //
71 IConfig authConfig = config.Configs["InventoryService"]; 87 IConfig invConfig = config.Configs["HGInventoryService"];
72 if (authConfig != null) 88 if (invConfig != null)
73 { 89 {
74 dllName = authConfig.GetString("StorageProvider", dllName); 90 dllName = invConfig.GetString("StorageProvider", dllName);
75 connString = authConfig.GetString("ConnectionString", connString); 91 connString = invConfig.GetString("ConnectionString", connString);
92
76 // realm = authConfig.GetString("Realm", realm); 93 // realm = authConfig.GetString("Realm", realm);
94 string userAccountsDll = invConfig.GetString("UserAccountsService", string.Empty);
95 if (userAccountsDll == string.Empty)
96 throw new Exception("Please specify UserAccountsService in HGInventoryService configuration");
97
98 Object[] args = new Object[] { config };
99 m_UserAccountService = ServerUtils.LoadPlugin<IUserAccountService>(userAccountsDll, args);
100 if (m_UserAccountService == null)
101 throw new Exception(String.Format("Unable to create UserAccountService from {0}", userAccountsDll));
102
103 m_ProfileServiceURL = invConfig.GetString("ProfileServerURI", string.Empty);
104
105 m_Cache = UserAccountCache.CreateUserAccountCache(m_UserAccountService);
77 } 106 }
78 107
79 // 108 //
@@ -282,9 +311,18 @@ namespace OpenSim.Services.InventoryService
282 //{ 311 //{
283 //} 312 //}
284 313
285 //public InventoryItemBase GetItem(InventoryItemBase item) 314 public override InventoryItemBase GetItem(InventoryItemBase item)
286 //{ 315 {
287 //} 316 InventoryItemBase it = base.GetItem(item);
317
318 UserAccount user = m_Cache.GetUser(it.CreatorId);
319
320 // Adjust the creator data
321 if (user != null && it != null && (it.CreatorData == null || it.CreatorData == string.Empty))
322 it.CreatorData = m_ProfileServiceURL + "/" + it.CreatorId + ";" + user.FirstName + " " + user.LastName;
323
324 return it;
325 }
288 326
289 //public InventoryFolderBase GetFolder(InventoryFolderBase folder) 327 //public InventoryFolderBase GetFolder(InventoryFolderBase folder)
290 //{ 328 //{
diff --git a/OpenSim/Services/HypergridService/UserAccountCache.cs b/OpenSim/Services/HypergridService/UserAccountCache.cs
new file mode 100644
index 0000000..3e9aea1
--- /dev/null
+++ b/OpenSim/Services/HypergridService/UserAccountCache.cs
@@ -0,0 +1,105 @@
1using System;
2using System.Collections.Generic;
3using System.Reflection;
4
5using log4net;
6using OpenMetaverse;
7
8using OpenSim.Services.Interfaces;
9
10namespace OpenSim.Services.HypergridService
11{
12 public class UserAccountCache : IUserAccountService
13 {
14 private const double CACHE_EXPIRATION_SECONDS = 120000.0; // 33 hours!
15
16 private static readonly ILog m_log =
17 LogManager.GetLogger(
18 MethodBase.GetCurrentMethod().DeclaringType);
19 private ExpiringCache<UUID, UserAccount> m_UUIDCache;
20
21 private IUserAccountService m_UserAccountService;
22
23 private static UserAccountCache m_Singleton;
24
25 public static UserAccountCache CreateUserAccountCache(IUserAccountService u)
26 {
27 if (m_Singleton == null)
28 m_Singleton = new UserAccountCache(u);
29
30 return m_Singleton;
31 }
32
33 private UserAccountCache(IUserAccountService u)
34 {
35 m_UUIDCache = new ExpiringCache<UUID, UserAccount>();
36 m_UserAccountService = u;
37 }
38
39 public void Cache(UUID userID, UserAccount account)
40 {
41 // Cache even null accounts
42 m_UUIDCache.AddOrUpdate(userID, account, CACHE_EXPIRATION_SECONDS);
43
44 //m_log.DebugFormat("[USER CACHE]: cached user {0}", userID);
45 }
46
47 public UserAccount Get(UUID userID, out bool inCache)
48 {
49 UserAccount account = null;
50 inCache = false;
51 if (m_UUIDCache.TryGetValue(userID, out account))
52 {
53 //m_log.DebugFormat("[USER CACHE]: Account {0} {1} found in cache", account.FirstName, account.LastName);
54 inCache = true;
55 return account;
56 }
57
58 return null;
59 }
60
61 public UserAccount GetUser(string id)
62 {
63 UUID uuid = UUID.Zero;
64 UUID.TryParse(id, out uuid);
65 bool inCache = false;
66 UserAccount account = Get(uuid, out inCache);
67 if (!inCache)
68 {
69 account = m_UserAccountService.GetUserAccount(UUID.Zero, uuid);
70 Cache(uuid, account);
71 }
72
73 return account;
74 }
75
76 #region IUserAccountService
77 public UserAccount GetUserAccount(UUID scopeID, UUID userID)
78 {
79 return GetUser(userID.ToString());
80 }
81
82 public UserAccount GetUserAccount(UUID scopeID, string FirstName, string LastName)
83 {
84 return null;
85 }
86
87 public UserAccount GetUserAccount(UUID scopeID, string Email)
88 {
89 return null;
90 }
91
92 public List<UserAccount> GetUserAccounts(UUID scopeID, string query)
93 {
94 return null;
95 }
96
97 public bool StoreUserAccount(UserAccount data)
98 {
99 return false;
100 }
101 #endregion
102
103 }
104
105}
diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs
index b26cd6e..335c7e7 100644
--- a/OpenSim/Services/LLLoginService/LLLoginService.cs
+++ b/OpenSim/Services/LLLoginService/LLLoginService.cs
@@ -769,6 +769,7 @@ namespace OpenSim.Services.LLLoginService
769 if (account.ServiceURLs == null) 769 if (account.ServiceURLs == null)
770 return; 770 return;
771 771
772 // Old style: get the service keys from the DB
772 foreach (KeyValuePair<string, object> kvp in account.ServiceURLs) 773 foreach (KeyValuePair<string, object> kvp in account.ServiceURLs)
773 { 774 {
774 if (kvp.Value == null || (kvp.Value != null && kvp.Value.ToString() == string.Empty)) 775 if (kvp.Value == null || (kvp.Value != null && kvp.Value.ToString() == string.Empty))
@@ -780,6 +781,21 @@ namespace OpenSim.Services.LLLoginService
780 aCircuit.ServiceURLs[kvp.Key] = kvp.Value; 781 aCircuit.ServiceURLs[kvp.Key] = kvp.Value;
781 } 782 }
782 } 783 }
784
785 // New style: service keys start with SRV_; override the previous
786 string[] keys = m_LoginServerConfig.GetKeys();
787
788 if (keys.Length > 0)
789 {
790 IEnumerable<string> serviceKeys = keys.Where(value => value.StartsWith("SRV_"));
791 foreach (string serviceKey in serviceKeys)
792 {
793 string keyName = serviceKey.Replace("SRV_", "");
794 aCircuit.ServiceURLs[keyName] = m_LoginServerConfig.GetString(serviceKey, string.Empty);
795 m_log.DebugFormat("[LLLOGIN SERVICE]: found new key {0} {1}", keyName, aCircuit.ServiceURLs[keyName]);
796 }
797 }
798
783 } 799 }
784 800
785 private bool LaunchAgentDirectly(ISimulationService simConnector, GridRegion region, AgentCircuitData aCircuit, out string reason) 801 private bool LaunchAgentDirectly(ISimulationService simConnector, GridRegion region, AgentCircuitData aCircuit, out string reason)
diff --git a/bin/OpenSim.Grid.GridServer.addin.xml b/bin/OpenSim.Grid.GridServer.addin.xml
deleted file mode 100644
index 85742a1..0000000
--- a/bin/OpenSim.Grid.GridServer.addin.xml
+++ /dev/null
@@ -1,9 +0,0 @@
1<Addin id="OpenSim.Grid.GridServer" isroot="true" version="0.5">
2 <Runtime>
3 <Import assembly="OpenSim.Grid.GridServer.exe"/>
4 <Import assembly="OpenSim.Framework.dll"/>
5 </Runtime>
6 <ExtensionPoint path = "/OpenSim/GridServer">
7 <ExtensionNode name="Plugin" type="OpenSim.Framework.PluginExtensionNode" objectType="OpenSim.Grid.GridServer.IGridPlugin"/>
8 </ExtensionPoint>
9</Addin>
diff --git a/bin/OpenSim.Grid.GridServer.exe.config b/bin/OpenSim.Grid.GridServer.exe.config
deleted file mode 100644
index efc486f..0000000
--- a/bin/OpenSim.Grid.GridServer.exe.config
+++ /dev/null
@@ -1,28 +0,0 @@
1<?xml version="1.0" encoding="utf-8" ?>
2<configuration>
3 <configSections>
4 <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />
5 </configSections>
6 <appSettings>
7 </appSettings>
8 <log4net>
9 <appender name="Console" type="OpenSim.Framework.Console.OpenSimAppender, OpenSim.Framework.Console">
10 <layout type="log4net.Layout.PatternLayout">
11 <conversionPattern value="%date{HH:mm:ss} - %message%newline" />
12 </layout>
13 </appender>
14 <appender name="LogFileAppender" type="log4net.Appender.FileAppender">
15 <file value="OpenSim.Grid.GridServer.log" />
16 <appendToFile value="true" />
17 <layout type="log4net.Layout.PatternLayout">
18 <conversionPattern value="%date %-5level - %logger %message%newline" />
19 </layout>
20 </appender>
21
22 <root>
23 <level value="DEBUG" />
24 <appender-ref ref="Console" />
25 <appender-ref ref="LogFileAppender" />
26 </root>
27 </log4net>
28</configuration>
diff --git a/bin/OpenSim.Grid.MessagingServer.exe.config b/bin/OpenSim.Grid.MessagingServer.exe.config
deleted file mode 100644
index 481ce4b..0000000
--- a/bin/OpenSim.Grid.MessagingServer.exe.config
+++ /dev/null
@@ -1,28 +0,0 @@
1<?xml version="1.0" encoding="utf-8" ?>
2<configuration>
3 <configSections>
4 <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />
5 </configSections>
6 <appSettings>
7 </appSettings>
8 <log4net>
9 <appender name="Console" type="OpenSim.Framework.Console.OpenSimAppender, OpenSim.Framework.Console">
10 <layout type="log4net.Layout.PatternLayout">
11 <conversionPattern value="%date{HH:mm:ss} - %message%newline" />
12 </layout>
13 </appender>
14 <appender name="LogFileAppender" type="log4net.Appender.FileAppender">
15 <file value="OpenSim.Grid.MessagingServer.log" />
16 <appendToFile value="true" />
17 <layout type="log4net.Layout.PatternLayout">
18 <conversionPattern value="%date %-5level - %logger %message%newline" />
19 </layout>
20 </appender>
21
22 <root>
23 <level value="DEBUG" />
24 <appender-ref ref="Console" />
25 <appender-ref ref="LogFileAppender" />
26 </root>
27 </log4net>
28</configuration>
diff --git a/bin/OpenSim.Grid.ScriptServer.exe.config b/bin/OpenSim.Grid.ScriptServer.exe.config
deleted file mode 100644
index 5cae2b0..0000000
--- a/bin/OpenSim.Grid.ScriptServer.exe.config
+++ /dev/null
@@ -1,28 +0,0 @@
1<?xml version="1.0" encoding="utf-8" ?>
2<configuration>
3 <configSections>
4 <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />
5 </configSections>
6 <appSettings>
7 </appSettings>
8 <log4net>
9 <appender name="Console" type="OpenSim.Framework.Console.OpenSimAppender, OpenSim.Framework.Console">
10 <layout type="log4net.Layout.PatternLayout">
11 <conversionPattern value="%date{HH:mm:ss} - %message%newline" />
12 </layout>
13 </appender>
14 <appender name="LogFileAppender" type="log4net.Appender.FileAppender">
15 <file value="OpenSim.Grid.ScriptServer.log" />
16 <appendToFile value="true" />
17 <layout type="log4net.Layout.PatternLayout">
18 <conversionPattern value="%date %-5level - %logger %message%newline" />
19 </layout>
20 </appender>
21
22 <root>
23 <level value="DEBUG" />
24 <appender-ref ref="Console" />
25 <appender-ref ref="LogFileAppender" />
26 </root>
27 </log4net>
28</configuration>
diff --git a/bin/OpenSim.Grid.UserServer.exe.config b/bin/OpenSim.Grid.UserServer.exe.config
deleted file mode 100644
index 315e69d..0000000
--- a/bin/OpenSim.Grid.UserServer.exe.config
+++ /dev/null
@@ -1,28 +0,0 @@
1<?xml version="1.0" encoding="utf-8" ?>
2<configuration>
3 <configSections>
4 <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />
5 </configSections>
6 <appSettings>
7 </appSettings>
8 <log4net>
9 <appender name="Console" type="OpenSim.Framework.Console.OpenSimAppender, OpenSim.Framework.Console">
10 <layout type="log4net.Layout.PatternLayout">
11 <conversionPattern value="%date{HH:mm:ss} - %message%newline" />
12 </layout>
13 </appender>
14 <appender name="LogFileAppender" type="log4net.Appender.FileAppender">
15 <file value="OpenSim.Grid.UserServer.log" />
16 <appendToFile value="true" />
17 <layout type="log4net.Layout.PatternLayout">
18 <conversionPattern value="%date %-5level - %logger %message%newline" />
19 </layout>
20 </appender>
21
22 <root>
23 <level value="DEBUG" />
24 <appender-ref ref="Console" />
25 <appender-ref ref="LogFileAppender" />
26 </root>
27 </log4net>
28</configuration>
diff --git a/bin/OpenSim.exe.config b/bin/OpenSim.exe.config
index 3c7adf5..eece040 100755
--- a/bin/OpenSim.exe.config
+++ b/bin/OpenSim.exe.config
@@ -13,6 +13,8 @@
13 <appender name="Console" type="OpenSim.Framework.Console.OpenSimAppender, OpenSim.Framework.Console"> 13 <appender name="Console" type="OpenSim.Framework.Console.OpenSimAppender, OpenSim.Framework.Console">
14 <layout type="log4net.Layout.PatternLayout"> 14 <layout type="log4net.Layout.PatternLayout">
15 <conversionPattern value="%date{HH:mm:ss} - %message" /> 15 <conversionPattern value="%date{HH:mm:ss} - %message" />
16 <!-- console log with milliseconds. Useful for debugging -->
17 <!-- <conversionPattern value="%date{HH:mm:ss.fff} - %message" /> -->
16 </layout> 18 </layout>
17 </appender> 19 </appender>
18 20
diff --git a/bin/Robust.HG.ini.example b/bin/Robust.HG.ini.example
index e1627c0..dbac73b 100644
--- a/bin/Robust.HG.ini.example
+++ b/bin/Robust.HG.ini.example
@@ -21,7 +21,7 @@
21; * [[<ConfigName>@]<port>/]<dll name>[:<class name>] 21; * [[<ConfigName>@]<port>/]<dll name>[:<class name>]
22; * 22; *
23[Startup] 23[Startup]
24ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003/OpenSim.Server.Handlers.dll:XInventoryInConnector,8002/OpenSim.Server.Handlers.dll:FreeswitchServerConnector,8003/OpenSim.Server.Handlers.dll:GridServiceConnector,8002/OpenSim.Server.Handlers.dll:GridInfoServerInConnector,8003/OpenSim.Server.Handlers.dll:AuthenticationServiceConnector,8002/OpenSim.Server.Handlers.dll:OpenIdServerConnector,8003/OpenSim.Server.Handlers.dll:AvatarServiceConnector,8002/OpenSim.Server.Handlers.dll:LLLoginServiceInConnector,8003/OpenSim.Server.Handlers.dll:PresenceServiceConnector,8003/OpenSim.Server.Handlers.dll:UserAccountServiceConnector,8003/OpenSim.Server.Handlers.dll:GridUserServiceConnector,8003/OpenSim.Server.Handlers.dll:FriendsServiceConnector,8002/OpenSim.Server.Handlers.dll:GatekeeperServiceInConnector,8002/OpenSim.Server.Handlers.dll:UserAgentServerConnector,HGInventoryService@8002/OpenSim.Server.Handlers.dll:XInventoryInConnector,8002/OpenSim.Server.Handlers.dll:AssetServiceConnector,8002/OpenSim.Server.Handlers.dll:HeloServiceInConnector" 24ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003/OpenSim.Server.Handlers.dll:XInventoryInConnector,8002/OpenSim.Server.Handlers.dll:FreeswitchServerConnector,8003/OpenSim.Server.Handlers.dll:GridServiceConnector,8002/OpenSim.Server.Handlers.dll:GridInfoServerInConnector,8003/OpenSim.Server.Handlers.dll:AuthenticationServiceConnector,8002/OpenSim.Server.Handlers.dll:OpenIdServerConnector,8003/OpenSim.Server.Handlers.dll:AvatarServiceConnector,8002/OpenSim.Server.Handlers.dll:LLLoginServiceInConnector,8003/OpenSim.Server.Handlers.dll:PresenceServiceConnector,8003/OpenSim.Server.Handlers.dll:UserAccountServiceConnector,8003/OpenSim.Server.Handlers.dll:GridUserServiceConnector,8003/OpenSim.Server.Handlers.dll:FriendsServiceConnector,8002/OpenSim.Server.Handlers.dll:GatekeeperServiceInConnector,8002/OpenSim.Server.Handlers.dll:UserAgentServerConnector,HGInventoryService@8002/OpenSim.Server.Handlers.dll:XInventoryInConnector,HGAssetService@8002/OpenSim.Server.Handlers.dll:AssetServiceConnector,8002/OpenSim.Server.Handlers.dll:HeloServiceInConnector"
25 25
26; * This is common for all services, it's the network setup for the entire 26; * This is common for all services, it's the network setup for the entire
27; * server instance, if none if specified above 27; * server instance, if none if specified above
@@ -154,10 +154,12 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003
154 154
155 ; Defaults for the users, if none is specified in the useraccounts table entry (ServiceURLs) 155 ; Defaults for the users, if none is specified in the useraccounts table entry (ServiceURLs)
156 ; CHANGE THIS 156 ; CHANGE THIS
157 HomeURI = "http://127.0.0.1:8002" 157 GatekeeperURI = "http://127.0.0.1:8002"
158 GatekeeperURI = "http://127.0.0.1:8002" 158
159 InventoryServerURI = "http://127.0.0.1:8002" 159 SRV_HomeURI = "http://127.0.0.1:8002"
160 AssetServerURI = "http://127.0.0.1:8002" 160 SRV_InventoryServerURI = "http://127.0.0.1:8002"
161 SRV_AssetServerURI = "http://127.0.0.1:8002"
162 SRV_ProfileServerURI = "http://127.0.0.1:8002"
161 163
162[GridInfoService] 164[GridInfoService]
163 ; These settings are used to return information on a get_grid_info call. 165 ; These settings are used to return information on a get_grid_info call.
@@ -169,7 +171,7 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003
169 ; See http://opensimulator.org/wiki/GridInfo 171 ; See http://opensimulator.org/wiki/GridInfo
170 172
171 ; login uri: for grid this is the login server URI 173 ; login uri: for grid this is the login server URI
172 login = http://127.0.0.1:9000/ 174 login = http://127.0.0.1:8002/
173 175
174 ; long grid name: the long name of your grid 176 ; long grid name: the long name of your grid
175 gridname = "the lost continent of hippo" 177 gridname = "the lost continent of hippo"
@@ -183,7 +185,7 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003
183 185
184 ; helper uri: optional: if it exists if will be used to tell the client to use 186 ; helper uri: optional: if it exists if will be used to tell the client to use
185 ; this for all economy related things 187 ; this for all economy related things
186 ;economy = http://127.0.0.1:9000/ 188 ;economy = http://127.0.0.1:8002/
187 189
188 ; web page of grid: optional: page providing further information about your grid 190 ; web page of grid: optional: page providing further information about your grid
189 ;about = http://127.0.0.1/about/ 191 ;about = http://127.0.0.1/about/
@@ -241,4 +243,15 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003
241; * 243; *
242[HGInventoryService] 244[HGInventoryService]
243 ; For the InventoryServiceInConnector 245 ; For the InventoryServiceInConnector
244 LocalServiceModule = "OpenSim.Services.InventoryService.dll:HGInventoryService" 246 LocalServiceModule = "OpenSim.Services.HypergridService.dll:HGInventoryService"
247 UserAccountsService = "OpenSim.Services.UserAccountService.dll:UserAccountService"
248 ProfileServerURI = "http://127.0.0.1:8002/user"
249
250; * The interface that local users get when they are in other grids.
251; * This restricts the access that the rest of the world has to
252; * the assets of this world.
253; *
254[HGAssetService]
255 LocalServiceModule = "OpenSim.Services.HypergridService.dll:HGAssetService"
256 UserAccountsService = "OpenSim.Services.UserAccountService.dll:UserAccountService"
257 ProfileServerURI = "http://127.0.0.1:8002/user"
diff --git a/bin/config-include/GridCommon.ini.example b/bin/config-include/GridCommon.ini.example
index cb771b8..762b09a 100644
--- a/bin/config-include/GridCommon.ini.example
+++ b/bin/config-include/GridCommon.ini.example
@@ -78,6 +78,14 @@
78 ; 78 ;
79 FriendsServerURI = "http://mygridserver.com:8003" 79 FriendsServerURI = "http://mygridserver.com:8003"
80 80
81[HGInventoryAccessModule]
82 ;
83 ; === HG ONLY ===
84 ; Change this to your profile server
85 ; accessible from other grids
86 ;
87 ProfileServerURI = "http://mygridserver.com:8002/profiles"
88
81[Modules] 89[Modules]
82 ;; Choose 0 or 1 cache modules, and the corresponding config file, if it exists. 90 ;; Choose 0 or 1 cache modules, and the corresponding config file, if it exists.
83 ;; Copy the config .example file into your own .ini file and change configs there 91 ;; Copy the config .example file into your own .ini file and change configs there
diff --git a/bin/config-include/StandaloneCommon.ini.example b/bin/config-include/StandaloneCommon.ini.example
index 1fcf043..58059f5 100644
--- a/bin/config-include/StandaloneCommon.ini.example
+++ b/bin/config-include/StandaloneCommon.ini.example
@@ -25,6 +25,15 @@
25 DefaultAssetLoader = "OpenSim.Framework.AssetLoader.Filesystem.dll" 25 DefaultAssetLoader = "OpenSim.Framework.AssetLoader.Filesystem.dll"
26 AssetLoaderArgs = "assets/AssetSets.xml" 26 AssetLoaderArgs = "assets/AssetSets.xml"
27 27
28[HGInventoryService]
29 ProfileServerURI = "http://127.0.0.1:9000/profiles"
30
31[HGAssetService]
32 ProfileServerURI = "http://127.0.0.1:9000/profiles"
33
34[HGInventoryAccessModule]
35 ProfileServerURI = "http://127.0.0.1:9000/profiles"
36
28[Modules] 37[Modules]
29 ;; Choose 0 or 1 cache modules, and the corresponding config file, if it exists. 38 ;; Choose 0 or 1 cache modules, and the corresponding config file, if it exists.
30 ;; Copy the config .example file into your own .ini file and change configs there 39 ;; Copy the config .example file into your own .ini file and change configs there
@@ -68,11 +77,12 @@
68 77
69[LoginService] 78[LoginService]
70 WelcomeMessage = "Welcome, Avatar!" 79 WelcomeMessage = "Welcome, Avatar!"
71
72 HomeURI = "http://127.0.0.1:9000"
73 GatekeeperURI = "http://127.0.0.1:9000" 80 GatekeeperURI = "http://127.0.0.1:9000"
74 InventoryServerURI = "http://127.0.0.1:9000" 81
75 AssetServerURI = "http://127.0.0.1:9000" 82 SRV_HomeURI = "http://127.0.0.1:9000"
83 SRV_InventoryServerURI = "http://127.0.0.1:9000"
84 SRV_AssetServerURI = "http://127.0.0.1:9000"
85 SRV_ProfileServerURI = "http://127.0.0.1:9000"
76 86
77[GatekeeperService] 87[GatekeeperService]
78 ExternalName = "http://127.0.0.1:9000" 88 ExternalName = "http://127.0.0.1:9000"
diff --git a/bin/config-include/StandaloneHypergrid.ini b/bin/config-include/StandaloneHypergrid.ini
index f164d33..68aa739 100644
--- a/bin/config-include/StandaloneHypergrid.ini
+++ b/bin/config-include/StandaloneHypergrid.ini
@@ -128,8 +128,14 @@
128;; This greatly restricts the inventory operations while in other grids 128;; This greatly restricts the inventory operations while in other grids
129[HGInventoryService] 129[HGInventoryService]
130 ; For the InventoryServiceInConnector 130 ; For the InventoryServiceInConnector
131 LocalServiceModule = "OpenSim.Services.InventoryService.dll:HGInventoryService" 131 LocalServiceModule = "OpenSim.Services.HypergridService.dll:HGInventoryService"
132 UserAccountsService = "OpenSim.Services.UserAccountService.dll:UserAccountService"
132 133
134;; The interface that local users get when they are in other grids
135;; This restricts/filters the asset operations from the outside
136[HGAssetService]
137 LocalServiceModule = "OpenSim.Services.HypergridService.dll:HGAssetService"
138 UserAccountsService = "OpenSim.Services.UserAccountService.dll:UserAccountService"
133 139
134;; This should always be the very last thing on this file 140;; This should always be the very last thing on this file
135[Includes] 141[Includes]
diff --git a/prebuild.xml b/prebuild.xml
index f08d0d3..a302d5f 100644
--- a/prebuild.xml
+++ b/prebuild.xml
@@ -175,6 +175,34 @@
175 </Files> 175 </Files>
176 </Project> 176 </Project>
177 177
178 <Project frameworkVersion="v3_5" name="OpenSim.Services.Interfaces" path="OpenSim/Services/Interfaces" type="Library">
179 <Configuration name="Debug">
180 <Options>
181 <OutputPath>../../../bin/</OutputPath>
182 </Options>
183 </Configuration>
184 <Configuration name="Release">
185 <Options>
186 <OutputPath>../../../bin/</OutputPath>
187 </Options>
188 </Configuration>
189
190 <ReferencePath>../../../bin/</ReferencePath>
191 <Reference name="System"/>
192 <Reference name="OpenMetaverseTypes" path="../../../bin/"/>
193 <Reference name="OpenMetaverse" path="../../../bin/"/>
194 <Reference name="OpenMetaverse.StructuredData" path="../../../bin/"/>
195 <Reference name="OpenSim.Framework"/>
196 <Reference name="OpenSim.Framework.Console"/>
197 <Reference name="OpenSim.Framework.Servers.HttpServer"/>
198 <Reference name="Nini" path="../../../bin/"/>
199 <Reference name="log4net" path="../../../bin/"/>
200
201 <Files>
202 <Match pattern="*.cs" recurse="true"/>
203 </Files>
204 </Project>
205
178 <Project frameworkVersion="v3_5" name="OpenSim.Framework.Serialization" path="OpenSim/Framework/Serialization" type="Library"> 206 <Project frameworkVersion="v3_5" name="OpenSim.Framework.Serialization" path="OpenSim/Framework/Serialization" type="Library">
179 <Configuration name="Debug"> 207 <Configuration name="Debug">
180 <Options> 208 <Options>
@@ -194,6 +222,7 @@
194 <Reference name="OpenMetaverse" path="../../../bin/"/> 222 <Reference name="OpenMetaverse" path="../../../bin/"/>
195 <Reference name="OpenMetaverseTypes" path="../../../bin/"/> 223 <Reference name="OpenMetaverseTypes" path="../../../bin/"/>
196 <Reference name="OpenSim.Framework"/> 224 <Reference name="OpenSim.Framework"/>
225 <Reference name="OpenSim.Services.Interfaces"/>
197 226
198 <Files> 227 <Files>
199 <Match pattern="*.cs" recurse="true"> 228 <Match pattern="*.cs" recurse="true">
@@ -661,35 +690,6 @@
661 </Files> 690 </Files>
662 </Project> 691 </Project>
663 692
664 <Project frameworkVersion="v3_5" name="OpenSim.Services.Interfaces" path="OpenSim/Services/Interfaces" type="Library">
665 <Configuration name="Debug">
666 <Options>
667 <OutputPath>../../../bin/</OutputPath>
668 </Options>
669 </Configuration>
670 <Configuration name="Release">
671 <Options>
672 <OutputPath>../../../bin/</OutputPath>
673 </Options>
674 </Configuration>
675
676 <ReferencePath>../../../bin/</ReferencePath>
677 <Reference name="System"/>
678 <Reference name="OpenMetaverseTypes" path="../../../bin/"/>
679 <Reference name="OpenMetaverse" path="../../../bin/"/>
680 <Reference name="OpenMetaverse.StructuredData" path="../../../bin/"/>
681 <Reference name="OpenSim.Framework"/>
682 <Reference name="OpenSim.Framework.Console"/>
683 <Reference name="OpenSim.Framework.Servers.HttpServer"/>
684 <Reference name="Nini" path="../../../bin/"/>
685 <Reference name="log4net" path="../../../bin/"/>
686
687 <Files>
688 <Match pattern="*.cs" recurse="true"/>
689 </Files>
690 </Project>
691
692
693 <Project frameworkVersion="v3_5" name="OpenSim.Framework.Capabilities" path="OpenSim/Framework/Capabilities" type="Library"> 693 <Project frameworkVersion="v3_5" name="OpenSim.Framework.Capabilities" path="OpenSim/Framework/Capabilities" type="Library">
694 <Configuration name="Debug"> 694 <Configuration name="Debug">
695 <Options> 695 <Options>
@@ -1284,10 +1284,13 @@
1284 <Reference name="OpenMetaverseTypes" path="../../../bin/"/> 1284 <Reference name="OpenMetaverseTypes" path="../../../bin/"/>
1285 <Reference name="OpenMetaverse" path="../../../bin/"/> 1285 <Reference name="OpenMetaverse" path="../../../bin/"/>
1286 <Reference name="OpenSim.Framework"/> 1286 <Reference name="OpenSim.Framework"/>
1287 <Reference name="OpenSim.Framework.Serialization"/>
1287 <Reference name="OpenSim.Framework.Console"/> 1288 <Reference name="OpenSim.Framework.Console"/>
1288 <Reference name="OpenSim.Framework.Servers.HttpServer"/> 1289 <Reference name="OpenSim.Framework.Servers.HttpServer"/>
1289 <Reference name="OpenSim.Services.Interfaces"/> 1290 <Reference name="OpenSim.Services.Interfaces"/>
1290 <Reference name="OpenSim.Services.Base"/> 1291 <Reference name="OpenSim.Services.Base"/>
1292 <Reference name="OpenSim.Services.AssetService"/>
1293 <Reference name="OpenSim.Services.InventoryService"/>
1291 <Reference name="OpenSim.Services.Connectors"/> 1294 <Reference name="OpenSim.Services.Connectors"/>
1292 <Reference name="OpenSim.Data"/> 1295 <Reference name="OpenSim.Data"/>
1293 <Reference name="OpenSim.Server.Base"/> 1296 <Reference name="OpenSim.Server.Base"/>