コード例 #1
0
        public void IncomingCapsRequest(UUID agentID, WhiteCore.Framework.Services.GridRegion region, ISimulationBase simbase, ref OSDMap capURLs)
        {
            m_agentID = agentID;
            m_region = region;
            m_userScopeIDs = simbase.ApplicationRegistry.RequestModuleInterface<IUserAccountService>().GetUserAccount(null, m_agentID).AllScopeIDs;

            m_gridService = simbase.ApplicationRegistry.RequestModuleInterface<IGridService>();
            IConfig config =
                simbase.ConfigSource.Configs["MapCaps"];
            if (config != null)
                m_allowCapsMessage = config.GetBoolean("AllowCapsMessage", m_allowCapsMessage);

            HttpServerHandle method = delegate(string path, Stream request, OSHttpRequest httpRequest,
                                               OSHttpResponse httpResponse)
                                          {
                                              return MapLayerRequest(HttpServerHandlerHelpers.ReadString(request), httpRequest, httpResponse);
                                          };
            m_uri = "/CAPS/MapLayer/" + UUID.Random() + "/";
            capURLs["MapLayer"] = MainServer.Instance.ServerURI + m_uri;
            capURLs["MapLayerGod"] = MainServer.Instance.ServerURI + m_uri;

            MainServer.Instance.AddStreamHandler(new GenericStreamHandler("POST", m_uri, method));
        }
コード例 #2
0
        public void IncomingCapsRequest(UUID agentID, WhiteCore.Framework.Services.GridRegion region, ISimulationBase simbase, ref OSDMap capURLs)
        {
            m_AgentID = agentID;
            m_assetService = simbase.ApplicationRegistry.RequestModuleInterface<IAssetService>();
            m_j2kDecoder = simbase.ApplicationRegistry.RequestModuleInterface<IJ2KDecoder>();

            m_getTextureURI = "/CAPS/GetTexture/" + UUID.Random() + "/";
            capURLs["GetTexture"] = MainServer.Instance.ServerURI + m_getTextureURI;
            MainServer.Instance.AddStreamHandler(new GenericStreamHandler("GET", m_getTextureURI, ProcessGetTexture));

            m_bakedTextureURI = "/CAPS/UploadBakedTexture/" + UUID.Random() + "/";
            capURLs["UploadBakedTexture"] = MainServer.Instance.ServerURI + m_bakedTextureURI;
            MainServer.Instance.AddStreamHandler(new GenericStreamHandler("POST", m_bakedTextureURI, UploadBakedTexture));

            m_getMeshURI = "/CAPS/GetMesh/" + UUID.Random() + "/";
            capURLs["GetMesh"] = MainServer.Instance.ServerURI + m_getMeshURI;
            MainServer.Instance.AddStreamHandler(new GenericStreamHandler("GET", m_getMeshURI, ProcessGetMesh));
        }
コード例 #3
0
        private string GetParentIDForRegion(WhiteCore.Framework.Services.GridRegion region)
        {
            lock (vlock)
            {
                string sceneUUID = region.RegionID.ToString();
                lock (m_parents)
                    if (m_parents.ContainsKey(sceneUUID))
                        return m_parents[sceneUUID];

                string channelId;

                string sceneName = region.RegionName;

                // Make sure that all local channels are deleted.
                // So we have to search for the children, and then do an
                // iteration over the set of children identified.
                // This assumes that there is just one directory per
                // region.

                if (VivoxTryGetDirectory(sceneUUID + "D", out channelId))
                {
                    MainConsole.Instance.DebugFormat(
                        "[VivoxVoice]: region {0}: uuid {1}: located directory id {2}",
                        sceneName, sceneUUID, channelId);

                    XmlElement children = VivoxListChildren(channelId);
                    string count;

                    if (XmlFind(children, "response.level0.channel-search.count",
                                out count))
                    {
                        int cnum = Convert.ToInt32(count);
                        for (int i = 0; i < cnum; i++)
                        {
                            string id;
                            if (XmlFind(children,
                                        "response.level0.channel-search.channels.channels.level4.id",
                                        i, out id))
                            {
                                if (!IsOK(VivoxDeleteChannel(channelId, id)))
                                    MainConsole.Instance.WarnFormat(
                                        "[VivoxVoice] Channel delete failed {0}:{1}:{2}",
                                        i, channelId, id);
                            }
                        }
                    }
                }
                else
                {
                    if (
                        !VivoxTryCreateDirectory(sceneUUID + "D", sceneName,
                                                 out channelId))
                    {
                        MainConsole.Instance.WarnFormat(
                            "[VivoxVoice] Create failed <{0}:{1}:{2}>",
                            "*", sceneUUID, sceneName);
                        channelId = String.Empty;
                    }
                }

                // Create a dictionary entry unconditionally. This eliminates the
                // need to check for a parent in the core code. The end result is
                // the same, if the parent table entry is an empty string, then
                // region channels will be created as first-level channels.

                lock (m_parents)
                    if (!m_parents.ContainsKey(sceneUUID))
                        m_parents.Add(sceneUUID, channelId);
                return channelId;
            }
        }
コード例 #4
0
        public void GetParcelChannelInfo(UUID avatarID, WhiteCore.Framework.Services.GridRegion region, string URL,
            out bool success, out UUID parcelID, out string parcelName, out int localID,
            out uint parcelFlags, out string ParentID)
        {
            ISyncMessagePosterService syncPoster = m_registry.RequestModuleInterface<ISyncMessagePosterService>();
            OSDMap request = new OSDMap();
            request["AvatarID"] = avatarID;
            request["Method"] = "GetParcelChannelInfo";
            request ["RegionName"] = region.RegionName;
            OSDMap response = null;
            syncPoster.Get(URL, request, resp => { response = resp; });
            while (response == null)
                Thread.Sleep (5);

            success = response["Success"];
            bool noAgents = response ["NoAgent"];
            if (!success || noAgents)
            {
                // parcel is not voice enabled or there are no agents here
                parcelID = UUID.Zero;
                parcelName = "";
                localID = 0;
                parcelFlags = 0;
                ParentID = "";
            } else
            {
                // set parcel details
                parcelID = response ["ParcelID"];
                parcelName = response ["ParcelName"];
                localID = response ["LocalID"];
                parcelFlags = response ["ParcelFlags"];
                ParentID = GetParentIDForRegion (region);
            }
        }
コード例 #5
0
        public void GetParcelChannelInfo(UUID avatarID, WhiteCore.Framework.Services.GridRegion region, string URL,
            out bool success, out UUID parcelID, out string parcelName, out int localID,
            out uint parcelFlags, out string ParentID)
        {
            ISyncMessagePosterService syncPoster = m_registry.RequestModuleInterface<ISyncMessagePosterService>();
            OSDMap request = new OSDMap();
            request["AvatarID"] = avatarID;
            request["Method"] = "GetParcelChannelInfo";
            OSDMap response = null;
            syncPoster.Get(URL, request, resp => { response = resp; });
            while (response == null)
                Thread.Sleep(5);

            success = response["Success"];
            if (response["NoAgent"])
                throw new NotSupportedException();
            parcelID = response["ParcelID"];
            parcelName = response["ParcelName"];
            localID = response["LocalID"];
            parcelFlags = response["ParcelFlags"];
            ParentID = GetParentIDForRegion(region);
        }
コード例 #6
0
        public void IncomingCapsRequest(UUID agentID, WhiteCore.Framework.Services.GridRegion region, ISimulationBase simbase, ref OSDMap capURLs)
        {
            m_agentID = agentID;
            m_moneyModule = simbase.ApplicationRegistry.RequestModuleInterface<IMoneyModule>();
            m_assetService = simbase.ApplicationRegistry.RequestModuleInterface<IAssetService>();
            m_inventoryService = simbase.ApplicationRegistry.RequestModuleInterface<IInventoryService>();
            m_libraryService = simbase.ApplicationRegistry.RequestModuleInterface<ILibraryService>();
            m_inventoryData = Framework.Utilities.DataManager.RequestPlugin<IInventoryData>();

            HttpServerHandle method = delegate(string path, Stream request, OSHttpRequest httpRequest,
                                               OSHttpResponse httpResponse)
            { return HandleWebFetchInventoryDescendents(request, m_agentID); };

            string uri = "/CAPS/FetchInventoryDescendents/" + UUID.Random() + "/";
            capURLs["WebFetchInventoryDescendents"] = MainServer.Instance.ServerURI + uri;
            capURLs["FetchInventoryDescendents"] = MainServer.Instance.ServerURI + uri;
            capURLs["FetchInventoryDescendents2"] = MainServer.Instance.ServerURI + uri;
            m_uris.Add(uri);
            MainServer.Instance.AddStreamHandler(new GenericStreamHandler("POST", uri, method));

            method = delegate(string path, Stream request, OSHttpRequest httpRequest,
                              OSHttpResponse httpResponse)
            { return HandleFetchLibDescendents(request, m_agentID); };
            uri = "/CAPS/FetchLibDescendents/" + UUID.Random() + "/";
            capURLs["FetchLibDescendents"] = MainServer.Instance.ServerURI + uri;
            capURLs["FetchLibDescendents2"] = MainServer.Instance.ServerURI + uri;
            m_uris.Add(uri);
            MainServer.Instance.AddStreamHandler(new GenericStreamHandler("POST", uri, method));

            method = delegate(string path, Stream request, OSHttpRequest httpRequest,
                              OSHttpResponse httpResponse)
            { return HandleFetchInventory(request, m_agentID); };
            uri = "/CAPS/FetchInventory/" + UUID.Random() + "/";
            capURLs["FetchInventory"] = MainServer.Instance.ServerURI + uri;
            capURLs["FetchInventory2"] = MainServer.Instance.ServerURI + uri;
            m_uris.Add(uri);
            MainServer.Instance.AddStreamHandler(new GenericStreamHandler("POST", uri, method));

            method = delegate(string path, Stream request, OSHttpRequest httpRequest,
                              OSHttpResponse httpResponse)
            { return HandleFetchLib(request, m_agentID); };
            uri = "/CAPS/FetchLib/" + UUID.Random() + "/";
            capURLs["FetchLib"] = MainServer.Instance.ServerURI + uri;
            capURLs["FetchLib2"] = MainServer.Instance.ServerURI + uri;
            m_uris.Add(uri);
            MainServer.Instance.AddStreamHandler(new GenericStreamHandler("POST", uri, method));

            uri = "/CAPS/NewFileAgentInventory/" + UUID.Random() + "/";
            capURLs["NewFileAgentInventory"] = MainServer.Instance.ServerURI + uri;
            m_uris.Add(uri);
            MainServer.Instance.AddStreamHandler(new GenericStreamHandler("POST", uri, NewAgentInventoryRequest));

            uri = "/CAPS/NewFileAgentInventoryVariablePrice/" + UUID.Random() + "/";
            capURLs["NewFileAgentInventoryVariablePrice"] = MainServer.Instance.ServerURI + uri;
            m_uris.Add(uri);
            MainServer.Instance.AddStreamHandler(new GenericStreamHandler("POST", uri, NewAgentInventoryRequestVariablePrice));

            uri = "/CAPS/CreateInventoryCategory/" + UUID.Random() + "/";
            capURLs["CreateInventoryCategory"] = MainServer.Instance.ServerURI + uri;
            m_uris.Add(uri);
            MainServer.Instance.AddStreamHandler(new GenericStreamHandler("POST", uri, CreateInventoryCategory));
        }
コード例 #7
0
 public void OnMakeChildAgent(IScenePresence presence, WhiteCore.Framework.Services.GridRegion destination)
 {
     if (m_conciergedScenes.Contains(presence.Scene))
     {
         IScene scene = presence.Scene;
         MainConsole.Instance.DebugFormat("[Concierge]: {0} leaves {1}", presence.Name, scene.RegionInfo.RegionName);
         IEntityCountModule entityCountModule = scene.RequestModuleInterface<IEntityCountModule>();
         if (entityCountModule != null)
         {
             AnnounceToAgentsRegion(scene, String.Format(m_announceLeaving, presence.Name,
                                                        scene.RegionInfo.RegionName, entityCountModule.RootAgents));
             UpdateBroker(scene);
         }
     }
 }