当前位置: 首页>>代码示例>>C#>>正文


C# IScriptModule.PostScriptEvent方法代码示例

本文整理汇总了C#中IScriptModule.PostScriptEvent方法的典型用法代码示例。如果您正苦于以下问题:C# IScriptModule.PostScriptEvent方法的具体用法?C# IScriptModule.PostScriptEvent怎么用?C# IScriptModule.PostScriptEvent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IScriptModule的用法示例。


在下文中一共展示了IScriptModule.PostScriptEvent方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: RequestSecureURL

        public UUID RequestSecureURL(IScriptModule engine, SceneObjectPart host, UUID itemID)
        {
            UUID urlcode = UUID.Random();

            if (m_HttpsServer == null)
            {
                engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_DENIED", "" });
                return urlcode;
            }

            lock (m_UrlMap)
            {
                if (m_UrlMap.Count >= m_TotalUrls)
                {
                    engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_DENIED", "" });
                    return urlcode;
                }
                string url = "https://" + m_ExternalHostNameForLSL + ":" + m_HttpsServer.Port.ToString() + "/lslhttps/" + urlcode.ToString() + "/";

                UrlData urlData = new UrlData();
                urlData.hostID = host.UUID;
                urlData.itemID = itemID;
                urlData.engine = engine;
                urlData.url = url;
                urlData.urlcode = urlcode;
                urlData.requests = new Dictionary<UUID, RequestData>();

                m_UrlMap[url] = urlData;
                
                string uri = "/lslhttps/" + urlcode.ToString() + "/";
               
                m_HttpsServer.AddPollServiceHTTPHandler(
                    uri,
                    new PollServiceEventArgs(HttpRequestHandler, HasEvents, GetEvents, NoEvents, urlcode));

                m_log.DebugFormat(
                    "[URL MODULE]: Set up incoming secure request url {0} for {1} in {2} {3}",
                    uri, itemID, host.Name, host.LocalId);

                engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_GRANTED", url });
            }

            return urlcode;
        }
开发者ID:justasabc,项目名称:opensim75grid,代码行数:44,代码来源:UrlModule.cs

示例2: RequestSecureURL

        public UUID RequestSecureURL(IScriptModule engine, SceneObjectPart host, UUID itemID)
        {
            UUID urlcode = UUID.Random();
            string url = String.Empty;

            if (m_HttpsServer == null)
            {
                engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_DENIED", "" });
                return urlcode;
            }

            lock (m_UrlMap)
            {
                if (m_UrlMap.Count >= m_TotalUrls)
                {
                    engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_DENIED", "" });
                    return urlcode;
                }

                url = m_HttpsServer.ServerURI + "/lslhttps/" + urlcode.ToString() + "/";

                UrlData urlData = new UrlData
                {
                    hostID = host.UUID,
                    itemID = itemID,
                    engine = engine,
                    url = url,
                    urlcode = urlcode,
                    requests = new List<UUID>()
                };

                m_UrlMap[url] = urlData;
            }

            string uri = "/lslhttps/" + urlcode.ToString() + "/";
            m_HttpServer.AddStreamHandler(new AsyncRequestHandler("POST", uri, AsyncHttpRequest));
            m_HttpServer.AddStreamHandler(new AsyncRequestHandler("GET", uri, AsyncHttpRequest));

            engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_GRANTED", url });

            return urlcode;
        }
开发者ID:BogusCurry,项目名称:halcyon,代码行数:42,代码来源:UrlModule.cs

示例3: RequestSecureURL

        public UUID RequestSecureURL(IScriptModule engine, ISceneChildEntity host, UUID itemID)
        {
            UUID urlcode = UUID.Random();

            engine.PostScriptEvent(itemID, host.UUID, "http_request",
                                   new Object[] {urlcode.ToString(), "URL_REQUEST_DENIED", ""});

            return urlcode;
        }
开发者ID:emperorstarfinder,项目名称:Virtual-Universe,代码行数:9,代码来源:UrlModule.cs

示例4: RequestURL

        public UUID RequestURL(IScriptModule engine, ISceneChildEntity host, UUID itemID)
        {
            UUID urlcode = UUID.Random();

            lock (m_UrlMap)
            {
                if (m_UrlMap.Count >= m_TotalUrls)
                {
                    engine.PostScriptEvent(itemID, host.UUID, "http_request",
                                           new Object[] {urlcode.ToString(), "URL_REQUEST_DENIED", ""});
                    return urlcode;
                }
                string url = MainServer.Instance.ServerURI + "/lslhttp/" + urlcode.ToString() + "/";

                UrlData urlData = new UrlData
                                      {
                                          hostID = host.UUID,
                                          itemID = itemID,
                                          engine = engine,
                                          url = url,
                                          urlcode = urlcode,
                                          requests = new Dictionary<UUID, RequestData>()
                                      };

                m_UrlMap[url] = urlData;

                string uri = "/lslhttp/" + urlcode.ToString() + "/";
                MainServer.Instance.AddPollServiceHTTPHandler(uri, new PollServiceEventArgs(HttpRequestHandler, HasEvents,
                                                                                       GetEvents, NoEvents,
                                                                                       urlcode));

                engine.PostScriptEvent(itemID, host.UUID, "http_request",
                                       new Object[] {urlcode.ToString(), "URL_REQUEST_GRANTED", url});
            }

            return urlcode;
        }
开发者ID:emperorstarfinder,项目名称:Virtual-Universe,代码行数:37,代码来源:UrlModule.cs

示例5: RegisterNewReceiver

 public void RegisterNewReceiver(IScriptModule scriptEngine, UUID channel, UUID objectID, UUID itemID, string uri)
 {
     scriptEngine.PostScriptEvent(itemID, objectID, "xmlrpc_uri", new Object[] {uri});
 }
开发者ID:NickyPerian,项目名称:Aurora,代码行数:4,代码来源:XmlRpcRouterModule.cs

示例6: RequestURL

        public UUID RequestURL(IScriptModule engine, SceneObjectPart host, UUID itemID)
        {
            UUID urlcode = UUID.Random();

            lock (m_UrlMap)
            {
                if (m_UrlMap.Count >= m_TotalUrls)
                {
                    engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_DENIED", "" });
                    return urlcode;
                }
                string url = "http://" + m_ExternalHostNameForLSL + ":" + m_HttpServer.Port.ToString() + "/lslhttp/" + urlcode.ToString() + "/";

                UrlData urlData = new UrlData();
                urlData.hostID = host.UUID;
                urlData.itemID = itemID;
                urlData.engine = engine;
                urlData.url = url;
                urlData.urlcode = urlcode;
                urlData.requests = new Dictionary<UUID, RequestData>();
                
                m_UrlMap[url] = urlData;
                
                string uri = "/lslhttp/" + urlcode.ToString() + "/";
               
                m_HttpServer.AddPollServiceHTTPHandler(
                    uri,
                    new PollServiceEventArgs(HttpRequestHandler, HasEvents, GetEvents, NoEvents, urlcode));

                engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_GRANTED", url });
            }

            return urlcode;
        }
开发者ID:JAllard,项目名称:osmodified,代码行数:34,代码来源:UrlModule.cs

示例7: RequestURL

        public UUID RequestURL(IScriptModule engine, SceneObjectPart host, UUID itemID)
        {
            UUID urlcode = UUID.Random();

            lock (m_UrlMap)
            {
                if (m_UrlMap.Count >= m_TotalUrls)
                {
                    engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_DENIED", "" });
                    return urlcode;
                }
                string url = "http://"+System.Environment.MachineName+":"+m_HttpServer.Port.ToString()+"/lslhttp/"+urlcode.ToString()+"/";

                UrlData urlData = new UrlData();
                urlData.hostID = host.UUID;
                urlData.itemID = itemID;
                urlData.engine = engine;
                urlData.url = url;
                urlData.urlcode = urlcode;
                urlData.requests = new Dictionary<UUID, RequestData>();

                m_UrlMap[url] = urlData;

                m_HttpServer.AddHTTPHandler("/lslhttp/"+urlcode.ToString()+"/", HttpRequestHandler);

                engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_GRANTED", url });
            }

            return urlcode;
        }
开发者ID:ChrisD,项目名称:opensim,代码行数:30,代码来源:UrlModule.cs

示例8: RequestSecureURL

        public UUID RequestSecureURL(IScriptModule engine, SceneObjectPart host, UUID itemID)
        {
            UUID urlcode = UUID.Random();

            if (m_HttpsServer == null)
            {
                engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_DENIED", "" });
                return urlcode;
            }

            lock (m_UrlMap) /* this lock here is for preventing concurrency when checking for Url amount */
            {
                if (m_UrlMap.Count >= TotalUrls)
                {
                    engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_DENIED", "" });
                    return urlcode;
                }
                string url = "https://" + ExternalHostNameForLSL + ":" + m_HttpsServer.Port.ToString() + "/lslhttps/" + urlcode.ToString() + "/";

                UrlData urlData = new UrlData();
                urlData.hostID = host.UUID;
                urlData.itemID = itemID;
                urlData.engine = engine;
                urlData.url = url;
                urlData.urlcode = urlcode;
                urlData.requests = new ThreadedClasses.RwLockedDictionary<UUID, RequestData>();

                m_UrlMap[url] = urlData;
                
                string uri = "/lslhttps/" + urlcode.ToString() + "/";
               
                PollServiceEventArgs args 
                    = new PollServiceEventArgs(HttpRequestHandler, uri, HasEvents, GetEvents, NoEvents, urlcode, 25000);
                args.Type = PollServiceEventArgs.EventType.LslHttp;
                m_HttpsServer.AddPollServiceHTTPHandler(uri, args);

                m_log.DebugFormat(
                    "[URL MODULE]: Set up incoming secure request url {0} for {1} in {2} {3}",
                    uri, itemID, host.Name, host.LocalId);

                engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_GRANTED", url });
            }

            return urlcode;
        }
开发者ID:BogusCurry,项目名称:arribasim-dev,代码行数:45,代码来源:UrlModule.cs

示例9: RequestSecureURL

        public UUID RequestSecureURL(IScriptModule engine, SceneObjectPart host, UUID itemID, Hashtable options)
        {
            UUID urlcode = UUID.Random();

            if (m_HttpsServer == null)
            {
                engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_DENIED", "" });
                return urlcode;
            }

            lock (m_UrlMap)
            {
                if (m_UrlMap.Count >= TotalUrls)
                {
                    engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_DENIED", "" });
                    return urlcode;
                }
                string url = "https://" + ExternalHostNameForLSL + ":" + m_HttpsServer.Port.ToString() + "/lslhttps/" + urlcode.ToString() + "/";

                UrlData urlData = new UrlData();
                urlData.hostID = host.UUID;
                urlData.itemID = itemID;
                urlData.engine = engine;
                urlData.url = url;
                urlData.urlcode = urlcode;
                urlData.isSsl = true;
                urlData.requests = new Dictionary<UUID, RequestData>();
                urlData.allowXss = false;

                if (options != null && options["allowXss"] != null)
                    urlData.allowXss = true;
                
                m_UrlMap[url] = urlData;
                
                string uri = "/lslhttps/" + urlcode.ToString() + "/";
               
                PollServiceEventArgs args 
                    = new PollServiceEventArgs(HttpRequestHandler, uri, HasEvents, GetEvents, NoEvents, urlcode, 25000);
                args.Type = PollServiceEventArgs.EventType.LslHttp;
                m_HttpsServer.AddPollServiceHTTPHandler(uri, args);

//                m_log.DebugFormat(
//                    "[URL MODULE]: Set up incoming secure request url {0} for {1} in {2} {3}",
//                    uri, itemID, host.Name, host.LocalId);

                engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_GRANTED", url });
            }

            return urlcode;
        }
开发者ID:emperorstarfinder,项目名称:Opensim2,代码行数:50,代码来源:UrlModule.cs


注:本文中的IScriptModule.PostScriptEvent方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。