aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
authordiva2009-02-14 16:37:55 +0000
committerdiva2009-02-14 16:37:55 +0000
commit217ffee8cb50e0a7ddfc0d4c4e4bb6a68de909d8 (patch)
tree3131df695140a7846fcd86b689c9a9afe5ee880f /OpenSim/Framework
parentThank you, patnad, for a patch that removes the "Subdivision of" text (diff)
downloadopensim-SC-217ffee8cb50e0a7ddfc0d4c4e4bb6a68de909d8.zip
opensim-SC-217ffee8cb50e0a7ddfc0d4c4e4bb6a68de909d8.tar.gz
opensim-SC-217ffee8cb50e0a7ddfc0d4c4e4bb6a68de909d8.tar.bz2
opensim-SC-217ffee8cb50e0a7ddfc0d4c4e4bb6a68de909d8.tar.xz
Moved RegionUp to REST/LocalComms. The original functionality has been entirely maintained, although it will have to be revisited soon, because it's buggy.
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r--OpenSim/Framework/RegionInfo.cs69
1 files changed, 69 insertions, 0 deletions
diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs
index a0e5ba5..84751bd 100644
--- a/OpenSim/Framework/RegionInfo.cs
+++ b/OpenSim/Framework/RegionInfo.cs
@@ -31,6 +31,7 @@ using System.Net.Sockets;
31using System.Xml; 31using System.Xml;
32using Nini.Config; 32using Nini.Config;
33using OpenMetaverse; 33using OpenMetaverse;
34using OpenMetaverse.StructuredData;
34 35
35namespace OpenSim.Framework 36namespace OpenSim.Framework
36{ 37{
@@ -605,5 +606,73 @@ namespace OpenSim.Framework
605 configMember.forceSetConfigurationOption("lastmap_uuid", mapUUID.ToString()); 606 configMember.forceSetConfigurationOption("lastmap_uuid", mapUUID.ToString());
606 configMember.forceSetConfigurationOption("lastmap_refresh", lastMapRefresh); 607 configMember.forceSetConfigurationOption("lastmap_refresh", lastMapRefresh);
607 } 608 }
609
610 public OSDMap PackRegionInfoData()
611 {
612 OSDMap args = new OSDMap();
613 args["region_id"] = OSD.FromUUID(RegionID);
614 if ((RegionName != null) && !RegionName.Equals(""))
615 args["region_name"] = OSD.FromString(RegionName);
616 args["external_host_name"] = OSD.FromString(ExternalHostName);
617 args["http_port"] = OSD.FromString(HttpPort.ToString());
618 args["server_uri"] = OSD.FromString(ServerURI);
619 args["region_xloc"] = OSD.FromString(RegionLocX.ToString());
620 args["region_yloc"] = OSD.FromString(RegionLocY.ToString());
621 args["internal_ep_address"] = OSD.FromString(InternalEndPoint.Address.ToString());
622 args["internal_ep_port"] = OSD.FromString(InternalEndPoint.Port.ToString());
623 if ((RemotingAddress != null) && !RemotingAddress.Equals(""))
624 args["remoting_address"] = OSD.FromString(RemotingAddress);
625 args["remoting_port"] = OSD.FromString(RemotingPort.ToString());
626 args["allow_alt_ports"] = OSD.FromBoolean(m_allow_alternate_ports);
627 if ((proxyUrl != null) && !proxyUrl.Equals(""))
628 args["proxy_url"] = OSD.FromString(proxyUrl);
629
630 return args;
631 }
632
633 public void UnpackRegionInfoData(OSDMap args)
634 {
635 if (args["region_id"] != null)
636 RegionID = args["region_id"].AsUUID();
637 if (args["region_name"] != null)
638 RegionName = args["region_name"].AsString();
639 if (args["external_host_name"] != null)
640 ExternalHostName = args["external_host_name"].AsString();
641 if (args["http_port"] != null)
642 UInt32.TryParse(args["http_port"].AsString(), out m_httpPort);
643 if (args["server_uri"] != null)
644 ServerURI = args["server_uri"].AsString();
645 if (args["region_xloc"] != null)
646 {
647 uint locx;
648 UInt32.TryParse(args["region_xloc"].AsString(), out locx);
649 RegionLocX = locx;
650 }
651 if (args["region_yloc"] != null)
652 {
653 uint locy;
654 UInt32.TryParse(args["region_yloc"].AsString(), out locy);
655 RegionLocY = locy;
656 }
657 IPAddress ip_addr = null;
658 if (args["internal_ep_address"] != null)
659 {
660 IPAddress.TryParse(args["internal_ep_address"].AsString(), out ip_addr);
661 }
662 int port = 0;
663 if (args["internal_ep_port"] != null)
664 {
665 Int32.TryParse(args["internal_ep_port"].AsString(), out port);
666 }
667 InternalEndPoint = new IPEndPoint(ip_addr, port);
668 if (args["remoting_address"] != null)
669 RemotingAddress = args["remoting_address"].AsString();
670 if (args["remoting_port"] != null)
671 UInt32.TryParse(args["remoting_port"].AsString(), out m_remotingPort);
672 if (args["allow_alt_ports"] != null)
673 m_allow_alternate_ports = args["allow_alt_ports"].AsBoolean();
674 if (args["proxy_url"] != null)
675 proxyUrl = args["proxy_url"].AsString();
676 }
608 } 677 }
609} 678}