Merge branch 'master' into careminster-presence-refactor
commit
e05f728b08
|
@ -323,7 +323,7 @@ namespace OpenSim.Data.Tests
|
||||||
.IgnoreProperty(x => x.InvType)
|
.IgnoreProperty(x => x.InvType)
|
||||||
.IgnoreProperty(x => x.CreatorIdAsUuid)
|
.IgnoreProperty(x => x.CreatorIdAsUuid)
|
||||||
.IgnoreProperty(x => x.Description)
|
.IgnoreProperty(x => x.Description)
|
||||||
.IgnoreProperty(x => x.CreatorId)
|
.IgnoreProperty(x => x.CreatorIdentification)
|
||||||
.IgnoreProperty(x => x.CreatorData));
|
.IgnoreProperty(x => x.CreatorData));
|
||||||
|
|
||||||
inventoryScrambler.Scramble(expected);
|
inventoryScrambler.Scramble(expected);
|
||||||
|
@ -334,7 +334,7 @@ namespace OpenSim.Data.Tests
|
||||||
.IgnoreProperty(x => x.InvType)
|
.IgnoreProperty(x => x.InvType)
|
||||||
.IgnoreProperty(x => x.CreatorIdAsUuid)
|
.IgnoreProperty(x => x.CreatorIdAsUuid)
|
||||||
.IgnoreProperty(x => x.Description)
|
.IgnoreProperty(x => x.Description)
|
||||||
.IgnoreProperty(x => x.CreatorId)
|
.IgnoreProperty(x => x.CreatorIdentification)
|
||||||
.IgnoreProperty(x => x.CreatorData));
|
.IgnoreProperty(x => x.CreatorData));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -51,8 +51,16 @@ namespace OpenSim.Framework
|
||||||
string[] parts = temp.Split('\n');
|
string[] parts = temp.Split('\n');
|
||||||
int.TryParse(parts[0].Substring(17, 1), out Version);
|
int.TryParse(parts[0].Substring(17, 1), out Version);
|
||||||
UUID.TryParse(parts[1].Substring(10, 36), out RegionID);
|
UUID.TryParse(parts[1].Substring(10, 36), out RegionID);
|
||||||
// the vector is stored with spaces as separators, not with commas ("10.3 32.5 43" instead of "10.3, 32.5, 43")
|
// The position is a vector with spaces as separators ("10.3 32.5 43").
|
||||||
Vector3.TryParse(parts[2].Substring(10, parts[2].Length - 10).Replace(" ", ","), out Position);
|
// Parse each scalar separately to take into account the system's culture setting.
|
||||||
|
string[] scalars = parts[2].Substring(10, parts[2].Length - 10).Split(' ');
|
||||||
|
if (scalars.Length > 0)
|
||||||
|
System.Single.TryParse(scalars[0], out Position.X);
|
||||||
|
if (scalars.Length > 1)
|
||||||
|
System.Single.TryParse(scalars[1], out Position.Y);
|
||||||
|
if (scalars.Length > 2)
|
||||||
|
System.Single.TryParse(scalars[2], out Position.Z);
|
||||||
|
|
||||||
ulong.TryParse(parts[3].Substring(14, parts[3].Length - 14), out RegionHandle);
|
ulong.TryParse(parts[3].Substring(14, parts[3].Length - 14), out RegionHandle);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2385,15 +2385,13 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
newObject.RootPart.ParentGroup.CreateScriptInstances(0, false, DefaultScriptEngine, 2);
|
newObject.RootPart.ParentGroup.CreateScriptInstances(0, false, DefaultScriptEngine, GetStateSource(newObject));
|
||||||
|
|
||||||
newObject.ResumeScripts();
|
newObject.ResumeScripts();
|
||||||
|
|
||||||
// Do this as late as possible so that listeners have full access to the incoming object
|
// Do this as late as possible so that listeners have full access to the incoming object
|
||||||
EventManager.TriggerOnIncomingSceneObject(newObject);
|
EventManager.TriggerOnIncomingSceneObject(newObject);
|
||||||
|
|
||||||
TriggerChangedTeleport(newObject);
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2520,7 +2518,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void TriggerChangedTeleport(SceneObjectGroup sog)
|
private int GetStateSource(SceneObjectGroup sog)
|
||||||
{
|
{
|
||||||
ScenePresence sp = GetScenePresence(sog.OwnerID);
|
ScenePresence sp = GetScenePresence(sog.OwnerID);
|
||||||
|
|
||||||
|
@ -2531,13 +2529,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
if (aCircuit != null && (aCircuit.teleportFlags != (uint)TeleportFlags.Default))
|
if (aCircuit != null && (aCircuit.teleportFlags != (uint)TeleportFlags.Default))
|
||||||
{
|
{
|
||||||
// This will get your attention
|
// This will get your attention
|
||||||
//m_log.Error("[XXX] Triggering ");
|
//m_log.Error("[XXX] Triggering CHANGED_TELEPORT");
|
||||||
|
|
||||||
// Trigger CHANGED_TELEPORT
|
return 5; // StateSource.Teleporting
|
||||||
sp.Scene.EventManager.TriggerOnScriptChangedEvent(sog.LocalId, (uint)Changed.TELEPORT);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
return 2; // StateSource.PrimCrossing
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
|
@ -85,6 +85,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// <param name="assetType">The type of the asset for the uuid given</param>
|
/// <param name="assetType">The type of the asset for the uuid given</param>
|
||||||
/// <param name="assetUuids">The assets gathered</param>
|
/// <param name="assetUuids">The assets gathered</param>
|
||||||
public void GatherAssetUuids(UUID assetUuid, AssetType assetType, IDictionary<UUID, AssetType> assetUuids)
|
public void GatherAssetUuids(UUID assetUuid, AssetType assetType, IDictionary<UUID, AssetType> assetUuids)
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
assetUuids[assetUuid] = assetType;
|
assetUuids[assetUuid] = assetType;
|
||||||
|
|
||||||
|
@ -105,6 +107,14 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
GetSceneObjectAssetUuids(assetUuid, assetUuids);
|
GetSceneObjectAssetUuids(assetUuid, assetUuids);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
m_log.ErrorFormat(
|
||||||
|
"[UUID GATHERER]: Failed to gather uuids for asset id {0}, type {1}",
|
||||||
|
assetUuid, assetType);
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gather all the asset uuids associated with a given object.
|
/// Gather all the asset uuids associated with a given object.
|
||||||
|
|
|
@ -42,7 +42,8 @@ namespace OpenSim.Region.ScriptEngine.Interfaces
|
||||||
NewRez = 1,
|
NewRez = 1,
|
||||||
PrimCrossing = 2,
|
PrimCrossing = 2,
|
||||||
ScriptedRez = 3,
|
ScriptedRez = 3,
|
||||||
AttachedRez = 4
|
AttachedRez = 4,
|
||||||
|
Teleporting = 5
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface IScriptWorkItem
|
public interface IScriptWorkItem
|
||||||
|
|
|
@ -393,15 +393,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
|
||||||
{
|
{
|
||||||
//m_log.Debug("[Script] Posted changed(CHANGED_REGION_RESTART) to script");
|
//m_log.Debug("[Script] Posted changed(CHANGED_REGION_RESTART) to script");
|
||||||
PostEvent(new EventParams("changed",
|
PostEvent(new EventParams("changed",
|
||||||
new Object[] { new LSL_Types.LSLInteger((int)Changed.REGION_RESTART) },
|
new Object[] { new LSL_Types.LSLInteger((int)Changed.REGION_RESTART) }, new DetectParams[0]));
|
||||||
new DetectParams[0]));
|
|
||||||
}
|
}
|
||||||
else if (m_stateSource == StateSource.PrimCrossing)
|
else if (m_stateSource == StateSource.PrimCrossing || m_stateSource == StateSource.Teleporting)
|
||||||
{
|
{
|
||||||
// CHANGED_REGION
|
// CHANGED_REGION
|
||||||
PostEvent(new EventParams("changed",
|
PostEvent(new EventParams("changed",
|
||||||
new Object[] { new LSL_Types.LSLInteger((int)Changed.REGION) },
|
new Object[] { new LSL_Types.LSLInteger((int)Changed.REGION) }, new DetectParams[0]));
|
||||||
new DetectParams[0]));
|
|
||||||
|
// CHANGED_TELEPORT
|
||||||
|
if (m_stateSource == StateSource.Teleporting)
|
||||||
|
PostEvent(new EventParams("changed",
|
||||||
|
new Object[] { new LSL_Types.LSLInteger((int)Changed.TELEPORT) }, new DetectParams[0]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -47,6 +47,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
{
|
{
|
||||||
|
|
||||||
private const double ANGLE_ACCURACY_IN_RADIANS = 1E-6;
|
private const double ANGLE_ACCURACY_IN_RADIANS = 1E-6;
|
||||||
|
private const double VECTOR_COMPONENT_ACCURACY = 0.0000005d;
|
||||||
private LSL_Api m_lslApi;
|
private LSL_Api m_lslApi;
|
||||||
|
|
||||||
[SetUp]
|
[SetUp]
|
||||||
|
@ -164,5 +165,28 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
Assert.Greater(eulerCalc.z, eulerCheck.z - ANGLE_ACCURACY_IN_RADIANS, "TestllRot2Euler Z lower bounds check fail");
|
Assert.Greater(eulerCalc.z, eulerCheck.z - ANGLE_ACCURACY_IN_RADIANS, "TestllRot2Euler Z lower bounds check fail");
|
||||||
Assert.Less(eulerCalc.z, eulerCheck.z + ANGLE_ACCURACY_IN_RADIANS, "TestllRot2Euler Z upper bounds check fail");
|
Assert.Less(eulerCalc.z, eulerCheck.z + ANGLE_ACCURACY_IN_RADIANS, "TestllRot2Euler Z upper bounds check fail");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
// llVecNorm test.
|
||||||
|
public void TestllVecNorm()
|
||||||
|
{
|
||||||
|
// Check special case for normalizing zero vector.
|
||||||
|
CheckllVecNorm(new LSL_Types.Vector3(0.0d, 0.0d, 0.0d), new LSL_Types.Vector3(0.0d, 0.0d, 0.0d));
|
||||||
|
// Check various vectors.
|
||||||
|
CheckllVecNorm(new LSL_Types.Vector3(10.0d, 25.0d, 0.0d), new LSL_Types.Vector3(0.371391d, 0.928477d, 0.0d));
|
||||||
|
CheckllVecNorm(new LSL_Types.Vector3(1.0d, 0.0d, 0.0d), new LSL_Types.Vector3(1.0d, 0.0d, 0.0d));
|
||||||
|
CheckllVecNorm(new LSL_Types.Vector3(-90.0d, 55.0d, 2.0d), new LSL_Types.Vector3(-0.853128d, 0.521356d, 0.018958d));
|
||||||
|
CheckllVecNorm(new LSL_Types.Vector3(255.0d, 255.0d, 255.0d), new LSL_Types.Vector3(0.577350d, 0.577350d, 0.577350d));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void CheckllVecNorm(LSL_Types.Vector3 vec, LSL_Types.Vector3 vecNormCheck)
|
||||||
|
{
|
||||||
|
// Call LSL function to normalize the vector.
|
||||||
|
LSL_Types.Vector3 vecNorm = m_lslApi.llVecNorm(vec);
|
||||||
|
// Check each vector component against expected result.
|
||||||
|
Assert.AreEqual(vecNorm.x, vecNormCheck.x, VECTOR_COMPONENT_ACCURACY, "TestllVecNorm vector check fail on x component");
|
||||||
|
Assert.AreEqual(vecNorm.y, vecNormCheck.y, VECTOR_COMPONENT_ACCURACY, "TestllVecNorm vector check fail on y component");
|
||||||
|
Assert.AreEqual(vecNorm.z, vecNormCheck.z, VECTOR_COMPONENT_ACCURACY, "TestllVecNorm vector check fail on z component");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue