예제 #1
0
        public OSDMap PackRegionInfoData()
        {
            OSDMap args = new OSDMap();

            args["region_id"] = OSD.FromUUID(RegionID);
            if ((RegionName != null) && !RegionName.Equals(""))
            {
                args["region_name"] = OSD.FromString(RegionName);
            }
            args["external_host_name"]  = OSD.FromString(ExternalHostName);
            args["http_port"]           = OSD.FromString(HttpPort.ToString());
            args["server_uri"]          = OSD.FromString(ServerURI);
            args["region_xloc"]         = OSD.FromString(RegionLocX.ToString());
            args["region_yloc"]         = OSD.FromString(RegionLocY.ToString());
            args["internal_ep_address"] = OSD.FromString(InternalEndPoint.Address.ToString());
            args["internal_ep_port"]    = OSD.FromString(InternalEndPoint.Port.ToString());
            if ((RemotingAddress != null) && !RemotingAddress.Equals(""))
            {
                args["remoting_address"] = OSD.FromString(RemotingAddress);
            }
            args["remoting_port"]   = OSD.FromString(RemotingPort.ToString());
            args["allow_alt_ports"] = OSD.FromBoolean(m_allow_alternate_ports);
            if ((proxyUrl != null) && !proxyUrl.Equals(""))
            {
                args["proxy_url"] = OSD.FromString(proxyUrl);
            }
            if (RegionType != String.Empty)
            {
                args["region_type"] = OSD.FromString(RegionType);
            }

            return(args);
        }
예제 #2
0
        public OSDMap PackRegionInfoData()
        {
            OSDMap args = new OSDMap();

            args["region_id"] = OSD.FromUUID(RegionID);
            if (!String.IsNullOrEmpty(RegionName))
            {
                args["region_name"] = OSD.FromString(RegionName);
            }
            args["external_host_name"]  = OSD.FromString(ExternalHostName);
            args["http_port"]           = OSD.FromString(HttpPort.ToString());
            args["region_xloc"]         = OSD.FromString(RegionLocX.ToString());
            args["region_yloc"]         = OSD.FromString(RegionLocY.ToString());
            args["internal_ep_address"] = OSD.FromString(InternalEndPoint.Address.ToString());
            args["internal_ep_port"]    = OSD.FromString(InternalEndPoint.Port.ToString());
            if (!String.IsNullOrEmpty(RemotingAddress))
            {
                args["remoting_address"] = OSD.FromString(RemotingAddress);
            }
            args["remoting_port"]   = OSD.FromString(RemotingPort.ToString());
            args["allow_alt_ports"] = OSD.FromBoolean(m_allow_alternate_ports);
            if (!String.IsNullOrEmpty(proxyUrl))
            {
                args["proxy_url"] = OSD.FromString(proxyUrl);
            }

            if (OutsideIP != null)
            {
                args["outside_ip"] = OSD.FromString(OutsideIP);
            }

            return(args);
        }
예제 #3
0
        public Dictionary <string, object> ToKeyValuePairs()
        {
            Dictionary <string, object> kvp = new Dictionary <string, object>();

            kvp["uuid"]       = RegionID.ToString();
            kvp["locX"]       = RegionLocX.ToString();
            kvp["locY"]       = RegionLocY.ToString();
            kvp["sizeX"]      = RegionSizeX.ToString();
            kvp["sizeY"]      = RegionSizeY.ToString();
            kvp["regionName"] = RegionName;

            if (RegionFlags != null)
            {
                kvp["flags"] = ((int)RegionFlags).ToString();
            }

            kvp["serverIP"]         = ExternalHostName; //ExternalEndPoint.Address.ToString();
            kvp["serverHttpPort"]   = HttpPort.ToString();
            kvp["serverURI"]        = ServerURI;
            kvp["serverPort"]       = InternalEndPoint.Port.ToString();
            kvp["regionMapTexture"] = TerrainImage.ToString();
            kvp["parcelMapTexture"] = ParcelImage.ToString();
            kvp["access"]           = Access.ToString();
            kvp["regionSecret"]     = RegionSecret;
            kvp["owner_uuid"]       = EstateOwner.ToString();
            kvp["Token"]            = Token.ToString();
            // Maturity doesn't seem to exist in the DB

            return(kvp);
        }
예제 #4
0
        public override IEnumerable <KeyValuePair <string, string> > GetLoadedOptionsPairs()
        {
            yield return(new KeyValuePair <string, string>("IP", Ip.ToString()));

            yield return(new KeyValuePair <string, string>("HTTP PORT", HttpPort.ToString()));

            yield return(new KeyValuePair <string, string>("STATS PERIOD SEC", StatsPeriodSec.ToString()));
        }
예제 #5
0
        public override IEnumerable <KeyValuePair <string, string> > GetLoadedOptionsPairs()
        {
            yield return(new KeyValuePair <string, string>("IP", Ip));

            yield return(new KeyValuePair <string, string>("TCP PORT", TcpPort.ToString()));

            yield return(new KeyValuePair <string, string>("HTTP PORT", HttpPort.ToString()));

            yield return(new KeyValuePair <string, string>("TIMEOUT", Timeout.ToString()));

            yield return(new KeyValuePair <string, string>("READ WINDOW", ReadWindow.ToString()));

            yield return(new KeyValuePair <string, string>("WRITE WINDOW", WriteWindow.ToString()));

            yield return(new KeyValuePair <string, string>("PING WINDOW", PingWindow.ToString()));
        }
예제 #6
0
        public Dictionary <string, object> ToKeyValuePairs()
        {
            Dictionary <string, object> kvp = new Dictionary <string, object>();

            kvp["uuid"] = RegionID.ToString();
            kvp["locX"] = RegionLocX.ToString();
            kvp["locY"] = RegionLocY.ToString();
            kvp["external_ip_address"] = ExternalEndPoint.Address.ToString();
            kvp["external_port"]       = ExternalEndPoint.Port.ToString();
            kvp["external_host_name"]  = ExternalHostName;
            kvp["http_port"]           = HttpPort.ToString();
            kvp["internal_ip_address"] = InternalEndPoint.Address.ToString();
            kvp["internal_port"]       = InternalEndPoint.Port.ToString();
            kvp["alternate_ports"]     = m_allow_alternate_ports.ToString();
            kvp["server_uri"]          = ServerURI;

            return(kvp);
        }
예제 #7
0
        public override string ToString()
        {
            var info = new StringBuilder();

            info.Append("IsPublic: ").AppendLine(IsPublic.ToString());
            info.Append("HttpPort: ").AppendLine(HttpPort.ToString());
            info.Append("Username: "******"Password:"******"IsCorsActive:").AppendLine(IsCorsActive.ToString());
            info.Append("IsSslActive:").AppendLine(IsSslActive.ToString());
            info.Append("SSL Certificate Path:").AppendLine(SslCertificatePath);
            info.Append("SSL Certificate Key Path:").AppendLine(SslCertificateKeyPath);
            info.Append("Log directory:").AppendLine(LogDirectoryPath);
            info.Append("Log rotation interval (days):").AppendLine(LogRotationInterval.ToString());
            info.Append("IsAccessLogActive:").AppendLine(IsAccessLogActive.ToString());
            info.Append("IsServiceSideEventsActive:").AppendLine(IsServiceSideEventsActive.ToString());

            return(info.ToString());
        }
예제 #8
0
        public OSDMap PackRegionInfoData(bool secure)
        {
            OSDMap args = new OSDMap();

            args["region_id"] = OSD.FromUUID(RegionID);
            if ((RegionName != null) && !RegionName.Equals(""))
            {
                args["region_name"] = OSD.FromString(RegionName);
            }
            args["external_host_name"]  = OSD.FromString(ExternalHostName);
            args["http_port"]           = OSD.FromString(HttpPort.ToString());
            args["server_uri"]          = OSD.FromString(ServerURI);
            args["region_xloc"]         = OSD.FromString(RegionLocX.ToString());
            args["region_yloc"]         = OSD.FromString(RegionLocY.ToString());
            args["internal_ep_address"] = OSD.FromString(InternalEndPoint.Address.ToString());
            args["internal_ep_port"]    = OSD.FromString(InternalEndPoint.Port.ToString());
            args["allow_alt_ports"]     = OSD.FromBoolean(m_allow_alternate_ports);
            if (RegionType != String.Empty)
            {
                args["region_type"] = OSD.FromString(RegionType);
            }
            args["password"]      = OSD.FromUUID(Password);
            args["region_size_x"] = OSD.FromInteger(RegionSizeX);
            args["region_size_y"] = OSD.FromInteger(RegionSizeY);
            args["region_size_z"] = OSD.FromInteger(RegionSizeZ);
            if (secure)
            {
                args["disabled"]        = OSD.FromBoolean(Disabled);
                args["scope_id"]        = OSD.FromUUID(ScopeID);
                args["object_capacity"] = OSD.FromInteger(m_objectCapacity);
                args["region_type"]     = OSD.FromString(RegionType);
                args["see_into_this_sim_from_neighbor"]  = OSD.FromBoolean(SeeIntoThisSimFromNeighbor);
                args["trust_binaries_from_foreign_sims"] = OSD.FromBoolean(TrustBinariesFromForeignSims);
                args["allow_script_crossing"]            = OSD.FromBoolean(AllowScriptCrossing);
                args["allow_physical_prims"]             = OSD.FromBoolean(AllowPhysicalPrims);
                args["number_startup"] = OSD.FromInteger(NumberStartup);
                args["startupType"]    = OSD.FromInteger((int)Startup);
                args["FindExternalIP"] = OSD.FromBoolean(FindExternalAutomatically);
                args["RegionSettings"] = RegionSettings.ToOSD();
            }
            return(args);
        }
예제 #9
0
        public Dictionary <string, object> ToKeyValuePairs()
        {
            Dictionary <string, object> kvp = new Dictionary <string, object>();

            kvp["uuid"]                 = RegionID.ToString();
            kvp["locX"]                 = RegionLocX.ToString();
            kvp["locY"]                 = RegionLocY.ToString();
            kvp["regionName"]           = RegionName;
            kvp["regionType"]           = RegionType;
            kvp["serverIP"]             = ExternalHostName; //ExternalEndPoint.Address.ToString();
            kvp["serverHttpPort"]       = HttpPort.ToString();
            kvp["serverURI"]            = ServerURI;
            kvp["serverPort"]           = InternalEndPoint.Port.ToString();
            kvp["regionMapTexture"]     = TerrainImage.ToString();
            kvp["regionTerrainTexture"] = TerrainMapImage.ToString();
            kvp["access"]               = Access.ToString();
            kvp["owner_uuid"]           = EstateOwner.ToString();
            kvp["Token"]                = AuthToken.ToString();
            kvp["sizeX"]                = RegionSizeX.ToString();
            kvp["sizeY"]                = RegionSizeY.ToString();
            return(kvp);
        }
예제 #10
0
        public override IEnumerable <KeyValuePair <string, string> > GetLoadedOptionsPairs()
        {
            foreach (var pair in base.GetLoadedOptionsPairs())
            {
                yield return(pair);
            }
            yield return(new KeyValuePair <string, string>("IP", Ip.ToString()));

            yield return(new KeyValuePair <string, string>("TCP PORT", TcpPort.ToString()));

            yield return(new KeyValuePair <string, string>("HTTP PORT", HttpPort.ToString()));

            yield return(new KeyValuePair <string, string>("STATS PERIOD SEC", StatsPeriodSec.ToString()));

            yield return(new KeyValuePair <string, string>("CHUNK CACHE", ChunksToCache.ToString()));

            yield return(new KeyValuePair <string, string>("DB PATH", string.IsNullOrEmpty(DbPath) ? "<DEFAULT>" : DbPath));

            yield return(new KeyValuePair <string, string>("NO PROJECTIONS", NoProjections.ToString()));

            yield return(new KeyValuePair <string, string>("PROJECTION THREADS", ProjectionThreads.ToString()));
        }
예제 #11
0
        private async Task SpawnDockerContainer()
        {
            using (var conf = new DockerClientConfiguration(new Uri("npipe://./pipe/docker_engine")))
                using (var client = conf.CreateClient())
                {
                    var containers = await client.Containers.ListContainersAsync(new ContainersListParameters()
                    {
                        All = true
                    });

                    var container = containers.FirstOrDefault(c => c.Names.Contains("/" + ContainerName));
                    if (container == null)
                    {
                        // Download GitLab images
                        await client.Images.CreateImageAsync(new ImagesCreateParameters()
                        {
                            FromImage = ImageName, Tag = ImageTag
                        }, new AuthConfig()
                        {
                        }, new Progress <JSONMessage>());

                        // Create the container
                        var hostConfig = new HostConfig()
                        {
                            PortBindings = new Dictionary <string, IList <PortBinding> >
                            {
                                { "80/tcp", new List <PortBinding> {
                                      new PortBinding {
                                          HostIP = "127.0.0.1", HostPort = HttpPort.ToString(CultureInfo.InvariantCulture)
                                      }
                                  } },
                            }
                        };

                        var response = await client.Containers.CreateContainerAsync(new CreateContainerParameters()
                        {
                            Hostname   = "localhost",
                            Image      = ImageName + ":" + ImageTag,
                            Name       = ContainerName,
                            Tty        = false,
                            HostConfig = hostConfig,
                        });

                        containers = await client.Containers.ListContainersAsync(new ContainersListParameters()
                        {
                            All = true
                        });

                        container = containers.First(c => c.ID == response.ID);
                    }

                    // Start the container
                    if (container.State != "running")
                    {
                        var started = await client.Containers.StartContainerAsync(container.ID, new ContainerStartParameters());

                        if (!started)
                        {
                            Assert.Fail("Cannot start the docker container");
                        }
                    }

                    // Wait for the container to be ready
                    await WaitForContainerAsync();
                }
        }