30 using System.Reflection;
32 using System.Collections.Generic;
33 using System.Threading;
36 using OpenMetaverse.StructuredData;
39 using OpenSim.Region.Framework;
40 using OpenSim.Region.Framework.Scenes;
41 using OpenSim.Region.Framework.Interfaces;
42 using OpenSim.Framework;
43 using OpenSim.Services.Interfaces;
54 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
57 private Scene m_scene;
59 private struct RegionSend {
67 private static ExpiringCache<UUID, List<RegionSend>> m_Cache =
new ExpiringCache<UUID, List<RegionSend>>();
68 private const double TIMEOUT = 1.0;
73 m_TransferModule = et;
78 List<RegionSend> rsendlist;
80 if (m_Cache.TryGetValue(agentID, out rsendlist))
82 rsend = rsendlist.Find(r => r.region == m_scene.RegionInfo.RegionID);
83 if (rsend.region !=
UUID.Zero)
92 rsend.region = m_scene.RegionInfo.RegionID;
98 while (!m_scene.TryGetClient(agentID, out client) && counter-- > 0)
119 if (!sp.
IsChildAgent && !m_TransferModule.IsInTransit(agentID))
128 if (rsendlist == null)
130 rsendlist =
new List<RegionSend>();
131 m_Cache.AddOrUpdate(agentID, rsendlist, TIMEOUT);
133 rsendlist.Add(rsend);
141 UserAccount account = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, agentID);
143 level = account.UserLevel;
152 while ((sp = m_scene.GetScenePresence(agentID)) == null && (ntimes-- > 0))
157 "[XXX]: Did not find presence with id {0} in {1} before timeout",
158 agentID, m_scene.RegionInfo.RegionName);
virtual ScenePresence WaitGetScenePresence(UUID agentID)
OpenSim.Framework.Constants.TeleportFlags TeleportFlags
OpenMetaverse.StructuredData.OSDMap OSDMap
int UserLevel(UUID agentID)
OpenMetaverse.StructuredData.OSDMap OSDMap
OpenSim.Framework.Constants.TeleportFlags TeleportFlags
bool ShouldSend(UUID agentID)
Interactive OpenSim region server
bool IsInTransit
This signals whether the presence is in transit between neighbouring regions.
SimulatorFeaturesHelper(Scene scene, IEntityTransferModule et)