From decd51f0811639169d63cb80fcc7dec931ea9530 Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Fri, 11 Dec 2009 08:11:26 -0800
Subject: Attempt at fixing mantis #4411.
---
OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGGridConnector.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'OpenSim/Region')
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
((ISharedRegionModule)m_GridServiceConnector).AddRegion(scene);
// Yikes!! Remove this as soon as user services get refactored
- LocalAssetServerURI = scene.CommsManager.NetworkServersInfo.UserURL;
+ LocalAssetServerURI = scene.CommsManager.NetworkServersInfo.AssetURL;
LocalInventoryServerURI = scene.CommsManager.NetworkServersInfo.InventoryURL;
LocalUserServerURI = scene.CommsManager.NetworkServersInfo.UserURL;
HGNetworkServersInfo.Init(LocalAssetServerURI, LocalInventoryServerURI, LocalUserServerURI);
--
cgit v1.1
From 4bbe9a51ac8c4412b41c4e271a0d2652ca52e118 Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Fri, 11 Dec 2009 09:09:36 -0800
Subject: Added an image uuid to objects marked "Show in search". Only works
for boxes.
---
OpenSim/Region/DataSnapshot/ObjectSnapshot.cs | 70 +++++++++++++++++++++++++++
1 file changed, 70 insertions(+)
(limited to 'OpenSim/Region')
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
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private bool m_stale = true;
+ private static UUID m_DefaultImage = new UUID("89556747-24cb-43ed-920b-47caed15465f");
+ private static UUID m_BlankImage = new UUID("5748decc-f629-461c-9a36-a35a221fe21f");
+
+
public void Initialize(Scene scene, DataSnapshotManager parent)
{
m_scene = scene;
@@ -142,6 +146,19 @@ namespace OpenSim.Region.DataSnapshot.Providers
node.InnerText = land.LandData.GlobalID.ToString();
xmlobject.AppendChild(node);
+ node = nodeFactory.CreateNode(XmlNodeType.Element, "location", "");
+ Vector3 loc = obj.AbsolutePosition;
+ node.InnerText = loc.X.ToString() + "/" + loc.Y.ToString() + "/" + loc.Z.ToString();
+ xmlobject.AppendChild(node);
+
+ string bestImage = GuessImage(obj);
+ if (bestImage != string.Empty)
+ {
+ node = nodeFactory.CreateNode(XmlNodeType.Element, "image", "");
+ node.InnerText = bestImage;
+ xmlobject.AppendChild(node);
+ }
+
parent.AppendChild(xmlobject);
}
}
@@ -173,5 +190,58 @@ namespace OpenSim.Region.DataSnapshot.Providers
}
public event ProviderStale OnStale;
+
+ ///
+ /// Guesses the best image, based on a simple heuristic. It guesses only for boxes.
+ /// We're optimizing for boxes, because those are the most common objects
+ /// marked "Show in search" -- boxes with content inside.For other shapes,
+ /// it's really hard to tell which texture should be grabbed.
+ ///
+ ///
+ ///
+ private string GuessImage(SceneObjectGroup sog)
+ {
+ string bestguess = string.Empty;
+ Dictionary counts = new Dictionary();
+ if (sog.RootPart.Shape != null && sog.RootPart.Shape.ProfileShape == ProfileShape.Square &&
+ sog.RootPart.Shape.Textures != null && sog.RootPart.Shape.Textures.FaceTextures != null)
+ {
+ if (sog.RootPart.Shape.Textures.DefaultTexture.TextureID != UUID.Zero &&
+ sog.RootPart.Shape.Textures.DefaultTexture.TextureID != m_DefaultImage &&
+ sog.RootPart.Shape.Textures.DefaultTexture.TextureID != m_BlankImage &&
+ sog.RootPart.Shape.Textures.DefaultTexture.RGBA.A < 50)
+ {
+ counts[sog.RootPart.Shape.Textures.DefaultTexture.TextureID] = 8;
+ }
+
+ foreach (Primitive.TextureEntryFace tentry in sog.RootPart.Shape.Textures.FaceTextures)
+ {
+ if (tentry != null)
+ {
+ if (tentry.TextureID != UUID.Zero && tentry.TextureID != m_DefaultImage && tentry.TextureID != m_BlankImage && tentry.RGBA.A < 50)
+ {
+ int c = 0;
+ counts.TryGetValue(tentry.TextureID, out c);
+ counts[tentry.TextureID] = c + 1;
+ // decrease the default texture count
+ if (counts.ContainsKey(sog.RootPart.Shape.Textures.DefaultTexture.TextureID))
+ counts[sog.RootPart.Shape.Textures.DefaultTexture.TextureID] = counts[sog.RootPart.Shape.Textures.DefaultTexture.TextureID] - 1;
+ }
+ }
+ }
+
+ // Let's pick the most unique texture
+ int min = 9999;
+ foreach (KeyValuePair kv in counts)
+ {
+ if (kv.Value < min && kv.Value >= 1)
+ {
+ bestguess = kv.Key.ToString();
+ min = kv.Value;
+ }
+ }
+ }
+ return bestguess;
+ }
}
}
--
cgit v1.1
From 81debdfebe21bf7bd28a62dc3468151729d2e6c1 Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Fri, 11 Dec 2009 20:20:18 -0800
Subject: A few more guards along the path to user server.
---
OpenSim/Region/Communications/OGS1/OGS1UserDataPlugin.cs | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
(limited to 'OpenSim/Region')
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
userData.Email = (string)data["email"];
userData.ID = new UUID((string)data["uuid"]);
userData.Created = Convert.ToInt32(data["profile_created"]);
- userData.UserInventoryURI = (string)data["server_inventory"];
- userData.UserAssetURI = (string)data["server_asset"];
- userData.FirstLifeAboutText = (string)data["profile_firstlife_about"];
+ if (data.Contains("server_inventory") && data["server_inventory"] != null)
+ userData.UserInventoryURI = (string)data["server_inventory"];
+ if (data.Contains("server_asset") && data["server_asset"] != null)
+ userData.UserAssetURI = (string)data["server_asset"];
+ if (data.Contains("profile_firstlife_about") && data["profile_firstlife_about"] != null)
+ userData.FirstLifeAboutText = (string)data["profile_firstlife_about"];
userData.FirstLifeImage = new UUID((string)data["profile_firstlife_image"]);
userData.CanDoMask = Convert.ToUInt32((string)data["profile_can_do"]);
userData.WantDoMask = Convert.ToUInt32(data["profile_want_do"]);
--
cgit v1.1
From d89f3e98111c7d228ab6196093eb308445429b72 Mon Sep 17 00:00:00 2001
From: Kunnis
Date: Fri, 11 Dec 2009 23:14:01 -0600
Subject: Getting rid of SimpleRegionInfo and SerializableRegionInfo per Mel
Signed-off-by: Melanie
---
.../Framework/Scenes/SceneCommunicationService.cs | 37 +++-------------------
1 file changed, 4 insertions(+), 33 deletions(-)
(limited to 'OpenSim/Region')
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
neighbours.RemoveAll(delegate(GridRegion r) { return r.RegionID == m_regionInfo.RegionID; });
return neighbours;
- //SimpleRegionInfo regionData = m_commsProvider.GridService.RequestNeighbourInfo()
- //return m_commsProvider.GridService.RequestNeighbours(pRegionLocX, pRegionLocY);
}
}
@@ -367,20 +365,8 @@ namespace OpenSim.Region.Framework.Scenes
///
public void EnableNeighbourChildAgents(ScenePresence avatar, List lstneighbours)
{
- //List neighbours = new List();
List neighbours = new List();
- ////m_commsProvider.GridService.RequestNeighbours(m_regionInfo.RegionLocX, m_regionInfo.RegionLocY);
- //for (int i = 0; i < lstneighbours.Count; i++)
- //{
- // // We don't want to keep sending to regions that consistently fail on comms.
- // if (!(lstneighbours[i].commFailTF))
- // {
- // neighbours.Add(new SimpleRegionInfo(lstneighbours[i]));
- // }
- //}
- // we're going to be using the above code once neighbour cache is correct. Currently it doesn't appear to be
- // So we're temporarily going back to the old method of grabbing it from the Grid Server Every time :/
if (m_regionInfo != null)
{
neighbours = RequestNeighbours(avatar.Scene,m_regionInfo.RegionLocX, m_regionInfo.RegionLocY);
@@ -431,7 +417,6 @@ namespace OpenSim.Region.Framework.Scenes
/// Create the necessary child agents
List cagents = new List();
- //foreach (SimpleRegionInfo neighbour in neighbours)
foreach (GridRegion neighbour in neighbours)
{
if (neighbour.RegionHandle != avatar.Scene.RegionInfo.RegionHandle)
@@ -583,7 +568,9 @@ namespace OpenSim.Region.Framework.Scenes
//m_log.Info("[INTER]: " + debugRegionName + ": SceneCommunicationService: Sending InterRegion Notification that region is up " + region.RegionName);
for (int x = (int)region.RegionLocX - 1; x <= region.RegionLocX + 1; x++)
+ {
for (int y = (int)region.RegionLocY - 1; y <= region.RegionLocY + 1; y++)
+ {
if (!((x == region.RegionLocX) && (y == region.RegionLocY))) // skip this region
{
ulong handle = Utils.UIntsToLong((uint)x * Constants.RegionSize, (uint)y * Constants.RegionSize);
@@ -593,24 +580,8 @@ namespace OpenSim.Region.Framework.Scenes
InformNeighborsThatRegionisUpCompleted,
d);
}
-
- //List neighbours = new List();
- //// This stays uncached because we don't already know about our neighbors at this point.
-
- //neighbours = m_scene.GridService.GetNeighbours(m_regionInfo.ScopeID, m_regionInfo.RegionID);
- //if (neighbours != null)
- //{
- // for (int i = 0; i < neighbours.Count; i++)
- // {
- // InformNeighbourThatRegionUpDelegate d = InformNeighboursThatRegionIsUpAsync;
-
- // d.BeginInvoke(neighbourService, region, neighbours[i].RegionHandle,
- // InformNeighborsThatRegionisUpCompleted,
- // d);
- // }
- //}
-
- //bool val = m_commsProvider.InterRegion.RegionUp(new SerializableRegionInfo(region));
+ }
+ }
}
--
cgit v1.1