コード例 #1
0
        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);
        }
コード例 #2
0
 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);
 }
コード例 #3
0
        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);
            }
        }
コード例 #4
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 */
            }
        }
コード例 #5
0
 public override bool ContainsKey(uint estateID) => m_Data.ContainsKey(estateID);
コード例 #6
0
 public override bool Exists(UUID key) =>
 m_Assets.ContainsKey(key);
コード例 #7
0
ファイル: ViewerAgent.cs プロジェクト: ft-/silversim-testing
        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();
            }
        }
コード例 #8
0
 public bool ContainsKey(UGUI user) =>
 m_Preferences.ContainsKey(user.ID);
コード例 #9
0
 bool ISimulationDataPhysicsConvexStorageInterface.ContainsKey(ObjectPart.PrimitiveShape primShape) =>
 m_ConvexShapesByPrimShape.ContainsKey(primShape);
コード例 #10
0
 bool ISimulationDataPhysicsConvexStorageInterface.ContainsKey(UUID meshid, PrimitivePhysicsShapeType physicsShape) =>
 m_ConvexShapesByMesh.ContainsKey(GetMeshKey(meshid, physicsShape));
 bool ISimulationDataRegionSettingsStorageInterface.ContainsKey(UUID regionID) =>
 m_RegionSettingsData.ContainsKey(regionID);