request scriptengine

master
Christopher Latza 2020-06-10 20:46:06 +02:00
parent ad3d94cbe8
commit c171f0e739
2 changed files with 19 additions and 1 deletions

View File

@ -22,6 +22,7 @@
<Reference name="OpenSim.Region.CoreModules" path="../../../bin"/>
<Reference name="OpenSim.Region.Framework" path="../../../bin"/>
<Reference name="OpenSim.Region.ScriptEngine.Shared.Api" path="../../../bin"/>
<Reference name="OpenSim.Region.ScriptEngine.Interfaces" path="../../../bin"/>
<Reference name="OpenSim.Framework" path="../../../bin"/>
<Reference name="OpenSim.Framework.Console" path="../../../bin"/>
<Reference name="OpenSim.Framework.Servers" path="../../../bin"/>

View File

@ -5,6 +5,7 @@ using OpenMetaverse;
using OpenSim.Region.CoreModules.World.LegacyMap;
using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.Framework.Scenes;
using OpenSim.Region.ScriptEngine.Interfaces;
using OpenSim.Region.ScriptEngine.Shared.Api;
using System;
using System.Collections.Generic;
@ -35,6 +36,7 @@ namespace OpenSim.Modules.PathFinding
private string m_dataDirectory = "./PathFindingData";
private IScriptModuleComms m_scriptModule;
private AsyncCommandManager m_asyncCommands = null;
private IScriptEngine m_scriptEngine = null;
public string Name
{
@ -114,6 +116,13 @@ namespace OpenSim.Modules.PathFinding
m_log.WarnFormat("[" + Name + "]: script method registration failed; {0}", e.Message);
m_enabled = false;
}
m_scriptEngine = m_scene.RequestModuleInterface<IScriptEngine>();
if(m_scriptEngine != null)
{
m_asyncCommands = new AsyncCommandManager(m_scriptEngine);
}
}
}
@ -216,7 +225,7 @@ namespace OpenSim.Modules.PathFinding
{
SceneObjectPart _host = m_scene.GetSceneObjectPart(hostID);
if(_host != null)
if(_host != null || m_asyncCommands != null)
{
String imageName = UUID.Random().ToString();
@ -226,6 +235,14 @@ namespace OpenSim.Modules.PathFinding
return imageName;
}
else
{
if (_host == null)
m_log.ErrorFormat("[" + Name + "]: Host is null");
if (m_asyncCommands == null)
m_log.ErrorFormat("[" + Name + "]: AsyncCommands is null");
}
return UUID.Zero.ToString();