diff options
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 0f6c507..809027f 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |||
@@ -151,12 +151,16 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
151 | // Add this agent in this region as a banned person | 151 | // Add this agent in this region as a banned person |
152 | public void Add(ulong pRegionHandle, UUID pAgentID) | 152 | public void Add(ulong pRegionHandle, UUID pAgentID) |
153 | { | 153 | { |
154 | this.Add(pRegionHandle, pAgentID, 45, 15); | ||
155 | } | ||
156 | public void Add(ulong pRegionHandle, UUID pAgentID, double newTime, double extendTime) | ||
157 | { | ||
154 | if (!m_bannedRegions.TryGetValue(pAgentID, out m_idCache)) | 158 | if (!m_bannedRegions.TryGetValue(pAgentID, out m_idCache)) |
155 | { | 159 | { |
156 | m_idCache = new ExpiringCache<ulong, DateTime>(); | 160 | m_idCache = new ExpiringCache<ulong, DateTime>(); |
157 | m_bannedRegions.Add(pAgentID, m_idCache, TimeSpan.FromSeconds(45)); | 161 | m_bannedRegions.Add(pAgentID, m_idCache, TimeSpan.FromSeconds(newTime)); |
158 | } | 162 | } |
159 | m_idCache.Add(pRegionHandle, DateTime.Now + TimeSpan.FromSeconds(15), TimeSpan.FromSeconds(15)); | 163 | m_idCache.Add(pRegionHandle, DateTime.Now + TimeSpan.FromSeconds(extendTime), TimeSpan.FromSeconds(extendTime)); |
160 | } | 164 | } |
161 | // Remove the agent from the region's banned list | 165 | // Remove the agent from the region's banned list |
162 | public void Remove(ulong pRegionHandle, UUID pAgentID) | 166 | public void Remove(ulong pRegionHandle, UUID pAgentID) |
@@ -1447,6 +1451,31 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1447 | 1451 | ||
1448 | #region Agent Crossings | 1452 | #region Agent Crossings |
1449 | 1453 | ||
1454 | public bool checkAgentAccessToRegion(ScenePresence agent, GridRegion destiny, Vector3 position, out string version, out string reason) | ||
1455 | { | ||
1456 | reason = String.Empty; | ||
1457 | version = String.Empty; | ||
1458 | |||
1459 | UUID agentID = agent.UUID; | ||
1460 | ulong destinyHandle = destiny.RegionHandle; | ||
1461 | |||
1462 | if (m_bannedRegionCache.IfBanned(destinyHandle, agentID)) | ||
1463 | { | ||
1464 | reason = "Cannot connect to region"; | ||
1465 | return false; | ||
1466 | } | ||
1467 | |||
1468 | Scene ascene = agent.Scene; | ||
1469 | |||
1470 | if (!ascene.SimulationService.QueryAccess(destiny, agentID, position, out version, out reason)) | ||
1471 | { | ||
1472 | m_bannedRegionCache.Add(destinyHandle, agentID, 30.0, 30.0); | ||
1473 | return false; | ||
1474 | } | ||
1475 | |||
1476 | return true; | ||
1477 | } | ||
1478 | |||
1450 | public GridRegion GetDestination(Scene scene, UUID agentID, Vector3 pos, out string version, out Vector3 newpos) | 1479 | public GridRegion GetDestination(Scene scene, UUID agentID, Vector3 pos, out string version, out Vector3 newpos) |
1451 | { | 1480 | { |
1452 | string r = String.Empty; | 1481 | string r = String.Empty; |