Merge branch 'master' into test-merge0418

This commit is contained in:
Mic Bowman
2011-04-18 11:29:43 -07:00
22 changed files with 626 additions and 801 deletions

View File

@@ -296,11 +296,14 @@ namespace OpenSim.Region.Framework.Scenes
{
Vector3 val = value;
if ((m_scene.TestBorderCross(val - Vector3.UnitX, Cardinals.E) || m_scene.TestBorderCross(val + Vector3.UnitX, Cardinals.W)
|| m_scene.TestBorderCross(val - Vector3.UnitY, Cardinals.N) || m_scene.TestBorderCross(val + Vector3.UnitY, Cardinals.S))
&& !IsAttachmentCheckFull() && (!m_scene.LoadingPrims))
if (Scene != null)
{
m_scene.CrossPrimGroupIntoNewRegion(val, this, true);
if ((Scene.TestBorderCross(val - Vector3.UnitX, Cardinals.E) || Scene.TestBorderCross(val + Vector3.UnitX, Cardinals.W)
|| Scene.TestBorderCross(val - Vector3.UnitY, Cardinals.N) || Scene.TestBorderCross(val + Vector3.UnitY, Cardinals.S))
&& !IsAttachmentCheckFull() && (!Scene.LoadingPrims))
{
m_scene.CrossPrimGroupIntoNewRegion(val, this, true);
}
}
if (RootPart.GetStatusSandbox())
@@ -308,8 +311,11 @@ namespace OpenSim.Region.Framework.Scenes
if (Util.GetDistanceTo(RootPart.StatusSandboxPos, value) > 10)
{
RootPart.ScriptSetPhysicsStatus(false);
Scene.SimChat(Utils.StringToBytes("Hit Sandbox Limit"),
ChatTypeEnum.DebugChannel, 0x7FFFFFFF, RootPart.AbsolutePosition, Name, UUID, false);
if (Scene != null)
Scene.SimChat(Utils.StringToBytes("Hit Sandbox Limit"),
ChatTypeEnum.DebugChannel, 0x7FFFFFFF, RootPart.AbsolutePosition, Name, UUID, false);
return;
}
}
@@ -326,7 +332,8 @@ namespace OpenSim.Region.Framework.Scenes
//m_scene.PhysicsScene.AddPhysicsActorTaint(m_rootPart.PhysActor);
//}
m_scene.EventManager.TriggerParcelPrimCountTainted();
if (Scene != null)
Scene.EventManager.TriggerParcelPrimCountTainted();
}
}

View File

@@ -55,11 +55,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
/// <param name="coa"></param>
/// <returns></returns>
public static string ToXml(CoalescedSceneObjects coa)
{
// TODO: Should probably return an empty xml serialization rather than a blank string
if (!coa.HasObjects)
return "";
{
using (StringWriter sw = new StringWriter())
{
using (XmlTextWriter writer = new XmlTextWriter(sw))
@@ -105,10 +101,49 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
string output = sw.ToString();
// m_log.Debug(output);
// Console.WriteLine(output);
return output;
}
}
public static bool TryFromXml(string xml, out CoalescedSceneObjects coa)
{
// m_log.DebugFormat("[COALESCED SCENE OBJECTS SERIALIZER]: TryFromXml() deserializing {0}", xml);
coa = null;
using (StringReader sr = new StringReader(xml))
{
using (XmlTextReader reader = new XmlTextReader(sr))
{
reader.Read();
if (reader.Name != "CoalescedObject")
{
// m_log.DebugFormat(
// "[COALESCED SCENE OBJECTS SERIALIZER]: TryFromXml() root element was {0} so returning false",
// reader.Name);
return false;
}
coa = new CoalescedSceneObjects(UUID.Zero);
reader.Read();
while (reader.NodeType != XmlNodeType.EndElement && reader.Name != "CoalescedObject")
{
if (reader.Name == "SceneObjectGroup")
{
string soXml = reader.ReadOuterXml();
coa.Add(SceneObjectSerializer.FromOriginalXmlFormat(soXml));
}
}
reader.ReadEndElement(); // CoalescedObject
}
}
return true;
}
}
}

View File

@@ -117,11 +117,11 @@ namespace OpenSim.Region.Framework.Scenes.Tests
ISharedRegionModule interregionComms = new LocalSimulationConnectorModule();
Scene sceneB = SceneSetupHelpers.SetupScene("sceneB", sceneBId, 1010, 1010, "grid");
Scene sceneB = SceneSetupHelpers.SetupScene("sceneB", sceneBId, 1010, 1010);
SceneSetupHelpers.SetupSceneModules(sceneB, new IniConfigSource(), interregionComms);
sceneB.RegisterRegionWithGrid();
Scene sceneA = SceneSetupHelpers.SetupScene("sceneA", sceneAId, 1000, 1000, "grid");
Scene sceneA = SceneSetupHelpers.SetupScene("sceneA", sceneAId, 1000, 1000);
SceneSetupHelpers.SetupSceneModules(sceneA, new IniConfigSource(), interregionComms);
sceneA.RegisterRegionWithGrid();

View File

@@ -101,7 +101,7 @@ namespace OpenSim.Region.Framework.Tests
TestHelper.InMethod();
// log4net.Config.XmlConfigurator.Configure();
Scene scene = SceneSetupHelpers.SetupScene("inventory");
Scene scene = SceneSetupHelpers.SetupScene();
UserAccount user1 = CreateUser(scene);
SceneObjectGroup sog1 = CreateSO1(scene, user1.PrincipalID);
SceneObjectPart sop1 = sog1.RootPart;
@@ -127,7 +127,7 @@ namespace OpenSim.Region.Framework.Tests
TestHelper.InMethod();
// log4net.Config.XmlConfigurator.Configure();
Scene scene = SceneSetupHelpers.SetupScene("inventory");
Scene scene = SceneSetupHelpers.SetupScene();
UserAccount user1 = CreateUser(scene);
SceneObjectGroup sog1 = CreateSO1(scene, user1.PrincipalID);
SceneObjectPart sop1 = sog1.RootPart;

View File

@@ -47,7 +47,9 @@ namespace OpenSim.Region.Framework.Scenes.Tests
[SetUp]
public void Init()
{
m_assetService = new MockAssetService();
// FIXME: We don't need a full scene here - it would be enough to set up the asset service.
Scene scene = SceneSetupHelpers.SetupScene();
m_assetService = scene.AssetService;
m_uuidGatherer = new UuidGatherer(m_assetService);
}