本文整理汇总了C#中IScriptModule类的典型用法代码示例。如果您正苦于以下问题:C# IScriptModule类的具体用法?C# IScriptModule怎么用?C# IScriptModule使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IScriptModule类属于命名空间,在下文中一共展示了IScriptModule类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RegionLoaded
public void RegionLoaded(Scene scene)
{
m_scriptModule = scene.RequestModuleInterface<IScriptModule>();
if (m_scriptModule != null)
m_log.Info("[MODULE COMMANDS]: Script engine found, module active");
}
示例2: Evaluate
/// <summary>
/// Execute code within a given module context and returns the result.
/// The module must be local with respect to the compiled code object.
/// </summary>
public object Evaluate(IScriptModule module) {
ScriptModule localModule;
if (module == null) {
localModule = RemoteWrapper.TryGetLocal<ScriptModule>(ScriptDomainManager.CurrentManager.Host.DefaultModule);
} else {
localModule = RemoteWrapper.GetLocalArgument<ScriptModule>(module, "module");
}
return _code.Run(localModule);
}
示例3: PublishModule
public void PublishModule(IScriptModule module, string publicName) {
_manager.PublishModule(RemoteWrapper.GetLocalArgument<ScriptModule>(module, "module"), publicName);
}
示例4: RegionLoaded
public void RegionLoaded(IScene scene)
{
m_scriptModule = scene.RequestModuleInterface<IScriptModule>();
}
示例5: 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;
}
示例6: ModuleCreated
public void ModuleCreated(IScriptModule module) {
_host.ModuleCreated(module);
}
示例7: 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;
}
示例8: EvaluateAndWrap
public IObjectHandle EvaluateAndWrap(IScriptModule module) {
return _compiledCode.EvaluateAndWrap(module);
}
示例9: Execute
public void Execute(IScriptModule module) {
_compiledCode.Execute(module);
}
示例10: ModuleCreated
public virtual void ModuleCreated(IScriptModule module)
{
// nop
}
示例11: 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;
}
示例12: AddRegion
public void AddRegion(Scene scene)
{
m_scene = scene;
m_scene.RegisterModuleInterface<IWorldComm>(this);
m_scriptModule = scene.RequestModuleInterface<IScriptModule> ();
m_scene.EventManager.OnChatFromClient += DeliverClientMessage;
m_scene.EventManager.OnChatBroadcast += DeliverClientMessage;
}
示例13: PublishModule
public void PublishModule(IScriptModule module, string publicName) {
_manager.Environment.PublishModule(module, publicName);
}
示例14: CodeSenseProvider
public CodeSenseProvider(IScriptEngine engine, IScriptModule module) {
Contract.RequiresNotNull(engine, "engine");
_engine = engine;
_module = module;
}
示例15: Evaluate
/// <summary>
/// Execute code within a given module context and returns the result.
/// The module must be local with respect to the compiled code object.
/// </summary>
public object Evaluate(IScriptModule module)
{
IScriptModule localModule;
if (module == null) {
localModule = ScriptDomainManager.CurrentManager.Host.DefaultModule;
} else {
localModule = module;
}
return _code.Run((ScriptModule)localModule);
}