Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor

avinationmerge
meta7 2010-08-07 06:33:51 -07:00
commit bcb3b57f8d
39 changed files with 36897 additions and 27801 deletions

View File

@ -319,6 +319,13 @@ namespace OpenSim.Framework.Servers.HttpServer
OSHttpRequest req = new OSHttpRequest(context, request);
OSHttpResponse resp = new OSHttpResponse(new HttpResponse(context, request),context);
HandleRequest(req, resp);
// !!!HACK ALERT!!!
// There seems to be a bug in the underlying http code that makes subsequent requests
// come up with trash in Accept headers. Until that gets fixed, we're cleaning them up here.
if (request.AcceptTypes != null)
for (int i = 0; i < request.AcceptTypes.Length; i++)
request.AcceptTypes[i] = string.Empty;
}
// public void ConvertIHttpClientContextToOSHttp(object stateinfo)

View File

@ -390,33 +390,38 @@ Asset service request failures: {3}" + Environment.NewLine,
public override string XReport(string uptime, string version)
{
OSDMap args = new OSDMap(30);
args["AssetsInCache"] = OSD.FromReal(AssetsInCache);
args["TimeAfterCacheMiss"] = OSD.FromReal(assetRequestTimeAfterCacheMiss.Milliseconds / 1000.0);
args["BlockedMissingTextureRequests"] = OSD.FromReal(BlockedMissingTextureRequests);
args["AssetServiceRequestFailures"] = OSD.FromReal(AssetServiceRequestFailures);
args["abnormalClientThreadTerminations"] = OSD.FromReal(abnormalClientThreadTerminations);
args["InventoryServiceRetrievalFailures"] = OSD.FromReal(InventoryServiceRetrievalFailures);
args["Dilatn"] = OSD.FromReal(timeDilation);
args["SimFPS"] = OSD.FromReal(simFps);
args["PhyFPS"] = OSD.FromReal(physicsFps);
args["AgntUp"] = OSD.FromReal(agentUpdates);
args["RootAg"] = OSD.FromReal(rootAgents);
args["ChldAg"] = OSD.FromReal(childAgents);
args["Prims"] = OSD.FromReal(totalPrims);
args["AtvPrm"] = OSD.FromReal(activePrims);
args["AtvScr"] = OSD.FromReal(activeScripts);
args["ScrLPS"] = OSD.FromReal(scriptLinesPerSecond);
args["PktsIn"] = OSD.FromReal(inPacketsPerSecond);
args["PktOut"] = OSD.FromReal(outPacketsPerSecond);
args["PendDl"] = OSD.FromReal(pendingDownloads);
args["PendUl"] = OSD.FromReal(pendingUploads);
args["UnackB"] = OSD.FromReal(unackedBytes);
args["TotlFt"] = OSD.FromReal(totalFrameTime);
args["NetFt"] = OSD.FromReal(netFrameTime);
args["PhysFt"] = OSD.FromReal(physicsFrameTime);
args["OthrFt"] = OSD.FromReal(otherFrameTime);
args["AgntFt"] = OSD.FromReal(agentFrameTime);
args["ImgsFt"] = OSD.FromReal(imageFrameTime);
args["AssetsInCache"] = OSD.FromString (String.Format ("{0:0.##}", AssetsInCache));
args["TimeAfterCacheMiss"] = OSD.FromString (String.Format ("{0:0.##}",
assetRequestTimeAfterCacheMiss.Milliseconds / 1000.0));
args["BlockedMissingTextureRequests"] = OSD.FromString (String.Format ("{0:0.##}",
BlockedMissingTextureRequests));
args["AssetServiceRequestFailures"] = OSD.FromString (String.Format ("{0:0.##}",
AssetServiceRequestFailures));
args["abnormalClientThreadTerminations"] = OSD.FromString (String.Format ("{0:0.##}",
abnormalClientThreadTerminations));
args["InventoryServiceRetrievalFailures"] = OSD.FromString (String.Format ("{0:0.##}",
InventoryServiceRetrievalFailures));
args["Dilatn"] = OSD.FromString (String.Format ("{0:0.##}", timeDilation));
args["SimFPS"] = OSD.FromString (String.Format ("{0:0.##}", simFps));
args["PhyFPS"] = OSD.FromString (String.Format ("{0:0.##}", physicsFps));
args["AgntUp"] = OSD.FromString (String.Format ("{0:0.##}", agentUpdates));
args["RootAg"] = OSD.FromString (String.Format ("{0:0.##}", rootAgents));
args["ChldAg"] = OSD.FromString (String.Format ("{0:0.##}", childAgents));
args["Prims"] = OSD.FromString (String.Format ("{0:0.##}", totalPrims));
args["AtvPrm"] = OSD.FromString (String.Format ("{0:0.##}", activePrims));
args["AtvScr"] = OSD.FromString (String.Format ("{0:0.##}", activeScripts));
args["ScrLPS"] = OSD.FromString (String.Format ("{0:0.##}", scriptLinesPerSecond));
args["PktsIn"] = OSD.FromString (String.Format ("{0:0.##}", inPacketsPerSecond));
args["PktOut"] = OSD.FromString (String.Format ("{0:0.##}", outPacketsPerSecond));
args["PendDl"] = OSD.FromString (String.Format ("{0:0.##}", pendingDownloads));
args["PendUl"] = OSD.FromString (String.Format ("{0:0.##}", pendingUploads));
args["UnackB"] = OSD.FromString (String.Format ("{0:0.##}", unackedBytes));
args["TotlFt"] = OSD.FromString (String.Format ("{0:0.##}", totalFrameTime));
args["NetFt"] = OSD.FromString (String.Format ("{0:0.##}", netFrameTime));
args["PhysFt"] = OSD.FromString (String.Format ("{0:0.##}", physicsFrameTime));
args["OthrFt"] = OSD.FromString (String.Format ("{0:0.##}", otherFrameTime));
args["AgntFt"] = OSD.FromString (String.Format ("{0:0.##}", agentFrameTime));
args["ImgsFt"] = OSD.FromString (String.Format ("{0:0.##}", imageFrameTime));
args["Memory"] = OSD.FromString (base.XReport (uptime, version));
args["Uptime"] = OSD.FromString (uptime);
args["Version"] = OSD.FromString (version);

View File

@ -1171,6 +1171,16 @@ namespace OpenSim.Framework
}
public static uint ConvertAccessLevelToMaturity(byte maturity)
{
if (maturity <= 13)
return 0;
else if (maturity <= 21)
return 1;
else
return 2;
}
/// <summary>
/// Produces an OSDMap from its string representation on a stream
/// </summary>

View File

@ -2675,7 +2675,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
// Bit 0: Mature, bit 7: on sale, other bits: no idea
reply.Data.Flags = (byte)(
((land.Flags & (uint)ParcelFlags.MaturePublish) != 0 ? (1 << 0) : 0) +
(info.AccessLevel > 13 ? (1 << 0) : 0) +
((land.Flags & (uint)ParcelFlags.ForSale) != 0 ? (1 << 7) : 0));
Vector3 pos = land.UserLocation;
@ -2683,8 +2683,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
{
pos = (land.AABBMax + land.AABBMin) * 0.5f;
}
reply.Data.GlobalX = info.RegionLocX * Constants.RegionSize + x;
reply.Data.GlobalY = info.RegionLocY * Constants.RegionSize + y;
reply.Data.GlobalX = info.RegionLocX + x;
reply.Data.GlobalY = info.RegionLocY + y;
reply.Data.GlobalZ = pos.Z;
reply.Data.SimName = Utils.StringToBytes(info.RegionName);
reply.Data.SnapshotID = land.SnapshotID;

View File

@ -293,8 +293,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
}
// Fire after attach, so we don't get messy perms dialogs
// 3 == AttachedRez
objatt.CreateScriptInstances(0, true, m_scene.DefaultScriptEngine, 3);
// 4 == AttachedRez
objatt.CreateScriptInstances(0, true, m_scene.DefaultScriptEngine, 4);
objatt.ResumeScripts();
// Do this last so that event listeners have access to all the effects of the attachment

View File

@ -169,7 +169,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
}
catch
{
m_log.Info("[OFFLINE MESSAGING]: No PST timezone found on this machine. Saving with local timestamp.");
//m_log.Info("[OFFLINE MESSAGING]: No PST timezone found on this machine. Saving with local timestamp.");
}
// And make it look local again to fool the unix time util

View File

@ -132,7 +132,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
{
UUID toAgentID = new UUID(im.toAgentID);
m_log.DebugFormat("[INSTANT MESSAGE]: Attempting delivery of IM from {0} to {1}", im.fromAgentName, toAgentID.ToString());
//m_log.DebugFormat("[INSTANT MESSAGE]: Attempting delivery of IM from {0} to {1}", im.fromAgentName, toAgentID.ToString());
// Try root avatar only first
foreach (Scene scene in m_Scenes)
@ -140,12 +140,12 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
if (scene.Entities.ContainsKey(toAgentID) &&
scene.Entities[toAgentID] is ScenePresence)
{
m_log.DebugFormat("[INSTANT MESSAGE]: Looking for {0} in {1}", toAgentID.ToString(), scene.RegionInfo.RegionName);
// m_log.DebugFormat("[INSTANT MESSAGE]: Looking for {0} in {1}", toAgentID.ToString(), scene.RegionInfo.RegionName);
// Local message
ScenePresence user = (ScenePresence) scene.Entities[toAgentID];
if (!user.IsChildAgent)
{
m_log.DebugFormat("[INSTANT MESSAGE]: Delivering to client");
// m_log.DebugFormat("[INSTANT MESSAGE]: Delivering to client");
user.ControllingClient.SendInstantMessage(im);
// Message sent
@ -167,7 +167,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
// Local message
ScenePresence user = (ScenePresence) scene.Entities[toAgentID];
m_log.DebugFormat("[INSTANT MESSAGE]: Delivering to client");
// m_log.DebugFormat("[INSTANT MESSAGE]: Delivering to client");
user.ControllingClient.SendInstantMessage(im);
// Message sent

View File

@ -741,7 +741,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
public void TestMergeIarPath()
{
TestHelper.InMethod();
log4net.Config.XmlConfigurator.Configure();
// log4net.Config.XmlConfigurator.Configure();
Scene scene = SceneSetupHelpers.SetupScene("inventory");
UserAccount ua1 = UserProfileTestUtils.CreateUserWithInventory(scene);

View File

@ -121,7 +121,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Land
#region ILandService
public LandData GetLandData(ulong regionHandle, uint x, uint y)
public LandData GetLandData(ulong regionHandle, uint x, uint y, out byte regionAccess)
{
m_log.DebugFormat("[LAND IN CONNECTOR]: GetLandData for {0}. Count = {1}",
regionHandle, m_Scenes.Count);
@ -130,10 +130,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Land
if (s.RegionInfo.RegionHandle == regionHandle)
{
m_log.Debug("[LAND IN CONNECTOR]: Found region to GetLandData from");
regionAccess = s.RegionInfo.AccessLevel;
return s.GetLandData(x, y);
}
}
m_log.DebugFormat("[LAND IN CONNECTOR]: region handle {0} not found", regionHandle);
regionAccess = 42;
return null;
}

View File

@ -233,6 +233,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
return m_GridService.GetFallbackRegions(scopeID, x, y);
}
public List<GridRegion> GetHyperlinks(UUID scopeID)
{
return m_GridService.GetHyperlinks(scopeID);
}
public int GetRegionFlags(UUID scopeID, UUID regionID)
{
return m_GridService.GetRegionFlags(scopeID, regionID);

View File

@ -136,6 +136,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid.Tests
900 * (int)Constants.RegionSize, 1100 * (int)Constants.RegionSize);
Assert.IsNotNull(results, "Retrieved GetRegionRange list is null");
Assert.That(results.Count, Is.EqualTo(2), "Retrieved neighbour collection is not the number expected");
results = m_LocalConnector.GetHyperlinks(UUID.Zero);
Assert.IsNotNull(results, "Retrieved GetHyperlinks list is null");
Assert.That(results.Count, Is.EqualTo(0), "Retrieved linked regions collection is not the number expected");
}
}
}

View File

@ -116,8 +116,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Land
#region ILandService
public LandData GetLandData(ulong regionHandle, uint x, uint y)
public LandData GetLandData(ulong regionHandle, uint x, uint y, out byte regionAccess)
{
regionAccess = 2;
m_log.DebugFormat("[LAND CONNECTOR]: request for land data in {0} at {1}, {2}",
regionHandle, x, y);
@ -126,6 +127,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Land
if (s.RegionInfo.RegionHandle == regionHandle)
{
LandData land = s.GetLandData(x, y);
regionAccess = s.RegionInfo.AccessLevel;
return land;
}
}

View File

@ -90,7 +90,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Land
if (!m_Enabled)
return;
m_GridService = scene.GridService;
m_LocalService.AddRegion(scene);
scene.RegisterModuleInterface<ILandService>(this);
}
@ -103,18 +102,19 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Land
public void RegionLoaded(Scene scene)
{
m_GridService = scene.GridService;
}
#region ILandService
public override LandData GetLandData(ulong regionHandle, uint x, uint y)
public override LandData GetLandData(ulong regionHandle, uint x, uint y, out byte regionAccess)
{
LandData land = m_LocalService.GetLandData(regionHandle, x, y);
LandData land = m_LocalService.GetLandData(regionHandle, x, y, out regionAccess);
if (land != null)
return land;
return base.GetLandData(regionHandle, x, y);
return base.GetLandData(regionHandle, x, y, out regionAccess);
}
#endregion ILandService

View File

@ -51,6 +51,7 @@ namespace OpenSim.Region.CoreModules.World.Land
public LandData LandData;
public ulong RegionHandle;
public uint X, Y;
public byte RegionAccess;
}
public class LandManagementModule : INonSharedRegionModule
@ -1484,13 +1485,15 @@ namespace OpenSim.Region.CoreModules.World.Land
if (extLandData.RegionHandle == m_scene.RegionInfo.RegionHandle)
{
extLandData.LandData = this.GetLandObject(extLandData.X, extLandData.Y).LandData;
extLandData.RegionAccess = m_scene.RegionInfo.AccessLevel;
}
else
{
ILandService landService = m_scene.RequestModuleInterface<ILandService>();
extLandData.LandData = landService.GetLandData(extLandData.RegionHandle,
extLandData.X,
extLandData.Y);
extLandData.Y,
out extLandData.RegionAccess);
if (extLandData.LandData == null)
{
// we didn't find the region/land => don't cache
@ -1522,6 +1525,7 @@ namespace OpenSim.Region.CoreModules.World.Land
r.RegionName = info.RegionName;
r.RegionLocX = (uint)info.RegionLocX;
r.RegionLocY = (uint)info.RegionLocY;
r.RegionSettings.Maturity = (int)Util.ConvertAccessLevelToMaturity(data.RegionAccess);
remoteClient.SendParcelInfo(r, data.LandData, parcelID, data.X, data.Y);
}
else

View File

@ -1824,6 +1824,8 @@ namespace OpenSim.Region.Framework.Scenes
/// <param name="originalPrim"></param>
/// <param name="offset"></param>
/// <param name="flags"></param>
/// <param name="AgentID"></param>
/// <param name="GroupID"></param>
protected internal void DuplicateObject(uint originalPrim, Vector3 offset, uint flags, UUID AgentID, UUID GroupID)
{
//m_log.DebugFormat("[SCENE]: Duplication of object {0} at offset {1} requested by agent {2}", originalPrim, offset, AgentID);
@ -1838,7 +1840,10 @@ namespace OpenSim.Region.Framework.Scenes
/// <param name="originalPrim"></param>
/// <param name="offset"></param>
/// <param name="flags"></param>
protected internal SceneObjectGroup DuplicateObject(uint originalPrimID, Vector3 offset, uint flags, UUID AgentID, UUID GroupID, Quaternion rot)
/// <param name="AgentID"></param>
/// <param name="GroupID"></param>
/// <param name="rot"></param>
public SceneObjectGroup DuplicateObject(uint originalPrimID, Vector3 offset, uint flags, UUID AgentID, UUID GroupID, Quaternion rot)
{
//m_log.DebugFormat("[SCENE]: Duplication of object {0} at offset {1} requested by agent {2}", originalPrim, offset, AgentID);
SceneObjectGroup original = GetGroupByPrim(originalPrimID);

View File

@ -1184,6 +1184,10 @@ namespace OpenSim.Region.Framework.Scenes
set { _nextOwnerMask = value; }
}
/// <summary>
/// Property flags. See OpenMetaverse.PrimFlags
/// </summary>
/// Example properties are PrimFlags.Phantom and PrimFlags.DieAtEdge
public PrimFlags Flags
{
get { return _flags; }

View File

@ -1,4 +1,4 @@
/*
/*
* Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders.
*
@ -26,61 +26,46 @@
*/
using System;
using System.Reflection;
using NUnit.Framework;
using NUnit.Framework.SyntaxHelpers;
using OpenMetaverse;
using OpenSim.Framework;
using GridRegion = OpenSim.Services.Interfaces.GridRegion;
using OpenSim.Framework.Communications;
using OpenSim.Region.Framework.Scenes;
using OpenSim.Tests.Common;
using OpenSim.Tests.Common.Mock;
using OpenSim.Tests.Common.Setup;
namespace OpenSim.Region.Framework.Scenes.Tests
{
/// <summary>
/// Scene presence tests
/// </summary>
[TestFixture]
public class SceneBaseTests
public class SceneGraphTests
{
private class SceneBaseImpl : SceneBase
{
public override void Update()
{
throw new NotImplementedException();
}
public override void LoadWorldMap()
{
throw new NotImplementedException();
}
public override void AddNewClient(IClientAPI client)
{
throw new NotImplementedException();
}
public override void RemoveClient(UUID agentID)
{
throw new NotImplementedException();
}
public override void OtherRegionUp(GridRegion otherRegion)
{
throw new NotImplementedException();
}
public override bool TryGetScenePresence(UUID agentID, out ScenePresence scenePresence)
{
throw new NotImplementedException();
}
public override bool CheckClient(UUID agentID, System.Net.IPEndPoint ep)
{
throw new NotImplementedException();
}
}
[Test]
public void TestConstructor()
public void TestDuplicateObject()
{
new SceneBaseImpl();
TestHelper.InMethod();
Scene scene = SceneSetupHelpers.SetupScene();
UUID ownerUuid = new UUID("00000000-0000-0000-0000-000000000010");
string objName = "obj1";
UUID objUuid = new UUID("00000000-0000-0000-0000-000000000001");
SceneObjectPart part
= new SceneObjectPart(ownerUuid, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero)
{ Name = objName, UUID = objUuid };
scene.AddNewSceneObject(new SceneObjectGroup(part), false);
SceneObjectGroup duplicatedSo
= scene.SceneGraph.DuplicateObject(
part.LocalId, new Vector3(10, 0, 0), 0, ownerUuid, UUID.Zero, Quaternion.Identity);
Assert.That(duplicatedSo.Children.Count, Is.EqualTo(1));
Assert.That(duplicatedSo.RootPart.LocalId, Is.Not.EqualTo(part.LocalId));
//SceneObjectPart retrievedPart = scene.GetSceneObjectPart(objUuid);
}
}
}

View File

@ -32,7 +32,6 @@ using NUnit.Framework.SyntaxHelpers;
using OpenMetaverse;
using OpenSim.Framework;
using OpenSim.Framework.Communications;
using OpenSim.Region.Framework.Scenes;
using OpenSim.Tests.Common;
using OpenSim.Tests.Common.Mock;

View File

@ -1,147 +0,0 @@
/*
* Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the OpenSimulator Project nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using System;
using System.Collections.Generic;
using NUnit.Framework;
using OpenMetaverse;
using OpenSim.Framework;
using OpenSim.Region.Framework.Interfaces;
namespace OpenSim.Region.Framework.Scenes.Tests
{
/// <summary>
/// Scene presence tests
/// </summary>
[TestFixture]
public class SceneTests
{
private class FakeStorageManager : StorageManager
{
private class FakeRegionDataStore : IRegionDataStore
{
public void Initialise(string filename)
{
}
public void Dispose()
{
}
public void StoreObject(SceneObjectGroup obj, UUID regionUUID)
{
throw new NotImplementedException();
}
public void RemoveObject(UUID uuid, UUID regionUUID)
{
throw new NotImplementedException();
}
public void StorePrimInventory(UUID primID, ICollection<TaskInventoryItem> items)
{
throw new NotImplementedException();
}
public List<SceneObjectGroup> LoadObjects(UUID regionUUID)
{
throw new NotImplementedException();
}
public void StoreTerrain(double[,] terrain, UUID regionID)
{
throw new NotImplementedException();
}
public double[,] LoadTerrain(UUID regionID)
{
throw new NotImplementedException();
}
public void StoreLandObject(ILandObject Parcel)
{
throw new NotImplementedException();
}
public void RemoveLandObject(UUID globalID)
{
throw new NotImplementedException();
}
public List<LandData> LoadLandObjects(UUID regionUUID)
{
throw new NotImplementedException();
}
public void StoreRegionSettings(RegionSettings rs)
{
throw new NotImplementedException();
}
public RegionLightShareData LoadRegionWindlightSettings(UUID regionUUID)
{
//This connector doesn't support the windlight module yet
//Return default LL windlight settings
return new RegionLightShareData();
}
public void StoreRegionWindlightSettings(RegionLightShareData wl)
{
//This connector doesn't support the windlight module yet
}
public RegionSettings LoadRegionSettings(UUID regionUUID)
{
return null;
}
public void Shutdown()
{
throw new NotImplementedException();
}
}
public FakeStorageManager() : base(new FakeRegionDataStore())
{
}
public FakeStorageManager(IRegionDataStore storage) : this()
{
}
public FakeStorageManager(string dllName, string connectionstring, string estateconnectionstring) : this()
{
}
}
[Test]
public void TestConstructor()
{
RegionInfo regionInfo = new RegionInfo(0,0,null,null);
FakeStorageManager storageManager = new FakeStorageManager();
new Scene(regionInfo, null, null, storageManager, null, false, false, false, null, null);
}
}
}

View File

@ -109,6 +109,9 @@ namespace OpenSim.Server.Handlers.Grid
case "get_fallback_regions":
return GetFallbackRegions(request);
case "get_hyperlinks":
return GetHyperlinks(request);
case "get_region_flags":
return GetRegionFlags(request);
}
@ -483,6 +486,36 @@ namespace OpenSim.Server.Handlers.Grid
return encoding.GetBytes(xmlString);
}
byte[] GetHyperlinks(Dictionary<string, object> request)
{
//m_log.DebugFormat("[GRID HANDLER]: GetHyperlinks");
UUID scopeID = UUID.Zero;
if (request.ContainsKey("SCOPEID"))
UUID.TryParse(request["SCOPEID"].ToString(), out scopeID);
else
m_log.WarnFormat("[GRID HANDLER]: no scopeID in request to get linked regions");
List<GridRegion> rinfos = m_GridService.GetHyperlinks(scopeID);
Dictionary<string, object> result = new Dictionary<string, object>();
if ((rinfos == null) || ((rinfos != null) && (rinfos.Count == 0)))
result["result"] = "null";
else
{
int i = 0;
foreach (GridRegion rinfo in rinfos)
{
Dictionary<string, object> rinfoDict = rinfo.ToKeyValuePairs();
result["region" + i] = rinfoDict;
i++;
}
}
string xmlString = ServerUtils.BuildXmlResponse(result);
//m_log.DebugFormat("[GRID HANDLER]: resp string: {0}", xmlString);
UTF8Encoding encoding = new UTF8Encoding();
return encoding.GetBytes(xmlString);
}
byte[] GetRegionFlags(Dictionary<string, object> request)
{
UUID scopeID = UUID.Zero;

View File

@ -66,7 +66,8 @@ namespace OpenSim.Server.Handlers.Land
uint y = Convert.ToUInt32(requestData["y"]);
m_log.DebugFormat("[LAND HANDLER]: Got request for land data at {0}, {1} for region {2}", x, y, regionHandle);
LandData landData = m_LocalService.GetLandData(regionHandle, x, y);
byte regionAccess;
LandData landData = m_LocalService.GetLandData(regionHandle, x, y, out regionAccess);
Hashtable hash = new Hashtable();
if (landData != null)
{
@ -83,6 +84,7 @@ namespace OpenSim.Server.Handlers.Land
hash["SalePrice"] = landData.SalePrice.ToString();
hash["SnapshotID"] = landData.SnapshotID.ToString();
hash["UserLocation"] = landData.UserLocation.ToString();
hash["RegionAccess"] = regionAccess.ToString();
}
XmlRpcResponse response = new XmlRpcResponse();

View File

@ -556,6 +556,56 @@ namespace OpenSim.Services.Connectors
return rinfos;
}
public List<GridRegion> GetHyperlinks(UUID scopeID)
{
Dictionary<string, object> sendData = new Dictionary<string, object>();
sendData["SCOPEID"] = scopeID.ToString();
sendData["METHOD"] = "get_hyperlinks";
List<GridRegion> rinfos = new List<GridRegion>();
string reply = string.Empty;
try
{
reply = SynchronousRestFormsRequester.MakeRequest("POST",
m_ServerURI + "/grid",
ServerUtils.BuildQueryString(sendData));
//m_log.DebugFormat("[GRID CONNECTOR]: reply was {0}", reply);
}
catch (Exception e)
{
m_log.DebugFormat("[GRID CONNECTOR]: Exception when contacting grid server: {0}", e.Message);
return rinfos;
}
if (reply != string.Empty)
{
Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply);
if (replyData != null)
{
Dictionary<string, object>.ValueCollection rinfosList = replyData.Values;
foreach (object r in rinfosList)
{
if (r is Dictionary<string, object>)
{
GridRegion rinfo = new GridRegion((Dictionary<string, object>)r);
rinfos.Add(rinfo);
}
}
}
else
m_log.DebugFormat("[GRID CONNECTOR]: GetHyperlinks {0} received null response",
scopeID);
}
else
m_log.DebugFormat("[GRID CONNECTOR]: GetHyperlinks received null reply");
return rinfos;
}
public virtual int GetRegionFlags(UUID scopeID, UUID regionID)
{
Dictionary<string, object> sendData = new Dictionary<string, object>();

View File

@ -64,7 +64,7 @@ namespace OpenSim.Services.Connectors
m_GridService = gridServices;
}
public virtual LandData GetLandData(ulong regionHandle, uint x, uint y)
public virtual LandData GetLandData(ulong regionHandle, uint x, uint y, out byte regionAccess)
{
LandData landData = null;
Hashtable hash = new Hashtable();
@ -74,6 +74,7 @@ namespace OpenSim.Services.Connectors
IList paramList = new ArrayList();
paramList.Add(hash);
regionAccess = 42; // Default to adult. Better safe...
try
{
@ -109,6 +110,8 @@ namespace OpenSim.Services.Connectors
landData.SalePrice = Convert.ToInt32(hash["SalePrice"]);
landData.SnapshotID = new UUID((string)hash["SnapshotID"]);
landData.UserLocation = Vector3.Parse((string)hash["UserLocation"]);
if (hash["RegionAccess"] != null)
regionAccess = (byte)Convert.ToInt32((string)hash["RegionAccess"]);
m_log.DebugFormat("[OGS1 GRID SERVICES] Got land data for parcel {0}", landData.Name);
}
catch (Exception e)

View File

@ -359,6 +359,12 @@ namespace OpenSim.Services.Connectors.SimianGrid
return new List<GridRegion>(0);
}
public List<GridRegion> GetHyperlinks(UUID scopeID)
{
// Hypergrid/linked regions are not supported
return new List<GridRegion>();
}
public int GetRegionFlags(UUID scopeID, UUID regionID)
{
const int REGION_ONLINE = 4;

View File

@ -426,6 +426,22 @@ namespace OpenSim.Services.GridService
return ret;
}
public List<GridRegion> GetHyperlinks(UUID scopeID)
{
List<GridRegion> ret = new List<GridRegion>();
List<RegionData> regions = m_Database.GetHyperlinks(scopeID);
foreach (RegionData r in regions)
{
if ((Convert.ToInt32(r.Data["flags"]) & (int)OpenSim.Data.RegionFlags.RegionOnline) != 0)
ret.Add(RegionData2RegionInfo(r));
}
m_log.DebugFormat("[GRID SERVICE]: Hyperlinks returned {0} regions", ret.Count);
return ret;
}
public int GetRegionFlags(UUID scopeID, UUID regionID)
{
RegionData region = m_Database.Get(regionID, scopeID);

View File

@ -62,6 +62,7 @@ namespace OpenSim.Services.GridService
protected GatekeeperServiceConnector m_GatekeeperConnector;
protected UUID m_ScopeID = UUID.Zero;
protected bool m_Check4096 = true;
// Hyperlink regions are hyperlinks on the map
public readonly Dictionary<UUID, GridRegion> m_HyperlinkRegions = new Dictionary<UUID, GridRegion>();
@ -116,6 +117,8 @@ namespace OpenSim.Services.GridService
if (scope != string.Empty)
UUID.TryParse(scope, out m_ScopeID);
m_Check4096 = gridConfig.GetBoolean("Check4096", true);
m_GatekeeperConnector = new GatekeeperServiceConnector(m_AssetService);
m_log.DebugFormat("[HYPERGRID LINKER]: Loaded all services...");
@ -277,7 +280,7 @@ namespace OpenSim.Services.GridService
}
uint x, y;
if (!Check4096(handle, out x, out y))
if (m_Check4096 && !Check4096(handle, out x, out y))
{
RemoveHyperlinkRegion(regInfo.RegionID);
reason = "Region is too far (" + x + ", " + y + ")";
@ -332,18 +335,50 @@ namespace OpenSim.Services.GridService
/// <returns></returns>
public bool Check4096(ulong realHandle, out uint x, out uint y)
{
GridRegion defRegion = DefaultRegion;
uint ux = 0, uy = 0;
Utils.LongToUInts(realHandle, out ux, out uy);
x = ux / Constants.RegionSize;
y = uy / Constants.RegionSize;
if ((Math.Abs((int)defRegion.RegionLocX - ux) >= 4096 * Constants.RegionSize) ||
(Math.Abs((int)defRegion.RegionLocY - uy) >= 4096 * Constants.RegionSize))
const uint limit = (4096 - 1) * Constants.RegionSize;
uint xmin = ux - limit;
uint xmax = ux + limit;
uint ymin = uy - limit;
uint ymax = uy + limit;
// World map boundary checks
if (xmin < 0 || xmin > ux)
xmin = 0;
if (xmax > int.MaxValue || xmax < ux)
xmax = int.MaxValue;
if (ymin < 0 || ymin > uy)
ymin = 0;
if (ymax > int.MaxValue || ymax < uy)
ymax = int.MaxValue;
// Check for any regions that are within the possible teleport range to the linked region
List<GridRegion> regions = m_GridService.GetRegionRange(m_ScopeID, (int)xmin, (int)xmax, (int)ymin, (int)ymax);
if (regions.Count == 0)
{
return false;
}
else
{
// Check for regions which are not linked regions
List<GridRegion> hyperlinks = m_GridService.GetHyperlinks(m_ScopeID);
// would like to use .Except, but doesn't seem to exist
//IEnumerable<GridRegion> availableRegions = regions.Except(hyperlinks);
List<GridRegion> availableRegions = regions.FindAll(delegate(GridRegion region)
{
// Ewww! n^2
if (hyperlinks.Find(delegate(GridRegion r) { return r.RegionID == region.RegionID; }) == null) // not hyperlink. good.
return true;
return false;
});
if (availableRegions.Count == 0)
return false;
}
return true;
}

View File

@ -92,6 +92,7 @@ namespace OpenSim.Services.Interfaces
List<GridRegion> GetDefaultRegions(UUID scopeID);
List<GridRegion> GetFallbackRegions(UUID scopeID, int x, int y);
List<GridRegion> GetHyperlinks(UUID scopeID);
int GetRegionFlags(UUID scopeID, UUID regionID);
}

View File

@ -33,6 +33,6 @@ namespace OpenSim.Services.Interfaces
{
public interface ILandService
{
LandData GetLandData(ulong regionHandle, uint x, uint y);
LandData GetLandData(ulong regionHandle, uint x, uint y, out byte regionAccess);
}
}

File diff suppressed because it is too large Load Diff

View File

@ -54,6 +54,8 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003
LocalServiceModule = "OpenSim.Services.GridService.dll:GridService"
Realm = "regions"
; AllowDuplicateNames = "True"
; Check4096 = "False"
;; Next, we can specify properties of regions, including default and fallback regions
;; The syntax is: Region_<RegionName> = "<flags>"
;; or: Region_<RegionID> = "<flags>"

View File

@ -48,6 +48,9 @@
;;--- For MySql region storage (alternative)
;StorageProvider = "OpenSim.Data.MySQL.dll:MySqlRegionData"
; If HG, do you want this check on the distance to be performed?
; Check4096 = "False"
;; Next, we can specify properties of regions, including default and fallback regions
;; The syntax is: Region_<RegioName> = "<flags>"
;; where <flags> can be DefaultRegion, FallbackRegion, NoDirectLogin, Persistent, LockedOut

3
bin/hdfsdll.dll.config Normal file
View File

@ -0,0 +1,3 @@
<configuration>
<dllmap dll="hdfsdll" target="./hdfsdll.so" />
</configuration>

BIN
bin/hdfsdll.so Executable file

Binary file not shown.

BIN
bin/xmrhelpers.so Executable file

Binary file not shown.

View File

@ -2950,6 +2950,7 @@
<ReferencePath>../../../bin/</ReferencePath>
<Reference name="System"/>
<Reference name="System.Core"/>
<Reference name="System.Xml"/>
<Reference name="System.Drawing"/>
<Reference name="OpenMetaverseTypes.dll"/>