aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services
diff options
context:
space:
mode:
authorMelanie2010-09-03 03:37:18 +0100
committerMelanie2010-09-03 03:37:18 +0100
commit4e0d6e8e41cf25a8e8d8524d9d5e94ab0752fb00 (patch)
tree6ecae46c7c5d46d4eb5a5ed65c1a7a8b8b15cc04 /OpenSim/Services
parentFix an issue with rezzing scripted objects. (diff)
parentMerge branch 'master' of melanie@opensimulator.org:/var/git/opensim (diff)
downloadopensim-SC-4e0d6e8e41cf25a8e8d8524d9d5e94ab0752fb00.zip
opensim-SC-4e0d6e8e41cf25a8e8d8524d9d5e94ab0752fb00.tar.gz
opensim-SC-4e0d6e8e41cf25a8e8d8524d9d5e94ab0752fb00.tar.bz2
opensim-SC-4e0d6e8e41cf25a8e8d8524d9d5e94ab0752fb00.tar.xz
Merge branch 'master' into careminster-presence-refactor
Diffstat (limited to 'OpenSim/Services')
-rw-r--r--OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs16
-rw-r--r--OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs7
-rw-r--r--OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs24
-rw-r--r--OpenSim/Services/GridService/HypergridLinker.cs29
-rw-r--r--OpenSim/Services/InventoryService/XInventoryService.cs24
5 files changed, 61 insertions, 39 deletions
diff --git a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs
index 8d0f7be..77e3b20 100644
--- a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs
@@ -86,13 +86,8 @@ namespace OpenSim.Services.Connectors.Hypergrid
86 paramList.Add(hash); 86 paramList.Add(hash);
87 87
88 XmlRpcRequest request = new XmlRpcRequest("link_region", paramList); 88 XmlRpcRequest request = new XmlRpcRequest("link_region", paramList);
89 IPEndPoint ext = info.ExternalEndPoint; 89 string uri = "http://" + ((info.ServerURI == string.Empty) ? info.ExternalEndPoint.Address + ":" + info.HttpPort + "/" : info.ServerURI);
90 string uri = ""; 90 m_log.Debug("[GATEKEEPER SERVICE CONNECTOR]: Linking to " + uri);
91 if (ext != null)
92 {
93 uri = "http://" + ext.Address + ":" + info.HttpPort + "/";
94 }
95 //m_log.Debug("[GATEKEEPER SERVICE CONNECTOR]: Linking to " + uri);
96 XmlRpcResponse response = null; 91 XmlRpcResponse response = null;
97 try 92 try
98 { 93 {
@@ -193,12 +188,7 @@ namespace OpenSim.Services.Connectors.Hypergrid
193 paramList.Add(hash); 188 paramList.Add(hash);
194 189
195 XmlRpcRequest request = new XmlRpcRequest("get_region", paramList); 190 XmlRpcRequest request = new XmlRpcRequest("get_region", paramList);
196 IPEndPoint ext = gatekeeper.ExternalEndPoint; 191 string uri = "http://" + ((gatekeeper.ServerURI == string.Empty) ? gatekeeper.ExternalEndPoint.Address + ":" + gatekeeper.HttpPort + "/" : gatekeeper.ServerURI);
197 string uri = "";
198 if (ext != null)
199 {
200 uri = "http://" + ext.Address + ":" + gatekeeper.HttpPort + "/";
201 }
202 m_log.Debug("[GATEKEEPER SERVICE CONNECTOR]: contacting " + uri); 192 m_log.Debug("[GATEKEEPER SERVICE CONNECTOR]: contacting " + uri);
203 XmlRpcResponse response = null; 193 XmlRpcResponse response = null;
204 try 194 try
diff --git a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs
index 4501937..7fa086a 100644
--- a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs
@@ -51,15 +51,16 @@ namespace OpenSim.Services.Connectors.Hypergrid
51 MethodBase.GetCurrentMethod().DeclaringType); 51 MethodBase.GetCurrentMethod().DeclaringType);
52 52
53 string m_ServerURL; 53 string m_ServerURL;
54 Uri m_Uri;
55 public UserAgentServiceConnector(string url) 54 public UserAgentServiceConnector(string url)
56 { 55 {
57 m_ServerURL = url; 56 m_ServerURL = url;
57 // Doing this here, because XML-RPC or mono have some strong ideas about
58 // caching DNS translations.
58 try 59 try
59 { 60 {
60 m_Uri = new Uri(m_ServerURL); 61 Uri m_Uri = new Uri(m_ServerURL);
61 IPAddress ip = Util.GetHostFromDNS(m_Uri.Host); 62 IPAddress ip = Util.GetHostFromDNS(m_Uri.Host);
62 m_ServerURL = "http://" + ip.ToString() + ":" + m_Uri.Port; 63 m_ServerURL = m_ServerURL.Replace(m_Uri.Host, ip.ToString()); ;
63 } 64 }
64 catch (Exception e) 65 catch (Exception e)
65 { 66 {
diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
index 9e30044..6d852f1 100644
--- a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
@@ -104,17 +104,23 @@ namespace OpenSim.Services.Connectors.Simulation
104 return false; 104 return false;
105 } 105 }
106 106
107 // Eventually, we want to use a caps url instead of the agentID
108 string uri = string.Empty; 107 string uri = string.Empty;
109 try 108
110 { 109 // HACK -- Simian grid make it work!!!
111 uri = "http://" + destination.ExternalEndPoint.Address + ":" + destination.HttpPort + AgentPath() + aCircuit.AgentID + "/"; 110 if (destination.ServerURI != string.Empty)
112 } 111 uri = "http://" + destination.ServerURI + AgentPath() + aCircuit.AgentID + "/";
113 catch (Exception e) 112 else
114 { 113 {
115 m_log.Debug("[REMOTE SIMULATION CONNECTOR]: Unable to resolve external endpoint on agent create. Reason: " + e.Message); 114 try
116 reason = e.Message; 115 {
117 return false; 116 uri = "http://" + destination.ExternalEndPoint.Address + ":" + destination.HttpPort + AgentPath() + aCircuit.AgentID + "/";
117 }
118 catch (Exception e)
119 {
120 m_log.Debug("[REMOTE SIMULATION CONNECTOR]: Unable to resolve external endpoint on agent create. Reason: " + e.Message);
121 reason = e.Message;
122 return false;
123 }
118 } 124 }
119 125
120 //Console.WriteLine(" >>> DoCreateChildAgentCall <<< " + uri); 126 //Console.WriteLine(" >>> DoCreateChildAgentCall <<< " + uri);
diff --git a/OpenSim/Services/GridService/HypergridLinker.cs b/OpenSim/Services/GridService/HypergridLinker.cs
index 3d722ec..b86fb6f 100644
--- a/OpenSim/Services/GridService/HypergridLinker.cs
+++ b/OpenSim/Services/GridService/HypergridLinker.cs
@@ -158,7 +158,7 @@ namespace OpenSim.Services.GridService
158 string host = "127.0.0.1"; 158 string host = "127.0.0.1";
159 string portstr; 159 string portstr;
160 string regionName = ""; 160 string regionName = "";
161 uint port = 9000; 161 uint port = 0;
162 string[] parts = mapName.Split(new char[] { ':' }); 162 string[] parts = mapName.Split(new char[] { ':' });
163 if (parts.Length >= 1) 163 if (parts.Length >= 1)
164 { 164 {
@@ -177,18 +177,16 @@ namespace OpenSim.Services.GridService
177 regionName = parts[2]; 177 regionName = parts[2];
178 } 178 }
179 179
180 // Sanity check. 180 //// Sanity check.
181 //IPAddress ipaddr = null; 181 //try
182 try 182 //{
183 { 183 // Util.GetHostFromDNS(host);
184 //ipaddr = Util.GetHostFromDNS(host); 184 //}
185 Util.GetHostFromDNS(host); 185 //catch
186 } 186 //{
187 catch 187 // reason = "Malformed hostname";
188 { 188 // return null;
189 reason = "Malformed hostname"; 189 //}
190 return null;
191 }
192 190
193 GridRegion regInfo; 191 GridRegion regInfo;
194 bool success = TryCreateLink(scopeID, xloc, yloc, regionName, port, host, out regInfo, out reason); 192 bool success = TryCreateLink(scopeID, xloc, yloc, regionName, port, host, out regInfo, out reason);
@@ -217,6 +215,11 @@ namespace OpenSim.Services.GridService
217 regInfo.RegionLocY = yloc; 215 regInfo.RegionLocY = yloc;
218 regInfo.ScopeID = scopeID; 216 regInfo.ScopeID = scopeID;
219 217
218 // Big HACK for Simian Grid !!!
219 // We need to clean up all URLs used in OpenSim !!!
220 if (externalHostName.Contains("/"))
221 regInfo.ServerURI = externalHostName;
222
220 try 223 try
221 { 224 {
222 regInfo.InternalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), (int)0); 225 regInfo.InternalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), (int)0);
diff --git a/OpenSim/Services/InventoryService/XInventoryService.cs b/OpenSim/Services/InventoryService/XInventoryService.cs
index 84306e7..fb395ec 100644
--- a/OpenSim/Services/InventoryService/XInventoryService.cs
+++ b/OpenSim/Services/InventoryService/XInventoryService.cs
@@ -293,13 +293,35 @@ namespace OpenSim.Services.InventoryService
293 293
294 public virtual bool AddFolder(InventoryFolderBase folder) 294 public virtual bool AddFolder(InventoryFolderBase folder)
295 { 295 {
296 InventoryFolderBase check = GetFolder(folder);
297 if (check != null)
298 return false;
299
296 XInventoryFolder xFolder = ConvertFromOpenSim(folder); 300 XInventoryFolder xFolder = ConvertFromOpenSim(folder);
297 return m_Database.StoreFolder(xFolder); 301 return m_Database.StoreFolder(xFolder);
298 } 302 }
299 303
300 public virtual bool UpdateFolder(InventoryFolderBase folder) 304 public virtual bool UpdateFolder(InventoryFolderBase folder)
301 { 305 {
302 return AddFolder(folder); 306 XInventoryFolder xFolder = ConvertFromOpenSim(folder);
307 InventoryFolderBase check = GetFolder(folder);
308 if (check == null)
309 return AddFolder(folder);
310
311 if (check.Type != -1 || xFolder.type != -1)
312 {
313 if (xFolder.version > check.Version)
314 return false;
315 check.Version = (ushort)xFolder.version;
316 xFolder = ConvertFromOpenSim(check);
317 return m_Database.StoreFolder(xFolder);
318 }
319
320 if (xFolder.version < check.Version)
321 xFolder.version = check.Version;
322 xFolder.folderID = check.ID;
323
324 return m_Database.StoreFolder(xFolder);
303 } 325 }
304 326
305 public virtual bool MoveFolder(InventoryFolderBase folder) 327 public virtual bool MoveFolder(InventoryFolderBase folder)