Merge branch 'master' into careminster-presence-refactor

avinationmerge
Melanie 2010-06-22 23:38:56 +01:00
commit 317ac50a97
3 changed files with 46 additions and 10 deletions

View File

@ -6893,6 +6893,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if (cut.y - cut.x < 0.05f) if (cut.y - cut.x < 0.05f)
{ {
cut.x = cut.y - 0.05f; cut.x = cut.y - 0.05f;
if (cut.x < 0.0f)
{
cut.x = 0.0f;
cut.y = 0.05f;
}
} }
shapeBlock.ProfileBegin = (ushort)(50000 * cut.x); shapeBlock.ProfileBegin = (ushort)(50000 * cut.x);
shapeBlock.ProfileEnd = (ushort)(50000 * (1 - cut.y)); shapeBlock.ProfileEnd = (ushort)(50000 * (1 - cut.y));
@ -7097,9 +7102,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{ {
profilecut.y = 1f; profilecut.y = 1f;
} }
if (profilecut.y - cut.x < 0.05f) if (profilecut.y - profilecut.x < 0.05f)
{ {
profilecut.x = cut.y - 0.05f; profilecut.x = profilecut.y - 0.05f;
if (profilecut.x < 0.0f)
{
profilecut.x = 0.0f;
profilecut.y = 0.05f;
}
} }
shapeBlock.ProfileBegin = (ushort)(50000 * profilecut.x); shapeBlock.ProfileBegin = (ushort)(50000 * profilecut.x);
shapeBlock.ProfileEnd = (ushort)(50000 * (1 - profilecut.y)); shapeBlock.ProfileEnd = (ushort)(50000 * (1 - profilecut.y));

View File

@ -198,6 +198,8 @@ namespace OpenSim.Services.Connectors.SimianGrid
if (!String.IsNullOrEmpty(identifier)) if (!String.IsNullOrEmpty(identifier))
{ {
// Add/update the md5hash identity // Add/update the md5hash identity
// TODO: Support salts when AddIdentity does
// TODO: Create an a1hash too for WebDAV logins
requestArgs = new NameValueCollection requestArgs = new NameValueCollection
{ {
{ "RequestMethod", "AddIdentity" }, { "RequestMethod", "AddIdentity" },

View File

@ -59,18 +59,35 @@ namespace OpenSim.Services.Connectors.SimianGrid
MethodBase.GetCurrentMethod().DeclaringType); MethodBase.GetCurrentMethod().DeclaringType);
private string m_serverUrl = String.Empty; private string m_serverUrl = String.Empty;
private Dictionary<UUID, Scene> m_scenes = new Dictionary<UUID, Scene>();
#region ISharedRegionModule #region ISharedRegionModule
public Type ReplaceableInterface { get { return null; } } public Type ReplaceableInterface { get { return null; } }
public void RegionLoaded(Scene scene) { if (!String.IsNullOrEmpty(m_serverUrl)) { UploadMapTile(scene); } } public void RegionLoaded(Scene scene) { }
public void PostInitialise() { } public void PostInitialise() { }
public void Close() { } public void Close() { }
public SimianGridServiceConnector() { } public SimianGridServiceConnector() { }
public string Name { get { return "SimianGridServiceConnector"; } } public string Name { get { return "SimianGridServiceConnector"; } }
public void AddRegion(Scene scene) { if (!String.IsNullOrEmpty(m_serverUrl)) { scene.RegisterModuleInterface<IGridService>(this); } } public void AddRegion(Scene scene)
public void RemoveRegion(Scene scene) { if (!String.IsNullOrEmpty(m_serverUrl)) { scene.UnregisterModuleInterface<IGridService>(this); } } {
// Every shared region module has to maintain an indepedent list of
// currently running regions
lock (m_scenes)
m_scenes[scene.RegionInfo.RegionID] = scene;
if (!String.IsNullOrEmpty(m_serverUrl))
scene.RegisterModuleInterface<IGridService>(this);
}
public void RemoveRegion(Scene scene)
{
lock (m_scenes)
m_scenes.Remove(scene.RegionInfo.RegionID);
if (!String.IsNullOrEmpty(m_serverUrl))
scene.UnregisterModuleInterface<IGridService>(this);
}
#endregion ISharedRegionModule #endregion ISharedRegionModule
@ -107,6 +124,13 @@ namespace OpenSim.Services.Connectors.SimianGrid
{ {
IPEndPoint ext = regionInfo.ExternalEndPoint; IPEndPoint ext = regionInfo.ExternalEndPoint;
if (ext == null) return "Region registration for " + regionInfo.RegionName + " failed: Could not resolve EndPoint"; if (ext == null) return "Region registration for " + regionInfo.RegionName + " failed: Could not resolve EndPoint";
// Generate and upload our map tile in PNG format to the SimianGrid AddMapTile service
Scene scene;
if (m_scenes.TryGetValue(regionInfo.RegionID, out scene))
UploadMapTile(scene);
else
m_log.Warn("Registering region " + regionInfo.RegionName + " (" + regionInfo.RegionID + ") that we are not tracking");
Vector3d minPosition = new Vector3d(regionInfo.RegionLocX, regionInfo.RegionLocY, 0.0); Vector3d minPosition = new Vector3d(regionInfo.RegionLocX, regionInfo.RegionLocY, 0.0);
Vector3d maxPosition = minPosition + new Vector3d(Constants.RegionSize, Constants.RegionSize, 4096.0); Vector3d maxPosition = minPosition + new Vector3d(Constants.RegionSize, Constants.RegionSize, 4096.0);
@ -432,7 +456,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
if (!String.IsNullOrEmpty(errorMessage)) if (!String.IsNullOrEmpty(errorMessage))
{ {
m_log.WarnFormat("[SIMIAN GRID CONNECTOR]: Failed to store {0} byte PNG map tile for {1}: {2}", m_log.WarnFormat("[SIMIAN GRID CONNECTOR]: Failed to store {0} byte PNG map tile for {1}: {2}",
pngData.Length, scene.RegionInfo.RegionName, errorMessage); pngData.Length, scene.RegionInfo.RegionName, errorMessage.Replace('\n', ' '));
} }
} }