aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDiva Canto2010-01-17 20:10:42 -0800
committerDiva Canto2010-01-17 20:10:42 -0800
commitb5fcb5e872ec138ff7138906bffae193b6dae1a6 (patch)
treeedbf410ccc19cc118287513222e1e6d3a090b332
parentAgent gets there through the Gatekeeper, but still a few quirks to fix. (diff)
downloadopensim-SC_OLD-b5fcb5e872ec138ff7138906bffae193b6dae1a6.zip
opensim-SC_OLD-b5fcb5e872ec138ff7138906bffae193b6dae1a6.tar.gz
opensim-SC_OLD-b5fcb5e872ec138ff7138906bffae193b6dae1a6.tar.bz2
opensim-SC_OLD-b5fcb5e872ec138ff7138906bffae193b6dae1a6.tar.xz
HG teleports through gatekeeper are working.
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs18
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs11
-rw-r--r--OpenSim/Server/Handlers/Hypergrid/AgentHandlers.cs10
-rw-r--r--OpenSim/Server/Handlers/Hypergrid/GatekeeperServerConnector.cs1
-rw-r--r--OpenSim/Server/Handlers/Hypergrid/ObjectHandlers.cs68
-rw-r--r--OpenSim/Services/HypergridService/GatekeeperService.cs39
-rw-r--r--OpenSim/Services/Interfaces/IGatekeeperService.cs4
-rw-r--r--bin/config-include/StandaloneHypergrid.ini1
8 files changed, 14 insertions, 138 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index 8268bfa..622d057 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -344,8 +344,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
344 AgentData agent = new AgentData(); 344 AgentData agent = new AgentData();
345 sp.CopyTo(agent); 345 sp.CopyTo(agent);
346 agent.Position = position; 346 agent.Position = position;
347 agent.CallbackURI = "http://" + sp.Scene.RegionInfo.ExternalHostName + ":" + sp.Scene.RegionInfo.HttpPort + 347 SetCallbackURL(agent, sp.Scene.RegionInfo);
348 "/agent/" + sp.UUID.ToString() + "/" + sp.Scene.RegionInfo.RegionID.ToString() + "/release/";
349 348
350 UpdateAgent(reg, finalDestination, agent); 349 UpdateAgent(reg, finalDestination, agent);
351 350
@@ -379,7 +378,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
379 EnableChildAgents(sp); 378 EnableChildAgents(sp);
380 379
381 // Finally, kill the agent we just created at the destination. 380 // Finally, kill the agent we just created at the destination.
382 m_aScene.SimulationService.CloseAgent(reg, sp.UUID); 381 m_aScene.SimulationService.CloseAgent(finalDestination, sp.UUID);
383 382
384 return; 383 return;
385 } 384 }
@@ -389,7 +388,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
389 sp.MakeChildAgent(); 388 sp.MakeChildAgent();
390 389
391 // CrossAttachmentsIntoNewRegion is a synchronous call. We shouldn't need to wait after it 390 // CrossAttachmentsIntoNewRegion is a synchronous call. We shouldn't need to wait after it
392 CrossAttachmentsIntoNewRegion(reg, sp, true); 391 CrossAttachmentsIntoNewRegion(finalDestination, sp, true);
393 392
394 // Finally, let's close this previously-known-as-root agent, when the jump is outside the view zone 393 // Finally, let's close this previously-known-as-root agent, when the jump is outside the view zone
395 394
@@ -447,12 +446,19 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
447 446
448 protected virtual bool CreateAgent(GridRegion reg, GridRegion finalDestination, AgentCircuitData agentCircuit, uint teleportFlags, out string reason) 447 protected virtual bool CreateAgent(GridRegion reg, GridRegion finalDestination, AgentCircuitData agentCircuit, uint teleportFlags, out string reason)
449 { 448 {
450 return m_aScene.SimulationService.CreateAgent(reg, agentCircuit, teleportFlags, out reason); 449 return m_aScene.SimulationService.CreateAgent(finalDestination, agentCircuit, teleportFlags, out reason);
451 } 450 }
452 451
453 protected virtual bool UpdateAgent(GridRegion reg, GridRegion finalDestination, AgentData agent) 452 protected virtual bool UpdateAgent(GridRegion reg, GridRegion finalDestination, AgentData agent)
454 { 453 {
455 return m_aScene.SimulationService.UpdateAgent(reg, agent); 454 return m_aScene.SimulationService.UpdateAgent(finalDestination, agent);
455 }
456
457 protected virtual void SetCallbackURL(AgentData agent, RegionInfo region)
458 {
459 agent.CallbackURI = "http://" + region.ExternalHostName + ":" + region.HttpPort +
460 "/agent/" + agent.AgentID.ToString() + "/" + region.RegionID.ToString() + "/release/";
461
456 } 462 }
457 463
458 protected void KillEntity(Scene scene, uint localID) 464 protected void KillEntity(Scene scene, uint localID)
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
index e5a862d..6645293 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
@@ -148,17 +148,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
148 return m_aScene.SimulationService.CreateAgent(reg, agentCircuit, teleportFlags, out reason); 148 return m_aScene.SimulationService.CreateAgent(reg, agentCircuit, teleportFlags, out reason);
149 } 149 }
150 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 }
161
162 #endregion 151 #endregion
163 } 152 }
164} 153}
diff --git a/OpenSim/Server/Handlers/Hypergrid/AgentHandlers.cs b/OpenSim/Server/Handlers/Hypergrid/AgentHandlers.cs
index a56363c..01e368c 100644
--- a/OpenSim/Server/Handlers/Hypergrid/AgentHandlers.cs
+++ b/OpenSim/Server/Handlers/Hypergrid/AgentHandlers.cs
@@ -64,16 +64,6 @@ namespace OpenSim.Server.Handlers.Hypergrid
64 return m_GatekeeperService.LoginAgent(aCircuit, destination, out reason); 64 return m_GatekeeperService.LoginAgent(aCircuit, destination, out reason);
65 } 65 }
66 66
67 protected override bool UpdateAgent(GridRegion destination, AgentData agent)
68 {
69 return m_GatekeeperService.UpdateAgent(destination, agent);
70 }
71
72 protected override void ReleaseAgent(UUID regionID, UUID id)
73 {
74 m_GatekeeperService.ReleaseAgent(regionID, id);
75 }
76
77 } 67 }
78 68
79} 69}
diff --git a/OpenSim/Server/Handlers/Hypergrid/GatekeeperServerConnector.cs b/OpenSim/Server/Handlers/Hypergrid/GatekeeperServerConnector.cs
index 27b793d..c56ea3f 100644
--- a/OpenSim/Server/Handlers/Hypergrid/GatekeeperServerConnector.cs
+++ b/OpenSim/Server/Handlers/Hypergrid/GatekeeperServerConnector.cs
@@ -65,7 +65,6 @@ namespace OpenSim.Server.Handlers.Hypergrid
65 server.AddXmlRPCHandler("get_region", hghandlers.GetRegion, false); 65 server.AddXmlRPCHandler("get_region", hghandlers.GetRegion, false);
66 66
67 server.AddHTTPHandler("/foreignagent/", new AgentHandler(m_GatekeeperService).Handler); 67 server.AddHTTPHandler("/foreignagent/", new AgentHandler(m_GatekeeperService).Handler);
68 server.AddHTTPHandler("/foreignobject/", new ObjectHandler(m_GatekeeperService).Handler);
69 68
70 } 69 }
71 70
diff --git a/OpenSim/Server/Handlers/Hypergrid/ObjectHandlers.cs b/OpenSim/Server/Handlers/Hypergrid/ObjectHandlers.cs
deleted file mode 100644
index 20eb375..0000000
--- a/OpenSim/Server/Handlers/Hypergrid/ObjectHandlers.cs
+++ /dev/null
@@ -1,68 +0,0 @@
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
28using System;
29using System.Collections;
30using System.IO;
31using System.Reflection;
32using System.Net;
33using System.Text;
34
35using OpenSim.Server.Base;
36using OpenSim.Server.Handlers.Base;
37using OpenSim.Services.Interfaces;
38using GridRegion = OpenSim.Services.Interfaces.GridRegion;
39using OpenSim.Framework;
40using OpenSim.Framework.Servers.HttpServer;
41using OpenSim.Server.Handlers.Simulation;
42using Utils = OpenSim.Server.Handlers.Simulation.Utils;
43
44using OpenMetaverse;
45using OpenMetaverse.StructuredData;
46using Nini.Config;
47using log4net;
48
49
50namespace OpenSim.Server.Handlers.Hypergrid
51{
52 public class ObjectHandler : OpenSim.Server.Handlers.Simulation.ObjectHandler
53 {
54 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
55 private IGatekeeperService m_GatekeeperService;
56
57 public ObjectHandler(IGatekeeperService gatekeeper)
58 {
59 m_GatekeeperService = gatekeeper;
60 }
61
62 protected override bool CreateObject(GridRegion destination, ISceneObject sog)
63 {
64 return m_GatekeeperService.LoginAttachment(destination, sog);
65 }
66
67 }
68} \ No newline at end of file
diff --git a/OpenSim/Services/HypergridService/GatekeeperService.cs b/OpenSim/Services/HypergridService/GatekeeperService.cs
index 416e443..72db93f 100644
--- a/OpenSim/Services/HypergridService/GatekeeperService.cs
+++ b/OpenSim/Services/HypergridService/GatekeeperService.cs
@@ -221,44 +221,7 @@ namespace OpenSim.Services.HypergridService
221 return m_SimulationService.CreateAgent(destination, aCircuit, 0, out reason); 221 return m_SimulationService.CreateAgent(destination, aCircuit, 0, out reason);
222 } 222 }
223 223
224 public bool UpdateAgent(GridRegion destination, AgentData agent) 224 protected bool Authenticate(AgentCircuitData aCircuit)
225 {
226 // Get the region
227 destination = m_GridService.GetRegionByUUID(m_ScopeID, destination.RegionID);
228 if (destination == null)
229 {
230 return false;
231 }
232
233 return m_SimulationService.UpdateAgent(destination, agent);
234 }
235
236 public bool LoginAttachment(GridRegion destination, ISceneObject sog)
237 {
238 // Get the region
239 destination = m_GridService.GetRegionByUUID(m_ScopeID, destination.RegionID);
240 if (destination == null)
241 {
242 return false;
243 }
244
245 // May want to filter attachments
246 return m_SimulationService.CreateObject(destination, sog, false);
247 }
248
249 public void ReleaseAgent(UUID regionID, UUID agentID)
250 {
251 GridRegion region = m_GridService.GetRegionByUUID(m_ScopeID, regionID);
252 if (region != null)
253 {
254 string uri = "http://" + region.ExternalHostName + ":" + region.HttpPort +
255 "/agent/" + agentID.ToString() + "/" + regionID.ToString() + "/release/";
256
257 m_SimulationService.ReleaseAgent(regionID, agentID, uri);
258 }
259 }
260
261 protected bool Authenticate(AgentCircuitData aCircuit)
262 { 225 {
263 string authURL = string.Empty; 226 string authURL = string.Empty;
264 if (aCircuit.ServiceURLs.ContainsKey("HomeURI")) 227 if (aCircuit.ServiceURLs.ContainsKey("HomeURI"))
diff --git a/OpenSim/Services/Interfaces/IGatekeeperService.cs b/OpenSim/Services/Interfaces/IGatekeeperService.cs
index 5e21804..d41df75 100644
--- a/OpenSim/Services/Interfaces/IGatekeeperService.cs
+++ b/OpenSim/Services/Interfaces/IGatekeeperService.cs
@@ -39,9 +39,5 @@ namespace OpenSim.Services.Interfaces
39 GridRegion GetHyperlinkRegion(UUID regionID); 39 GridRegion GetHyperlinkRegion(UUID regionID);
40 40
41 bool LoginAgent(AgentCircuitData aCircuit, GridRegion destination, out string reason); 41 bool LoginAgent(AgentCircuitData aCircuit, GridRegion destination, out string reason);
42 bool UpdateAgent(GridRegion destination, AgentData agent);
43 void ReleaseAgent(UUID regionID, UUID agentID);
44
45 bool LoginAttachment(GridRegion destination, ISceneObject sog);
46 } 42 }
47} 43}
diff --git a/bin/config-include/StandaloneHypergrid.ini b/bin/config-include/StandaloneHypergrid.ini
index 67714cf..eb887a6 100644
--- a/bin/config-include/StandaloneHypergrid.ini
+++ b/bin/config-include/StandaloneHypergrid.ini
@@ -29,6 +29,7 @@
29 LibraryModule = true 29 LibraryModule = true
30 LLLoginServiceInConnector = true 30 LLLoginServiceInConnector = true
31 AuthenticationServiceInConnector = true 31 AuthenticationServiceInConnector = true
32 SimulationServiceInConnector = true
32 33
33[AssetService] 34[AssetService]
34 ; For the AssetServiceInConnector 35 ; For the AssetServiceInConnector