public static void CollectCoarseLocations(Scene scene, out List<Vector3> CoarseLocations, out List<UUID> AvatarUUIDs)
        {
            CoarseLocations = new List<Vector3>();
            AvatarUUIDs = new List<UUID>();
            lock (scene.SyncRoot)
            {
                List<ScenePresence> avatars = scene.GetAvatars();
                foreach (ScenePresence avatar in avatars)
                {
                    lock (avatar.m_posInfo)
                    {
                        if (avatar.IsInTransit || avatar.IsDeleted)
                            continue;
                        SceneObjectPart sop = avatar.m_posInfo.Parent;
                        if (sop != null)    // is seated?
                            if (sop.ParentGroup.InTransit)    // and in transit
                                continue;        // skip this one since we don't have a reliable position

                        CoarseLocations.Add(avatar.AbsolutePosition);
                    }
                    AvatarUUIDs.Add(avatar.UUID);
                }
            }
        }
Exemple #2
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();
        }