public override Dictionary <UUID, bool> Exists(List <UUID> assets)
        {
            var v = new Dictionary <UUID, bool>();

            foreach (UUID k in assets)
            {
                v[k] = m_Assets.ContainsKey(k);
            }
            return(v);
        }
 public override void Update(UGUI requestingAgent, ExperienceInfo info)
 {
     if (!m_Experiences.ContainsKey(info.ID.ID))
     {
         throw new KeyNotFoundException();
     }
     if (!Admins[info.ID, requestingAgent])
     {
         throw new InvalidOperationException();
     }
     m_Experiences[info.ID.ID] = new ExperienceInfo(info);
 }
        public int RequestTextureViaCircuit(
            ScriptInstance instance,
            ViewerAgentAccessor agent,
            LSLKey textureID,
            int type)
        {
            lock (instance)
            {
                ViewerConnection vc;
                ViewerCircuit    viewerCircuit;
                if (m_Clients.TryGetValue(agent.AgentID, out vc) &&
                    vc.ViewerCircuits.TryGetValue((uint)agent.CircuitCode, out viewerCircuit) &&
                    !m_ActiveImageTransfers.ContainsKey(textureID.AsUUID))
                {
                    m_ActiveImageTransfers[textureID.AsUUID] = new ImageReceiveInfo();
                    var reqImage = new RequestImage
                    {
                        AgentID   = viewerCircuit.AgentID,
                        SessionID = viewerCircuit.SessionID,
                    };
                    reqImage.RequestImageList.Add(new RequestImage.RequestImageEntry
                    {
                        DiscardLevel     = 1,
                        ImageID          = textureID.AsUUID,
                        Type             = (RequestImage.ImageType)type,
                        Packet           = 0,
                        DownloadPriority = 1
                    });

                    viewerCircuit.SendMessage(reqImage);

                    return(1);
                }
                return(0);
            }
        }
        private void VerifyNeighbor(RegionInfo rinfo)
        {
            if (rinfo.ServerURI == ServerURI)
            {
                if (!Neighbors.ContainsKey(rinfo.ID))
                {
                    Neighbors[rinfo.ID] = new NeighborEntry
                    {
                        RemoteOffset     = rinfo.Location - GridPosition,
                        RemoteRegionData = rinfo
                    };
                    CheckAgentsForNeighbors();
                }
                return;
            }

            var headers = new Dictionary <string, string>();

            try
            {
                new HttpClient.Head(rinfo.ServerURI + "helo")
                {
                    Headers = headers
                }.ExecuteRequest();
            }
            catch
            {
                headers.Clear();
            }

            if (headers.ContainsKey("X-UDP-InterSim"))
            {
                /* neighbor supports UDP Inter-Sim connects */
                var  randomID = UUID.Random;
                uint circuitID;
                Neighbors[rinfo.ID] = new NeighborEntry
                {
                    RemoteOffset     = rinfo.Location - GridPosition,
                    RemoteRegionData = rinfo
                };
                EnableSimCircuit(rinfo, out randomID, out circuitID);
            }
            else
            {
                /* we have to keep the original protocol which may be slow */
            }
        }
 public override bool ContainsKey(uint estateID) => m_Data.ContainsKey(estateID);
 public override bool Exists(UUID key) =>
 m_Assets.ContainsKey(key);
Exemple #7
0
        private void HandleChildAgentChanges(AgentCircuit circuit)
        {
            SceneInterface scene = circuit.Scene;

            if (scene == null)
            {
                return;
            }

            Dictionary <GridVector, IChildAgentConnection> disconnects = new Dictionary <GridVector, IChildAgentConnection>();

            foreach (KeyValuePair <GridVector, IChildAgentConnection> kvp in KnownChildAgentConnections)
            {
                UUID childSceneID = kvp.Value.SceneID;
                if (childSceneID == scene.ID)
                {
                    continue;
                }

                disconnects.Add(kvp.Key, kvp.Value);
            }

            /* remove all that stay active */
            foreach (KeyValuePair <UUID, SceneInterface.NeighborEntry> kvp in scene.Neighbors)
            {
                disconnects.Remove(kvp.Value.RemoteRegionData.Location);
            }

            /* connect new child agents */
            foreach (KeyValuePair <UUID, SceneInterface.NeighborEntry> kvp in scene.Neighbors)
            {
                if (!KnownChildAgentConnections.ContainsKey(kvp.Value.RemoteRegionData.Location))
                {
                    SceneInterface childScene;
                    if (m_Scenes.TryGetValue(kvp.Key, out childScene))
                    {
                        /* local connect */
#if DEBUG
                        m_Log.DebugFormat("Connect agent {0} to scene {1} as child locally", NamedOwner.FullName, childScene.ID);
#endif

                        UUID            seedId;
                        string          seedCapsUri  = NewCapsURL(childScene, out seedId);
                        var             udpServer    = (UDPCircuitsManager)childScene.UDPServer;
                        AgentCircuit    childCircuit = circuit.CreateChild(udpServer, seedId);
                        DestinationInfo connectInfo  = new DestinationInfo(kvp.Value.RemoteRegionData)
                        {
                            TeleportFlags = TeleportFlags.None
                        };
                        Circuits.Add(childScene.ID, childCircuit);
                        try
                        {
                            childScene.Add(this);
                            try
                            {
                                udpServer.AddCircuit(childCircuit);
                            }
                            catch
                            {
                                childScene.Remove(this);
                                continue;
                            }
                        }
                        catch
                        {
                            Circuits.Remove(childScene.ID);
                            continue;
                        }
                        EnableSimulator(scene.ID, circuit.CircuitCode, seedCapsUri, connectInfo);
                    }
                    else
                    {
                    }
                }
            }

            /* disconnect unneeded child agents */
            foreach (IChildAgentConnection conn in disconnects.Values)
            {
#if DEBUG
                m_Log.DebugFormat("Disconnect agent {0} from scene {1}", NamedOwner.FullName, conn.SceneID);
#endif
                conn.Disable();
            }
        }
 public bool ContainsKey(UGUI user) =>
 m_Preferences.ContainsKey(user.ID);
Exemple #9
0
 bool ISimulationDataPhysicsConvexStorageInterface.ContainsKey(ObjectPart.PrimitiveShape primShape) =>
 m_ConvexShapesByPrimShape.ContainsKey(primShape);
Exemple #10
0
 bool ISimulationDataPhysicsConvexStorageInterface.ContainsKey(UUID meshid, PrimitivePhysicsShapeType physicsShape) =>
 m_ConvexShapesByMesh.ContainsKey(GetMeshKey(meshid, physicsShape));
 bool ISimulationDataRegionSettingsStorageInterface.ContainsKey(UUID regionID) =>
 m_RegionSettingsData.ContainsKey(regionID);