예제 #1
0
        protected string ShortRegionInfo(string key, string value)
        {
            RestXmlWriter rxw = new RestXmlWriter(new StringWriter());

            if (String.IsNullOrEmpty(value) || String.IsNullOrEmpty(key))
            {
                return(null);
            }

            rxw.WriteStartElement(String.Empty, "region", String.Empty);
            rxw.WriteStartElement(String.Empty, key, String.Empty);
            rxw.WriteString(value);
            rxw.WriteEndDocument();

            return(rxw.ToString());
        }
예제 #2
0
        protected string RegionStats(IOSHttpResponse httpResponse, Scene scene)
        {
            int users   = scene.GetRootAgentCount();
            int objects = scene.Entities.Count - users;

            RestXmlWriter rxw = new RestXmlWriter(new StringWriter());

            rxw.WriteStartElement(String.Empty, "region", String.Empty);
            rxw.WriteStartElement(String.Empty, "stats", String.Empty);

            rxw.WriteStartElement(String.Empty, "users", String.Empty);
            rxw.WriteString(users.ToString());
            rxw.WriteEndElement();

            rxw.WriteStartElement(String.Empty, "objects", String.Empty);
            rxw.WriteString(objects.ToString());
            rxw.WriteEndElement();

            rxw.WriteEndDocument();

            return(rxw.ToString());
        }
예제 #3
0
        protected string ShortRegionInfo(string key, string value)
        {
            RestXmlWriter rxw = new RestXmlWriter(new StringWriter());

            if (String.IsNullOrEmpty(value) ||
                String.IsNullOrEmpty(key)) return null;

            rxw.WriteStartElement(String.Empty, "region", String.Empty);
            rxw.WriteStartElement(String.Empty, key, String.Empty);
            rxw.WriteString(value);
            rxw.WriteEndDocument();

            return rxw.ToString();
        }
예제 #4
0
        protected string RegionStats(OSHttpResponse httpResponse, Scene scene)
        {
            int users = scene.GetAvatars().Count;
            int objects = scene.Entities.Count - users;

            RestXmlWriter rxw = new RestXmlWriter(new StringWriter());

            rxw.WriteStartElement(String.Empty, "region", String.Empty);
            rxw.WriteStartElement(String.Empty, "stats", String.Empty);

            rxw.WriteStartElement(String.Empty, "users", String.Empty);
            rxw.WriteString(users.ToString());
            rxw.WriteEndElement();

            rxw.WriteStartElement(String.Empty, "objects", String.Empty);
            rxw.WriteString(objects.ToString());
            rxw.WriteEndElement();

            rxw.WriteEndDocument();

            return rxw.ToString();
        }