diff options
Diffstat (limited to 'OpenSim/Region/DataSnapshot')
-rw-r--r-- | OpenSim/Region/DataSnapshot/DataSnapshotManager.cs | 18 | ||||
-rw-r--r-- | OpenSim/Region/DataSnapshot/EstateSnapshot.cs | 15 | ||||
-rw-r--r-- | OpenSim/Region/DataSnapshot/LandSnapshot.cs | 7 | ||||
-rw-r--r-- | OpenSim/Region/DataSnapshot/ObjectSnapshot.cs | 62 |
4 files changed, 49 insertions, 53 deletions
diff --git a/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs b/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs index 4df9094..6949d7c 100644 --- a/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs +++ b/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs | |||
@@ -101,21 +101,9 @@ namespace OpenSim.Region.DataSnapshot | |||
101 | try | 101 | try |
102 | { | 102 | { |
103 | m_enabled = config.Configs["DataSnapshot"].GetBoolean("index_sims", m_enabled); | 103 | m_enabled = config.Configs["DataSnapshot"].GetBoolean("index_sims", m_enabled); |
104 | if (config.Configs["Startup"].GetBoolean("gridmode", false)) | 104 | IConfig conf = config.Configs["GridService"]; |
105 | { | 105 | if (conf != null) |
106 | m_gridinfo.Add( | 106 | m_gridinfo.Add("gridserverURL", conf.GetString("GridServerURI", "http://127.0.0.1:8003")); |
107 | "gridserverURL", | ||
108 | config.Configs["Network"].GetString( | ||
109 | "grid_server_url", "http://127.0.0.1:" + ConfigSettings.DefaultGridServerHttpPort.ToString())); | ||
110 | m_gridinfo.Add( | ||
111 | "userserverURL", | ||
112 | config.Configs["Network"].GetString( | ||
113 | "user_server_url", "http://127.0.0.1:" + ConfigSettings.DefaultUserServerHttpPort.ToString())); | ||
114 | m_gridinfo.Add( | ||
115 | "assetserverURL", | ||
116 | config.Configs["Network"].GetString( | ||
117 | "asset_server_url", "http://127.0.0.1:" + ConfigSettings.DefaultAssetServerHttpPort.ToString())); | ||
118 | } | ||
119 | 107 | ||
120 | m_gridinfo.Add( | 108 | m_gridinfo.Add( |
121 | "Name", config.Configs["DataSnapshot"].GetString("gridname", "the lost continent of hippo")); | 109 | "Name", config.Configs["DataSnapshot"].GetString("gridname", "the lost continent of hippo")); |
diff --git a/OpenSim/Region/DataSnapshot/EstateSnapshot.cs b/OpenSim/Region/DataSnapshot/EstateSnapshot.cs index 5fff89f..8da9e8c 100644 --- a/OpenSim/Region/DataSnapshot/EstateSnapshot.cs +++ b/OpenSim/Region/DataSnapshot/EstateSnapshot.cs | |||
@@ -29,9 +29,10 @@ using System; | |||
29 | using System.Xml; | 29 | using System.Xml; |
30 | using OpenMetaverse; | 30 | using OpenMetaverse; |
31 | using OpenSim.Framework; | 31 | using OpenSim.Framework; |
32 | using OpenSim.Framework.Communications.Cache; | 32 | |
33 | using OpenSim.Region.DataSnapshot.Interfaces; | 33 | using OpenSim.Region.DataSnapshot.Interfaces; |
34 | using OpenSim.Region.Framework.Scenes; | 34 | using OpenSim.Region.Framework.Scenes; |
35 | using OpenSim.Services.Interfaces; | ||
35 | 36 | ||
36 | namespace OpenSim.Region.DataSnapshot.Providers | 37 | namespace OpenSim.Region.DataSnapshot.Providers |
37 | { | 38 | { |
@@ -55,21 +56,17 @@ namespace OpenSim.Region.DataSnapshot.Providers | |||
55 | //Now in DataSnapshotProvider module form! | 56 | //Now in DataSnapshotProvider module form! |
56 | XmlNode estatedata = factory.CreateNode(XmlNodeType.Element, "estate", ""); | 57 | XmlNode estatedata = factory.CreateNode(XmlNodeType.Element, "estate", ""); |
57 | 58 | ||
58 | UUID ownerid = m_scene.RegionInfo.MasterAvatarAssignedUUID; | 59 | UUID ownerid = m_scene.RegionInfo.EstateSettings.EstateOwner; |
59 | if (m_scene.RegionInfo.EstateSettings.EstateOwner != UUID.Zero) | ||
60 | ownerid = m_scene.RegionInfo.EstateSettings.EstateOwner; | ||
61 | |||
62 | CachedUserInfo userInfo = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(ownerid); | ||
63 | 60 | ||
61 | UserAccount userInfo = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, ownerid); | ||
64 | //TODO: Change to query userserver about the master avatar UUID ? | 62 | //TODO: Change to query userserver about the master avatar UUID ? |
65 | String firstname; | 63 | String firstname; |
66 | String lastname; | 64 | String lastname; |
67 | 65 | ||
68 | if (userInfo != null) | 66 | if (userInfo != null) |
69 | { | 67 | { |
70 | UserProfileData userProfile = userInfo.UserProfile; | 68 | firstname = userInfo.FirstName; |
71 | firstname = userProfile.FirstName; | 69 | lastname = userInfo.LastName; |
72 | lastname = userProfile.SurName; | ||
73 | 70 | ||
74 | //TODO: Fix the marshalling system to have less copypasta gruntwork | 71 | //TODO: Fix the marshalling system to have less copypasta gruntwork |
75 | XmlNode user = factory.CreateNode(XmlNodeType.Element, "user", ""); | 72 | XmlNode user = factory.CreateNode(XmlNodeType.Element, "user", ""); |
diff --git a/OpenSim/Region/DataSnapshot/LandSnapshot.cs b/OpenSim/Region/DataSnapshot/LandSnapshot.cs index 51eacef..64d29f2 100644 --- a/OpenSim/Region/DataSnapshot/LandSnapshot.cs +++ b/OpenSim/Region/DataSnapshot/LandSnapshot.cs | |||
@@ -32,11 +32,12 @@ using System.Xml; | |||
32 | using log4net; | 32 | using log4net; |
33 | using OpenMetaverse; | 33 | using OpenMetaverse; |
34 | using OpenSim.Framework; | 34 | using OpenSim.Framework; |
35 | using OpenSim.Framework.Communications.Cache; | 35 | |
36 | using OpenSim.Region.CoreModules.World.Land; | 36 | using OpenSim.Region.CoreModules.World.Land; |
37 | using OpenSim.Region.DataSnapshot.Interfaces; | 37 | using OpenSim.Region.DataSnapshot.Interfaces; |
38 | using OpenSim.Region.Framework.Interfaces; | 38 | using OpenSim.Region.Framework.Interfaces; |
39 | using OpenSim.Region.Framework.Scenes; | 39 | using OpenSim.Region.Framework.Scenes; |
40 | using OpenSim.Services.Interfaces; | ||
40 | 41 | ||
41 | namespace OpenSim.Region.DataSnapshot.Providers | 42 | namespace OpenSim.Region.DataSnapshot.Providers |
42 | { | 43 | { |
@@ -258,8 +259,8 @@ namespace OpenSim.Region.DataSnapshot.Providers | |||
258 | try | 259 | try |
259 | { | 260 | { |
260 | XmlNode username = nodeFactory.CreateNode(XmlNodeType.Element, "name", ""); | 261 | XmlNode username = nodeFactory.CreateNode(XmlNodeType.Element, "name", ""); |
261 | CachedUserInfo profile = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(userOwnerUUID); | 262 | UserAccount account = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, userOwnerUUID); |
262 | username.InnerText = profile.UserProfile.FirstName + " " + profile.UserProfile.SurName; | 263 | username.InnerText = account.FirstName + " " + account.LastName; |
263 | userblock.AppendChild(username); | 264 | userblock.AppendChild(username); |
264 | } | 265 | } |
265 | catch (Exception) | 266 | catch (Exception) |
diff --git a/OpenSim/Region/DataSnapshot/ObjectSnapshot.cs b/OpenSim/Region/DataSnapshot/ObjectSnapshot.cs index 76dac61..f441aa9 100644 --- a/OpenSim/Region/DataSnapshot/ObjectSnapshot.cs +++ b/OpenSim/Region/DataSnapshot/ObjectSnapshot.cs | |||
@@ -203,44 +203,54 @@ namespace OpenSim.Region.DataSnapshot.Providers | |||
203 | { | 203 | { |
204 | string bestguess = string.Empty; | 204 | string bestguess = string.Empty; |
205 | Dictionary<UUID, int> counts = new Dictionary<UUID, int>(); | 205 | Dictionary<UUID, int> counts = new Dictionary<UUID, int>(); |
206 | if (sog.RootPart.Shape != null && sog.RootPart.Shape.ProfileShape == ProfileShape.Square && | 206 | |
207 | sog.RootPart.Shape.Textures != null && sog.RootPart.Shape.Textures.FaceTextures != null) | 207 | PrimitiveBaseShape shape = sog.RootPart.Shape; |
208 | if (shape != null && shape.ProfileShape == ProfileShape.Square) | ||
208 | { | 209 | { |
209 | if (sog.RootPart.Shape.Textures.DefaultTexture.TextureID != UUID.Zero && | 210 | Primitive.TextureEntry textures = shape.Textures; |
210 | sog.RootPart.Shape.Textures.DefaultTexture.TextureID != m_DefaultImage && | 211 | if (textures != null) |
211 | sog.RootPart.Shape.Textures.DefaultTexture.TextureID != m_BlankImage && | ||
212 | sog.RootPart.Shape.Textures.DefaultTexture.RGBA.A < 50) | ||
213 | { | 212 | { |
214 | counts[sog.RootPart.Shape.Textures.DefaultTexture.TextureID] = 8; | 213 | if (textures.DefaultTexture != null && |
215 | } | 214 | textures.DefaultTexture.TextureID != UUID.Zero && |
215 | textures.DefaultTexture.TextureID != m_DefaultImage && | ||
216 | textures.DefaultTexture.TextureID != m_BlankImage && | ||
217 | textures.DefaultTexture.RGBA.A < 50f) | ||
218 | { | ||
219 | counts[textures.DefaultTexture.TextureID] = 8; | ||
220 | } | ||
216 | 221 | ||
217 | foreach (Primitive.TextureEntryFace tentry in sog.RootPart.Shape.Textures.FaceTextures) | 222 | if (textures.FaceTextures != null) |
218 | { | ||
219 | if (tentry != null) | ||
220 | { | 223 | { |
221 | if (tentry.TextureID != UUID.Zero && tentry.TextureID != m_DefaultImage && tentry.TextureID != m_BlankImage && tentry.RGBA.A < 50) | 224 | foreach (Primitive.TextureEntryFace tentry in textures.FaceTextures) |
222 | { | 225 | { |
223 | int c = 0; | 226 | if (tentry != null) |
224 | counts.TryGetValue(tentry.TextureID, out c); | 227 | { |
225 | counts[tentry.TextureID] = c + 1; | 228 | if (tentry.TextureID != UUID.Zero && tentry.TextureID != m_DefaultImage && tentry.TextureID != m_BlankImage && tentry.RGBA.A < 50) |
226 | // decrease the default texture count | 229 | { |
227 | if (counts.ContainsKey(sog.RootPart.Shape.Textures.DefaultTexture.TextureID)) | 230 | int c = 0; |
228 | counts[sog.RootPart.Shape.Textures.DefaultTexture.TextureID] = counts[sog.RootPart.Shape.Textures.DefaultTexture.TextureID] - 1; | 231 | counts.TryGetValue(tentry.TextureID, out c); |
232 | counts[tentry.TextureID] = c + 1; | ||
233 | // decrease the default texture count | ||
234 | if (counts.ContainsKey(textures.DefaultTexture.TextureID)) | ||
235 | counts[textures.DefaultTexture.TextureID] = counts[textures.DefaultTexture.TextureID] - 1; | ||
236 | } | ||
237 | } | ||
229 | } | 238 | } |
230 | } | 239 | } |
231 | } | ||
232 | 240 | ||
233 | // Let's pick the most unique texture | 241 | // Let's pick the most unique texture |
234 | int min = 9999; | 242 | int min = 9999; |
235 | foreach (KeyValuePair<UUID, int> kv in counts) | 243 | foreach (KeyValuePair<UUID, int> kv in counts) |
236 | { | ||
237 | if (kv.Value < min && kv.Value >= 1) | ||
238 | { | 244 | { |
239 | bestguess = kv.Key.ToString(); | 245 | if (kv.Value < min && kv.Value >= 1) |
240 | min = kv.Value; | 246 | { |
247 | bestguess = kv.Key.ToString(); | ||
248 | min = kv.Value; | ||
249 | } | ||
241 | } | 250 | } |
242 | } | 251 | } |
243 | } | 252 | } |
253 | |||
244 | return bestguess; | 254 | return bestguess; |
245 | } | 255 | } |
246 | } | 256 | } |