From 13f141a4d521fc15618c2983c989805d9174b969 Mon Sep 17 00:00:00 2001
From: Mic Bowman
Date: Mon, 25 Apr 2011 15:36:59 -0700
Subject: Fix the totals shown by show throttle
---
OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs
index 50f1e2c..ca5501d 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs
@@ -183,7 +183,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
// Create a token bucket throttle for this client that has the scene token bucket as a parent
m_throttleClient = new AdaptiveTokenBucket(parentThrottle, rates.Total, rates.AdaptiveThrottlesEnabled);
// Create a token bucket throttle for the total categary with the client bucket as a throttle
- m_throttleCategory = new TokenBucket(m_throttleClient, rates.Total);
+ m_throttleCategory = new TokenBucket(m_throttleClient, 0);
// Create an array of token buckets for this clients different throttle categories
m_throttleCategories = new TokenBucket[THROTTLE_CATEGORY_COUNT];
--
cgit v1.1
From b9bca893efaeea3dd76dd3cb2082c181e5510b59 Mon Sep 17 00:00:00 2001
From: Mic Bowman
Date: Mon, 25 Apr 2011 16:13:16 -0700
Subject: Removed debug message in the token bucket code
---
OpenSim/Region/ClientStack/LindenUDP/TokenBucket.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/ClientStack/LindenUDP/TokenBucket.cs b/OpenSim/Region/ClientStack/LindenUDP/TokenBucket.cs
index 2ec79ab..29fd1a4 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/TokenBucket.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/TokenBucket.cs
@@ -365,7 +365,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if (m_enabled)
{
- m_log.WarnFormat("[TOKENBUCKET] Adaptive throttle enabled");
+ // m_log.DebugFormat("[TOKENBUCKET] Adaptive throttle enabled");
MaxDripRate = maxDripRate;
AdjustedDripRate = m_minimumFlow;
}
--
cgit v1.1
From 037373b825235235e89112abe81f985efa052c2a Mon Sep 17 00:00:00 2001
From: dahlia
Date: Mon, 25 Apr 2011 17:11:54 -0700
Subject: recover from unhandled exception from bad rotation data while
processing entity updates in LLClientView.cs
---
OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index 1f7e66d..0f7f666 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -4764,7 +4764,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP
data.RelativePosition.ToBytes(objectData, 0);
data.Velocity.ToBytes(objectData, 12);
data.Acceleration.ToBytes(objectData, 24);
- data.RotationOffset.ToBytes(objectData, 36);
+ try
+ {
+ data.RotationOffset.ToBytes(objectData, 36);
+ }
+ catch (Exception e)
+ {
+ m_log.Warn("[LLClientView]: exception converting quaternion to bytes, using Quaternion.Identity. Exception: " + e.ToString());
+ OpenMetaverse.Quaternion.Identity.ToBytes(objectData, 36);
+ }
data.AngularVelocity.ToBytes(objectData, 48);
ObjectUpdatePacket.ObjectDataBlock update = new ObjectUpdatePacket.ObjectDataBlock();
--
cgit v1.1
From 1505fbb647f72803efd39aa5e38ad39e6811f6fb Mon Sep 17 00:00:00 2001
From: Mic Bowman
Date: Tue, 26 Apr 2011 08:54:05 -0700
Subject: Add back the high prioritization for other avatars in the
BestAvatarResponsiveness prioritizer.
---
OpenSim/Region/Framework/Scenes/Prioritizer.cs | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/Framework/Scenes/Prioritizer.cs b/OpenSim/Region/Framework/Scenes/Prioritizer.cs
index a7637c0..4595a29 100644
--- a/OpenSim/Region/Framework/Scenes/Prioritizer.cs
+++ b/OpenSim/Region/Framework/Scenes/Prioritizer.cs
@@ -165,18 +165,20 @@ namespace OpenSim.Region.Framework.Scenes
{
if (!presence.IsChildAgent)
{
+ // All avatars other than our own go into pqueue 1
+ if (entity is ScenePresence)
+ return 1;
+
if (entity is SceneObjectPart)
{
+ // Attachments are high priority,
+ if (((SceneObjectPart)entity).ParentGroup.RootPart.IsAttachment)
+ return 1;
+
// Non physical prims are lower priority than physical prims
PhysicsActor physActor = ((SceneObjectPart)entity).ParentGroup.RootPart.PhysActor;
if (physActor == null || !physActor.IsPhysical)
pqueue++;
-
- // Attachments are high priority,
- // MIC: shouldn't these already be in the highest priority queue already
- // since their root position is same as the avatars?
- if (((SceneObjectPart)entity).ParentGroup.RootPart.IsAttachment)
- pqueue = 1;
}
}
}
--
cgit v1.1
From 16f6f55f2d203f9ef40fba85860bb9dbd416bd0f Mon Sep 17 00:00:00 2001
From: dahlia
Date: Tue, 26 Apr 2011 16:22:44 -0700
Subject: network traffic reduction - decrease update frequency for moving
avatars when velocity is unchanged
---
OpenSim/Region/Framework/Scenes/ScenePresence.cs | 34 +++++++++++++++++-------
1 file changed, 24 insertions(+), 10 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index ef0eb89..e4413a9 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -2340,12 +2340,14 @@ namespace OpenSim.Region.Framework.Scenes
#region Update Client(s)
+
///
/// Sends a location update to the client connected to this scenePresence
///
///
public void SendTerseUpdateToClient(IClientAPI remoteClient)
{
+
// If the client is inactive, it's getting its updates from another
// server.
if (remoteClient.IsActive)
@@ -2358,8 +2360,8 @@ namespace OpenSim.Region.Framework.Scenes
//m_log.DebugFormat("[SCENEPRESENCE]: TerseUpdate: Pos={0} Rot={1} Vel={2}", m_pos, m_bodyRot, m_velocity);
remoteClient.SendPrimUpdate(
- this,
- PrimUpdateFlags.Position | PrimUpdateFlags.Rotation | PrimUpdateFlags.Velocity
+ this,
+ PrimUpdateFlags.Position | PrimUpdateFlags.Rotation | PrimUpdateFlags.Velocity
| PrimUpdateFlags.Acceleration | PrimUpdateFlags.AngularVelocity);
m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS));
@@ -2367,16 +2369,31 @@ namespace OpenSim.Region.Framework.Scenes
}
}
+
+ // vars to support reduced update frequency when velocity is unchanged
+ private Vector3 lastVelocitySentToAllClients = Vector3.Zero;
+ private int lastTerseUpdateToAllClientsTick = Util.EnvironmentTickCount();
+
///
/// Send a location/velocity/accelleration update to all agents in scene
///
public void SendTerseUpdateToAllClients()
{
- m_perfMonMS = Util.EnvironmentTickCount();
-
- m_scene.ForEachClient(SendTerseUpdateToClient);
+ int currentTick = Util.EnvironmentTickCount();
- m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS));
+ // decrease update frequency when avatar is moving but velocity is not changing
+ if (m_velocity.Length() < 0.01f
+ || Vector3.Distance(lastVelocitySentToAllClients, m_velocity) > 0.01f
+ || currentTick - lastTerseUpdateToAllClientsTick > 1500)
+ {
+ m_perfMonMS = currentTick;
+ lastVelocitySentToAllClients = m_velocity;
+ lastTerseUpdateToAllClientsTick = currentTick;
+
+ m_scene.ForEachClient(SendTerseUpdateToClient);
+
+ m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS));
+ }
}
public void SendCoarseLocations(List coarseLocations, List avatarUUIDs)
@@ -3268,10 +3285,7 @@ namespace OpenSim.Region.Framework.Scenes
m_updateflag = true;
- // The magic constant 0.95f seems to make walking feel less jerky,
- // probably because it hackishly accounts for the overall latency of
- // these Velocity updates -- Diva
- Velocity = force * .95F;
+ Velocity = force;
m_forceToApply = null;
}
--
cgit v1.1
From 50aa93137d052c643a6ed44c32f0b4c5b32da79e Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Thu, 28 Apr 2011 00:59:21 +0100
Subject: Fix a bug where physical objects rezzed with an initial velocity by
script do not receive this velocity.
This is a minimal fix for the 0.7.1 release, pending a non copy/paste solution.
This hopefully addresses http://opensimulator.org/mantis/view.php?id=5457
The bug was introduced in commit 3ba5eeb
---
OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 6 ++++++
1 file changed, 6 insertions(+)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 0f85925..0b2b01a 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -2039,6 +2039,12 @@ namespace OpenSim.Region.Framework.Scenes
if (rot != null)
group.UpdateGroupRotationR((Quaternion)rot);
+ // TODO: This needs to be refactored with the similar code in
+ // SceneGraph.AddNewSceneObject(SceneObjectGroup sceneObject, bool attachToBackup, Vector3 pos, Quaternion rot, Vector3 vel)
+ // possibly by allowing this method to take a null rotation.
+ if (group.RootPart.PhysActor != null && group.RootPart.PhysActor.IsPhysical && vel != Vector3.Zero)
+ group.RootPart.ApplyImpulse((vel * group.GetMass()), false);
+
// We can only call this after adding the scene object, since the scene object references the scene
// to find out if scripts should be activated at all.
group.CreateScriptInstances(param, true, DefaultScriptEngine, 3);
--
cgit v1.1
From 549dc5aeb9e693f1f575896796d19b03ec3a732f Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Thu, 28 Apr 2011 08:58:04 -0700
Subject: Eliminated sAgentCircuitData, a data structure that has been obsolete
for quite some time.
---
OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index 22bad99..43903ce 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -11635,7 +11635,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
info.userEP = m_userEndPoint;
info.proxyEP = null;
- info.agentcircuit = new sAgentCircuitData(RequestClientInfo());
+ info.agentcircuit = RequestClientInfo();
return info;
}
--
cgit v1.1
From cd7517ccb9d522f5fecd57523285a0b17c147620 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Thu, 28 Apr 2011 22:59:12 +0100
Subject: Stop CHANGED_INVENTORY firing twice if a notecard is edited in prim.
Addresses http://opensimulator.org/mantis/view.php?id=5444
Fix is to stop the asset transaction calling UpdateInventoryItem() since the caller is doing it anyway, which is more correct.
This did not effect scripts.
---
.../Agent/AssetTransaction/AgentAssetsTransactions.cs | 9 +++++----
OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 4 ++++
OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | 7 +++++--
3 files changed, 14 insertions(+), 6 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs
index 771038e..9d8082b 100644
--- a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs
+++ b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs
@@ -41,8 +41,7 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
///
public class AgentAssetTransactions
{
-// private static readonly ILog m_log = LogManager.GetLogger(
-// MethodBase.GetCurrentMethod().DeclaringType);
+// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
// Fields
private bool m_dumpAssetsToFile;
@@ -149,6 +148,10 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
if (asset != null)
{
+// m_log.DebugFormat(
+// "[AGENT ASSETS TRANSACTIONS]: Updating item {0} in {1} for transaction {2}",
+// item.Name, part.Name, transactionID);
+
asset.FullID = UUID.Random();
asset.Name = item.Name;
asset.Description = item.Description;
@@ -156,8 +159,6 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
item.AssetID = asset.FullID;
m_Scene.AssetService.Store(asset);
-
- part.Inventory.UpdateInventoryItem(item);
}
}
}
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 0b2b01a..b0f0de6 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -1430,6 +1430,10 @@ namespace OpenSim.Region.Framework.Scenes
}
else // Updating existing item with new perms etc
{
+// m_log.DebugFormat(
+// "[PRIM INVENTORY]: Updating item {0} in {1} for UpdateTaskInventory()",
+// currentItem.Name, part.Name);
+
IAgentAssetTransactions agentTransactions = this.RequestModuleInterface();
if (agentTransactions != null)
{
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
index 3281eab..3b60f8c 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
@@ -693,8 +693,9 @@ namespace OpenSim.Region.Framework.Scenes
{
TaskInventoryItem it = GetInventoryItem(item.ItemID);
if (it != null)
-
{
+// m_log.DebugFormat("[PRIM INVENTORY]: Updating item {0} in {1}", item.Name, m_part.Name);
+
item.ParentID = m_part.UUID;
item.ParentPartID = m_part.UUID;
@@ -711,14 +712,16 @@ namespace OpenSim.Region.Framework.Scenes
m_items[item.ItemID] = item;
m_inventorySerial++;
}
-
+
if (fireScriptEvents)
m_part.TriggerScriptChangedEvent(Changed.INVENTORY);
+
if (considerChanged)
{
HasInventoryChanged = true;
m_part.ParentGroup.HasGroupChanged = true;
}
+
return true;
}
else
--
cgit v1.1
From 9892e115ccdcc8567087041917fb5c7694aa8836 Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Thu, 28 Apr 2011 20:19:54 -0700
Subject: Fatpack message on agent transfers: 1 message only (UpdateAgent)
containing the agent and all attachments. Preserves backwards compatibility
-- older sims get passed attachments one by one. Meaning that I finally
introduced versioning in the simulation service.
---
.../Avatar/Attachments/AttachmentsModule.cs | 13 +--
.../EntityTransfer/EntityTransferModule.cs | 61 +++++-----
.../EntityTransfer/HGEntityTransferModule.cs | 5 +-
.../Simulation/LocalSimulationConnector.cs | 6 +-
.../Simulation/RemoteSimulationConnector.cs | 7 +-
OpenSim/Region/Framework/Scenes/Scene.cs | 4 +-
.../Region/Framework/Scenes/SceneObjectGroup.cs | 2 +
OpenSim/Region/Framework/Scenes/ScenePresence.cs | 124 +++++----------------
8 files changed, 84 insertions(+), 138 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
index ff26264..520d794 100644
--- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
@@ -562,14 +562,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
///
///
///
- ///
+ ///
///
- protected void AttachToAgent(ScenePresence avatar, SceneObjectGroup so, uint attachmentpoint, Vector3 AttachOffset, bool silent)
+ protected void AttachToAgent(ScenePresence avatar, SceneObjectGroup so, uint attachmentpoint, Vector3 attachOffset, bool silent)
{
- // don't attach attachments to child agents
- if (avatar.IsChildAgent) return;
-// m_log.DebugFormat("[ATTACHMENTS MODULE]: Adding attachment {0} to avatar {1}", Name, avatar.Name);
+ m_log.DebugFormat("[ATTACHMENTS MODULE]: Adding attachment {0} to avatar {1} in pt {2} pos {3} {4}", Name, avatar.Name,
+ attachmentpoint, attachOffset, so.RootPart.AttachedPos);
so.DetachFromBackup();
@@ -590,8 +589,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
so.RootPart.PhysActor = null;
}
- so.AbsolutePosition = AttachOffset;
- so.RootPart.AttachedPos = AttachOffset;
+ so.AbsolutePosition = attachOffset;
+ so.RootPart.AttachedPos = attachOffset;
so.RootPart.IsAttachment = true;
so.RootPart.SetParentLocalId(avatar.LocalId);
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index c88be7d..1054785 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -285,11 +285,13 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
}
string reason;
- if (!m_aScene.SimulationService.QueryAccess(finalDestination, sp.ControllingClient.AgentId, Vector3.Zero, out reason))
+ string version;
+ if (!m_aScene.SimulationService.QueryAccess(finalDestination, sp.ControllingClient.AgentId, Vector3.Zero, out version, out reason))
{
sp.ControllingClient.SendTeleportFailed("Teleport failed: " + reason);
return;
}
+ m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Destination is running version {0}", version);
sp.ControllingClient.SendTeleportStart(teleportFlags);
@@ -371,20 +373,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
capsPath = finalDestination.ServerURI + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath);
}
- // Expect avatar crossing is a heavy-duty function at the destination.
- // That is where MakeRoot is called, which fetches appearance and inventory.
- // Plus triggers OnMakeRoot, which spawns a series of asynchronous updates.
- //m_commsProvider.InterRegion.ExpectAvatarCrossing(reg.RegionHandle, avatar.ControllingClient.AgentId,
- // position, false);
-
- //{
- // avatar.ControllingClient.SendTeleportFailed("Problem with destination.");
- // // We should close that agent we just created over at destination...
- // List lst = new List();
- // lst.Add(reg.RegionHandle);
- // SendCloseChildAgentAsync(avatar.UUID, lst);
- // return;
- //}
SetInTransit(sp.UUID);
@@ -426,7 +414,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
// TeleportFinish makes the client send CompleteMovementIntoRegion (at the destination), which
// trigers a whole shebang of things there, including MakeRoot. So let's wait for confirmation
- // that the client contacted the destination before we send the attachments and close things here.
+ // that the client contacted the destination before we close things here.
if (!WaitForCallback(sp.UUID))
{
m_log.WarnFormat(
@@ -437,14 +425,20 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
return;
}
- // CrossAttachmentsIntoNewRegion is a synchronous call. We shouldn't need to wait after it
- CrossAttachmentsIntoNewRegion(finalDestination, sp, true);
+ // For backwards compatibility
+ if (version == "Unknown" || version == string.Empty)
+ {
+ // CrossAttachmentsIntoNewRegion is a synchronous call. We shouldn't need to wait after it
+ m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Old simulator, sending attachments one by one...");
+ CrossAttachmentsIntoNewRegion(finalDestination, sp, true);
+ }
+
+ // May need to logout or other cleanup
+ AgentHasMovedAway(sp, logout);
// Well, this is it. The agent is over there.
KillEntity(sp.Scene, sp.LocalId);
- // May need to logout or other cleanup
- AgentHasMovedAway(sp.ControllingClient.SessionId, logout);
// Now let's make it officially a child agent
sp.MakeChildAgent();
@@ -513,8 +507,13 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
}
- protected virtual void AgentHasMovedAway(UUID sessionID, bool logout)
+ protected virtual void AgentHasMovedAway(ScenePresence sp, bool logout)
{
+ foreach (SceneObjectGroup sop in sp.Attachments)
+ {
+ sop.Scene.DeleteSceneObject(sop, true);
+ }
+ sp.Attachments.Clear();
}
protected void KillEntity(Scene scene, uint localID)
@@ -784,7 +783,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
GridRegion neighbourRegion = scene.GridService.GetRegionByPosition(scene.RegionInfo.ScopeID, (int)x, (int)y);
string reason;
- if (!scene.SimulationService.QueryAccess(neighbourRegion, agent.ControllingClient.AgentId, newpos, out reason))
+ string version;
+ if (!scene.SimulationService.QueryAccess(neighbourRegion, agent.ControllingClient.AgentId, newpos, out version, out reason))
{
agent.ControllingClient.SendAlertMessage("Cannot region cross into banned parcel");
if (r == null)
@@ -804,7 +804,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
agent.InTransit();
CrossAgentToNewRegionDelegate d = CrossAgentToNewRegionAsync;
- d.BeginInvoke(agent, newpos, neighbourx, neighboury, neighbourRegion, isFlying, CrossAgentToNewRegionCompleted, d);
+ d.BeginInvoke(agent, newpos, neighbourx, neighboury, neighbourRegion, isFlying, version, CrossAgentToNewRegionCompleted, d);
return true;
}
@@ -861,17 +861,17 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
icon.EndInvoke(iar);
}
- public delegate ScenePresence CrossAgentToNewRegionDelegate(ScenePresence agent, Vector3 pos, uint neighbourx, uint neighboury, GridRegion neighbourRegion, bool isFlying);
+ public delegate ScenePresence CrossAgentToNewRegionDelegate(ScenePresence agent, Vector3 pos, uint neighbourx, uint neighboury, GridRegion neighbourRegion, bool isFlying, string version);
///
/// This Closes child agents on neighbouring regions
/// Calls an asynchronous method to do so.. so it doesn't lag the sim.
///
- protected ScenePresence CrossAgentToNewRegionAsync(ScenePresence agent, Vector3 pos, uint neighbourx, uint neighboury, GridRegion neighbourRegion, bool isFlying)
+ protected ScenePresence CrossAgentToNewRegionAsync(ScenePresence agent, Vector3 pos, uint neighbourx, uint neighboury, GridRegion neighbourRegion, bool isFlying, string version)
{
ulong neighbourHandle = Utils.UIntsToLong((uint)(neighbourx * Constants.RegionSize), (uint)(neighboury * Constants.RegionSize));
- m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Crossing agent {0} {1} to {2}-{3}", agent.Firstname, agent.Lastname, neighbourx, neighboury);
+ m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Crossing agent {0} {1} to {2}-{3} running version {4}", agent.Firstname, agent.Lastname, neighbourx, neighboury, version);
Scene m_scene = agent.Scene;
@@ -945,7 +945,14 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
agent.SendOtherAgentsAvatarDataToMe();
agent.SendOtherAgentsAppearanceToMe();
- CrossAttachmentsIntoNewRegion(neighbourRegion, agent, true);
+ // Backwards compatibility
+ if (version == "Unknown" || version == string.Empty)
+ {
+ m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Old neighbor, passing attachments one by one...");
+ CrossAttachmentsIntoNewRegion(neighbourRegion, agent, true);
+ }
+
+ AgentHasMovedAway(agent, false);
// the user may change their profile information in other region,
// so the userinfo in UserProfileCache is not reliable any more, delete it
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
index 79e76b4..5c53f78 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
@@ -142,11 +142,12 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
return false;
}
- protected override void AgentHasMovedAway(UUID sessionID, bool logout)
+ protected override void AgentHasMovedAway(ScenePresence sp, bool logout)
{
+ base.AgentHasMovedAway(sp, logout);
if (logout)
// Log them out of this grid
- m_aScene.PresenceService.LogoutAgent(sessionID);
+ m_aScene.PresenceService.LogoutAgent(sp.ControllingClient.SessionId);
}
protected override bool CreateAgent(ScenePresence sp, GridRegion reg, GridRegion finalDestination, AgentCircuitData agentCircuit, uint teleportFlags, out string reason, out bool logout)
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs
index a298b65..2cf02b5 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs
@@ -41,6 +41,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
public class LocalSimulationConnectorModule : ISharedRegionModule, ISimulationService
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
+ // Version of this service
+ private const string m_Version = "SIMULATION/0.1";
+
private List m_sceneList = new List();
private IEntityTransferModule m_AgentTransferModule;
@@ -257,9 +260,10 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
return false;
}
- public bool QueryAccess(GridRegion destination, UUID id, Vector3 position, out string reason)
+ public bool QueryAccess(GridRegion destination, UUID id, Vector3 position, out string version, out string reason)
{
reason = "Communications failure";
+ version = m_Version;
if (destination == null)
return false;
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs
index 67f4d60..7858f2a 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs
@@ -229,19 +229,20 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
}
- public bool QueryAccess(GridRegion destination, UUID id, Vector3 position, out string reason)
+ public bool QueryAccess(GridRegion destination, UUID id, Vector3 position, out string version, out string reason)
{
reason = "Communications failure";
+ version = "Unknown";
if (destination == null)
return false;
// Try local first
- if (m_localBackend.QueryAccess(destination, id, position, out reason))
+ if (m_localBackend.QueryAccess(destination, id, position, out version, out reason))
return true;
// else do the remote thing
if (!m_localBackend.IsLocalRegion(destination.RegionHandle))
- return m_remoteConnector.QueryAccess(destination, id, position, out reason);
+ return m_remoteConnector.QueryAccess(destination, id, position, out version, out reason);
return false;
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 01de824..696c6ee 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -2316,7 +2316,9 @@ namespace OpenSim.Region.Framework.Scenes
///
public bool IncomingCreateObject(ISceneObject sog)
{
- //m_log.Debug(" >>> IncomingCreateObject(sog) <<< " + ((SceneObjectGroup)sog).AbsolutePosition + " deleted? " + ((SceneObjectGroup)sog).IsDeleted);
+ //m_log.DebugFormat(" >>> IncomingCreateObject(sog) <<< {0} deleted? {1} isAttach? {2}", ((SceneObjectGroup)sog).AbsolutePosition,
+ // ((SceneObjectGroup)sog).IsDeleted, ((SceneObjectGroup)sog).RootPart.IsAttachment);
+
SceneObjectGroup newObject;
try
{
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 19a9506..bccbe68 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -3361,6 +3361,8 @@ namespace OpenSim.Region.Framework.Scenes
{
SceneObjectGroup sog = Copy(false);
sog.m_isDeleted = false;
+ sog.RootPart.IsAttachment = false;
+ sog.RootPart.GroupPosition = sog.RootPart.AttachedPos;
return sog;
}
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index e4413a9..507fc50 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -3078,54 +3078,6 @@ namespace OpenSim.Region.Framework.Scenes
cAgent.Appearance = new AvatarAppearance(m_appearance);
-/*
- try
- {
- // We might not pass the Wearables in all cases...
- // They're only needed so that persistent changes to the appearance
- // are preserved in the new region where the user is moving to.
- // But in Hypergrid we might not let this happen.
- int i = 0;
- UUID[] wears = new UUID[m_appearance.Wearables.Length * 2];
- foreach (AvatarWearable aw in m_appearance.Wearables)
- {
- if (aw != null)
- {
- wears[i++] = aw.ItemID;
- wears[i++] = aw.AssetID;
- }
- else
- {
- wears[i++] = UUID.Zero;
- wears[i++] = UUID.Zero;
- }
- }
- cAgent.Wearables = wears;
-
- cAgent.VisualParams = m_appearance.VisualParams;
-
- if (m_appearance.Texture != null)
- cAgent.AgentTextures = m_appearance.Texture.GetBytes();
- }
- catch (Exception e)
- {
- m_log.Warn("[SCENE PRESENCE]: exception in CopyTo " + e.Message);
- }
-
- //Attachments
- List attPoints = m_appearance.GetAttachedPoints();
- if (attPoints != null)
- {
- //m_log.DebugFormat("[SCENE PRESENCE]: attachments {0}", attPoints.Count);
- int i = 0;
- AvatarAttachment[] attachs = new AvatarAttachment[attPoints.Count];
- foreach (int point in attPoints)
- {
- attachs[i++] = new AvatarAttachment(point, m_appearance.GetAttachedItem(point), m_appearance.GetAttachedAsset(point));
- }
- cAgent.Attachments = attachs;
- }
-*/
lock (scriptedcontrols)
{
ControllerData[] controls = new ControllerData[scriptedcontrols.Count];
@@ -3145,9 +3097,21 @@ namespace OpenSim.Region.Framework.Scenes
}
catch { }
- // cAgent.GroupID = ??
- // Groups???
-
+ // Attachment objects
+ if (m_attachments != null && m_attachments.Count > 0)
+ {
+ cAgent.AttachmentObjects = new List();
+ cAgent.AttachmentObjectStates = new List();
+ IScriptModule se = m_scene.RequestModuleInterface();
+ foreach (SceneObjectGroup sog in m_attachments)
+ {
+ // We need to make a copy and pass that copy
+ // because of transfers withn the same sim
+ ISceneObject clone = sog.CloneForNewScene();
+ cAgent.AttachmentObjects.Add(clone);
+ cAgent.AttachmentObjectStates.Add(sog.GetStateSnapshot());
+ }
+ }
}
public void CopyFrom(AgentData cAgent)
@@ -3188,50 +3152,6 @@ namespace OpenSim.Region.Framework.Scenes
AddToPhysicalScene(isFlying);
}
-/*
- uint i = 0;
- try
- {
- if (cAgent.Wearables == null)
- cAgent.Wearables = new UUID[0];
- AvatarWearable[] wears = new AvatarWearable[cAgent.Wearables.Length / 2];
- for (uint n = 0; n < cAgent.Wearables.Length; n += 2)
- {
- UUID itemId = cAgent.Wearables[n];
- UUID assetId = cAgent.Wearables[n + 1];
- wears[i++] = new AvatarWearable(itemId, assetId);
- }
- // m_appearance.Wearables = wears;
- Primitive.TextureEntry textures = null;
- if (cAgent.AgentTextures != null && cAgent.AgentTextures.Length > 1)
- textures = new Primitive.TextureEntry(cAgent.AgentTextures, 0, cAgent.AgentTextures.Length);
-
- byte[] visuals = null;
-
- if ((cAgent.VisualParams != null) && (cAgent.VisualParams.Length < AvatarAppearance.VISUALPARAM_COUNT))
- visuals = (byte[])cAgent.VisualParams.Clone();
-
- m_appearance = new AvatarAppearance(cAgent.AgentID,wears,textures,visuals);
- }
- catch (Exception e)
- {
- m_log.Warn("[SCENE PRESENCE]: exception in CopyFrom " + e.Message);
- }
-
- // Attachments
- try
- {
- if (cAgent.Attachments != null)
- {
- m_appearance.ClearAttachments();
- foreach (AvatarAttachment att in cAgent.Attachments)
- {
- m_appearance.SetAttachment(att.AttachPoint, att.ItemID, att.AssetID);
- }
- }
- }
- catch { }
-*/
try
{
lock (scriptedcontrols)
@@ -3261,8 +3181,18 @@ namespace OpenSim.Region.Framework.Scenes
}
catch { }
- //cAgent.GroupID = ??
- //Groups???
+ if (cAgent.AttachmentObjects != null && cAgent.AttachmentObjects.Count > 0)
+ {
+ m_attachments = new List();
+ int i = 0;
+ foreach (ISceneObject so in cAgent.AttachmentObjects)
+ {
+ ((SceneObjectGroup)so).LocalId = 0;
+ ((SceneObjectGroup)so).RootPart.UpdateFlag = 0;
+ so.SetState(cAgent.AttachmentObjectStates[i++], m_scene);
+ m_scene.IncomingCreateObject(so);
+ }
+ }
}
public bool CopyAgent(out IAgentData agent)
--
cgit v1.1
From 73caa4e94abc920269c2eba8423be49192ef184b Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Fri, 29 Apr 2011 08:42:51 -0700
Subject: Minor correction to yesterday's changes. Make normal prim crossing
(no attach) work well again.
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 2 --
OpenSim/Region/Framework/Scenes/ScenePresence.cs | 3 +++
2 files changed, 3 insertions(+), 2 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index bccbe68..19a9506 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -3361,8 +3361,6 @@ namespace OpenSim.Region.Framework.Scenes
{
SceneObjectGroup sog = Copy(false);
sog.m_isDeleted = false;
- sog.RootPart.IsAttachment = false;
- sog.RootPart.GroupPosition = sog.RootPart.AttachedPos;
return sog;
}
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 507fc50..fe4a7d1 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -3108,6 +3108,9 @@ namespace OpenSim.Region.Framework.Scenes
// We need to make a copy and pass that copy
// because of transfers withn the same sim
ISceneObject clone = sog.CloneForNewScene();
+ // Attachment module assumes that GroupPosition holds the offsets...!
+ ((SceneObjectGroup)clone).RootPart.GroupPosition = sog.RootPart.AttachedPos;
+ ((SceneObjectGroup)clone).RootPart.IsAttachment = false;
cAgent.AttachmentObjects.Add(clone);
cAgent.AttachmentObjectStates.Add(sog.GetStateSnapshot());
}
--
cgit v1.1
From d565041e163d3bb47d6f5e3b7432871ee24edc13 Mon Sep 17 00:00:00 2001
From: Dan Lake
Date: Fri, 29 Apr 2011 15:49:10 -0700
Subject: Fix crash when [Mesh] section is missing from configuration files
---
OpenSim/Region/Physics/Meshing/Meshmerizer.cs | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs
index 64774d8..f89b824 100644
--- a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs
+++ b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs
@@ -88,7 +88,8 @@ namespace OpenSim.Region.Physics.Meshing
decodedSculptMapPath = start_config.GetString("DecodedSculptMapPath","j2kDecodeCache");
cacheSculptMaps = start_config.GetBoolean("CacheSculptMaps", cacheSculptMaps);
- useMeshiesPhysicsMesh = mesh_config.GetBoolean("UseMeshiesPhysicsMesh", useMeshiesPhysicsMesh);
+ if(mesh_config != null)
+ useMeshiesPhysicsMesh = mesh_config.GetBoolean("UseMeshiesPhysicsMesh", useMeshiesPhysicsMesh);
try
{
--
cgit v1.1
From 0d49611f6db017da16b6099c440b6c1e2b2218b9 Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Fri, 29 Apr 2011 15:52:06 -0700
Subject: Remove the scripts of the attachments in the departing region and
recreate them if fail.
---
.../Framework/EntityTransfer/EntityTransferModule.cs | 12 ++++++++++--
OpenSim/Region/Framework/Scenes/ScenePresence.cs | 2 ++
2 files changed, 12 insertions(+), 2 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index 1054785..b985fbb 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -479,7 +479,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
// Fail. Reset it back
sp.IsChildAgent = false;
-
+ ReInstantiateScripts(sp);
ResetFromTransit(sp.UUID);
EnableChildAgents(sp);
@@ -930,6 +930,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
if (!WaitForCallback(agent.UUID))
{
m_log.Debug("[ENTITY TRANSFER MODULE]: Callback never came in crossing agent");
+ ReInstantiateScripts(agent);
ResetFromTransit(agent.UUID);
// Yikes! We should just have a ref to scene here.
@@ -1756,7 +1757,14 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
return false;
}
-
+ protected void ReInstantiateScripts(ScenePresence sp)
+ {
+ sp.Attachments.ForEach(delegate(SceneObjectGroup sog)
+ {
+ sog.CreateScriptInstances(0, false, sp.Scene.DefaultScriptEngine, 0);
+ sog.ResumeScripts();
+ });
+ }
#endregion
}
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index fe4a7d1..9b9d9da 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -3113,6 +3113,8 @@ namespace OpenSim.Region.Framework.Scenes
((SceneObjectGroup)clone).RootPart.IsAttachment = false;
cAgent.AttachmentObjects.Add(clone);
cAgent.AttachmentObjectStates.Add(sog.GetStateSnapshot());
+ // Let's remove the scripts of the original object here
+ sog.RemoveScriptInstances(true);
}
}
}
--
cgit v1.1
From 4d5d6222f7edd7cd9c659571f280076c863a0fb1 Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Fri, 29 Apr 2011 17:09:48 -0700
Subject: Delaying starting the scripts on TPs and crossings until the agent is
root.
---
OpenSim/Region/Framework/Scenes/Scene.cs | 22 +++++--------
OpenSim/Region/Framework/Scenes/ScenePresence.cs | 41 ++++++++++++++++++------
2 files changed, 40 insertions(+), 23 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 696c6ee..2cbe4dc 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -1229,7 +1229,6 @@ namespace OpenSim.Region.Framework.Scenes
// Increment the frame counter
++Frame;
-
try
{
// Check if any objects have reached their targets
@@ -2336,9 +2335,13 @@ namespace OpenSim.Region.Framework.Scenes
return false;
}
- newObject.RootPart.ParentGroup.CreateScriptInstances(0, false, DefaultScriptEngine, GetStateSource(newObject));
-
- newObject.ResumeScripts();
+ // For attachments, we need to wait until the agent is root
+ // before we restart the scripts, or else some functions won't work.
+ if (!newObject.IsAttachment)
+ {
+ newObject.RootPart.ParentGroup.CreateScriptInstances(0, false, DefaultScriptEngine, GetStateSource(newObject));
+ newObject.ResumeScripts();
+ }
// Do this as late as possible so that listeners have full access to the incoming object
EventManager.TriggerOnIncomingSceneObject(newObject);
@@ -2455,17 +2458,8 @@ namespace OpenSim.Region.Framework.Scenes
ScenePresence sp = GetScenePresence(sog.OwnerID);
if (sp != null)
- {
- AgentCircuitData aCircuit = m_authenticateHandler.GetAgentCircuitData(sp.UUID);
+ return sp.GetStateSource();
- if (aCircuit != null && (aCircuit.teleportFlags != (uint)TeleportFlags.Default))
- {
- // This will get your attention
- //m_log.Error("[XXX] Triggering CHANGED_TELEPORT");
-
- return 5; // StateSource.Teleporting
- }
- }
return 2; // StateSource.PrimCrossing
}
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 9b9d9da..1aac09d 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -840,6 +840,9 @@ namespace OpenSim.Region.Framework.Scenes
//m_log.DebugFormat("[SCENE]: known regions in {0}: {1}", Scene.RegionInfo.RegionName, KnownChildRegionHandles.Count);
+ bool wasChild = m_isChildAgent;
+ m_isChildAgent = false;
+
IGroupsModule gm = m_scene.RequestModuleInterface();
if (gm != null)
m_grouptitle = gm.GetGroupTitle(m_uuid);
@@ -929,14 +932,21 @@ namespace OpenSim.Region.Framework.Scenes
// Animator.SendAnimPack();
m_scene.SwapRootAgentCount(false);
-
- //CachedUserInfo userInfo = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(m_uuid);
- //if (userInfo != null)
- // userInfo.FetchInventory();
- //else
- // m_log.ErrorFormat("[SCENE]: Could not find user info for {0} when making it a root agent", m_uuid);
-
- m_isChildAgent = false;
+
+ // The initial login scene presence is already root when it gets here
+ // and it has already rezzed the attachments and started their scripts.
+ // We do the following only for non-login agents, because their scripts
+ // haven't started yet.
+ if (wasChild)
+ {
+ m_log.DebugFormat("[SCENE PRESENCE]: Restarting scripts in attachments...");
+ // Resume scripts
+ Attachments.ForEach(delegate(SceneObjectGroup sog)
+ {
+ sog.RootPart.ParentGroup.CreateScriptInstances(0, false, m_scene.DefaultScriptEngine, GetStateSource());
+ sog.ResumeScripts();
+ });
+ }
// send the animations of the other presences to me
m_scene.ForEachScenePresence(delegate(ScenePresence presence)
@@ -948,6 +958,20 @@ namespace OpenSim.Region.Framework.Scenes
m_scene.EventManager.TriggerOnMakeRootAgent(this);
}
+ public int GetStateSource()
+ {
+ AgentCircuitData aCircuit = m_scene.AuthenticateHandler.GetAgentCircuitData(UUID);
+
+ if (aCircuit != null && (aCircuit.teleportFlags != (uint)TeleportFlags.Default))
+ {
+ // This will get your attention
+ //m_log.Error("[XXX] Triggering CHANGED_TELEPORT");
+
+ return 5; // StateSource.Teleporting
+ }
+ return 2; // StateSource.PrimCrossing
+ }
+
///
/// This turns a root agent into a child agent
/// when an agent departs this region for a neighbor, this gets called.
@@ -1139,7 +1163,6 @@ namespace OpenSim.Region.Framework.Scenes
AbsolutePosition = pos;
}
- m_isChildAgent = false;
bool m_flying = ((m_AgentControlFlags & AgentManager.ControlFlags.AGENT_CONTROL_FLY) != 0);
MakeRootAgent(AbsolutePosition, m_flying);
--
cgit v1.1