本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例5: RegisterNewReceiver
public void RegisterNewReceiver(IScriptModule scriptEngine, UUID channel, UUID objectID, UUID itemID, string uri)
{
scriptEngine.PostScriptEvent(itemID, objectID, "xmlrpc_uri", new Object[] {uri});
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}