diff options
Diffstat (limited to 'OpenSim/Services/Interfaces/IGridService.cs')
-rw-r--r-- | OpenSim/Services/Interfaces/IGridService.cs | 125 |
1 files changed, 122 insertions, 3 deletions
diff --git a/OpenSim/Services/Interfaces/IGridService.cs b/OpenSim/Services/Interfaces/IGridService.cs index f5f1f75..7e5597b 100644 --- a/OpenSim/Services/Interfaces/IGridService.cs +++ b/OpenSim/Services/Interfaces/IGridService.cs | |||
@@ -159,7 +159,17 @@ namespace OpenSim.Services.Interfaces | |||
159 | } | 159 | } |
160 | } | 160 | } |
161 | set { | 161 | set { |
162 | <<<<<<< HEAD | ||
162 | if (value.EndsWith("/")) { | 163 | if (value.EndsWith("/")) { |
164 | ======= | ||
165 | if ( value == null) | ||
166 | { | ||
167 | m_serverURI = String.Empty; | ||
168 | return; | ||
169 | } | ||
170 | |||
171 | if ( value.EndsWith("/") ) { | ||
172 | >>>>>>> avn/ubitvar | ||
163 | m_serverURI = value; | 173 | m_serverURI = value; |
164 | } else { | 174 | } else { |
165 | m_serverURI = value + '/'; | 175 | m_serverURI = value + '/'; |
@@ -500,9 +510,13 @@ namespace OpenSim.Services.Interfaces | |||
500 | } | 510 | } |
501 | catch (SocketException e) | 511 | catch (SocketException e) |
502 | { | 512 | { |
503 | throw new Exception( | 513 | /*throw new Exception( |
504 | "Unable to resolve local hostname " + m_externalHostName + " innerException of type '" + | 514 | "Unable to resolve local hostname " + m_externalHostName + " innerException of type '" + |
505 | e + "' attached to this exception", e); | 515 | e + "' attached to this exception", e);*/ |
516 | // Don't throw a fatal exception here, instead, return Null and handle it in the caller. | ||
517 | // Reason is, on systems such as OSgrid it has occured that known hostnames stop | ||
518 | // resolving and thus make surrounding regions crash out with this exception. | ||
519 | return null; | ||
506 | } | 520 | } |
507 | 521 | ||
508 | return new IPEndPoint(ia, m_internalEndPoint.Port); | 522 | return new IPEndPoint(ia, m_internalEndPoint.Port); |
@@ -525,5 +539,110 @@ namespace OpenSim.Services.Interfaces | |||
525 | { | 539 | { |
526 | get { return Util.UIntsToLong((uint)RegionLocX, (uint)RegionLocY); } | 540 | get { return Util.UIntsToLong((uint)RegionLocX, (uint)RegionLocY); } |
527 | } | 541 | } |
542 | <<<<<<< HEAD | ||
543 | ======= | ||
544 | |||
545 | public Dictionary<string, object> ToKeyValuePairs() | ||
546 | { | ||
547 | Dictionary<string, object> kvp = new Dictionary<string, object>(); | ||
548 | kvp["uuid"] = RegionID.ToString(); | ||
549 | kvp["locX"] = RegionLocX.ToString(); | ||
550 | kvp["locY"] = RegionLocY.ToString(); | ||
551 | kvp["sizeX"] = RegionSizeX.ToString(); | ||
552 | kvp["sizeY"] = RegionSizeY.ToString(); | ||
553 | kvp["regionName"] = RegionName; | ||
554 | kvp["serverIP"] = ExternalHostName; //ExternalEndPoint.Address.ToString(); | ||
555 | kvp["serverHttpPort"] = HttpPort.ToString(); | ||
556 | kvp["serverURI"] = ServerURI; | ||
557 | kvp["serverPort"] = InternalEndPoint.Port.ToString(); | ||
558 | kvp["regionMapTexture"] = TerrainImage.ToString(); | ||
559 | kvp["parcelMapTexture"] = ParcelImage.ToString(); | ||
560 | kvp["access"] = Access.ToString(); | ||
561 | kvp["regionSecret"] = RegionSecret; | ||
562 | kvp["owner_uuid"] = EstateOwner.ToString(); | ||
563 | kvp["Token"] = Token.ToString(); | ||
564 | // Maturity doesn't seem to exist in the DB | ||
565 | return kvp; | ||
566 | } | ||
567 | |||
568 | public GridRegion(Dictionary<string, object> kvp) | ||
569 | { | ||
570 | if (kvp.ContainsKey("uuid")) | ||
571 | RegionID = new UUID((string)kvp["uuid"]); | ||
572 | |||
573 | if (kvp.ContainsKey("locX")) | ||
574 | RegionLocX = Convert.ToInt32((string)kvp["locX"]); | ||
575 | |||
576 | if (kvp.ContainsKey("locY")) | ||
577 | RegionLocY = Convert.ToInt32((string)kvp["locY"]); | ||
578 | |||
579 | if (kvp.ContainsKey("sizeX")) | ||
580 | RegionSizeX = Convert.ToInt32((string)kvp["sizeX"]); | ||
581 | else | ||
582 | RegionSizeX = (int)Constants.RegionSize; | ||
583 | |||
584 | if (kvp.ContainsKey("sizeY")) | ||
585 | RegionSizeY = Convert.ToInt32((string)kvp["sizeY"]); | ||
586 | else | ||
587 | RegionSizeY = (int)Constants.RegionSize; | ||
588 | |||
589 | if (kvp.ContainsKey("regionName")) | ||
590 | RegionName = (string)kvp["regionName"]; | ||
591 | |||
592 | if (kvp.ContainsKey("access")) | ||
593 | { | ||
594 | byte access = Convert.ToByte((string)kvp["access"]); | ||
595 | Maturity = (int)Util.ConvertAccessLevelToMaturity(access); | ||
596 | } | ||
597 | |||
598 | if (kvp.ContainsKey("serverIP")) | ||
599 | { | ||
600 | //int port = 0; | ||
601 | //Int32.TryParse((string)kvp["serverPort"], out port); | ||
602 | //IPEndPoint ep = new IPEndPoint(IPAddress.Parse((string)kvp["serverIP"]), port); | ||
603 | ExternalHostName = (string)kvp["serverIP"]; | ||
604 | } | ||
605 | else | ||
606 | ExternalHostName = "127.0.0.1"; | ||
607 | |||
608 | if (kvp.ContainsKey("serverPort")) | ||
609 | { | ||
610 | Int32 port = 0; | ||
611 | Int32.TryParse((string)kvp["serverPort"], out port); | ||
612 | InternalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), port); | ||
613 | } | ||
614 | |||
615 | if (kvp.ContainsKey("serverHttpPort")) | ||
616 | { | ||
617 | UInt32 port = 0; | ||
618 | UInt32.TryParse((string)kvp["serverHttpPort"], out port); | ||
619 | HttpPort = port; | ||
620 | } | ||
621 | |||
622 | if (kvp.ContainsKey("serverURI")) | ||
623 | ServerURI = (string)kvp["serverURI"]; | ||
624 | |||
625 | if (kvp.ContainsKey("regionMapTexture")) | ||
626 | UUID.TryParse((string)kvp["regionMapTexture"], out TerrainImage); | ||
627 | |||
628 | if (kvp.ContainsKey("parcelMapTexture")) | ||
629 | UUID.TryParse((string)kvp["parcelMapTexture"], out ParcelImage); | ||
630 | |||
631 | if (kvp.ContainsKey("access")) | ||
632 | Access = Byte.Parse((string)kvp["access"]); | ||
633 | |||
634 | if (kvp.ContainsKey("regionSecret")) | ||
635 | RegionSecret =(string)kvp["regionSecret"]; | ||
636 | |||
637 | if (kvp.ContainsKey("owner_uuid")) | ||
638 | EstateOwner = new UUID(kvp["owner_uuid"].ToString()); | ||
639 | |||
640 | if (kvp.ContainsKey("Token")) | ||
641 | Token = kvp["Token"].ToString(); | ||
642 | |||
643 | // m_log.DebugFormat("{0} New GridRegion. id={1}, loc=<{2},{3}>, size=<{4},{5}>", | ||
644 | // LogHeader, RegionID, RegionLocX, RegionLocY, RegionSizeX, RegionSizeY); | ||
645 | } | ||
646 | >>>>>>> avn/ubitvar | ||
528 | } | 647 | } |
529 | } \ No newline at end of file | 648 | } |