diff options
author | Justin Clark-Casey (justincc) | 2012-05-24 00:31:14 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-05-24 00:31:14 +0100 |
commit | 459c7635afdbc4002cacbf5780185645a4296f6a (patch) | |
tree | 9cf90fb39bc20e9283d6702d102475db08ca53d3 /OpenSim/Region/CoreModules/Framework | |
parent | Environment Module - allows Environment settings for Viewer3 warning: include... (diff) | |
download | opensim-SC_OLD-459c7635afdbc4002cacbf5780185645a4296f6a.zip opensim-SC_OLD-459c7635afdbc4002cacbf5780185645a4296f6a.tar.gz opensim-SC_OLD-459c7635afdbc4002cacbf5780185645a4296f6a.tar.bz2 opensim-SC_OLD-459c7635afdbc4002cacbf5780185645a4296f6a.tar.xz |
If an agent is still registered as 'in transit' by the source region, don't allow an immediate teleport back.
This is to help relieve a race condition when an agent teleports then immediately attempts to teleport back before the source region has properly cleaned up/demoted the old ScenePresence.
This is rare in viewers but much more possible via scripting or region module.
However, more needs to be done since virtually all clean up happens after the transit flag is cleared .
Possibly need to add a 'cleaning up' state to in transit.
This change required making the EntityTransferModule and HGEntityTransferModule per-region rather than shared, in order to allow separate transit lists.
Changes were also required in LocalSimulationConnector.
Tested in standalone, grid and with local and remote region crossings with attachments.
Diffstat (limited to 'OpenSim/Region/CoreModules/Framework')
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | 69 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs | 55 |
2 files changed, 58 insertions, 66 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 36e9da6..408d63d 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |||
@@ -46,7 +46,7 @@ using Nini.Config; | |||
46 | 46 | ||
47 | namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | 47 | namespace OpenSim.Region.CoreModules.Framework.EntityTransfer |
48 | { | 48 | { |
49 | public class EntityTransferModule : ISharedRegionModule, IEntityTransferModule | 49 | public class EntityTransferModule : INonSharedRegionModule, IEntityTransferModule |
50 | { | 50 | { |
51 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 51 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
52 | 52 | ||
@@ -65,9 +65,11 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
65 | public bool EnableWaitForCallbackFromTeleportDest { get; set; } | 65 | public bool EnableWaitForCallbackFromTeleportDest { get; set; } |
66 | 66 | ||
67 | protected bool m_Enabled = false; | 67 | protected bool m_Enabled = false; |
68 | protected Scene m_aScene; | 68 | |
69 | protected List<Scene> m_Scenes = new List<Scene>(); | 69 | protected Scene m_scene; |
70 | |||
70 | protected List<UUID> m_agentsInTransit; | 71 | protected List<UUID> m_agentsInTransit; |
72 | |||
71 | private ExpiringCache<UUID, ExpiringCache<ulong, DateTime>> m_bannedRegions = | 73 | private ExpiringCache<UUID, ExpiringCache<ulong, DateTime>> m_bannedRegions = |
72 | new ExpiringCache<UUID, ExpiringCache<ulong, DateTime>>(); | 74 | new ExpiringCache<UUID, ExpiringCache<ulong, DateTime>>(); |
73 | 75 | ||
@@ -129,10 +131,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
129 | if (!m_Enabled) | 131 | if (!m_Enabled) |
130 | return; | 132 | return; |
131 | 133 | ||
132 | if (m_aScene == null) | 134 | m_scene = scene; |
133 | m_aScene = scene; | ||
134 | 135 | ||
135 | m_Scenes.Add(scene); | ||
136 | scene.RegisterModuleInterface<IEntityTransferModule>(this); | 136 | scene.RegisterModuleInterface<IEntityTransferModule>(this); |
137 | scene.EventManager.OnNewClient += OnNewClient; | 137 | scene.EventManager.OnNewClient += OnNewClient; |
138 | } | 138 | } |
@@ -143,27 +143,11 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
143 | client.OnTeleportLandmarkRequest += RequestTeleportLandmark; | 143 | client.OnTeleportLandmarkRequest += RequestTeleportLandmark; |
144 | } | 144 | } |
145 | 145 | ||
146 | public virtual void Close() | 146 | public virtual void Close() {} |
147 | { | ||
148 | if (!m_Enabled) | ||
149 | return; | ||
150 | } | ||
151 | 147 | ||
152 | public virtual void RemoveRegion(Scene scene) | 148 | public virtual void RemoveRegion(Scene scene) {} |
153 | { | ||
154 | if (!m_Enabled) | ||
155 | return; | ||
156 | if (scene == m_aScene) | ||
157 | m_aScene = null; | ||
158 | 149 | ||
159 | m_Scenes.Remove(scene); | 150 | public virtual void RegionLoaded(Scene scene) {} |
160 | } | ||
161 | |||
162 | public virtual void RegionLoaded(Scene scene) | ||
163 | { | ||
164 | if (!m_Enabled) | ||
165 | return; | ||
166 | } | ||
167 | 151 | ||
168 | #endregion | 152 | #endregion |
169 | 153 | ||
@@ -294,7 +278,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
294 | { | 278 | { |
295 | uint x = 0, y = 0; | 279 | uint x = 0, y = 0; |
296 | Utils.LongToUInts(regionHandle, out x, out y); | 280 | Utils.LongToUInts(regionHandle, out x, out y); |
297 | GridRegion reg = m_aScene.GridService.GetRegionByPosition(sp.Scene.RegionInfo.ScopeID, (int)x, (int)y); | 281 | GridRegion reg = m_scene.GridService.GetRegionByPosition(sp.Scene.RegionInfo.ScopeID, (int)x, (int)y); |
298 | 282 | ||
299 | if (reg != null) | 283 | if (reg != null) |
300 | { | 284 | { |
@@ -441,7 +425,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
441 | 425 | ||
442 | string reason; | 426 | string reason; |
443 | string version; | 427 | string version; |
444 | if (!m_aScene.SimulationService.QueryAccess( | 428 | if (!m_scene.SimulationService.QueryAccess( |
445 | finalDestination, sp.ControllingClient.AgentId, Vector3.Zero, out version, out reason)) | 429 | finalDestination, sp.ControllingClient.AgentId, Vector3.Zero, out version, out reason)) |
446 | { | 430 | { |
447 | sp.ControllingClient.SendTeleportFailed(reason); | 431 | sp.ControllingClient.SendTeleportFailed(reason); |
@@ -660,7 +644,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
660 | EnableChildAgents(sp); | 644 | EnableChildAgents(sp); |
661 | 645 | ||
662 | // Finally, kill the agent we just created at the destination. | 646 | // Finally, kill the agent we just created at the destination. |
663 | m_aScene.SimulationService.CloseAgent(finalDestination, sp.UUID); | 647 | m_scene.SimulationService.CloseAgent(finalDestination, sp.UUID); |
664 | 648 | ||
665 | sp.Scene.EventManager.TriggerTeleportFail(sp.ControllingClient, logout); | 649 | sp.Scene.EventManager.TriggerTeleportFail(sp.ControllingClient, logout); |
666 | } | 650 | } |
@@ -668,7 +652,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
668 | protected virtual bool CreateAgent(ScenePresence sp, GridRegion reg, GridRegion finalDestination, AgentCircuitData agentCircuit, uint teleportFlags, out string reason, out bool logout) | 652 | protected virtual bool CreateAgent(ScenePresence sp, GridRegion reg, GridRegion finalDestination, AgentCircuitData agentCircuit, uint teleportFlags, out string reason, out bool logout) |
669 | { | 653 | { |
670 | logout = false; | 654 | logout = false; |
671 | bool success = m_aScene.SimulationService.CreateAgent(finalDestination, agentCircuit, teleportFlags, out reason); | 655 | bool success = m_scene.SimulationService.CreateAgent(finalDestination, agentCircuit, teleportFlags, out reason); |
672 | 656 | ||
673 | if (success) | 657 | if (success) |
674 | sp.Scene.EventManager.TriggerTeleportStart(sp.ControllingClient, reg, finalDestination, teleportFlags, logout); | 658 | sp.Scene.EventManager.TriggerTeleportStart(sp.ControllingClient, reg, finalDestination, teleportFlags, logout); |
@@ -678,7 +662,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
678 | 662 | ||
679 | protected virtual bool UpdateAgent(GridRegion reg, GridRegion finalDestination, AgentData agent) | 663 | protected virtual bool UpdateAgent(GridRegion reg, GridRegion finalDestination, AgentData agent) |
680 | { | 664 | { |
681 | return m_aScene.SimulationService.UpdateAgent(finalDestination, agent); | 665 | return m_scene.SimulationService.UpdateAgent(finalDestination, agent); |
682 | } | 666 | } |
683 | 667 | ||
684 | protected virtual void SetCallbackURL(AgentData agent, RegionInfo region) | 668 | protected virtual void SetCallbackURL(AgentData agent, RegionInfo region) |
@@ -730,7 +714,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
730 | return false; | 714 | return false; |
731 | } | 715 | } |
732 | 716 | ||
733 | |||
734 | #endregion | 717 | #endregion |
735 | 718 | ||
736 | #region Landmark Teleport | 719 | #region Landmark Teleport |
@@ -742,7 +725,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
742 | /// <param name="position"></param> | 725 | /// <param name="position"></param> |
743 | public virtual void RequestTeleportLandmark(IClientAPI remoteClient, AssetLandmark lm) | 726 | public virtual void RequestTeleportLandmark(IClientAPI remoteClient, AssetLandmark lm) |
744 | { | 727 | { |
745 | GridRegion info = m_aScene.GridService.GetRegionByUUID(UUID.Zero, lm.RegionID); | 728 | GridRegion info = m_scene.GridService.GetRegionByUUID(UUID.Zero, lm.RegionID); |
746 | 729 | ||
747 | if (info == null) | 730 | if (info == null) |
748 | { | 731 | { |
@@ -763,12 +746,12 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
763 | m_log.DebugFormat( | 746 | m_log.DebugFormat( |
764 | "[ENTITY TRANSFER MODULE]: Request to teleport {0} {1} home", client.Name, client.AgentId); | 747 | "[ENTITY TRANSFER MODULE]: Request to teleport {0} {1} home", client.Name, client.AgentId); |
765 | 748 | ||
766 | //OpenSim.Services.Interfaces.PresenceInfo pinfo = m_aScene.PresenceService.GetAgent(client.SessionId); | 749 | //OpenSim.Services.Interfaces.PresenceInfo pinfo = m_scene.PresenceService.GetAgent(client.SessionId); |
767 | GridUserInfo uinfo = m_aScene.GridUserService.GetGridUserInfo(client.AgentId.ToString()); | 750 | GridUserInfo uinfo = m_scene.GridUserService.GetGridUserInfo(client.AgentId.ToString()); |
768 | 751 | ||
769 | if (uinfo != null) | 752 | if (uinfo != null) |
770 | { | 753 | { |
771 | GridRegion regionInfo = m_aScene.GridService.GetRegionByUUID(UUID.Zero, uinfo.HomeRegionID); | 754 | GridRegion regionInfo = m_scene.GridService.GetRegionByUUID(UUID.Zero, uinfo.HomeRegionID); |
772 | if (regionInfo == null) | 755 | if (regionInfo == null) |
773 | { | 756 | { |
774 | // can't find the Home region: Tell viewer and abort | 757 | // can't find the Home region: Tell viewer and abort |
@@ -1625,7 +1608,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1625 | #region Agent Arrived | 1608 | #region Agent Arrived |
1626 | public void AgentArrivedAtDestination(UUID id) | 1609 | public void AgentArrivedAtDestination(UUID id) |
1627 | { | 1610 | { |
1628 | m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Agent {0} released", id); | ||
1629 | ResetFromTransit(id); | 1611 | ResetFromTransit(id); |
1630 | } | 1612 | } |
1631 | 1613 | ||
@@ -1896,8 +1878,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1896 | //// And the new channel... | 1878 | //// And the new channel... |
1897 | //if (m_interregionCommsOut != null) | 1879 | //if (m_interregionCommsOut != null) |
1898 | // successYN = m_interregionCommsOut.SendCreateObject(newRegionHandle, grp, true); | 1880 | // successYN = m_interregionCommsOut.SendCreateObject(newRegionHandle, grp, true); |
1899 | if (m_aScene.SimulationService != null) | 1881 | if (m_scene.SimulationService != null) |
1900 | successYN = m_aScene.SimulationService.CreateObject(destination, newPosition, grp, true); | 1882 | successYN = m_scene.SimulationService.CreateObject(destination, newPosition, grp, true); |
1901 | 1883 | ||
1902 | if (successYN) | 1884 | if (successYN) |
1903 | { | 1885 | { |
@@ -2004,7 +1986,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
2004 | /// </summary> | 1986 | /// </summary> |
2005 | /// <returns>true if the agent is in the process of being teleported, false otherwise.</returns> | 1987 | /// <returns>true if the agent is in the process of being teleported, false otherwise.</returns> |
2006 | /// <param name='id'>The agent ID</para></param> | 1988 | /// <param name='id'>The agent ID</para></param> |
2007 | protected bool IsInTransit(UUID id) | 1989 | public bool IsInTransit(UUID id) |
2008 | { | 1990 | { |
2009 | lock (m_agentsInTransit) | 1991 | lock (m_agentsInTransit) |
2010 | return m_agentsInTransit.Contains(id); | 1992 | return m_agentsInTransit.Contains(id); |
@@ -2024,10 +2006,19 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
2024 | if (m_agentsInTransit.Contains(id)) | 2006 | if (m_agentsInTransit.Contains(id)) |
2025 | { | 2007 | { |
2026 | m_agentsInTransit.Remove(id); | 2008 | m_agentsInTransit.Remove(id); |
2009 | |||
2010 | m_log.DebugFormat( | ||
2011 | "[ENTITY TRANSFER MODULE]: Agent {0} cleared from transit in {1}", | ||
2012 | id, m_scene.RegionInfo.RegionName); | ||
2013 | |||
2027 | return true; | 2014 | return true; |
2028 | } | 2015 | } |
2029 | } | 2016 | } |
2030 | 2017 | ||
2018 | m_log.WarnFormat( | ||
2019 | "[ENTITY TRANSFER MODULE]: Agent {0} requested to clear from transit in {1} but was already cleared.", | ||
2020 | id, m_scene.RegionInfo.RegionName); | ||
2021 | |||
2031 | return false; | 2022 | return false; |
2032 | } | 2023 | } |
2033 | 2024 | ||
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs index b578bcb..4124667 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs | |||
@@ -45,11 +45,11 @@ using Nini.Config; | |||
45 | 45 | ||
46 | namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | 46 | namespace OpenSim.Region.CoreModules.Framework.EntityTransfer |
47 | { | 47 | { |
48 | public class HGEntityTransferModule : EntityTransferModule, ISharedRegionModule, IEntityTransferModule, IUserAgentVerificationModule | 48 | public class HGEntityTransferModule |
49 | : EntityTransferModule, INonSharedRegionModule, IEntityTransferModule, IUserAgentVerificationModule | ||
49 | { | 50 | { |
50 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 51 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
51 | 52 | ||
52 | private bool m_Initialized = false; | ||
53 | private int m_levelHGTeleport = 0; | 53 | private int m_levelHGTeleport = 0; |
54 | 54 | ||
55 | private GatekeeperServiceConnector m_GatekeeperConnector; | 55 | private GatekeeperServiceConnector m_GatekeeperConnector; |
@@ -64,6 +64,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
64 | public override void Initialise(IConfigSource source) | 64 | public override void Initialise(IConfigSource source) |
65 | { | 65 | { |
66 | IConfig moduleConfig = source.Configs["Modules"]; | 66 | IConfig moduleConfig = source.Configs["Modules"]; |
67 | |||
67 | if (moduleConfig != null) | 68 | if (moduleConfig != null) |
68 | { | 69 | { |
69 | string name = moduleConfig.GetString("EntityTransferModule", ""); | 70 | string name = moduleConfig.GetString("EntityTransferModule", ""); |
@@ -82,10 +83,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
82 | public override void AddRegion(Scene scene) | 83 | public override void AddRegion(Scene scene) |
83 | { | 84 | { |
84 | base.AddRegion(scene); | 85 | base.AddRegion(scene); |
86 | |||
85 | if (m_Enabled) | 87 | if (m_Enabled) |
86 | { | ||
87 | scene.RegisterModuleInterface<IUserAgentVerificationModule>(this); | 88 | scene.RegisterModuleInterface<IUserAgentVerificationModule>(this); |
88 | } | ||
89 | } | 89 | } |
90 | 90 | ||
91 | protected override void OnNewClient(IClientAPI client) | 91 | protected override void OnNewClient(IClientAPI client) |
@@ -98,33 +98,28 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
98 | public override void RegionLoaded(Scene scene) | 98 | public override void RegionLoaded(Scene scene) |
99 | { | 99 | { |
100 | base.RegionLoaded(scene); | 100 | base.RegionLoaded(scene); |
101 | if (m_Enabled) | ||
102 | if (!m_Initialized) | ||
103 | { | ||
104 | m_GatekeeperConnector = new GatekeeperServiceConnector(scene.AssetService); | ||
105 | m_Initialized = true; | ||
106 | |||
107 | } | ||
108 | 101 | ||
102 | if (m_Enabled) | ||
103 | m_GatekeeperConnector = new GatekeeperServiceConnector(scene.AssetService); | ||
109 | } | 104 | } |
105 | |||
110 | public override void RemoveRegion(Scene scene) | 106 | public override void RemoveRegion(Scene scene) |
111 | { | 107 | { |
112 | base.AddRegion(scene); | 108 | base.AddRegion(scene); |
109 | |||
113 | if (m_Enabled) | 110 | if (m_Enabled) |
114 | { | ||
115 | scene.UnregisterModuleInterface<IUserAgentVerificationModule>(this); | 111 | scene.UnregisterModuleInterface<IUserAgentVerificationModule>(this); |
116 | } | ||
117 | } | 112 | } |
118 | 113 | ||
119 | |||
120 | #endregion | 114 | #endregion |
121 | 115 | ||
122 | #region HG overrides of IEntiryTransferModule | 116 | #region HG overrides of IEntiryTransferModule |
123 | 117 | ||
124 | protected override GridRegion GetFinalDestination(GridRegion region) | 118 | protected override GridRegion GetFinalDestination(GridRegion region) |
125 | { | 119 | { |
126 | int flags = m_aScene.GridService.GetRegionFlags(m_aScene.RegionInfo.ScopeID, region.RegionID); | 120 | int flags = m_scene.GridService.GetRegionFlags(m_scene.RegionInfo.ScopeID, region.RegionID); |
127 | m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: region {0} flags: {1}", region.RegionID, flags); | 121 | m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: region {0} flags: {1}", region.RegionID, flags); |
122 | |||
128 | if ((flags & (int)OpenSim.Data.RegionFlags.Hyperlink) != 0) | 123 | if ((flags & (int)OpenSim.Data.RegionFlags.Hyperlink) != 0) |
129 | { | 124 | { |
130 | m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Destination region {0} is hyperlink", region.RegionID); | 125 | m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Destination region {0} is hyperlink", region.RegionID); |
@@ -135,6 +130,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
135 | m_log.WarnFormat("[HG ENTITY TRANSFER MODULE]: GetHyperlinkRegion to Gatekeeper {0} failed", region.ServerURI); | 130 | m_log.WarnFormat("[HG ENTITY TRANSFER MODULE]: GetHyperlinkRegion to Gatekeeper {0} failed", region.ServerURI); |
136 | return real_destination; | 131 | return real_destination; |
137 | } | 132 | } |
133 | |||
138 | return region; | 134 | return region; |
139 | } | 135 | } |
140 | 136 | ||
@@ -143,7 +139,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
143 | if (base.NeedsClosing(drawdist, oldRegionX, newRegionX, oldRegionY, newRegionY, reg)) | 139 | if (base.NeedsClosing(drawdist, oldRegionX, newRegionX, oldRegionY, newRegionY, reg)) |
144 | return true; | 140 | return true; |
145 | 141 | ||
146 | int flags = m_aScene.GridService.GetRegionFlags(m_aScene.RegionInfo.ScopeID, reg.RegionID); | 142 | int flags = m_scene.GridService.GetRegionFlags(m_scene.RegionInfo.ScopeID, reg.RegionID); |
147 | if (flags == -1 /* no region in DB */ || (flags & (int)OpenSim.Data.RegionFlags.Hyperlink) != 0) | 143 | if (flags == -1 /* no region in DB */ || (flags & (int)OpenSim.Data.RegionFlags.Hyperlink) != 0) |
148 | return true; | 144 | return true; |
149 | 145 | ||
@@ -156,7 +152,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
156 | if (logout) | 152 | if (logout) |
157 | { | 153 | { |
158 | // Log them out of this grid | 154 | // Log them out of this grid |
159 | m_aScene.PresenceService.LogoutAgent(sp.ControllingClient.SessionId); | 155 | m_scene.PresenceService.LogoutAgent(sp.ControllingClient.SessionId); |
160 | } | 156 | } |
161 | } | 157 | } |
162 | 158 | ||
@@ -165,7 +161,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
165 | m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: CreateAgent {0} {1}", reg.ServerURI, finalDestination.ServerURI); | 161 | m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: CreateAgent {0} {1}", reg.ServerURI, finalDestination.ServerURI); |
166 | reason = string.Empty; | 162 | reason = string.Empty; |
167 | logout = false; | 163 | logout = false; |
168 | int flags = m_aScene.GridService.GetRegionFlags(m_aScene.RegionInfo.ScopeID, reg.RegionID); | 164 | int flags = m_scene.GridService.GetRegionFlags(m_scene.RegionInfo.ScopeID, reg.RegionID); |
169 | if (flags == -1 /* no region in DB */ || (flags & (int)OpenSim.Data.RegionFlags.Hyperlink) != 0) | 165 | if (flags == -1 /* no region in DB */ || (flags & (int)OpenSim.Data.RegionFlags.Hyperlink) != 0) |
170 | { | 166 | { |
171 | // this user is going to another grid | 167 | // this user is going to another grid |
@@ -205,7 +201,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
205 | "[ENTITY TRANSFER MODULE]: Request to teleport {0} {1} home", client.Name, client.AgentId); | 201 | "[ENTITY TRANSFER MODULE]: Request to teleport {0} {1} home", client.Name, client.AgentId); |
206 | 202 | ||
207 | // Let's find out if this is a foreign user or a local user | 203 | // Let's find out if this is a foreign user or a local user |
208 | IUserManagement uMan = m_aScene.RequestModuleInterface<IUserManagement>(); | 204 | IUserManagement uMan = m_scene.RequestModuleInterface<IUserManagement>(); |
209 | if (uMan != null && uMan.IsLocalGridUser(id)) | 205 | if (uMan != null && uMan.IsLocalGridUser(id)) |
210 | { | 206 | { |
211 | // local grid user | 207 | // local grid user |
@@ -262,19 +258,21 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
262 | { | 258 | { |
263 | m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Teleporting agent via landmark to {0} region {1} position {2}", | 259 | m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Teleporting agent via landmark to {0} region {1} position {2}", |
264 | (lm.Gatekeeper == string.Empty) ? "local" : lm.Gatekeeper, lm.RegionID, lm.Position); | 260 | (lm.Gatekeeper == string.Empty) ? "local" : lm.Gatekeeper, lm.RegionID, lm.Position); |
261 | |||
265 | if (lm.Gatekeeper == string.Empty) | 262 | if (lm.Gatekeeper == string.Empty) |
266 | { | 263 | { |
267 | base.RequestTeleportLandmark(remoteClient, lm); | 264 | base.RequestTeleportLandmark(remoteClient, lm); |
268 | return; | 265 | return; |
269 | } | 266 | } |
270 | 267 | ||
271 | GridRegion info = m_aScene.GridService.GetRegionByUUID(UUID.Zero, lm.RegionID); | 268 | GridRegion info = m_scene.GridService.GetRegionByUUID(UUID.Zero, lm.RegionID); |
272 | 269 | ||
273 | // Local region? | 270 | // Local region? |
274 | if (info != null) | 271 | if (info != null) |
275 | { | 272 | { |
276 | ((Scene)(remoteClient.Scene)).RequestTeleportLocation(remoteClient, info.RegionHandle, lm.Position, | 273 | ((Scene)(remoteClient.Scene)).RequestTeleportLocation(remoteClient, info.RegionHandle, lm.Position, |
277 | Vector3.Zero, (uint)(Constants.TeleportFlags.SetLastToTarget | Constants.TeleportFlags.ViaLandmark)); | 274 | Vector3.Zero, (uint)(Constants.TeleportFlags.SetLastToTarget | Constants.TeleportFlags.ViaLandmark)); |
275 | |||
278 | return; | 276 | return; |
279 | } | 277 | } |
280 | else | 278 | else |
@@ -285,6 +283,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
285 | GridRegion gatekeeper = new GridRegion(); | 283 | GridRegion gatekeeper = new GridRegion(); |
286 | gatekeeper.ServerURI = lm.Gatekeeper; | 284 | gatekeeper.ServerURI = lm.Gatekeeper; |
287 | GridRegion finalDestination = gConn.GetHyperlinkRegion(gatekeeper, new UUID(lm.RegionID)); | 285 | GridRegion finalDestination = gConn.GetHyperlinkRegion(gatekeeper, new UUID(lm.RegionID)); |
286 | |||
288 | if (finalDestination != null) | 287 | if (finalDestination != null) |
289 | { | 288 | { |
290 | ScenePresence sp = scene.GetScenePresence(remoteClient.AgentId); | 289 | ScenePresence sp = scene.GetScenePresence(remoteClient.AgentId); |
@@ -314,8 +313,12 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
314 | IUserAgentService security = new UserAgentServiceConnector(url); | 313 | IUserAgentService security = new UserAgentServiceConnector(url); |
315 | return security.VerifyClient(aCircuit.SessionID, token); | 314 | return security.VerifyClient(aCircuit.SessionID, token); |
316 | } | 315 | } |
317 | else | 316 | else |
318 | m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Agent {0} {1} does not have a HomeURI OH NO!", aCircuit.firstname, aCircuit.lastname); | 317 | { |
318 | m_log.DebugFormat( | ||
319 | "[HG ENTITY TRANSFER MODULE]: Agent {0} {1} does not have a HomeURI OH NO!", | ||
320 | aCircuit.firstname, aCircuit.lastname); | ||
321 | } | ||
319 | 322 | ||
320 | return false; | 323 | return false; |
321 | } | 324 | } |
@@ -332,8 +335,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
332 | } | 335 | } |
333 | 336 | ||
334 | // Let's find out if this is a foreign user or a local user | 337 | // Let's find out if this is a foreign user or a local user |
335 | IUserManagement uMan = m_aScene.RequestModuleInterface<IUserManagement>(); | 338 | IUserManagement uMan = m_scene.RequestModuleInterface<IUserManagement>(); |
336 | UserAccount account = m_aScene.UserAccountService.GetUserAccount(m_aScene.RegionInfo.ScopeID, obj.AgentId); | 339 | UserAccount account = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, obj.AgentId); |
337 | if (uMan != null && uMan.IsLocalGridUser(obj.AgentId)) | 340 | if (uMan != null && uMan.IsLocalGridUser(obj.AgentId)) |
338 | { | 341 | { |
339 | // local grid user | 342 | // local grid user |
@@ -356,7 +359,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
356 | 359 | ||
357 | #endregion | 360 | #endregion |
358 | 361 | ||
359 | |||
360 | private GridRegion MakeRegion(AgentCircuitData aCircuit) | 362 | private GridRegion MakeRegion(AgentCircuitData aCircuit) |
361 | { | 363 | { |
362 | GridRegion region = new GridRegion(); | 364 | GridRegion region = new GridRegion(); |
@@ -373,6 +375,5 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
373 | region.InternalEndPoint = new System.Net.IPEndPoint(System.Net.IPAddress.Parse("0.0.0.0"), (int)0); | 375 | region.InternalEndPoint = new System.Net.IPEndPoint(System.Net.IPAddress.Parse("0.0.0.0"), (int)0); |
374 | return region; | 376 | return region; |
375 | } | 377 | } |
376 | |||
377 | } | 378 | } |
378 | } | 379 | } \ No newline at end of file |