aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Services')
-rw-r--r--OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs36
-rw-r--r--OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs2
-rw-r--r--OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs1
-rw-r--r--OpenSim/Services/GridService/HypergridLinker.cs181
-rw-r--r--OpenSim/Services/HypergridService/GatekeeperService.cs29
-rw-r--r--OpenSim/Services/HypergridService/UserAgentService.cs2
-rw-r--r--OpenSim/Services/Interfaces/IUserAccountService.cs2
-rw-r--r--OpenSim/Services/LLLoginService/LLLoginService.cs5
8 files changed, 125 insertions, 133 deletions
diff --git a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs
index 85c1380..a1d9167 100644
--- a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs
@@ -29,6 +29,7 @@ using System;
29using System.Collections; 29using System.Collections;
30using System.Collections.Generic; 30using System.Collections.Generic;
31using System.Drawing; 31using System.Drawing;
32using System.IO;
32using System.Net; 33using System.Net;
33using System.Reflection; 34using System.Reflection;
34using OpenSim.Framework; 35using OpenSim.Framework;
@@ -48,7 +49,7 @@ namespace OpenSim.Services.Connectors.Hypergrid
48 { 49 {
49 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 50 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
50 51
51// private static UUID m_HGMapImage = new UUID("00000000-0000-1111-9999-000000000013"); 52 private static UUID m_HGMapImage = new UUID("00000000-0000-1111-9999-000000000013");
52 53
53 private IAssetService m_AssetService; 54 private IAssetService m_AssetService;
54 55
@@ -143,43 +144,44 @@ namespace OpenSim.Services.Connectors.Hypergrid
143 return true; 144 return true;
144 } 145 }
145 146
146 UUID m_MissingTexture = new UUID("5748decc-f629-461c-9a36-a35a221fe21f"); 147 public UUID GetMapImage(UUID regionID, string imageURL, string storagePath)
147
148 public UUID GetMapImage(UUID regionID, string imageURL)
149 { 148 {
150 if (m_AssetService == null) 149 if (m_AssetService == null)
151 return m_MissingTexture; 150 {
151 m_log.DebugFormat("[GATEKEEPER SERVICE CONNECTOR]: No AssetService defined. Map tile not retrieved.");
152 return m_HGMapImage;
153 }
152 154
155 UUID mapTile = m_HGMapImage;
156 string filename = string.Empty;
157 Bitmap bitmap = null;
153 try 158 try
154 { 159 {
155
156 WebClient c = new WebClient(); 160 WebClient c = new WebClient();
157 //m_log.Debug("JPEG: " + imageURL); 161 //m_log.Debug("JPEG: " + imageURL);
158 string filename = regionID.ToString(); 162 string name = regionID.ToString();
159 c.DownloadFile(imageURL, filename + ".jpg"); 163 filename = Path.Combine(storagePath, name + ".jpg");
160 Bitmap m = new Bitmap(filename + ".jpg"); 164 c.DownloadFile(imageURL, filename);
165 bitmap = new Bitmap(filename);
161 //m_log.Debug("Size: " + m.PhysicalDimension.Height + "-" + m.PhysicalDimension.Width); 166 //m_log.Debug("Size: " + m.PhysicalDimension.Height + "-" + m.PhysicalDimension.Width);
162 byte[] imageData = OpenJPEG.EncodeFromImage(m, true); 167 byte[] imageData = OpenJPEG.EncodeFromImage(bitmap, true);
163 AssetBase ass = new AssetBase(UUID.Random(), "region " + filename, (sbyte)AssetType.Texture, regionID.ToString()); 168 AssetBase ass = new AssetBase(UUID.Random(), "region " + name, (sbyte)AssetType.Texture, regionID.ToString());
164 169
165 // !!! for now 170 // !!! for now
166 //info.RegionSettings.TerrainImageID = ass.FullID; 171 //info.RegionSettings.TerrainImageID = ass.FullID;
167 172
168 ass.Temporary = true;
169 ass.Local = true;
170 ass.Data = imageData; 173 ass.Data = imageData;
171 174
172 m_AssetService.Store(ass); 175 m_AssetService.Store(ass);
173 176
174 // finally 177 // finally
175 return ass.FullID; 178 mapTile = ass.FullID;
176
177 } 179 }
178 catch // LEGIT: Catching problems caused by OpenJPEG p/invoke 180 catch // LEGIT: Catching problems caused by OpenJPEG p/invoke
179 { 181 {
180 m_log.Warn("[GATEKEEPER SERVICE CONNECTOR]: Failed getting/storing map image, because it is probably already in the cache"); 182 m_log.Info("[GATEKEEPER SERVICE CONNECTOR]: Failed getting/storing map image, because it is probably already in the cache");
181 } 183 }
182 return UUID.Zero; 184 return mapTile;
183 } 185 }
184 186
185 public GridRegion GetHyperlinkRegion(GridRegion gatekeeper, UUID regionID) 187 public GridRegion GetHyperlinkRegion(GridRegion gatekeeper, UUID regionID)
diff --git a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs
index 0c41935..7ddcfa6 100644
--- a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs
@@ -104,7 +104,7 @@ namespace OpenSim.Services.Connectors.Hypergrid
104 return false; 104 return false;
105 } 105 }
106 106
107 string uri = m_ServerURL + "/homeagent/" + aCircuit.AgentID + "/"; 107 string uri = m_ServerURL + "homeagent/" + aCircuit.AgentID + "/";
108 108
109 Console.WriteLine(" >>> LoginAgentToGrid <<< " + uri); 109 Console.WriteLine(" >>> LoginAgentToGrid <<< " + uri);
110 110
diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
index e2032d9..4e3cfa5 100644
--- a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
@@ -235,6 +235,7 @@ namespace OpenSim.Services.Connectors.Simulation
235 m_log.Warn("[REMOTE SIMULATION CONNECTOR]: PackAgentCircuitData failed with exception: " + e.Message); 235 m_log.Warn("[REMOTE SIMULATION CONNECTOR]: PackAgentCircuitData failed with exception: " + e.Message);
236 return null; 236 return null;
237 } 237 }
238
238 // Add the input arguments 239 // Add the input arguments
239 args["destination_x"] = OSD.FromString(destination.RegionLocX.ToString()); 240 args["destination_x"] = OSD.FromString(destination.RegionLocX.ToString());
240 args["destination_y"] = OSD.FromString(destination.RegionLocY.ToString()); 241 args["destination_y"] = OSD.FromString(destination.RegionLocY.ToString());
diff --git a/OpenSim/Services/GridService/HypergridLinker.cs b/OpenSim/Services/GridService/HypergridLinker.cs
index d5d0195..643d0fc 100644
--- a/OpenSim/Services/GridService/HypergridLinker.cs
+++ b/OpenSim/Services/GridService/HypergridLinker.cs
@@ -26,7 +26,9 @@
26 */ 26 */
27 27
28using System; 28using System;
29using System.Collections;
29using System.Collections.Generic; 30using System.Collections.Generic;
31using System.IO;
30using System.Linq; 32using System.Linq;
31using System.Net; 33using System.Net;
32using System.Reflection; 34using System.Reflection;
@@ -51,8 +53,6 @@ namespace OpenSim.Services.GridService
51 LogManager.GetLogger( 53 LogManager.GetLogger(
52 MethodBase.GetCurrentMethod().DeclaringType); 54 MethodBase.GetCurrentMethod().DeclaringType);
53 55
54 private static UUID m_HGMapImage = new UUID("00000000-0000-1111-9999-000000000013");
55
56 private static uint m_autoMappingX = 0; 56 private static uint m_autoMappingX = 0;
57 private static uint m_autoMappingY = 0; 57 private static uint m_autoMappingY = 0;
58 private static bool m_enableAutoMapping = false; 58 private static bool m_enableAutoMapping = false;
@@ -64,6 +64,7 @@ namespace OpenSim.Services.GridService
64 64
65 protected UUID m_ScopeID = UUID.Zero; 65 protected UUID m_ScopeID = UUID.Zero;
66 protected bool m_Check4096 = true; 66 protected bool m_Check4096 = true;
67 protected string m_MapTileDirectory = string.Empty;
67 68
68 // Hyperlink regions are hyperlinks on the map 69 // Hyperlink regions are hyperlinks on the map
69 public readonly Dictionary<UUID, GridRegion> m_HyperlinkRegions = new Dictionary<UUID, GridRegion>(); 70 public readonly Dictionary<UUID, GridRegion> m_HyperlinkRegions = new Dictionary<UUID, GridRegion>();
@@ -120,9 +121,24 @@ namespace OpenSim.Services.GridService
120 121
121 m_Check4096 = gridConfig.GetBoolean("Check4096", true); 122 m_Check4096 = gridConfig.GetBoolean("Check4096", true);
122 123
124 m_MapTileDirectory = gridConfig.GetString("MapTileDirectory", string.Empty);
125
123 m_GatekeeperConnector = new GatekeeperServiceConnector(m_AssetService); 126 m_GatekeeperConnector = new GatekeeperServiceConnector(m_AssetService);
124 127
125 m_log.DebugFormat("[HYPERGRID LINKER]: Loaded all services..."); 128 m_log.Debug("[HYPERGRID LINKER]: Loaded all services...");
129 }
130
131 if (!string.IsNullOrEmpty(m_MapTileDirectory))
132 {
133 try
134 {
135 Directory.CreateDirectory(m_MapTileDirectory);
136 }
137 catch (Exception e)
138 {
139 m_log.WarnFormat("[HYPERGRID LINKER]: Could not create map tile storage directory {0}: {1}", m_MapTileDirectory, e);
140 m_MapTileDirectory = string.Empty;
141 }
126 } 142 }
127 143
128 if (MainConsole.Instance != null) 144 if (MainConsole.Instance != null)
@@ -215,7 +231,9 @@ namespace OpenSim.Services.GridService
215 231
216 public bool TryCreateLink(UUID scopeID, int xloc, int yloc, string remoteRegionName, uint externalPort, string externalHostName, string serverURI, UUID ownerID, out GridRegion regInfo, out string reason) 232 public bool TryCreateLink(UUID scopeID, int xloc, int yloc, string remoteRegionName, uint externalPort, string externalHostName, string serverURI, UUID ownerID, out GridRegion regInfo, out string reason)
217 { 233 {
218 m_log.DebugFormat("[HYPERGRID LINKER]: Link to {0}:{1}:{2}, in {3}-{4}", externalHostName, externalPort, remoteRegionName, xloc, yloc); 234 m_log.DebugFormat("[HYPERGRID LINKER]: Link to {0}:{1}, in {2}-{3}",
235 ((serverURI == null) ? (externalHostName + ":" + externalPort) : serverURI),
236 remoteRegionName, xloc / Constants.RegionSize, yloc / Constants.RegionSize);
219 237
220 reason = string.Empty; 238 reason = string.Empty;
221 regInfo = new GridRegion(); 239 regInfo = new GridRegion();
@@ -242,7 +260,9 @@ namespace OpenSim.Services.GridService
242 GridRegion region = m_GridService.GetRegionByPosition(regInfo.ScopeID, regInfo.RegionLocX, regInfo.RegionLocY); 260 GridRegion region = m_GridService.GetRegionByPosition(regInfo.ScopeID, regInfo.RegionLocX, regInfo.RegionLocY);
243 if (region != null) 261 if (region != null)
244 { 262 {
245 m_log.WarnFormat("[HYPERGRID LINKER]: Coordinates {0}-{1} are already occupied by region {2} with uuid {3}", regInfo.RegionLocX, regInfo.RegionLocY, region.RegionName, region.RegionID); 263 m_log.WarnFormat("[HYPERGRID LINKER]: Coordinates {0}-{1} are already occupied by region {2} with uuid {3}",
264 regInfo.RegionLocX / Constants.RegionSize, regInfo.RegionLocY / Constants.RegionSize,
265 region.RegionName, region.RegionID);
246 reason = "Coordinates are already in use"; 266 reason = "Coordinates are already in use";
247 return false; 267 return false;
248 } 268 }
@@ -266,41 +286,22 @@ namespace OpenSim.Services.GridService
266 if (!m_GatekeeperConnector.LinkRegion(regInfo, out regionID, out handle, out externalName, out imageURL, out reason)) 286 if (!m_GatekeeperConnector.LinkRegion(regInfo, out regionID, out handle, out externalName, out imageURL, out reason))
267 return false; 287 return false;
268 288
269 if (regionID != UUID.Zero) 289 if (regionID == UUID.Zero)
270 {
271 region = m_GridService.GetRegionByUUID(scopeID, regionID);
272 if (region != null)
273 {
274 m_log.DebugFormat("[HYPERGRID LINKER]: Region already exists in coordinates {0} {1}", region.RegionLocX / Constants.RegionSize, region.RegionLocY / Constants.RegionSize);
275 regInfo = region;
276 return true;
277 }
278
279 regInfo.RegionID = regionID;
280
281 if ( externalName == string.Empty )
282 regInfo.RegionName = regInfo.ServerURI;
283 else
284 regInfo.RegionName = externalName;
285
286 m_log.Debug("[HYPERGRID LINKER]: naming linked region " + regInfo.RegionName);
287
288 // Try get the map image
289 //regInfo.TerrainImage = m_GatekeeperConnector.GetMapImage(regionID, imageURL);
290 // I need a texture that works for this... the one I tried doesn't seem to be working
291 regInfo.TerrainImage = m_HGMapImage;
292
293 AddHyperlinkRegion(regInfo, handle);
294 m_log.Info("[HYPERGRID LINKER]: Successfully linked to region_uuid " + regInfo.RegionID);
295
296 }
297 else
298 { 290 {
299 m_log.Warn("[HYPERGRID LINKER]: Unable to link region"); 291 m_log.Warn("[HYPERGRID LINKER]: Unable to link region");
300 reason = "Remote region could not be found"; 292 reason = "Remote region could not be found";
301 return false; 293 return false;
302 } 294 }
303 295
296 region = m_GridService.GetRegionByUUID(scopeID, regionID);
297 if (region != null)
298 {
299 m_log.DebugFormat("[HYPERGRID LINKER]: Region already exists in coordinates {0} {1}",
300 region.RegionLocX / Constants.RegionSize, region.RegionLocY / Constants.RegionSize);
301 regInfo = region;
302 return true;
303 }
304
304 uint x, y; 305 uint x, y;
305 if (m_Check4096 && !Check4096(handle, out x, out y)) 306 if (m_Check4096 && !Check4096(handle, out x, out y))
306 { 307 {
@@ -310,7 +311,20 @@ namespace OpenSim.Services.GridService
310 return false; 311 return false;
311 } 312 }
312 313
313 m_log.Debug("[HYPERGRID LINKER]: link region succeeded"); 314 regInfo.RegionID = regionID;
315
316 if ( externalName == string.Empty )
317 regInfo.RegionName = regInfo.ServerURI;
318 else
319 regInfo.RegionName = externalName;
320
321 m_log.Debug("[HYPERGRID LINKER]: naming linked region " + regInfo.RegionName);
322
323 // Get the map image
324 regInfo.TerrainImage = m_GatekeeperConnector.GetMapImage(regionID, imageURL, m_MapTileDirectory);
325
326 AddHyperlinkRegion(regInfo, handle);
327 m_log.Info("[HYPERGRID LINKER]: Successfully linked to region_uuid " + regInfo.RegionID);
314 return true; 328 return true;
315 } 329 }
316 330
@@ -423,15 +437,14 @@ namespace OpenSim.Services.GridService
423 return; 437 return;
424 } 438 }
425 439
426 MainConsole.Instance.Output("Region Name Region UUID"); 440 MainConsole.Instance.Output("Region Name");
427 MainConsole.Instance.Output("Location URI"); 441 MainConsole.Instance.Output("Location Region UUID");
428 MainConsole.Instance.Output("-------------------------------------------------------------------------------"); 442 MainConsole.Instance.Output(new string('-', 72));
429 foreach (RegionData r in regions) 443 foreach (RegionData r in regions)
430 { 444 {
431 MainConsole.Instance.Output(String.Format("{0,-39} {1}\n{2,-39} {3}\n", 445 MainConsole.Instance.Output(String.Format("{0}\n{2,-32} {1}\n",
432 r.RegionName, r.RegionID, 446 r.RegionName, r.RegionID, String.Format("{0},{1} ({2},{3})", r.posX, r.posY,
433 String.Format("{0},{1} ({2},{3})", r.posX, r.posY, r.posX / 256, r.posY / 256), 447 r.posX / Constants.RegionSize, r.posY / Constants.RegionSize)));
434 "http://" + r.Data["serverIP"].ToString() + ":" + r.Data["serverHttpPort"].ToString()));
435 } 448 }
436 return; 449 return;
437 } 450 }
@@ -459,11 +472,14 @@ namespace OpenSim.Services.GridService
459 xloc = Convert.ToInt32(cmdparams[0]) * (int)Constants.RegionSize; 472 xloc = Convert.ToInt32(cmdparams[0]) * (int)Constants.RegionSize;
460 yloc = Convert.ToInt32(cmdparams[1]) * (int)Constants.RegionSize; 473 yloc = Convert.ToInt32(cmdparams[1]) * (int)Constants.RegionSize;
461 serverURI = cmdparams[2]; 474 serverURI = cmdparams[2];
462 if (cmdparams.Length == 4) 475 if (cmdparams.Length > 3)
463 remoteName = cmdparams[3]; 476 remoteName = string.Join(" ", cmdparams, 3, cmdparams.Length - 3);
464 string reason = string.Empty; 477 string reason = string.Empty;
465 GridRegion regInfo; 478 GridRegion regInfo;
466 TryCreateLink(UUID.Zero, xloc, yloc, remoteName, 0, null, serverURI, UUID.Zero, out regInfo, out reason); 479 if (TryCreateLink(UUID.Zero, xloc, yloc, remoteName, 0, null, serverURI, UUID.Zero, out regInfo, out reason))
480 MainConsole.Instance.Output("Hyperlink established");
481 else
482 MainConsole.Instance.Output("Failed to link region: " + reason);
467 } 483 }
468 484
469 private void RunHGCommand(string command, string[] cmdparams) 485 private void RunHGCommand(string command, string[] cmdparams)
@@ -488,18 +504,6 @@ namespace OpenSim.Services.GridService
488 } 504 }
489 else if (command.Equals("link-region")) 505 else if (command.Equals("link-region"))
490 { 506 {
491 if (cmdparams.Length > 0 && cmdparams.Length < 5)
492 {
493 RunLinkRegionCommand(cmdparams);
494 }
495 else
496 {
497 LinkRegionCmdUsage();
498 }
499 return;
500 }
501 else if (command.Equals("link-region"))
502 {
503 if (cmdparams.Length < 3) 507 if (cmdparams.Length < 3)
504 { 508 {
505 if ((cmdparams.Length == 1) || (cmdparams.Length == 2)) 509 if ((cmdparams.Length == 1) || (cmdparams.Length == 2))
@@ -514,40 +518,24 @@ namespace OpenSim.Services.GridService
514 } 518 }
515 519
516 //this should be the prefererred way of setting up hg links now 520 //this should be the prefererred way of setting up hg links now
517 if ( cmdparams[2].StartsWith("http") && ( cmdparams.Length >= 3 && cmdparams.Length <= 5 )) { 521 if (cmdparams[2].StartsWith("http"))
522 {
518 RunLinkRegionCommand(cmdparams); 523 RunLinkRegionCommand(cmdparams);
519 } 524 }
520 else if (cmdparams[2].Contains(":")) 525 else if (cmdparams[2].Contains(":"))
521 { 526 {
522 // New format 527 // New format
523 int xloc, yloc; 528 string[] parts = cmdparams[2].Split(':');
524 string mapName; 529 if (parts.Length > 2)
525 try
526 { 530 {
527 xloc = Convert.ToInt32(cmdparams[0]); 531 // Insert remote region name
528 yloc = Convert.ToInt32(cmdparams[1]); 532 ArrayList parameters = new ArrayList(cmdparams);
529 mapName = cmdparams[2]; 533 parameters.Insert(3, parts[2]);
530 if (cmdparams.Length > 3) 534 cmdparams = (string[])parameters.ToArray(typeof(string));
531 for (int i = 3; i < cmdparams.Length; i++)
532 mapName += " " + cmdparams[i];
533
534 //m_log.Info(">> MapName: " + mapName);
535 }
536 catch (Exception e)
537 {
538 MainConsole.Instance.Output("[HGrid] Wrong format for link-region command: " + e.Message);
539 LinkRegionCmdUsage();
540 return;
541 } 535 }
536 cmdparams[2] = "http://" + parts[0] + ':' + parts[1];
542 537
543 // Convert cell coordinates given by the user to meters 538 RunLinkRegionCommand(cmdparams);
544 xloc = xloc * (int)Constants.RegionSize;
545 yloc = yloc * (int)Constants.RegionSize;
546 string reason = string.Empty;
547 if (TryLinkRegionToCoords(UUID.Zero, mapName, xloc, yloc, out reason) == null)
548 MainConsole.Instance.Output("Failed to link region: " + reason);
549 else
550 MainConsole.Instance.Output("Hyperlink established");
551 } 539 }
552 else 540 else
553 { 541 {
@@ -556,16 +544,12 @@ namespace OpenSim.Services.GridService
556 int xloc, yloc; 544 int xloc, yloc;
557 uint externalPort; 545 uint externalPort;
558 string externalHostName; 546 string externalHostName;
559 string serverURI;
560 try 547 try
561 { 548 {
562 xloc = Convert.ToInt32(cmdparams[0]); 549 xloc = Convert.ToInt32(cmdparams[0]);
563 yloc = Convert.ToInt32(cmdparams[1]); 550 yloc = Convert.ToInt32(cmdparams[1]);
564 externalPort = Convert.ToUInt32(cmdparams[3]); 551 externalPort = Convert.ToUInt32(cmdparams[3]);
565 externalHostName = cmdparams[2]; 552 externalHostName = cmdparams[2];
566 if ( cmdparams.Length == 4 ) {
567
568 }
569 //internalPort = Convert.ToUInt32(cmdparams[4]); 553 //internalPort = Convert.ToUInt32(cmdparams[4]);
570 //remotingPort = Convert.ToUInt32(cmdparams[5]); 554 //remotingPort = Convert.ToUInt32(cmdparams[5]);
571 } 555 }
@@ -582,27 +566,30 @@ namespace OpenSim.Services.GridService
582 string reason = string.Empty; 566 string reason = string.Empty;
583 if (TryCreateLink(UUID.Zero, xloc, yloc, string.Empty, externalPort, externalHostName, UUID.Zero, out regInfo, out reason)) 567 if (TryCreateLink(UUID.Zero, xloc, yloc, string.Empty, externalPort, externalHostName, UUID.Zero, out regInfo, out reason))
584 { 568 {
585 if (cmdparams.Length >= 5) 569 // What is this? The GridRegion instance will be discarded anyway,
586 { 570 // which effectively ignores any local name given with the command.
587 regInfo.RegionName = ""; 571 //if (cmdparams.Length >= 5)
588 for (int i = 4; i < cmdparams.Length; i++) 572 //{
589 regInfo.RegionName += cmdparams[i] + " "; 573 // regInfo.RegionName = "";
590 } 574 // for (int i = 4; i < cmdparams.Length; i++)
575 // regInfo.RegionName += cmdparams[i] + " ";
576 //}
591 } 577 }
592 } 578 }
593 return; 579 return;
594 } 580 }
595 else if (command.Equals("unlink-region")) 581 else if (command.Equals("unlink-region"))
596 { 582 {
597 if (cmdparams.Length < 1 || cmdparams.Length > 1) 583 if (cmdparams.Length < 1)
598 { 584 {
599 UnlinkRegionCmdUsage(); 585 UnlinkRegionCmdUsage();
600 return; 586 return;
601 } 587 }
602 if (TryUnlinkRegion(cmdparams[0])) 588 string region = string.Join(" ", cmdparams);
603 MainConsole.Instance.Output("Successfully unlinked " + cmdparams[0]); 589 if (TryUnlinkRegion(region))
590 MainConsole.Instance.Output("Successfully unlinked " + region);
604 else 591 else
605 MainConsole.Instance.Output("Unable to unlink " + cmdparams[0] + ", region not found."); 592 MainConsole.Instance.Output("Unable to unlink " + region + ", region not found.");
606 } 593 }
607 } 594 }
608 595
diff --git a/OpenSim/Services/HypergridService/GatekeeperService.cs b/OpenSim/Services/HypergridService/GatekeeperService.cs
index 05be7b8..4419201 100644
--- a/OpenSim/Services/HypergridService/GatekeeperService.cs
+++ b/OpenSim/Services/HypergridService/GatekeeperService.cs
@@ -123,42 +123,39 @@ namespace OpenSim.Services.HypergridService
123 externalName = m_ExternalName + ((regionName != string.Empty) ? " " + regionName : ""); 123 externalName = m_ExternalName + ((regionName != string.Empty) ? " " + regionName : "");
124 imageURL = string.Empty; 124 imageURL = string.Empty;
125 reason = string.Empty; 125 reason = string.Empty;
126 126 GridRegion region = null;
127 127
128 m_log.DebugFormat("[GATEKEEPER SERVICE]: Request to link to {0}", (regionName == string.Empty)? "default region" : regionName); 128 m_log.DebugFormat("[GATEKEEPER SERVICE]: Request to link to {0}", (regionName == string.Empty)? "default region" : regionName);
129 if (!m_AllowTeleportsToAnyRegion || regionName == string.Empty) 129 if (!m_AllowTeleportsToAnyRegion || regionName == string.Empty)
130 { 130 {
131 List<GridRegion> defs = m_GridService.GetDefaultRegions(m_ScopeID); 131 List<GridRegion> defs = m_GridService.GetDefaultRegions(m_ScopeID);
132 if (defs != null && defs.Count > 0) 132 if (defs != null && defs.Count > 0)
133 m_DefaultGatewayRegion = defs[0];
134
135 try
136 { 133 {
137 regionID = m_DefaultGatewayRegion.RegionID; 134 region = defs[0];
138 regionHandle = m_DefaultGatewayRegion.RegionHandle; 135 m_DefaultGatewayRegion = region;
139 } 136 }
140 catch 137 else
141 { 138 {
142 reason = "Grid setup problem. Try specifying a particular region here."; 139 reason = "Grid setup problem. Try specifying a particular region here.";
143 m_log.DebugFormat("[GATEKEEPER SERVICE]: Unable to send information. Please specify a default region for this grid!"); 140 m_log.DebugFormat("[GATEKEEPER SERVICE]: Unable to send information. Please specify a default region for this grid!");
144 return false; 141 return false;
145 } 142 }
146
147 return true;
148 } 143 }
149 144 else
150 GridRegion region = m_GridService.GetRegionByName(m_ScopeID, regionName);
151 if (region == null)
152 { 145 {
153 reason = "Region not found"; 146 region = m_GridService.GetRegionByName(m_ScopeID, regionName);
154 return false; 147 if (region == null)
148 {
149 reason = "Region not found";
150 return false;
151 }
155 } 152 }
156 153
157 regionID = region.RegionID; 154 regionID = region.RegionID;
158 regionHandle = region.RegionHandle; 155 regionHandle = region.RegionHandle;
159 string regionimage = "regionImage" + region.RegionID.ToString();
160 regionimage = regionimage.Replace("-", "");
161 156
157 string regionimage = "regionImage" + regionID.ToString();
158 regionimage = regionimage.Replace("-", "");
162 imageURL = region.ServerURI + "index.php?method=" + regionimage; 159 imageURL = region.ServerURI + "index.php?method=" + regionimage;
163 160
164 return true; 161 return true;
diff --git a/OpenSim/Services/HypergridService/UserAgentService.cs b/OpenSim/Services/HypergridService/UserAgentService.cs
index 3519250..12dda48 100644
--- a/OpenSim/Services/HypergridService/UserAgentService.cs
+++ b/OpenSim/Services/HypergridService/UserAgentService.cs
@@ -101,7 +101,7 @@ namespace OpenSim.Services.HypergridService
101 serverConfig = config.Configs["GatekeeperService"]; 101 serverConfig = config.Configs["GatekeeperService"];
102 m_GridName = serverConfig.GetString("ExternalName", string.Empty); 102 m_GridName = serverConfig.GetString("ExternalName", string.Empty);
103 } 103 }
104 else if (!m_GridName.EndsWith("/")) 104 if (!m_GridName.EndsWith("/"))
105 m_GridName = m_GridName + "/"; 105 m_GridName = m_GridName + "/";
106 } 106 }
107 } 107 }
diff --git a/OpenSim/Services/Interfaces/IUserAccountService.cs b/OpenSim/Services/Interfaces/IUserAccountService.cs
index c580078..9c992e0 100644
--- a/OpenSim/Services/Interfaces/IUserAccountService.cs
+++ b/OpenSim/Services/Interfaces/IUserAccountService.cs
@@ -101,7 +101,7 @@ namespace OpenSim.Services.Interfaces
101 if (str != string.Empty) 101 if (str != string.Empty)
102 { 102 {
103 string[] parts = str.Split(new char[] { ';' }); 103 string[] parts = str.Split(new char[] { ';' });
104 Dictionary<string, object> dic = new Dictionary<string, object>(); 104// Dictionary<string, object> dic = new Dictionary<string, object>();
105 foreach (string s in parts) 105 foreach (string s in parts)
106 { 106 {
107 string[] parts2 = s.Split(new char[] { '*' }); 107 string[] parts2 = s.Split(new char[] { '*' });
diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs
index 25d80bd..281b6e3 100644
--- a/OpenSim/Services/LLLoginService/LLLoginService.cs
+++ b/OpenSim/Services/LLLoginService/LLLoginService.cs
@@ -772,6 +772,8 @@ namespace OpenSim.Services.LLLoginService
772 { 772 {
773 aCircuit.ServiceURLs[kvp.Key] = kvp.Value; 773 aCircuit.ServiceURLs[kvp.Key] = kvp.Value;
774 } 774 }
775 if (!aCircuit.ServiceURLs[kvp.Key].ToString().EndsWith("/"))
776 aCircuit.ServiceURLs[kvp.Key] = aCircuit.ServiceURLs[kvp.Key] + "/";
775 } 777 }
776 778
777 // New style: service keys start with SRV_; override the previous 779 // New style: service keys start with SRV_; override the previous
@@ -784,6 +786,9 @@ namespace OpenSim.Services.LLLoginService
784 { 786 {
785 string keyName = serviceKey.Replace("SRV_", ""); 787 string keyName = serviceKey.Replace("SRV_", "");
786 aCircuit.ServiceURLs[keyName] = m_LoginServerConfig.GetString(serviceKey, string.Empty); 788 aCircuit.ServiceURLs[keyName] = m_LoginServerConfig.GetString(serviceKey, string.Empty);
789 if (!aCircuit.ServiceURLs[keyName].ToString().EndsWith("/"))
790 aCircuit.ServiceURLs[keyName] = aCircuit.ServiceURLs[keyName] + "/";
791
787 m_log.DebugFormat("[LLLOGIN SERVICE]: found new key {0} {1}", keyName, aCircuit.ServiceURLs[keyName]); 792 m_log.DebugFormat("[LLLOGIN SERVICE]: found new key {0} {1}", keyName, aCircuit.ServiceURLs[keyName]);
788 } 793 }
789 } 794 }