aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/Communications/OGS1/OGS1UserDataPlugin.cs9
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGGridConnector.cs2
-rw-r--r--OpenSim/Region/DataSnapshot/ObjectSnapshot.cs70
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs37
4 files changed, 81 insertions, 37 deletions
diff --git a/OpenSim/Region/Communications/OGS1/OGS1UserDataPlugin.cs b/OpenSim/Region/Communications/OGS1/OGS1UserDataPlugin.cs
index 2f9a45f..776d5d1 100644
--- a/OpenSim/Region/Communications/OGS1/OGS1UserDataPlugin.cs
+++ b/OpenSim/Region/Communications/OGS1/OGS1UserDataPlugin.cs
@@ -655,9 +655,12 @@ namespace OpenSim.Region.Communications.OGS1
655 userData.Email = (string)data["email"]; 655 userData.Email = (string)data["email"];
656 userData.ID = new UUID((string)data["uuid"]); 656 userData.ID = new UUID((string)data["uuid"]);
657 userData.Created = Convert.ToInt32(data["profile_created"]); 657 userData.Created = Convert.ToInt32(data["profile_created"]);
658 userData.UserInventoryURI = (string)data["server_inventory"]; 658 if (data.Contains("server_inventory") && data["server_inventory"] != null)
659 userData.UserAssetURI = (string)data["server_asset"]; 659 userData.UserInventoryURI = (string)data["server_inventory"];
660 userData.FirstLifeAboutText = (string)data["profile_firstlife_about"]; 660 if (data.Contains("server_asset") && data["server_asset"] != null)
661 userData.UserAssetURI = (string)data["server_asset"];
662 if (data.Contains("profile_firstlife_about") && data["profile_firstlife_about"] != null)
663 userData.FirstLifeAboutText = (string)data["profile_firstlife_about"];
661 userData.FirstLifeImage = new UUID((string)data["profile_firstlife_image"]); 664 userData.FirstLifeImage = new UUID((string)data["profile_firstlife_image"]);
662 userData.CanDoMask = Convert.ToUInt32((string)data["profile_can_do"]); 665 userData.CanDoMask = Convert.ToUInt32((string)data["profile_can_do"]);
663 userData.WantDoMask = Convert.ToUInt32(data["profile_want_do"]); 666 userData.WantDoMask = Convert.ToUInt32(data["profile_want_do"]);
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGGridConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGGridConnector.cs
index f2d8579..4d347cd 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGGridConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGGridConnector.cs
@@ -155,7 +155,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
155 ((ISharedRegionModule)m_GridServiceConnector).AddRegion(scene); 155 ((ISharedRegionModule)m_GridServiceConnector).AddRegion(scene);
156 156
157 // Yikes!! Remove this as soon as user services get refactored 157 // Yikes!! Remove this as soon as user services get refactored
158 LocalAssetServerURI = scene.CommsManager.NetworkServersInfo.UserURL; 158 LocalAssetServerURI = scene.CommsManager.NetworkServersInfo.AssetURL;
159 LocalInventoryServerURI = scene.CommsManager.NetworkServersInfo.InventoryURL; 159 LocalInventoryServerURI = scene.CommsManager.NetworkServersInfo.InventoryURL;
160 LocalUserServerURI = scene.CommsManager.NetworkServersInfo.UserURL; 160 LocalUserServerURI = scene.CommsManager.NetworkServersInfo.UserURL;
161 HGNetworkServersInfo.Init(LocalAssetServerURI, LocalInventoryServerURI, LocalUserServerURI); 161 HGNetworkServersInfo.Init(LocalAssetServerURI, LocalInventoryServerURI, LocalUserServerURI);
diff --git a/OpenSim/Region/DataSnapshot/ObjectSnapshot.cs b/OpenSim/Region/DataSnapshot/ObjectSnapshot.cs
index 9639095..76dac61 100644
--- a/OpenSim/Region/DataSnapshot/ObjectSnapshot.cs
+++ b/OpenSim/Region/DataSnapshot/ObjectSnapshot.cs
@@ -45,6 +45,10 @@ namespace OpenSim.Region.DataSnapshot.Providers
45 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 45 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
46 private bool m_stale = true; 46 private bool m_stale = true;
47 47
48 private static UUID m_DefaultImage = new UUID("89556747-24cb-43ed-920b-47caed15465f");
49 private static UUID m_BlankImage = new UUID("5748decc-f629-461c-9a36-a35a221fe21f");
50
51
48 public void Initialize(Scene scene, DataSnapshotManager parent) 52 public void Initialize(Scene scene, DataSnapshotManager parent)
49 { 53 {
50 m_scene = scene; 54 m_scene = scene;
@@ -142,6 +146,19 @@ namespace OpenSim.Region.DataSnapshot.Providers
142 node.InnerText = land.LandData.GlobalID.ToString(); 146 node.InnerText = land.LandData.GlobalID.ToString();
143 xmlobject.AppendChild(node); 147 xmlobject.AppendChild(node);
144 148
149 node = nodeFactory.CreateNode(XmlNodeType.Element, "location", "");
150 Vector3 loc = obj.AbsolutePosition;
151 node.InnerText = loc.X.ToString() + "/" + loc.Y.ToString() + "/" + loc.Z.ToString();
152 xmlobject.AppendChild(node);
153
154 string bestImage = GuessImage(obj);
155 if (bestImage != string.Empty)
156 {
157 node = nodeFactory.CreateNode(XmlNodeType.Element, "image", "");
158 node.InnerText = bestImage;
159 xmlobject.AppendChild(node);
160 }
161
145 parent.AppendChild(xmlobject); 162 parent.AppendChild(xmlobject);
146 } 163 }
147 } 164 }
@@ -173,5 +190,58 @@ namespace OpenSim.Region.DataSnapshot.Providers
173 } 190 }
174 191
175 public event ProviderStale OnStale; 192 public event ProviderStale OnStale;
193
194 /// <summary>
195 /// Guesses the best image, based on a simple heuristic. It guesses only for boxes.
196 /// We're optimizing for boxes, because those are the most common objects
197 /// marked "Show in search" -- boxes with content inside.For other shapes,
198 /// it's really hard to tell which texture should be grabbed.
199 /// </summary>
200 /// <param name="sog"></param>
201 /// <returns></returns>
202 private string GuessImage(SceneObjectGroup sog)
203 {
204 string bestguess = string.Empty;
205 Dictionary<UUID, int> counts = new Dictionary<UUID, int>();
206 if (sog.RootPart.Shape != null && sog.RootPart.Shape.ProfileShape == ProfileShape.Square &&
207 sog.RootPart.Shape.Textures != null && sog.RootPart.Shape.Textures.FaceTextures != null)
208 {
209 if (sog.RootPart.Shape.Textures.DefaultTexture.TextureID != UUID.Zero &&
210 sog.RootPart.Shape.Textures.DefaultTexture.TextureID != m_DefaultImage &&
211 sog.RootPart.Shape.Textures.DefaultTexture.TextureID != m_BlankImage &&
212 sog.RootPart.Shape.Textures.DefaultTexture.RGBA.A < 50)
213 {
214 counts[sog.RootPart.Shape.Textures.DefaultTexture.TextureID] = 8;
215 }
216
217 foreach (Primitive.TextureEntryFace tentry in sog.RootPart.Shape.Textures.FaceTextures)
218 {
219 if (tentry != null)
220 {
221 if (tentry.TextureID != UUID.Zero && tentry.TextureID != m_DefaultImage && tentry.TextureID != m_BlankImage && tentry.RGBA.A < 50)
222 {
223 int c = 0;
224 counts.TryGetValue(tentry.TextureID, out c);
225 counts[tentry.TextureID] = c + 1;
226 // decrease the default texture count
227 if (counts.ContainsKey(sog.RootPart.Shape.Textures.DefaultTexture.TextureID))
228 counts[sog.RootPart.Shape.Textures.DefaultTexture.TextureID] = counts[sog.RootPart.Shape.Textures.DefaultTexture.TextureID] - 1;
229 }
230 }
231 }
232
233 // Let's pick the most unique texture
234 int min = 9999;
235 foreach (KeyValuePair<UUID, int> kv in counts)
236 {
237 if (kv.Value < min && kv.Value >= 1)
238 {
239 bestguess = kv.Key.ToString();
240 min = kv.Value;
241 }
242 }
243 }
244 return bestguess;
245 }
176 } 246 }
177} 247}
diff --git a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs
index 3892769..e649139 100644
--- a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs
@@ -356,8 +356,6 @@ namespace OpenSim.Region.Framework.Scenes
356 neighbours.RemoveAll(delegate(GridRegion r) { return r.RegionID == m_regionInfo.RegionID; }); 356 neighbours.RemoveAll(delegate(GridRegion r) { return r.RegionID == m_regionInfo.RegionID; });
357 357
358 return neighbours; 358 return neighbours;
359 //SimpleRegionInfo regionData = m_commsProvider.GridService.RequestNeighbourInfo()
360 //return m_commsProvider.GridService.RequestNeighbours(pRegionLocX, pRegionLocY);
361 } 359 }
362 } 360 }
363 361
@@ -367,20 +365,8 @@ namespace OpenSim.Region.Framework.Scenes
367 /// </summary> 365 /// </summary>
368 public void EnableNeighbourChildAgents(ScenePresence avatar, List<RegionInfo> lstneighbours) 366 public void EnableNeighbourChildAgents(ScenePresence avatar, List<RegionInfo> lstneighbours)
369 { 367 {
370 //List<SimpleRegionInfo> neighbours = new List<SimpleRegionInfo>();
371 List<GridRegion> neighbours = new List<GridRegion>(); 368 List<GridRegion> neighbours = new List<GridRegion>();
372 369
373 ////m_commsProvider.GridService.RequestNeighbours(m_regionInfo.RegionLocX, m_regionInfo.RegionLocY);
374 //for (int i = 0; i < lstneighbours.Count; i++)
375 //{
376 // // We don't want to keep sending to regions that consistently fail on comms.
377 // if (!(lstneighbours[i].commFailTF))
378 // {
379 // neighbours.Add(new SimpleRegionInfo(lstneighbours[i]));
380 // }
381 //}
382 // we're going to be using the above code once neighbour cache is correct. Currently it doesn't appear to be
383 // So we're temporarily going back to the old method of grabbing it from the Grid Server Every time :/
384 if (m_regionInfo != null) 370 if (m_regionInfo != null)
385 { 371 {
386 neighbours = RequestNeighbours(avatar.Scene,m_regionInfo.RegionLocX, m_regionInfo.RegionLocY); 372 neighbours = RequestNeighbours(avatar.Scene,m_regionInfo.RegionLocX, m_regionInfo.RegionLocY);
@@ -431,7 +417,6 @@ namespace OpenSim.Region.Framework.Scenes
431 417
432 /// Create the necessary child agents 418 /// Create the necessary child agents
433 List<AgentCircuitData> cagents = new List<AgentCircuitData>(); 419 List<AgentCircuitData> cagents = new List<AgentCircuitData>();
434 //foreach (SimpleRegionInfo neighbour in neighbours)
435 foreach (GridRegion neighbour in neighbours) 420 foreach (GridRegion neighbour in neighbours)
436 { 421 {
437 if (neighbour.RegionHandle != avatar.Scene.RegionInfo.RegionHandle) 422 if (neighbour.RegionHandle != avatar.Scene.RegionInfo.RegionHandle)
@@ -583,7 +568,9 @@ namespace OpenSim.Region.Framework.Scenes
583 //m_log.Info("[INTER]: " + debugRegionName + ": SceneCommunicationService: Sending InterRegion Notification that region is up " + region.RegionName); 568 //m_log.Info("[INTER]: " + debugRegionName + ": SceneCommunicationService: Sending InterRegion Notification that region is up " + region.RegionName);
584 569
585 for (int x = (int)region.RegionLocX - 1; x <= region.RegionLocX + 1; x++) 570 for (int x = (int)region.RegionLocX - 1; x <= region.RegionLocX + 1; x++)
571 {
586 for (int y = (int)region.RegionLocY - 1; y <= region.RegionLocY + 1; y++) 572 for (int y = (int)region.RegionLocY - 1; y <= region.RegionLocY + 1; y++)
573 {
587 if (!((x == region.RegionLocX) && (y == region.RegionLocY))) // skip this region 574 if (!((x == region.RegionLocX) && (y == region.RegionLocY))) // skip this region
588 { 575 {
589 ulong handle = Utils.UIntsToLong((uint)x * Constants.RegionSize, (uint)y * Constants.RegionSize); 576 ulong handle = Utils.UIntsToLong((uint)x * Constants.RegionSize, (uint)y * Constants.RegionSize);
@@ -593,24 +580,8 @@ namespace OpenSim.Region.Framework.Scenes
593 InformNeighborsThatRegionisUpCompleted, 580 InformNeighborsThatRegionisUpCompleted,
594 d); 581 d);
595 } 582 }
596 583 }
597 //List<GridRegion> neighbours = new List<GridRegion>(); 584 }
598 //// This stays uncached because we don't already know about our neighbors at this point.
599
600 //neighbours = m_scene.GridService.GetNeighbours(m_regionInfo.ScopeID, m_regionInfo.RegionID);
601 //if (neighbours != null)
602 //{
603 // for (int i = 0; i < neighbours.Count; i++)
604 // {
605 // InformNeighbourThatRegionUpDelegate d = InformNeighboursThatRegionIsUpAsync;
606
607 // d.BeginInvoke(neighbourService, region, neighbours[i].RegionHandle,
608 // InformNeighborsThatRegionisUpCompleted,
609 // d);
610 // }
611 //}
612
613 //bool val = m_commsProvider.InterRegion.RegionUp(new SerializableRegionInfo(region));
614 } 585 }
615 586
616 587