master
Christopher Latza 2020-06-19 20:12:22 +02:00
parent 182e7c7234
commit c75eacd7d1
1 changed files with 91 additions and 79 deletions

View File

@ -170,11 +170,14 @@ namespace OpenSim.Modules.PathFinding
Environment _env = m_environments.Find(X => X.ID == requestData.EnvironmentID); Environment _env = m_environments.Find(X => X.ID == requestData.EnvironmentID);
if (_env != null) if (_env != null)
{
lock(_env)
{ {
_env.LastTimeUsed = (Int32)(DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1))).TotalSeconds; _env.LastTimeUsed = (Int32)(DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1))).TotalSeconds;
m_scriptModule.DispatchReply(requestData.ScriptID, 19850, "", requestData.RequestID.ToString()); m_scriptModule.DispatchReply(requestData.ScriptID, 19850, "", requestData.RequestID.ToString());
return; return;
} }
}
m_scriptModule.DispatchReply(requestData.ScriptID, 19851, "", requestData.RequestID.ToString()); m_scriptModule.DispatchReply(requestData.ScriptID, 19851, "", requestData.RequestID.ToString());
} }
@ -191,6 +194,8 @@ namespace OpenSim.Modules.PathFinding
Environment _env = m_environments.Find(X => X.ID == requestData.EnvironmentID); Environment _env = m_environments.Find(X => X.ID == requestData.EnvironmentID);
if (_env != null) if (_env != null)
{
lock(_env)
{ {
List<PathNode> _nodes = _env.Nodes.FindAll(X => X.Target == true); List<PathNode> _nodes = _env.Nodes.FindAll(X => X.Target == true);
@ -200,6 +205,7 @@ namespace OpenSim.Modules.PathFinding
} }
} }
} }
}
catch (Exception _error) catch (Exception _error)
{ {
m_scriptModule.DispatchReply(requestData.ScriptID, 19860, _error.Message, requestData.RequestID.ToString()); m_scriptModule.DispatchReply(requestData.ScriptID, 19860, _error.Message, requestData.RequestID.ToString());
@ -213,6 +219,8 @@ namespace OpenSim.Modules.PathFinding
Environment _env = m_environments.Find(X => X.ID == requestData.EnvironmentID); Environment _env = m_environments.Find(X => X.ID == requestData.EnvironmentID);
if (_env != null) if (_env != null)
{
lock(_env)
{ {
if (isTarget == 1) if (isTarget == 1)
removeAllTargets(requestData); removeAllTargets(requestData);
@ -239,6 +247,7 @@ namespace OpenSim.Modules.PathFinding
return; return;
} }
}
m_scriptModule.DispatchReply(requestData.ScriptID, 19851, "", requestData.RequestID.ToString()); m_scriptModule.DispatchReply(requestData.ScriptID, 19851, "", requestData.RequestID.ToString());
} }
@ -255,6 +264,8 @@ namespace OpenSim.Modules.PathFinding
Environment _env = m_environments.Find(X => X.ID == requestData.EnvironmentID); Environment _env = m_environments.Find(X => X.ID == requestData.EnvironmentID);
if (_env != null) if (_env != null)
{
lock(_env)
{ {
if ((int)start.X == (int)target.X || (int)start.Y == (int)target.Y) if ((int)start.X == (int)target.X || (int)start.Y == (int)target.Y)
{ {
@ -313,6 +324,7 @@ namespace OpenSim.Modules.PathFinding
return; return;
} }
} }
}
else else
{ {
m_scriptModule.DispatchReply(requestData.ScriptID, 19851, "", requestData.RequestID.ToString()); m_scriptModule.DispatchReply(requestData.ScriptID, 19851, "", requestData.RequestID.ToString());