diff options
Diffstat (limited to '')
4 files changed, 164 insertions, 6 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index d0171fe..8268bfa 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |||
@@ -239,12 +239,14 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
239 | //avatar.Scene.RemoveCapsHandler(avatar.UUID); | 239 | //avatar.Scene.RemoveCapsHandler(avatar.UUID); |
240 | 240 | ||
241 | string capsPath = String.Empty; | 241 | string capsPath = String.Empty; |
242 | |||
243 | AgentCircuitData currentAgentCircuit = sp.Scene.AuthenticateHandler.GetAgentCircuitData(sp.ControllingClient.CircuitCode); | ||
242 | AgentCircuitData agentCircuit = sp.ControllingClient.RequestClientInfo(); | 244 | AgentCircuitData agentCircuit = sp.ControllingClient.RequestClientInfo(); |
243 | agentCircuit.BaseFolder = UUID.Zero; | ||
244 | agentCircuit.InventoryFolder = UUID.Zero; | ||
245 | agentCircuit.startpos = position; | 245 | agentCircuit.startpos = position; |
246 | agentCircuit.child = true; | 246 | agentCircuit.child = true; |
247 | agentCircuit.Appearance = sp.Appearance; | 247 | agentCircuit.Appearance = sp.Appearance; |
248 | if (currentAgentCircuit != null) | ||
249 | agentCircuit.ServiceURLs = currentAgentCircuit.ServiceURLs; | ||
248 | 250 | ||
249 | if (NeedsNewAgent(oldRegionX, newRegionX, oldRegionY, newRegionY)) | 251 | if (NeedsNewAgent(oldRegionX, newRegionX, oldRegionY, newRegionY)) |
250 | { | 252 | { |
@@ -255,9 +257,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
255 | string reason = String.Empty; | 257 | string reason = String.Empty; |
256 | 258 | ||
257 | // Let's create an agent there if one doesn't exist yet. | 259 | // Let's create an agent there if one doesn't exist yet. |
258 | if (!m_aScene.SimulationService.CreateAgent(reg, agentCircuit, teleportFlags, out reason)) | 260 | if (!CreateAgent(reg, finalDestination, agentCircuit, teleportFlags, out reason)) |
259 | { | 261 | { |
260 | sp.ControllingClient.SendTeleportFailed(String.Format("Destination is not accepting teleports: {0}", | 262 | sp.ControllingClient.SendTeleportFailed(String.Format("Destination refused: {0}", |
261 | reason)); | 263 | reason)); |
262 | return; | 264 | return; |
263 | } | 265 | } |
@@ -345,8 +347,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
345 | agent.CallbackURI = "http://" + sp.Scene.RegionInfo.ExternalHostName + ":" + sp.Scene.RegionInfo.HttpPort + | 347 | agent.CallbackURI = "http://" + sp.Scene.RegionInfo.ExternalHostName + ":" + sp.Scene.RegionInfo.HttpPort + |
346 | "/agent/" + sp.UUID.ToString() + "/" + sp.Scene.RegionInfo.RegionID.ToString() + "/release/"; | 348 | "/agent/" + sp.UUID.ToString() + "/" + sp.Scene.RegionInfo.RegionID.ToString() + "/release/"; |
347 | 349 | ||
348 | // Straight to the region. Safe. | 350 | UpdateAgent(reg, finalDestination, agent); |
349 | m_aScene.SimulationService.UpdateAgent(reg, agent); | ||
350 | 351 | ||
351 | m_log.DebugFormat( | 352 | m_log.DebugFormat( |
352 | "[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} to client {1}", capsPath, sp.UUID); | 353 | "[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} to client {1}", capsPath, sp.UUID); |
@@ -444,6 +445,16 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
444 | } | 445 | } |
445 | } | 446 | } |
446 | 447 | ||
448 | protected virtual bool CreateAgent(GridRegion reg, GridRegion finalDestination, AgentCircuitData agentCircuit, uint teleportFlags, out string reason) | ||
449 | { | ||
450 | return m_aScene.SimulationService.CreateAgent(reg, agentCircuit, teleportFlags, out reason); | ||
451 | } | ||
452 | |||
453 | protected virtual bool UpdateAgent(GridRegion reg, GridRegion finalDestination, AgentData agent) | ||
454 | { | ||
455 | return m_aScene.SimulationService.UpdateAgent(reg, agent); | ||
456 | } | ||
457 | |||
447 | protected void KillEntity(Scene scene, uint localID) | 458 | protected void KillEntity(Scene scene, uint localID) |
448 | { | 459 | { |
449 | scene.SendKillObject(localID); | 460 | scene.SendKillObject(localID); |
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs index 5d88311..e5a862d 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs | |||
@@ -29,6 +29,7 @@ using System; | |||
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.Reflection; | 30 | using System.Reflection; |
31 | 31 | ||
32 | using OpenSim.Framework; | ||
32 | using OpenSim.Region.Framework.Interfaces; | 33 | using OpenSim.Region.Framework.Interfaces; |
33 | using OpenSim.Region.Framework.Scenes; | 34 | using OpenSim.Region.Framework.Scenes; |
34 | using OpenSim.Services.Connectors.Hypergrid; | 35 | using OpenSim.Services.Connectors.Hypergrid; |
@@ -58,6 +59,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
58 | } | 59 | } |
59 | } | 60 | } |
60 | 61 | ||
62 | private GatekeeperServiceConnector m_GatekeeperConnector; | ||
63 | |||
61 | #region ISharedRegionModule | 64 | #region ISharedRegionModule |
62 | 65 | ||
63 | public override string Name | 66 | public override string Name |
@@ -74,6 +77,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
74 | if (name == Name) | 77 | if (name == Name) |
75 | { | 78 | { |
76 | m_agentsInTransit = new List<UUID>(); | 79 | m_agentsInTransit = new List<UUID>(); |
80 | m_GatekeeperConnector = new GatekeeperServiceConnector(); | ||
77 | m_Enabled = true; | 81 | m_Enabled = true; |
78 | m_log.InfoFormat("[HG ENTITY TRANSFER MODULE]: {0} enabled.", Name); | 82 | m_log.InfoFormat("[HG ENTITY TRANSFER MODULE]: {0} enabled.", Name); |
79 | } | 83 | } |
@@ -131,6 +135,29 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
131 | return true; | 135 | return true; |
132 | } | 136 | } |
133 | 137 | ||
138 | protected override bool CreateAgent(GridRegion reg, GridRegion finalDestination, AgentCircuitData agentCircuit, uint teleportFlags, out string reason) | ||
139 | { | ||
140 | reason = string.Empty; | ||
141 | if (reg.RegionLocX != finalDestination.RegionLocX && reg.RegionLocY != finalDestination.RegionLocY) | ||
142 | { | ||
143 | // this user is going to another grid | ||
144 | reg.RegionName = finalDestination.RegionName; | ||
145 | return m_GatekeeperConnector.CreateAgent(reg, agentCircuit, teleportFlags, out reason); | ||
146 | } | ||
147 | |||
148 | return m_aScene.SimulationService.CreateAgent(reg, agentCircuit, teleportFlags, out reason); | ||
149 | } | ||
150 | |||
151 | protected override bool UpdateAgent(GridRegion reg, GridRegion finalDestination, AgentData agent) | ||
152 | { | ||
153 | if (reg.RegionLocX != finalDestination.RegionLocX && reg.RegionLocY != finalDestination.RegionLocY) | ||
154 | { | ||
155 | // this user is going to another grid | ||
156 | return m_GatekeeperConnector.UpdateAgent(reg, agent); | ||
157 | } | ||
158 | |||
159 | return m_aScene.SimulationService.UpdateAgent(reg, agent); | ||
160 | } | ||
134 | 161 | ||
135 | #endregion | 162 | #endregion |
136 | } | 163 | } |
diff --git a/OpenSim/Region/CoreModules/Resources/CoreModulePlugin.addin.xml b/OpenSim/Region/CoreModules/Resources/CoreModulePlugin.addin.xml index 08a90a2..c61198d 100644 --- a/OpenSim/Region/CoreModules/Resources/CoreModulePlugin.addin.xml +++ b/OpenSim/Region/CoreModules/Resources/CoreModulePlugin.addin.xml | |||
@@ -66,6 +66,7 @@ | |||
66 | <RegionModule id="LLLoginServiceInConnectorModule" type="OpenSim.Region.CoreModules.ServiceConnectorsIn.Login.LLLoginServiceInConnectorModule" /> \ | 66 | <RegionModule id="LLLoginServiceInConnectorModule" type="OpenSim.Region.CoreModules.ServiceConnectorsIn.Login.LLLoginServiceInConnectorModule" /> \ |
67 | <RegionModule id="SimulationServiceInConnectorModule" type="OpenSim.Region.CoreModules.ServiceConnectorsIn.Simulation.SimulationServiceInConnectorModule" /> \ | 67 | <RegionModule id="SimulationServiceInConnectorModule" type="OpenSim.Region.CoreModules.ServiceConnectorsIn.Simulation.SimulationServiceInConnectorModule" /> \ |
68 | <RegionModule id="GridInfoServiceInConnectorModule" type="OpenSim.Region.CoreModules.ServiceConnectorsIn.Grid.GridInfoServiceInConnectorModule" /> \ | 68 | <RegionModule id="GridInfoServiceInConnectorModule" type="OpenSim.Region.CoreModules.ServiceConnectorsIn.Grid.GridInfoServiceInConnectorModule" /> \ |
69 | <RegionModule id="AuthenticationServiceInConnectorModule" type="OpenSim.Region.CoreModules.ServiceConnectorsIn.Authentication.AuthenticationServiceInConnectorModule" /> | ||
69 | <RegionModule id="AccessModule" type="OpenSim.Region.CoreModules.World.AccessModule" /> \ | 70 | <RegionModule id="AccessModule" type="OpenSim.Region.CoreModules.World.AccessModule" /> \ |
70 | 71 | ||
71 | </Extension> | 72 | </Extension> |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Authentication/AuthenticationServiceInConnectorModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Authentication/AuthenticationServiceInConnectorModule.cs new file mode 100644 index 0000000..02acddc --- /dev/null +++ b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Authentication/AuthenticationServiceInConnectorModule.cs | |||
@@ -0,0 +1,119 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
29 | using System.Reflection; | ||
30 | using System.Collections.Generic; | ||
31 | using log4net; | ||
32 | using Nini.Config; | ||
33 | using OpenSim.Framework; | ||
34 | using OpenSim.Framework.Servers.HttpServer; | ||
35 | using OpenSim.Region.Framework.Scenes; | ||
36 | using OpenSim.Region.Framework.Interfaces; | ||
37 | using OpenSim.Server.Base; | ||
38 | using OpenSim.Server.Handlers.Base; | ||
39 | using OpenSim.Server.Handlers.Authentication; | ||
40 | using OpenSim.Services.Interfaces; | ||
41 | |||
42 | namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Authentication | ||
43 | { | ||
44 | public class AuthenticationServiceInConnectorModule : ISharedRegionModule | ||
45 | { | ||
46 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
47 | private static bool m_Enabled = false; | ||
48 | |||
49 | private IConfigSource m_Config; | ||
50 | bool m_Registered = false; | ||
51 | |||
52 | #region IRegionModule interface | ||
53 | |||
54 | public void Initialise(IConfigSource config) | ||
55 | { | ||
56 | m_Config = config; | ||
57 | IConfig moduleConfig = config.Configs["Modules"]; | ||
58 | if (moduleConfig != null) | ||
59 | { | ||
60 | m_Enabled = moduleConfig.GetBoolean("AuthenticationServiceInConnector", false); | ||
61 | if (m_Enabled) | ||
62 | { | ||
63 | m_log.Info("[AUTHENTICATION IN CONNECTOR]: Authentication Service In Connector enabled"); | ||
64 | } | ||
65 | |||
66 | } | ||
67 | |||
68 | } | ||
69 | |||
70 | public void PostInitialise() | ||
71 | { | ||
72 | } | ||
73 | |||
74 | public void Close() | ||
75 | { | ||
76 | } | ||
77 | |||
78 | public Type ReplaceableInterface | ||
79 | { | ||
80 | get { return null; } | ||
81 | } | ||
82 | |||
83 | public string Name | ||
84 | { | ||
85 | get { return "AuthenticationServiceInConnectorModule"; } | ||
86 | } | ||
87 | |||
88 | public void AddRegion(Scene scene) | ||
89 | { | ||
90 | if (!m_Enabled) | ||
91 | return; | ||
92 | } | ||
93 | |||
94 | public void RemoveRegion(Scene scene) | ||
95 | { | ||
96 | if (!m_Enabled) | ||
97 | return; | ||
98 | } | ||
99 | |||
100 | public void RegionLoaded(Scene scene) | ||
101 | { | ||
102 | if (!m_Enabled) | ||
103 | return; | ||
104 | |||
105 | if (!m_Registered) | ||
106 | { | ||
107 | m_Registered = true; | ||
108 | |||
109 | m_log.Info("[AUTHENTICATION IN CONNECTOR]: Starting..."); | ||
110 | |||
111 | new AuthenticationServiceConnector(m_Config, MainServer.Instance, "AuthenticationService"); | ||
112 | } | ||
113 | |||
114 | } | ||
115 | |||
116 | #endregion | ||
117 | |||
118 | } | ||
119 | } | ||