diff options
Added a SendChildAgentDataUpdate call on Teleports, so that the agent at the destination will have all the necessary information.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/ScenePresence.cs | 59 |
1 files changed, 55 insertions, 4 deletions
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index 41971fc..23dc9be 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs | |||
@@ -2571,6 +2571,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2571 | ControllingClient.SendAdminResponse(token, (uint)m_godlevel); | 2571 | ControllingClient.SendAdminResponse(token, (uint)m_godlevel); |
2572 | } | 2572 | } |
2573 | 2573 | ||
2574 | #region Child Agent Updates | ||
2574 | /// <summary> | 2575 | /// <summary> |
2575 | /// This updates important decision making data about a child agent | 2576 | /// This updates important decision making data about a child agent |
2576 | /// The main purpose is to figure out what objects to send to a child agent that's in a neighboring region | 2577 | /// The main purpose is to figure out what objects to send to a child agent that's in a neighboring region |
@@ -2581,22 +2582,34 @@ namespace OpenSim.Region.Environment.Scenes | |||
2581 | if (!IsChildAgent) | 2582 | if (!IsChildAgent) |
2582 | return; | 2583 | return; |
2583 | 2584 | ||
2585 | //Console.WriteLine(" >>> ChildAgentDataUpdate <<<"); | ||
2584 | int shiftx = ((int)rRegionX - (int)tRegionX) * (int)Constants.RegionSize; | 2586 | int shiftx = ((int)rRegionX - (int)tRegionX) * (int)Constants.RegionSize; |
2585 | int shifty = ((int)rRegionY - (int)tRegionY) * (int)Constants.RegionSize; | 2587 | int shifty = ((int)rRegionY - (int)tRegionY) * (int)Constants.RegionSize; |
2586 | 2588 | ||
2587 | m_DrawDistance = cAgentData.Far; | 2589 | m_DrawDistance = cAgentData.Far; |
2588 | m_pos = new Vector3(cAgentData.Position.X + shiftx, cAgentData.Position.Y + shifty, cAgentData.Position.Z); | 2590 | if (cAgentData.Position != new Vector3(-1, -1, -1)) // UGH!! |
2591 | m_pos = new Vector3(cAgentData.Position.X + shiftx, cAgentData.Position.Y + shifty, cAgentData.Position.Z); | ||
2589 | 2592 | ||
2590 | // It's hard to say here.. We can't really tell where the camera position is unless it's in world cordinates from the sending region | 2593 | // It's hard to say here.. We can't really tell where the camera position is unless it's in world cordinates from the sending region |
2591 | m_CameraCenter = cAgentData.Center; | 2594 | if (cAgentData.Center!= new Vector3(-1, -1, -1)) // UGH! |
2595 | m_CameraCenter = cAgentData.Center; | ||
2592 | // new Vector3(cAgentData.cameraPosition.x, cAgentData.cameraPosition.y, cAgentData.cameraPosition.z); | 2596 | // new Vector3(cAgentData.cameraPosition.x, cAgentData.cameraPosition.y, cAgentData.cameraPosition.z); |
2593 | 2597 | ||
2594 | 2598 | ||
2595 | m_godlevel = cAgentData.GodLevel; | 2599 | m_godlevel = cAgentData.GodLevel; |
2596 | m_avHeight = cAgentData.Size.Z; | 2600 | if (cAgentData.Center != new Vector3(-1, -1, -1)) |
2601 | m_avHeight = cAgentData.Size.Z; | ||
2597 | //SetHeight(cAgentData.AVHeight); | 2602 | //SetHeight(cAgentData.AVHeight); |
2598 | 2603 | ||
2599 | ControllingClient.SetChildAgentThrottle(cAgentData.Throttles); | 2604 | if ((cAgentData.Throttles != null) && cAgentData.Throttles.Length > 0) |
2605 | ControllingClient.SetChildAgentThrottle(cAgentData.Throttles); | ||
2606 | |||
2607 | // ugh!!! | ||
2608 | m_AgentControlFlags = cAgentData.ControlFlags; | ||
2609 | if (m_physicsActor != null) | ||
2610 | { | ||
2611 | m_physicsActor.Flying = ((m_AgentControlFlags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY) != 0); | ||
2612 | } | ||
2600 | 2613 | ||
2601 | // Sends out the objects in the user's draw distance if m_sendTasksToChild is true. | 2614 | // Sends out the objects in the user's draw distance if m_sendTasksToChild is true. |
2602 | if (m_scene.m_seeIntoRegionFromNeighbor) | 2615 | if (m_scene.m_seeIntoRegionFromNeighbor) |
@@ -2607,6 +2620,44 @@ namespace OpenSim.Region.Environment.Scenes | |||
2607 | //m_velocity = cAgentData.Velocity; | 2620 | //m_velocity = cAgentData.Velocity; |
2608 | } | 2621 | } |
2609 | 2622 | ||
2623 | public void CopyTo(AgentData cAgent) | ||
2624 | { | ||
2625 | cAgent.AgentID = UUID; | ||
2626 | cAgent.RegionHandle = m_scene.RegionInfo.RegionHandle; | ||
2627 | cAgent.AlwaysRun = m_setAlwaysRun; | ||
2628 | cAgent.Size = new Vector3(0, 0, m_avHeight); | ||
2629 | cAgent.Center = m_CameraCenter; | ||
2630 | cAgent.Far = m_DrawDistance; | ||
2631 | cAgent.GodLevel = (byte)m_godlevel; | ||
2632 | cAgent.Position = AbsolutePosition; | ||
2633 | cAgent.Velocity = Velocity; | ||
2634 | // Throttles | ||
2635 | float multiplier = 1; | ||
2636 | int innacurateNeighbors = m_scene.GetInaccurateNeighborCount(); | ||
2637 | if (innacurateNeighbors != 0) | ||
2638 | { | ||
2639 | multiplier = 1f / (float)innacurateNeighbors; | ||
2640 | } | ||
2641 | if (multiplier <= 0f) | ||
2642 | { | ||
2643 | multiplier = 0.25f; | ||
2644 | } | ||
2645 | //m_log.Info("[NeighborThrottle]: " + m_scene.GetInaccurateNeighborCount().ToString() + " - m: " + multiplier.ToString()); | ||
2646 | cAgent.Throttles = ControllingClient.GetThrottlesPacked(multiplier); | ||
2647 | |||
2648 | if ((m_physicsActor != null) && (m_physicsActor.Flying)) | ||
2649 | { | ||
2650 | m_AgentControlFlags |= (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY; | ||
2651 | } | ||
2652 | cAgent.ControlFlags = m_AgentControlFlags; | ||
2653 | |||
2654 | // Groups??? | ||
2655 | // Visual Params??? | ||
2656 | // Animations??? | ||
2657 | } | ||
2658 | |||
2659 | #endregion Child Agent Updates | ||
2660 | |||
2610 | /// <summary> | 2661 | /// <summary> |
2611 | /// Handles part of the PID controller function for moving an avatar. | 2662 | /// Handles part of the PID controller function for moving an avatar. |
2612 | /// </summary> | 2663 | /// </summary> |