master
Christopher Latza 2020-06-10 20:56:28 +02:00
parent c171f0e739
commit 8d7a69b962
1 changed files with 21 additions and 13 deletions

View File

@ -223,25 +223,33 @@ namespace OpenSim.Modules.PathFinding
[ScriptInvocation] [ScriptInvocation]
public string osCreateNewPathFindingScene(UUID hostID, UUID scriptID) public string osCreateNewPathFindingScene(UUID hostID, UUID scriptID)
{ {
SceneObjectPart _host = m_scene.GetSceneObjectPart(hostID); try
if(_host != null || m_asyncCommands != null)
{ {
String imageName = UUID.Random().ToString(); SceneObjectGroup _host = m_scene.GetSceneObjectGroup(hostID);
UUID tid = m_asyncCommands.DataserverPlugin.RegisterRequest(_host.LocalId, _host.GroupID, imageName); if (_host != null || m_asyncCommands != null)
{
String imageName = UUID.Random().ToString();
(new Thread(delegate () { createPathFindingScene(imageName); })).Start(); UUID tid = m_asyncCommands.DataserverPlugin.RegisterRequest(_host.LocalId, _host.GroupID, imageName);
return imageName; (new Thread(delegate () { createPathFindingScene(imageName); })).Start();
return imageName;
}
else
{
if (_host == null)
m_log.ErrorFormat("[" + Name + "]: Host is null");
if (m_asyncCommands == null)
m_log.ErrorFormat("[" + Name + "]: AsyncCommands is null");
}
} }
else catch(Exception _error)
{ {
if (_host == null) m_log.Error(_error.Message);
m_log.ErrorFormat("[" + Name + "]: Host is null"); m_log.Error(_error.StackTrace);
if (m_asyncCommands == null)
m_log.ErrorFormat("[" + Name + "]: AsyncCommands is null");
} }
return UUID.Zero.ToString(); return UUID.Zero.ToString();