aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/Connectors
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Services/Connectors')
-rw-r--r--OpenSim/Services/Connectors/Grid/GridServiceConnector.cs3
-rw-r--r--OpenSim/Services/Connectors/Grid/HypergridServiceConnector.cs92
-rw-r--r--OpenSim/Services/Connectors/Land/LandServiceConnector.cs13
-rw-r--r--OpenSim/Services/Connectors/Neighbour/NeighbourServiceConnector.cs22
4 files changed, 114 insertions, 16 deletions
diff --git a/OpenSim/Services/Connectors/Grid/GridServiceConnector.cs b/OpenSim/Services/Connectors/Grid/GridServiceConnector.cs
index 748892a..ba46b0d 100644
--- a/OpenSim/Services/Connectors/Grid/GridServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Grid/GridServiceConnector.cs
@@ -94,7 +94,8 @@ namespace OpenSim.Services.Connectors
94 sendData[kvp.Key] = (string)kvp.Value; 94 sendData[kvp.Key] = (string)kvp.Value;
95 95
96 sendData["SCOPEID"] = scopeID.ToString(); 96 sendData["SCOPEID"] = scopeID.ToString();
97 97 sendData["VERSIONMIN"] = ProtocolVersions.ClientProtocolVersionMin.ToString();
98 sendData["VERSIONMAX"] = ProtocolVersions.ClientProtocolVersionMax.ToString();
98 sendData["METHOD"] = "register"; 99 sendData["METHOD"] = "register";
99 100
100 string reqString = ServerUtils.BuildQueryString(sendData); 101 string reqString = ServerUtils.BuildQueryString(sendData);
diff --git a/OpenSim/Services/Connectors/Grid/HypergridServiceConnector.cs b/OpenSim/Services/Connectors/Grid/HypergridServiceConnector.cs
index b5e8743..dd19b01 100644
--- a/OpenSim/Services/Connectors/Grid/HypergridServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Grid/HypergridServiceConnector.cs
@@ -66,7 +66,7 @@ namespace OpenSim.Services.Connectors.Grid
66 IList paramList = new ArrayList(); 66 IList paramList = new ArrayList();
67 paramList.Add(hash); 67 paramList.Add(hash);
68 68
69 XmlRpcRequest request = new XmlRpcRequest("linkk_region", paramList); 69 XmlRpcRequest request = new XmlRpcRequest("link_region", paramList);
70 string uri = "http://" + info.ExternalEndPoint.Address + ":" + info.HttpPort + "/"; 70 string uri = "http://" + info.ExternalEndPoint.Address + ":" + info.HttpPort + "/";
71 m_log.Debug("[HGrid]: Linking to " + uri); 71 m_log.Debug("[HGrid]: Linking to " + uri);
72 XmlRpcResponse response = request.Send(uri, 10000); 72 XmlRpcResponse response = request.Send(uri, 10000);
@@ -82,6 +82,7 @@ namespace OpenSim.Services.Connectors.Grid
82 try 82 try
83 { 83 {
84 UUID.TryParse((string)hash["uuid"], out uuid); 84 UUID.TryParse((string)hash["uuid"], out uuid);
85 m_log.Debug(">> HERE, uuid: " + uuid);
85 info.RegionID = uuid; 86 info.RegionID = uuid;
86 if ((string)hash["handle"] != null) 87 if ((string)hash["handle"] != null)
87 { 88 {
@@ -148,5 +149,94 @@ namespace OpenSim.Services.Connectors.Grid
148 } 149 }
149 } 150 }
150 151
152 public bool InformRegionOfUser(GridRegion regInfo, AgentCircuitData agentData, GridRegion home, string userServer, string assetServer, string inventoryServer)
153 {
154 string capsPath = agentData.CapsPath;
155 Hashtable loginParams = new Hashtable();
156 loginParams["session_id"] = agentData.SessionID.ToString();
157
158 loginParams["firstname"] = agentData.firstname;
159 loginParams["lastname"] = agentData.lastname;
160
161 loginParams["agent_id"] = agentData.AgentID.ToString();
162 loginParams["circuit_code"] = agentData.circuitcode.ToString();
163 loginParams["startpos_x"] = agentData.startpos.X.ToString();
164 loginParams["startpos_y"] = agentData.startpos.Y.ToString();
165 loginParams["startpos_z"] = agentData.startpos.Z.ToString();
166 loginParams["caps_path"] = capsPath;
167
168 if (home != null)
169 {
170 loginParams["region_uuid"] = home.RegionID.ToString();
171 loginParams["regionhandle"] = home.RegionHandle.ToString();
172 loginParams["home_address"] = home.ExternalHostName;
173 loginParams["home_port"] = home.HttpPort.ToString();
174 loginParams["internal_port"] = home.InternalEndPoint.Port.ToString();
175
176 m_log.Debug(" --------- Home -------");
177 m_log.Debug(" >> " + loginParams["home_address"] + " <<");
178 m_log.Debug(" >> " + loginParams["region_uuid"] + " <<");
179 m_log.Debug(" >> " + loginParams["regionhandle"] + " <<");
180 m_log.Debug(" >> " + loginParams["home_port"] + " <<");
181 m_log.Debug(" --------- ------------ -------");
182 }
183 else
184 m_log.WarnFormat("[HGrid]: Home region not found for {0} {1}", agentData.firstname, agentData.lastname);
185
186 loginParams["userserver_id"] = userServer;
187 loginParams["assetserver_id"] = assetServer;
188 loginParams["inventoryserver_id"] = inventoryServer;
189
190
191 ArrayList SendParams = new ArrayList();
192 SendParams.Add(loginParams);
193
194 // Send
195 string uri = "http://" + regInfo.ExternalHostName + ":" + regInfo.HttpPort + "/";
196 //m_log.Debug("XXX uri: " + uri);
197 XmlRpcRequest request = new XmlRpcRequest("expect_hg_user", SendParams);
198 XmlRpcResponse reply;
199 try
200 {
201 reply = request.Send(uri, 6000);
202 }
203 catch (Exception e)
204 {
205 m_log.Warn("[HGrid]: Failed to notify region about user. Reason: " + e.Message);
206 return false;
207 }
208
209 if (!reply.IsFault)
210 {
211 bool responseSuccess = true;
212 if (reply.Value != null)
213 {
214 Hashtable resp = (Hashtable)reply.Value;
215 if (resp.ContainsKey("success"))
216 {
217 if ((string)resp["success"] == "FALSE")
218 {
219 responseSuccess = false;
220 }
221 }
222 }
223 if (responseSuccess)
224 {
225 m_log.Info("[HGrid]: Successfully informed remote region about user " + agentData.AgentID);
226 return true;
227 }
228 else
229 {
230 m_log.ErrorFormat("[HGrid]: Region responded that it is not available to receive clients");
231 return false;
232 }
233 }
234 else
235 {
236 m_log.ErrorFormat("[HGrid]: XmlRpc request to region failed with message {0}, code {1} ", reply.FaultString, reply.FaultCode);
237 return false;
238 }
239 }
240
151 } 241 }
152} 242}
diff --git a/OpenSim/Services/Connectors/Land/LandServiceConnector.cs b/OpenSim/Services/Connectors/Land/LandServiceConnector.cs
index 0243f1f..06bc11c 100644
--- a/OpenSim/Services/Connectors/Land/LandServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Land/LandServiceConnector.cs
@@ -38,6 +38,7 @@ using OpenSim.Framework.Servers.HttpServer;
38using OpenSim.Services.Interfaces; 38using OpenSim.Services.Interfaces;
39using OpenMetaverse; 39using OpenMetaverse;
40using Nwc.XmlRpc; 40using Nwc.XmlRpc;
41using GridRegion = OpenSim.Services.Interfaces.GridRegion;
41 42
42namespace OpenSim.Services.Connectors 43namespace OpenSim.Services.Connectors
43{ 44{
@@ -47,20 +48,20 @@ namespace OpenSim.Services.Connectors
47 LogManager.GetLogger( 48 LogManager.GetLogger(
48 MethodBase.GetCurrentMethod().DeclaringType); 49 MethodBase.GetCurrentMethod().DeclaringType);
49 50
50 protected IGridServices m_MapService = null; 51 protected IGridService m_GridService = null;
51 52
52 public LandServicesConnector() 53 public LandServicesConnector()
53 { 54 {
54 } 55 }
55 56
56 public LandServicesConnector(IGridServices gridServices) 57 public LandServicesConnector(IGridService gridServices)
57 { 58 {
58 Initialise(gridServices); 59 Initialise(gridServices);
59 } 60 }
60 61
61 public virtual void Initialise(IGridServices gridServices) 62 public virtual void Initialise(IGridService gridServices)
62 { 63 {
63 m_MapService = gridServices; 64 m_GridService = gridServices;
64 } 65 }
65 66
66 public virtual LandData GetLandData(ulong regionHandle, uint x, uint y) 67 public virtual LandData GetLandData(ulong regionHandle, uint x, uint y)
@@ -76,7 +77,9 @@ namespace OpenSim.Services.Connectors
76 77
77 try 78 try
78 { 79 {
79 RegionInfo info = m_MapService.RequestNeighbourInfo(regionHandle); 80 uint xpos = 0, ypos = 0;
81 Utils.LongToUInts(regionHandle, out xpos, out ypos);
82 GridRegion info = m_GridService.GetRegionByPosition(UUID.Zero, (int)xpos, (int)ypos);
80 if (info != null) // just to be sure 83 if (info != null) // just to be sure
81 { 84 {
82 XmlRpcRequest request = new XmlRpcRequest("land_data", paramList); 85 XmlRpcRequest request = new XmlRpcRequest("land_data", paramList);
diff --git a/OpenSim/Services/Connectors/Neighbour/NeighbourServiceConnector.cs b/OpenSim/Services/Connectors/Neighbour/NeighbourServiceConnector.cs
index 7fff537..145f212 100644
--- a/OpenSim/Services/Connectors/Neighbour/NeighbourServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Neighbour/NeighbourServiceConnector.cs
@@ -41,6 +41,8 @@ using OpenSim.Services.Interfaces;
41using OpenMetaverse; 41using OpenMetaverse;
42using OpenMetaverse.StructuredData; 42using OpenMetaverse.StructuredData;
43 43
44using GridRegion = OpenSim.Services.Interfaces.GridRegion;
45
44namespace OpenSim.Services.Connectors 46namespace OpenSim.Services.Connectors
45{ 47{
46 public class NeighbourServicesConnector : INeighbourService 48 public class NeighbourServicesConnector : INeighbourService
@@ -49,37 +51,39 @@ namespace OpenSim.Services.Connectors
49 LogManager.GetLogger( 51 LogManager.GetLogger(
50 MethodBase.GetCurrentMethod().DeclaringType); 52 MethodBase.GetCurrentMethod().DeclaringType);
51 53
52 protected IGridServices m_MapService = null; 54 protected IGridService m_GridService = null;
53 55
54 public NeighbourServicesConnector() 56 public NeighbourServicesConnector()
55 { 57 {
56 } 58 }
57 59
58 public NeighbourServicesConnector(IGridServices gridServices) 60 public NeighbourServicesConnector(IGridService gridServices)
59 { 61 {
60 Initialise(gridServices); 62 Initialise(gridServices);
61 } 63 }
62 64
63 public virtual void Initialise(IGridServices gridServices) 65 public virtual void Initialise(IGridService gridServices)
64 { 66 {
65 m_MapService = gridServices; 67 m_GridService = gridServices;
66 } 68 }
67 69
68 public virtual bool HelloNeighbour(ulong regionHandle, RegionInfo thisRegion) 70 public virtual GridRegion HelloNeighbour(ulong regionHandle, RegionInfo thisRegion)
69 { 71 {
70 RegionInfo regInfo = m_MapService.RequestNeighbourInfo(regionHandle); 72 uint x = 0, y = 0;
73 Utils.LongToUInts(regionHandle, out x, out y);
74 GridRegion regInfo = m_GridService.GetRegionByPosition(UUID.Zero, (int)x, (int)y);
71 if ((regInfo != null) && 75 if ((regInfo != null) &&
72 // Don't remote-call this instance; that's a startup hickup 76 // Don't remote-call this instance; that's a startup hickup
73 !((regInfo.ExternalHostName == thisRegion.ExternalHostName) && (regInfo.HttpPort == thisRegion.HttpPort))) 77 !((regInfo.ExternalHostName == thisRegion.ExternalHostName) && (regInfo.HttpPort == thisRegion.HttpPort)))
74 { 78 {
75 return DoHelloNeighbourCall(regInfo, thisRegion); 79 DoHelloNeighbourCall(regInfo, thisRegion);
76 } 80 }
77 //else 81 //else
78 // m_log.Warn("[REST COMMS]: Region not found " + regionHandle); 82 // m_log.Warn("[REST COMMS]: Region not found " + regionHandle);
79 return false; 83 return regInfo;
80 } 84 }
81 85
82 public bool DoHelloNeighbourCall(RegionInfo region, RegionInfo thisRegion) 86 public bool DoHelloNeighbourCall(GridRegion region, RegionInfo thisRegion)
83 { 87 {
84 string uri = "http://" + region.ExternalEndPoint.Address + ":" + region.HttpPort + "/region/" + thisRegion.RegionID + "/"; 88 string uri = "http://" + region.ExternalEndPoint.Address + ":" + region.HttpPort + "/region/" + thisRegion.RegionID + "/";
85 //m_log.Debug(" >>> DoHelloNeighbourCall <<< " + uri); 89 //m_log.Debug(" >>> DoHelloNeighbourCall <<< " + uri);