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

avinationmerge
Melanie Thielker 2010-08-08 02:04:37 +02:00
commit d2b3d45d76
4 changed files with 636 additions and 617 deletions

View File

@ -318,7 +318,7 @@ namespace OpenSim.Region.Framework.Scenes
private bool m_scriptListens_atRotTarget = false; private bool m_scriptListens_atRotTarget = false;
private bool m_scriptListens_notAtRotTarget = false; private bool m_scriptListens_notAtRotTarget = false;
public bool m_dupeInProgress = false;
internal Dictionary<UUID, string> m_savedScriptState = null; internal Dictionary<UUID, string> m_savedScriptState = null;
#region Properties #region Properties
@ -476,9 +476,13 @@ namespace OpenSim.Region.Framework.Scenes
part.IgnoreUndoUpdate = false; part.IgnoreUndoUpdate = false;
part.StoreUndoState(UndoType.STATE_GROUP_POSITION); part.StoreUndoState(UndoType.STATE_GROUP_POSITION);
part.GroupPosition = val; part.GroupPosition = val;
if (!m_dupeInProgress)
{
part.TriggerScriptChangedEvent(Changed.POSITION); part.TriggerScriptChangedEvent(Changed.POSITION);
} }
}
if (!m_dupeInProgress)
{
foreach (ScenePresence av in m_linkedAvatars) foreach (ScenePresence av in m_linkedAvatars)
{ {
Vector3 offset = m_parts[av.LinkedPrim].GetWorldPosition() - av.ParentPosition; Vector3 offset = m_parts[av.LinkedPrim].GetWorldPosition() - av.ParentPosition;
@ -486,6 +490,7 @@ namespace OpenSim.Region.Framework.Scenes
av.ParentPosition = m_parts[av.LinkedPrim].GetWorldPosition(); //ParentPosition gets cleared by AbsolutePosition av.ParentPosition = m_parts[av.LinkedPrim].GetWorldPosition(); //ParentPosition gets cleared by AbsolutePosition
av.SendFullUpdateToAllClients(); av.SendFullUpdateToAllClients();
} }
}
//if (m_rootPart.PhysActor != null) //if (m_rootPart.PhysActor != null)
//{ //{
@ -1801,7 +1806,11 @@ namespace OpenSim.Region.Framework.Scenes
/// <returns></returns> /// <returns></returns>
public SceneObjectGroup Copy(bool userExposed) public SceneObjectGroup Copy(bool userExposed)
{ {
SceneObjectGroup dupe = (SceneObjectGroup)MemberwiseClone(); SceneObjectGroup dupe;
try
{
m_dupeInProgress = true;
dupe = (SceneObjectGroup)MemberwiseClone();
dupe.m_isBackedUp = false; dupe.m_isBackedUp = false;
dupe.m_parts = new Dictionary<UUID, SceneObjectPart>(); dupe.m_parts = new Dictionary<UUID, SceneObjectPart>();
@ -1881,7 +1890,11 @@ namespace OpenSim.Region.Framework.Scenes
ScheduleGroupForFullUpdate(); ScheduleGroupForFullUpdate();
} }
}
finally
{
m_dupeInProgress = false;
}
return dupe; return dupe;
} }

View File

@ -720,6 +720,8 @@ namespace OpenSim.Region.Framework.Scenes
m_parentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(actor); m_parentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(actor);
} }
if (!m_parentGroup.m_dupeInProgress)
{
List<ScenePresence> avs = ParentGroup.GetLinkedAvatars(); List<ScenePresence> avs = ParentGroup.GetLinkedAvatars();
foreach (ScenePresence av in avs) foreach (ScenePresence av in avs)
{ {
@ -731,6 +733,7 @@ namespace OpenSim.Region.Framework.Scenes
} }
} }
} }
}
TriggerScriptChangedEvent(Changed.POSITION); TriggerScriptChangedEvent(Changed.POSITION);
} }
} }

View File

@ -2007,7 +2007,7 @@ namespace OpenSim.Region.Framework.Scenes
if (autopilot) if (autopilot)
{ // its not a scripted sit { // its not a scripted sit
// if (Util.GetDistanceTo(AbsolutePosition, autopilotTarget) < 4.5) // if (Util.GetDistanceTo(AbsolutePosition, autopilotTarget) < 4.5)
if( (Math.Abs(AbsolutePosition.X - autopilotTarget.X) < 10.0f) && (Math.Abs(AbsolutePosition.Y - autopilotTarget.Y) < 10.0f) ) if( (Math.Abs(AbsolutePosition.X - autopilotTarget.X) < 256.0f) && (Math.Abs(AbsolutePosition.Y - autopilotTarget.Y) < 256.0f) )
{ {
autopilot = false; // close enough autopilot = false; // close enough
m_lastWorldPosition = m_pos; /* CW - This give us a position to return the avatar to if the part is killed before standup. m_lastWorldPosition = m_pos; /* CW - This give us a position to return the avatar to if the part is killed before standup.
@ -2053,9 +2053,13 @@ namespace OpenSim.Region.Framework.Scenes
//Console.WriteLine("Camera Eye ={0}", cameraEyeOffset); //Console.WriteLine("Camera Eye ={0}", cameraEyeOffset);
//NOTE: SendSitResponse should be relative to the GROUP *NOT* THE PRIM if we're sitting on a child //NOTE: SendSitResponse should be relative to the GROUP *NOT* THE PRIM if we're sitting on a child
ControllingClient.SendSitResponse(part.ParentGroup.UUID, ((offset * part.RotationOffset) + part.OffsetPosition), sitOrientation, autopilot, cameraAtOffset, cameraEyeOffset, forceMouselook); Quaternion roffset = Quaternion.Identity;
if (SitTargetisSet)
{
roffset = part.RotationOffset;
}
ControllingClient.SendSitResponse(part.ParentGroup.UUID, ((offset * roffset) + part.OffsetPosition), sitOrientation / part.RotationOffset, autopilot, cameraAtOffset, cameraEyeOffset, forceMouselook);
m_requestedSitTargetUUID = part.UUID; //KF: Correct autopilot target
// This calls HandleAgentSit twice, once from here, and the client calls // This calls HandleAgentSit twice, once from here, and the client calls
// HandleAgentSit itself after it gets to the location // HandleAgentSit itself after it gets to the location
// It doesn't get to the location until we've moved them there though // It doesn't get to the location until we've moved them there though
@ -2375,7 +2379,6 @@ namespace OpenSim.Region.Framework.Scenes
m_parentPosition = part.AbsolutePosition; m_parentPosition = part.AbsolutePosition;
part.IsOccupied = true; part.IsOccupied = true;
part.ParentGroup.AddAvatar(agentID); part.ParentGroup.AddAvatar(agentID);
Console.WriteLine("Scripted Sit ofset {0}", m_pos);
} }
else else
{ {
@ -2441,7 +2444,7 @@ Console.WriteLine("Scripted Sit ofset {0}", m_pos);
} }
m_linkedPrim = part.UUID; m_linkedPrim = part.UUID;
m_offsetRotation = m_offsetRotation / part.RotationOffset;
Velocity = Vector3.Zero; Velocity = Vector3.Zero;
RemoveFromPhysicalScene(); RemoveFromPhysicalScene();
Animator.TrySetMovementAnimation(sitAnimation); Animator.TrySetMovementAnimation(sitAnimation);

View File

@ -250,7 +250,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if (toadd.Length > 0) if (toadd.Length > 0)
{ {
values.Add(rule); values.Add(new LSL_Integer(rule));
values.Add(toadd.Data[0]); values.Add(toadd.Data[0]);
} }
idx++; idx++;