aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs37
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs4
-rw-r--r--OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs1
3 files changed, 29 insertions, 13 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index 51897d7..e622e0c 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -319,7 +319,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
319 agentCircuit.Id0 = currentAgentCircuit.Id0; 319 agentCircuit.Id0 = currentAgentCircuit.Id0;
320 } 320 }
321 321
322 if (NeedsNewAgent(oldRegionX, newRegionX, oldRegionY, newRegionY)) 322 if (NeedsNewAgent(sp.DrawDistance, oldRegionX, newRegionX, oldRegionY, newRegionY))
323 { 323 {
324 // brand new agent, let's create a new caps seed 324 // brand new agent, let's create a new caps seed
325 agentCircuit.CapsPath = CapsUtil.GetRandomCapsObjectPath(); 325 agentCircuit.CapsPath = CapsUtil.GetRandomCapsObjectPath();
@@ -337,7 +337,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
337 // OK, it got this agent. Let's close some child agents 337 // OK, it got this agent. Let's close some child agents
338 sp.CloseChildAgents(newRegionX, newRegionY); 338 sp.CloseChildAgents(newRegionX, newRegionY);
339 IClientIPEndpoint ipepClient; 339 IClientIPEndpoint ipepClient;
340 if (NeedsNewAgent(oldRegionX, newRegionX, oldRegionY, newRegionY)) 340 if (NeedsNewAgent(sp.DrawDistance, oldRegionX, newRegionX, oldRegionY, newRegionY))
341 { 341 {
342 //sp.ControllingClient.SendTeleportProgress(teleportFlags, "Creating agent..."); 342 //sp.ControllingClient.SendTeleportProgress(teleportFlags, "Creating agent...");
343 #region IP Translation for NAT 343 #region IP Translation for NAT
@@ -448,7 +448,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
448 448
449 // Finally, let's close this previously-known-as-root agent, when the jump is outside the view zone 449 // Finally, let's close this previously-known-as-root agent, when the jump is outside the view zone
450 450
451 if (NeedsClosing(oldRegionX, newRegionX, oldRegionY, newRegionY, reg)) 451 if (NeedsClosing(sp.DrawDistance, oldRegionX, newRegionX, oldRegionY, newRegionY, reg))
452 { 452 {
453 Thread.Sleep(5000); 453 Thread.Sleep(5000);
454 sp.Close(); 454 sp.Close();
@@ -522,14 +522,14 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
522 return region; 522 return region;
523 } 523 }
524 524
525 protected virtual bool NeedsNewAgent(uint oldRegionX, uint newRegionX, uint oldRegionY, uint newRegionY) 525 protected virtual bool NeedsNewAgent(float drawdist, uint oldRegionX, uint newRegionX, uint oldRegionY, uint newRegionY)
526 { 526 {
527 return Util.IsOutsideView(oldRegionX, newRegionX, oldRegionY, newRegionY); 527 return Util.IsOutsideView(drawdist, oldRegionX, newRegionX, oldRegionY, newRegionY);
528 } 528 }
529 529
530 protected virtual bool NeedsClosing(uint oldRegionX, uint newRegionX, uint oldRegionY, uint newRegionY, GridRegion reg) 530 protected virtual bool NeedsClosing(float drawdist, uint oldRegionX, uint newRegionX, uint oldRegionY, uint newRegionY, GridRegion reg)
531 { 531 {
532 return Util.IsOutsideView(oldRegionX, newRegionX, oldRegionY, newRegionY); 532 return Util.IsOutsideView(drawdist, oldRegionX, newRegionX, oldRegionY, newRegionY);
533 } 533 }
534 534
535 protected virtual bool IsOutsideRegion(Scene s, Vector3 pos) 535 protected virtual bool IsOutsideRegion(Scene s, Vector3 pos)
@@ -1072,7 +1072,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1072 1072
1073 if (m_regionInfo != null) 1073 if (m_regionInfo != null)
1074 { 1074 {
1075 neighbours = RequestNeighbours(sp.Scene, m_regionInfo.RegionLocX, m_regionInfo.RegionLocY); 1075 neighbours = RequestNeighbours(sp, m_regionInfo.RegionLocX, m_regionInfo.RegionLocY);
1076 } 1076 }
1077 else 1077 else
1078 { 1078 {
@@ -1298,8 +1298,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1298 /// <param name="pRegionLocX"></param> 1298 /// <param name="pRegionLocX"></param>
1299 /// <param name="pRegionLocY"></param> 1299 /// <param name="pRegionLocY"></param>
1300 /// <returns></returns> 1300 /// <returns></returns>
1301 protected List<GridRegion> RequestNeighbours(Scene pScene, uint pRegionLocX, uint pRegionLocY) 1301 protected List<GridRegion> RequestNeighbours(ScenePresence avatar, uint pRegionLocX, uint pRegionLocY)
1302 { 1302 {
1303 Scene pScene = avatar.Scene;
1303 RegionInfo m_regionInfo = pScene.RegionInfo; 1304 RegionInfo m_regionInfo = pScene.RegionInfo;
1304 1305
1305 Border[] northBorders = pScene.NorthBorders.ToArray(); 1306 Border[] northBorders = pScene.NorthBorders.ToArray();
@@ -1307,10 +1308,24 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1307 Border[] eastBorders = pScene.EastBorders.ToArray(); 1308 Border[] eastBorders = pScene.EastBorders.ToArray();
1308 Border[] westBorders = pScene.WestBorders.ToArray(); 1309 Border[] westBorders = pScene.WestBorders.ToArray();
1309 1310
1310 // Legacy one region. Provided for simplicity while testing the all inclusive method in the else statement. 1311 // Leaving this as a "megaregions" computation vs "non-megaregions" computation; it isn't
1312 // clear what should be done with a "far view" given that megaregions already extended the
1313 // view to include everything in the megaregion
1311 if (northBorders.Length <= 1 && southBorders.Length <= 1 && eastBorders.Length <= 1 && westBorders.Length <= 1) 1314 if (northBorders.Length <= 1 && southBorders.Length <= 1 && eastBorders.Length <= 1 && westBorders.Length <= 1)
1312 { 1315 {
1313 return pScene.GridService.GetNeighbours(m_regionInfo.ScopeID, m_regionInfo.RegionID); 1316 int dd = avatar.DrawDistance < Constants.RegionSize ? (int)Constants.RegionSize : (int)avatar.DrawDistance;
1317
1318 int startX = (int)pRegionLocX * (int)Constants.RegionSize - dd + (int)(Constants.RegionSize/2);
1319 int startY = (int)pRegionLocY * (int)Constants.RegionSize - dd + (int)(Constants.RegionSize/2);
1320
1321 int endX = (int)pRegionLocX * (int)Constants.RegionSize + dd + (int)(Constants.RegionSize/2);
1322 int endY = (int)pRegionLocY * (int)Constants.RegionSize + dd + (int)(Constants.RegionSize/2);
1323
1324 List<GridRegion> neighbours =
1325 avatar.Scene.GridService.GetRegionRange(m_regionInfo.ScopeID, startX, endX, startY, endY);
1326
1327 neighbours.RemoveAll(delegate(GridRegion r) { return r.RegionID == m_regionInfo.RegionID; });
1328 return neighbours;
1314 } 1329 }
1315 else 1330 else
1316 { 1331 {
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
index c75bc0a..5a80100 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
@@ -130,9 +130,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
130 return region; 130 return region;
131 } 131 }
132 132
133 protected override bool NeedsClosing(uint oldRegionX, uint newRegionX, uint oldRegionY, uint newRegionY, GridRegion reg) 133 protected override bool NeedsClosing(float drawdist, uint oldRegionX, uint newRegionX, uint oldRegionY, uint newRegionY, GridRegion reg)
134 { 134 {
135 if (base.NeedsClosing(oldRegionX, newRegionX, oldRegionY, newRegionY, reg)) 135 if (base.NeedsClosing(drawdist, oldRegionX, newRegionX, oldRegionY, newRegionY, reg))
136 return true; 136 return true;
137 137
138 int flags = m_aScene.GridService.GetRegionFlags(m_aScene.RegionInfo.ScopeID, reg.RegionID); 138 int flags = m_aScene.GridService.GetRegionFlags(m_aScene.RegionInfo.ScopeID, reg.RegionID);
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
index 0163060..fcf571d 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
@@ -604,6 +604,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
604 { 604 {
605 m_log.Debug("[InventoryAccessModule]: Inventory object has UUID.Zero! Position 1"); 605 m_log.Debug("[InventoryAccessModule]: Inventory object has UUID.Zero! Position 1");
606 } 606 }
607 item.Owner = remoteClient.AgentId;
607 608
608 AssetBase rezAsset = m_Scene.AssetService.Get(item.AssetID.ToString()); 609 AssetBase rezAsset = m_Scene.AssetService.Get(item.AssetID.ToString());
609 610