Exemplo n.º 1
0
        private void ParcelObjectOwnersRequestHandler(Packet packet, LLAgent agent)
        {
            ParcelObjectOwnersRequestPacket request = (ParcelObjectOwnersRequestPacket)packet;

            SceneParcel parcel;

            if (m_parcels.TryGetParcel(request.ParcelData.LocalID, out parcel))
            {
                ParcelObjectOwnersReplyPacket    reply  = new ParcelObjectOwnersReplyPacket();
                Dictionary <UUID, OwnershipInfo> owners = new Dictionary <UUID, OwnershipInfo>();

                lock (parcel.ParcelEntities)
                {
                    foreach (ISceneEntity entity in parcel.ParcelEntities.Values)
                    {
                        // Skip child entities
                        if (entity is ILinkable && ((ILinkable)entity).Parent != null)
                        {
                            continue;
                        }

                        OwnershipInfo count;
                        if (!owners.TryGetValue(entity.OwnerID, out count))
                        {
                            count = new OwnershipInfo();
                            count.IsGroupOwned = false; // FIXME: Need to track group ownership
                            count.OnlineStatus = false; // FIXME: m_permissions.IsOnline(agent.ID, entity.OwnerID);

                            owners.Add(entity.OwnerID, count);
                        }

                        ++count.Count;
                    }
                }

                reply.Data = new ParcelObjectOwnersReplyPacket.DataBlock[owners.Count];
                int i = 0;
                foreach (KeyValuePair <UUID, OwnershipInfo> kvp in owners)
                {
                    reply.Data[i++] = new ParcelObjectOwnersReplyPacket.DataBlock
                    {
                        Count        = kvp.Value.Count,
                        OwnerID      = kvp.Key,
                        IsGroupOwned = kvp.Value.IsGroupOwned,
                        OnlineStatus = kvp.Value.OnlineStatus
                    };
                }

                m_udp.SendPacket(agent, reply, ThrottleCategory.Task, true);
            }
            else
            {
                m_log.Warn(agent.Name + " requested object owners for unknown parcel " + request.ParcelData.LocalID);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Request prim owners of a parcel of land.
        /// </summary>
        /// <param name="simulator">Simulator parcel is in</param>
        /// <param name="localID">The parcels region specific local ID</param>
        public void RequestObjectOwners(Simulator simulator, int localID)
        {
            ParcelObjectOwnersRequestPacket request = new ParcelObjectOwnersRequestPacket();

            request.AgentData.AgentID = Client.Self.AgentID;
            request.AgentData.SessionID = Client.Self.SessionID;

            request.ParcelData.LocalID = localID;
            Client.Network.SendPacket(request, simulator);
        }