aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/Connectors
diff options
context:
space:
mode:
authorOren Hurvitz2014-04-09 08:03:25 +0300
committerOren Hurvitz2014-04-09 09:22:20 +0100
commit06e0528d0b9929cbd8d2b360b0baa00288340d13 (patch)
tree0ffd33e5eda96badff712bdd78794ce6debbb392 /OpenSim/Services/Connectors
parentLog when the presence service logs-out all the users in a region (diff)
downloadopensim-SC_OLD-06e0528d0b9929cbd8d2b360b0baa00288340d13.zip
opensim-SC_OLD-06e0528d0b9929cbd8d2b360b0baa00288340d13.tar.gz
opensim-SC_OLD-06e0528d0b9929cbd8d2b360b0baa00288340d13.tar.bz2
opensim-SC_OLD-06e0528d0b9929cbd8d2b360b0baa00288340d13.tar.xz
In teleports, pass the source region to the destination (similar to an HTTP referrer)
Diffstat (limited to 'OpenSim/Services/Connectors')
-rw-r--r--OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs43
-rw-r--r--OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs30
2 files changed, 26 insertions, 47 deletions
diff --git a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs
index 61f8516..8abd046 100644
--- a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs
@@ -116,7 +116,7 @@ namespace OpenSim.Services.Connectors.Hypergrid
116 // The Login service calls this interface with fromLogin=true 116 // The Login service calls this interface with fromLogin=true
117 // Sims call it with fromLogin=false 117 // Sims call it with fromLogin=false
118 // Either way, this is verified by the handler 118 // Either way, this is verified by the handler
119 public bool LoginAgentToGrid(AgentCircuitData aCircuit, GridRegion gatekeeper, GridRegion destination, bool fromLogin, out string reason) 119 public bool LoginAgentToGrid(GridRegion source, AgentCircuitData aCircuit, GridRegion gatekeeper, GridRegion destination, bool fromLogin, out string reason)
120 { 120 {
121 reason = String.Empty; 121 reason = String.Empty;
122 122
@@ -138,56 +138,25 @@ namespace OpenSim.Services.Connectors.Hypergrid
138 Console.WriteLine(" >>> LoginAgentToGrid <<< " + home.ServerURI); 138 Console.WriteLine(" >>> LoginAgentToGrid <<< " + home.ServerURI);
139 139
140 uint flags = fromLogin ? (uint)TeleportFlags.ViaLogin : (uint)TeleportFlags.ViaHome; 140 uint flags = fromLogin ? (uint)TeleportFlags.ViaLogin : (uint)TeleportFlags.ViaHome;
141 return CreateAgent(home, aCircuit, flags, out reason); 141 return CreateAgent(source, home, aCircuit, flags, out reason);
142 } 142 }
143 143
144 144
145 // The simulators call this interface 145 // The simulators call this interface
146 public bool LoginAgentToGrid(AgentCircuitData aCircuit, GridRegion gatekeeper, GridRegion destination, out string reason) 146 public bool LoginAgentToGrid(GridRegion source, AgentCircuitData aCircuit, GridRegion gatekeeper, GridRegion destination, out string reason)
147 { 147 {
148 return LoginAgentToGrid(aCircuit, gatekeeper, destination, false, out reason); 148 return LoginAgentToGrid(source, aCircuit, gatekeeper, destination, false, out reason);
149 } 149 }
150 150
151 protected override void PackData(OSDMap args, AgentCircuitData aCircuit, GridRegion destination, uint flags) 151 protected override void PackData(OSDMap args, GridRegion source, AgentCircuitData aCircuit, GridRegion destination, uint flags)
152 { 152 {
153 base.PackData(args, aCircuit, destination, flags); 153 base.PackData(args, source, aCircuit, destination, flags);
154 args["gatekeeper_serveruri"] = OSD.FromString(m_Gatekeeper.ServerURI); 154 args["gatekeeper_serveruri"] = OSD.FromString(m_Gatekeeper.ServerURI);
155 args["gatekeeper_host"] = OSD.FromString(m_Gatekeeper.ExternalHostName); 155 args["gatekeeper_host"] = OSD.FromString(m_Gatekeeper.ExternalHostName);
156 args["gatekeeper_port"] = OSD.FromString(m_Gatekeeper.HttpPort.ToString()); 156 args["gatekeeper_port"] = OSD.FromString(m_Gatekeeper.HttpPort.ToString());
157 args["destination_serveruri"] = OSD.FromString(destination.ServerURI); 157 args["destination_serveruri"] = OSD.FromString(destination.ServerURI);
158 } 158 }
159 159
160 protected OSDMap PackCreateAgentArguments(AgentCircuitData aCircuit, GridRegion gatekeeper, GridRegion destination, IPEndPoint ipaddress)
161 {
162 OSDMap args = null;
163 try
164 {
165 args = aCircuit.PackAgentCircuitData();
166 }
167 catch (Exception e)
168 {
169 m_log.Debug("[USER AGENT CONNECTOR]: PackAgentCircuitData failed with exception: " + e.Message);
170 }
171
172 // Add the input arguments
173 args["gatekeeper_serveruri"] = OSD.FromString(gatekeeper.ServerURI);
174 args["gatekeeper_host"] = OSD.FromString(gatekeeper.ExternalHostName);
175 args["gatekeeper_port"] = OSD.FromString(gatekeeper.HttpPort.ToString());
176 args["destination_x"] = OSD.FromString(destination.RegionLocX.ToString());
177 args["destination_y"] = OSD.FromString(destination.RegionLocY.ToString());
178 args["destination_name"] = OSD.FromString(destination.RegionName);
179 args["destination_uuid"] = OSD.FromString(destination.RegionID.ToString());
180 args["destination_serveruri"] = OSD.FromString(destination.ServerURI);
181
182 // 10/3/2010
183 // I added the client_ip up to the regular AgentCircuitData, so this doesn't need to be here.
184 // This need cleaning elsewhere...
185 //if (ipaddress != null)
186 // args["client_ip"] = OSD.FromString(ipaddress.Address.ToString());
187
188 return args;
189 }
190
191 public void SetClientToken(UUID sessionID, string token) 160 public void SetClientToken(UUID sessionID, string token)
192 { 161 {
193 // no-op 162 // no-op
diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
index 98686f8..a5520c4 100644
--- a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
@@ -79,22 +79,32 @@ namespace OpenSim.Services.Connectors.Simulation
79 return "agent/"; 79 return "agent/";
80 } 80 }
81 81
82 protected virtual void PackData(OSDMap args, AgentCircuitData aCircuit, GridRegion destination, uint flags) 82 protected virtual void PackData(OSDMap args, GridRegion source, AgentCircuitData aCircuit, GridRegion destination, uint flags)
83 { 83 {
84 args["destination_x"] = OSD.FromString(destination.RegionLocX.ToString()); 84 if (source != null)
85 args["destination_y"] = OSD.FromString(destination.RegionLocY.ToString()); 85 {
86 args["destination_name"] = OSD.FromString(destination.RegionName); 86 args["source_x"] = OSD.FromString(source.RegionLocX.ToString());
87 args["destination_uuid"] = OSD.FromString(destination.RegionID.ToString()); 87 args["source_y"] = OSD.FromString(source.RegionLocY.ToString());
88 args["teleport_flags"] = OSD.FromString(flags.ToString()); 88 args["source_name"] = OSD.FromString(source.RegionName);
89 args["source_uuid"] = OSD.FromString(source.RegionID.ToString());
90 if (!String.IsNullOrEmpty(source.RawServerURI))
91 args["source_server_uri"] = OSD.FromString(source.RawServerURI);
92 }
93
94 args["destination_x"] = OSD.FromString(destination.RegionLocX.ToString());
95 args["destination_y"] = OSD.FromString(destination.RegionLocY.ToString());
96 args["destination_name"] = OSD.FromString(destination.RegionName);
97 args["destination_uuid"] = OSD.FromString(destination.RegionID.ToString());
98 args["teleport_flags"] = OSD.FromString(flags.ToString());
89 } 99 }
90 100
91 public bool CreateAgent(GridRegion destination, AgentCircuitData aCircuit, uint flags, out string reason) 101 public bool CreateAgent(GridRegion source, GridRegion destination, AgentCircuitData aCircuit, uint flags, out string reason)
92 { 102 {
93 string tmp = String.Empty; 103 string tmp = String.Empty;
94 return CreateAgent(destination, aCircuit, flags, out tmp, out reason); 104 return CreateAgent(source, destination, aCircuit, flags, out tmp, out reason);
95 } 105 }
96 106
97 public bool CreateAgent(GridRegion destination, AgentCircuitData aCircuit, uint flags, out string myipaddress, out string reason) 107 public bool CreateAgent(GridRegion source, GridRegion destination, AgentCircuitData aCircuit, uint flags, out string myipaddress, out string reason)
98 { 108 {
99 m_log.DebugFormat("[REMOTE SIMULATION CONNECTOR]: Creating agent at {0}", destination.ServerURI); 109 m_log.DebugFormat("[REMOTE SIMULATION CONNECTOR]: Creating agent at {0}", destination.ServerURI);
100 reason = String.Empty; 110 reason = String.Empty;
@@ -111,7 +121,7 @@ namespace OpenSim.Services.Connectors.Simulation
111 try 121 try
112 { 122 {
113 OSDMap args = aCircuit.PackAgentCircuitData(); 123 OSDMap args = aCircuit.PackAgentCircuitData();
114 PackData(args, aCircuit, destination, flags); 124 PackData(args, source, aCircuit, destination, flags);
115 125
116 OSDMap result = WebUtil.PostToServiceCompressed(uri, args, 30000); 126 OSDMap result = WebUtil.PostToServiceCompressed(uri, args, 30000);
117 bool success = result["success"].AsBoolean(); 127 bool success = result["success"].AsBoolean();