diff options
author | Justin Clark-Casey (justincc) | 2014-05-20 23:48:10 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2014-05-20 23:52:07 +0100 |
commit | 9479f647781184d39d174fd708650da1e847c18c (patch) | |
tree | 3faee1543e1c1614efc3034f802ee45093014688 | |
parent | On verbose groups messaging logging, count all operations in reported time wh... (diff) | |
download | opensim-SC_OLD-9479f647781184d39d174fd708650da1e847c18c.zip opensim-SC_OLD-9479f647781184d39d174fd708650da1e847c18c.tar.gz opensim-SC_OLD-9479f647781184d39d174fd708650da1e847c18c.tar.bz2 opensim-SC_OLD-9479f647781184d39d174fd708650da1e847c18c.tar.xz |
Fix issue where avatar and script chat could sometimes be heard from anywhere in neighbouring regions.
This was due to a silent uint overflow in ScenePresence.UpdateChildAgent() corrupting child agent positions
when the child agent was in a region with a greater x or y map co-ord than the root agent region
Probably introduced in beeec1c.
This still will not function properly with very high region map co-ords (in the millions) but other parts of the code don't handle this properly anyway.
Looks to address http://opensimulator.org/mantis/view.php?id=7163
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index dd4bbe9..28b5b46 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -3777,10 +3777,15 @@ namespace OpenSim.Region.Framework.Scenes | |||
3777 | if (!IsChildAgent) | 3777 | if (!IsChildAgent) |
3778 | return; | 3778 | return; |
3779 | 3779 | ||
3780 | //m_log.Debug(" >>> ChildAgentPositionUpdate <<< " + rRegionX + "-" + rRegionY); | 3780 | // m_log.DebugFormat( |
3781 | // "[SCENE PRESENCE]: ChildAgentPositionUpdate for {0} in {1}, tRegion {2},{3}, rRegion {4},{5}, pos {6}", | ||
3782 | // Name, Scene.Name, tRegionX, tRegionY, rRegionX, rRegionY, cAgentData.Position); | ||
3783 | |||
3781 | // Find the distance (in meters) between the two regions | 3784 | // Find the distance (in meters) between the two regions |
3782 | uint shiftx = Util.RegionToWorldLoc(rRegionX - tRegionX); | 3785 | // XXX: We cannot use Util.RegionLocToHandle() here because a negative value will silently overflow the |
3783 | uint shifty = Util.RegionToWorldLoc(rRegionY - tRegionY); | 3786 | // uint |
3787 | int shiftx = (int)(((int)rRegionX - (int)tRegionX) * Constants.RegionSize); | ||
3788 | int shifty = (int)(((int)rRegionY - (int)tRegionY) * Constants.RegionSize); | ||
3784 | 3789 | ||
3785 | Vector3 offset = new Vector3(shiftx, shifty, 0f); | 3790 | Vector3 offset = new Vector3(shiftx, shifty, 0f); |
3786 | 3791 | ||