From 4ec4e16c809cf86a63b736d2b7b6ad7291595a5f Mon Sep 17 00:00:00 2001
From: Jeff Ames
Date: Wed, 4 Jun 2008 09:59:27 +0000
Subject: Formatting cleanup, minor refactoring, svn properties.
---
.../ScriptEngine/Common/LSL_BuiltIn_Commands.cs | 2 +-
.../DotNetEngine/Compiler/LSL/Compiler.cs | 10 +-
.../DotNetEngine/Compiler/LSL/YP2CSConverter.cs | 2 +-
.../DotNetEngine/Compiler/YieldProlog/Atom.cs | 22 +-
.../Compiler/YieldProlog/BagofAnswers.cs | 28 +-
.../Compiler/YieldProlog/FindallAnswers.cs | 20 +-
.../DotNetEngine/Compiler/YieldProlog/Functor.cs | 24 +-
.../DotNetEngine/Compiler/YieldProlog/Functor1.cs | 20 +-
.../DotNetEngine/Compiler/YieldProlog/Functor2.cs | 22 +-
.../DotNetEngine/Compiler/YieldProlog/Functor3.cs | 22 +-
.../Compiler/YieldProlog/IndexedAnswers.cs | 22 +-
.../DotNetEngine/Compiler/YieldProlog/ListPair.cs | 26 +-
.../DotNetEngine/Compiler/YieldProlog/Parser.cs | 20 +-
.../Compiler/YieldProlog/PrologException.cs | 20 +-
.../YieldProlog/UndefinedPredicateException.cs | 20 +-
.../DotNetEngine/Compiler/YieldProlog/Variable.cs | 20 +-
.../DotNetEngine/Compiler/YieldProlog/YP.cs | 34 +-
.../Compiler/YieldProlog/YPCompiler.cs | 20 +-
.../ScriptEngine/XEngine/AsyncCommandManager.cs | 22 +-
.../XEngine/AsyncCommandPlugins/Dataserver.cs | 20 +-
.../XEngine/AsyncCommandPlugins/Eventstream.cs | 7 +-
.../XEngine/AsyncCommandPlugins/HttpRequest.cs | 2 +-
.../XEngine/AsyncCommandPlugins/SensorRepeat.cs | 20 +-
.../XEngine/AsyncCommandPlugins/Timer.cs | 8 +-
.../XEngine/AsyncCommandPlugins/XmlRequest.cs | 12 +-
OpenSim/Region/ScriptEngine/XEngine/Compiler.cs | 43 +--
.../Region/ScriptEngine/XEngine/EventManager.cs | 6 +-
OpenSim/Region/ScriptEngine/XEngine/Executor.cs | 3 +-
.../ScriptEngine/XEngine/LSL_ScriptCommands.cs | 300 ++++++++-------
.../XEngine/Script/AssemblyResolver.cs | 14 +-
.../XEngine/Script/BuiltIn_Commands_BaseClass.cs | 2 +-
.../ScriptEngine/XEngine/Script/LSL_Types.cs | 8 +-
OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | 420 ++++++++++-----------
33 files changed, 625 insertions(+), 616 deletions(-)
(limited to 'OpenSim/Region/ScriptEngine')
diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
index e5167aa..6a3f464 100644
--- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
+++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
@@ -178,7 +178,7 @@ namespace OpenSim.Region.ScriptEngine.Common
///
- /// accepts a valid LLUUID, -or- a name of an inventory item.
+ /// accepts a valid LLUUID, -or- a name of an inventory item.
/// Returns a valid LLUUID or LLUUID.Zero if key invalid and item not found
/// in prim inventory.
///
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs
index abad59c..7113f1a 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs
@@ -39,9 +39,9 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
{
public class Compiler
{
- private static readonly log4net.ILog m_log
+ private static readonly log4net.ILog m_log
= log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
-
+
// * Uses "LSL2Converter" to convert LSL to C# if necessary.
// * Compiles C#-code into an assembly
// * Returns assembly name ready for AppDomain load.
@@ -291,8 +291,8 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
if (enableCommanderLSL == true && l == enumCompileType.cs)
{
- foreach (KeyValuePair com
+ foreach (KeyValuePair com
in m_scriptEngine.World.GetCommanders())
{
compileScript = com.Value.GenerateRuntimeAPI() + compileScript;
@@ -318,7 +318,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
m_log.Debug("[ScriptEngine.DotNetEngine]: Preparing to compile the following LSL to C# translated code");
m_log.Debug("");
m_log.Debug(compileScript);
-
+
return CompileFromDotNetText(compileScript, l);
}
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/YP2CSConverter.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/YP2CSConverter.cs
index 557c1c9..0bd3b0c 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/YP2CSConverter.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/YP2CSConverter.cs
@@ -75,7 +75,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
{
ListPair VFC = new ListPair(FunctionCode, new Variable());
//Console.WriteLine("-------------------------")
- //Console.WriteLine( FunctionCode.ToString())
+ //Console.WriteLine(FunctionCode.ToString())
//Console.WriteLine("-------------------------")
YPCompiler.convertFunctionCSharp(FunctionCode);
//YPCompiler.convertStringCodesCSharp(VFC);
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/Atom.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/Atom.cs
index 7387ef4..0537f7d 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/Atom.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/Atom.cs
@@ -1,20 +1,20 @@
/*
* Copyright (C) 2007-2008, Jeff Thompson
- *
+ *
* All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
+ *
+ * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright
+ *
+ * * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * * Neither the name of the copyright holder nor the names of its contributors
- * may be used to endorse or promote products derived from this software
+ * * Neither the name of the copyright holder nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
* without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -167,7 +167,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog
return _name.GetHashCode();
}
- public string toQuotedString()
+ public string toQuotedString()
{
if (_name.Length == 0)
return "''";
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/BagofAnswers.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/BagofAnswers.cs
index 88ffdb7..250ad59 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/BagofAnswers.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/BagofAnswers.cs
@@ -1,20 +1,20 @@
/*
* Copyright (C) 2007-2008, Jeff Thompson
- *
+ *
* All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
+ *
+ * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright
+ *
+ * * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * * Neither the name of the copyright holder nor the names of its contributors
- * may be used to endorse or promote products derived from this software
+ * * Neither the name of the copyright holder nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
* without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -47,7 +47,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog
new TermArrayEqualityComparer();
///
- /// To get the free variables, split off any existential qualifiers from Goal such as the X in
+ /// To get the free variables, split off any existential qualifiers from Goal such as the X in
/// "X ^ f(Y)", get the set of unbound variables in Goal that are not qualifiers, then remove
/// the unbound variables that are qualifiers as well as the unbound variables in Template.
///
@@ -67,7 +67,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog
UnqualifiedGoal = YP.getValue(((Functor2)UnqualifiedGoal)._arg2);
}
- // Remember how many non-free variables there are so we can find the unique free variables
+ // Remember how many non-free variables there are so we can find the unique free variables
// that are added.
int nNonFreeVariables = variableSet.Count;
YP.addUniqueVariables(UnqualifiedGoal, variableSet);
@@ -116,8 +116,8 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog
///
/// For each result, unify the _freeVariables and unify bagArrayVariable with the associated bag.
///
- /// this is unified with the List of matches for template that
- /// corresponds to the bindings for freeVariables. Be very careful: this does not unify with a Prolog
+ /// this is unified with the List of matches for template that
+ /// corresponds to the bindings for freeVariables. Be very careful: this does not unify with a Prolog
/// list.
///
public IEnumerable resultArray(Variable bagArrayVariable)
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/FindallAnswers.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/FindallAnswers.cs
index dcd4250..cfc6788 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/FindallAnswers.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/FindallAnswers.cs
@@ -1,20 +1,20 @@
/*
* Copyright (C) 2007-2008, Jeff Thompson
- *
+ *
* All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
+ *
+ * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright
+ *
+ * * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * * Neither the name of the copyright holder nor the names of its contributors
- * may be used to endorse or promote products derived from this software
+ * * Neither the name of the copyright holder nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
* without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/Functor.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/Functor.cs
index 58c0e4b..07993ea 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/Functor.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/Functor.cs
@@ -1,20 +1,20 @@
/*
* Copyright (C) 2007-2008, Jeff Thompson
- *
+ *
* All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
+ *
+ * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright
+ *
+ * * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * * Neither the name of the copyright holder nor the names of its contributors
- * may be used to endorse or promote products derived from this software
+ * * Neither the name of the copyright holder nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
* without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -66,14 +66,14 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog
///
/// Return an Atom, Functor1, Functor2, Functor3 or Functor depending on the
- /// length of args.
+ /// length of args.
/// Note that this is different than the Functor constructor which requires
/// the length of args to be greater than 3.
///
///
///
///
- public static object make(Atom name, object[] args)
+ public static object make(Atom name, object[] args)
{
if (args.Length <= 0)
return name;
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/Functor1.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/Functor1.cs
index 582cd20..114e338 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/Functor1.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/Functor1.cs
@@ -1,20 +1,20 @@
/*
* Copyright (C) 2007-2008, Jeff Thompson
- *
+ *
* All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
+ *
+ * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright
+ *
+ * * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * * Neither the name of the copyright holder nor the names of its contributors
- * may be used to endorse or promote products derived from this software
+ * * Neither the name of the copyright holder nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
* without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/Functor2.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/Functor2.cs
index 138a44c..132d417 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/Functor2.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/Functor2.cs
@@ -1,20 +1,20 @@
/*
* Copyright (C) 2007-2008, Jeff Thompson
- *
+ *
* All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
+ *
+ * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright
+ *
+ * * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * * Neither the name of the copyright holder nor the names of its contributors
- * may be used to endorse or promote products derived from this software
+ * * Neither the name of the copyright holder nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
* without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -118,7 +118,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog
public object makeCopy(Variable.CopyStore copyStore)
{
- return new Functor2(_name, YP.makeCopy(_arg1, copyStore),
+ return new Functor2(_name, YP.makeCopy(_arg1, copyStore),
YP.makeCopy(_arg2, copyStore));
}
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/Functor3.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/Functor3.cs
index b52fdf3..064ec19 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/Functor3.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/Functor3.cs
@@ -1,20 +1,20 @@
/*
* Copyright (C) 2007-2008, Jeff Thompson
- *
+ *
* All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
+ *
+ * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright
+ *
+ * * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * * Neither the name of the copyright holder nor the names of its contributors
- * may be used to endorse or promote products derived from this software
+ * * Neither the name of the copyright holder nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
* without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -47,7 +47,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog
_arg2 = arg2;
_arg3 = arg3;
}
-
+
public Functor3(string name, object arg1, object arg2, object arg3)
: this(Atom.a(name), arg1, arg2, arg3)
{
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/IndexedAnswers.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/IndexedAnswers.cs
index 05b0a01..e1efda8 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/IndexedAnswers.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/IndexedAnswers.cs
@@ -1,20 +1,20 @@
/*
* Copyright (C) 2007-2008, Jeff Thompson
- *
+ *
* All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
+ *
+ * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright
+ *
+ * * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * * Neither the name of the copyright holder nor the names of its contributors
- * may be used to endorse or promote products derived from this software
+ * * Neither the name of the copyright holder nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
* without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -73,7 +73,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog
// If match has already indexed answers for a signature, we need to add
// this to the existing indexed answers.
- foreach(int signature in _gotAnswersForSignature.Keys)
+ foreach (int signature in _gotAnswersForSignature.Keys)
indexAnswerForSignature(answerCopy, signature);
}
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/ListPair.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/ListPair.cs
index 681c445..f0669f6 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/ListPair.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/ListPair.cs
@@ -1,20 +1,20 @@
/*
* Copyright (C) 2007-2008, Jeff Thompson
- *
+ *
* All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
+ *
+ * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright
+ *
+ * * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * * Neither the name of the copyright holder nor the names of its contributors
- * may be used to endorse or promote products derived from this software
+ * * Neither the name of the copyright holder nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
* without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -64,7 +64,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog
}
///
- /// Return a ListPair version of array, where repeated elements
+ /// Return a ListPair version of array, where repeated elements
/// (according to YP.termEqual) are removed.
///
///
@@ -89,7 +89,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog
}
///
- /// Return a ListPair version of array, where repeated elements
+ /// Return a ListPair version of array, where repeated elements
/// (according to YP.termEqual) are removed.
///
///
@@ -125,7 +125,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog
public static object make(object element1, object element2, object element3)
{
- return new ListPair(element1,
+ return new ListPair(element1,
new ListPair(element2, new ListPair(element3, Atom.NIL)));
}
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/Parser.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/Parser.cs
index a21a471..b2fad45 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/Parser.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/Parser.cs
@@ -1,20 +1,20 @@
/*
* Copyright (C) 2007-2008, Jeff Thompson
- *
+ *
* All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
+ *
+ * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright
+ *
+ * * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * * Neither the name of the copyright holder nor the names of its contributors
- * may be used to endorse or promote products derived from this software
+ * * Neither the name of the copyright holder nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
* without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/PrologException.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/PrologException.cs
index 63b304a..2a23fe1 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/PrologException.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/PrologException.cs
@@ -1,20 +1,20 @@
/*
* Copyright (C) 2007-2008, Jeff Thompson
- *
+ *
* All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
+ *
+ * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright
+ *
+ * * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * * Neither the name of the copyright holder nor the names of its contributors
- * may be used to endorse or promote products derived from this software
+ * * Neither the name of the copyright holder nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
* without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/UndefinedPredicateException.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/UndefinedPredicateException.cs
index f746a07..22a22b4 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/UndefinedPredicateException.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/UndefinedPredicateException.cs
@@ -1,20 +1,20 @@
/*
* Copyright (C) 2007-2008, Jeff Thompson
- *
+ *
* All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
+ *
+ * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright
+ *
+ * * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * * Neither the name of the copyright holder nor the names of its contributors
- * may be used to endorse or promote products derived from this software
+ * * Neither the name of the copyright holder nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
* without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/Variable.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/Variable.cs
index 47b5278..7829770 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/Variable.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/Variable.cs
@@ -1,20 +1,20 @@
/*
* Copyright (C) 2007-2008, Jeff Thompson
- *
+ *
* All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
+ *
+ * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright
+ *
+ * * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * * Neither the name of the copyright holder nor the names of its contributors
- * may be used to endorse or promote products derived from this software
+ * * Neither the name of the copyright holder nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
* without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/YP.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/YP.cs
index 2912ab9..a03cd30 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/YP.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/YP.cs
@@ -1,20 +1,20 @@
/*
* Copyright (C) 2007-2008, Jeff Thompson
- *
+ *
* All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
+ *
+ * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright
+ *
+ * * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * * Neither the name of the copyright holder nor the names of its contributors
- * may be used to endorse or promote products derived from this software
+ * * Neither the name of the copyright holder nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
* without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -650,8 +650,8 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog
if (term1TypeCode == -2)
{
// Variable.
- // We always check for equality first because we want to be sure
- // that less than returns false if the terms are equal, in
+ // We always check for equality first because we want to be sure
+ // that less than returns false if the terms are equal, in
// case that the less than check really behaves like less than or equal.
if ((Variable)Term1 != (Variable)Term2)
// The hash code should be unique to a Variable object.
@@ -694,8 +694,8 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog
}
///
- /// Type code is -2 if term is a Variable, 0 if it is an Atom,
- /// 1 if it is a Functor1, 2 if it is a Functor2, 3 if it is a Functor3,
+ /// Type code is -2 if term is a Variable, 0 if it is an Atom,
+ /// 1 if it is a Functor1, 2 if it is a Functor2, 3 if it is a Functor3,
/// 4 if it is Functor.
/// Otherwise, type code is -1.
/// This does not call YP.getValue(term).
@@ -1115,7 +1115,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog
IndexedAnswers indexedAnswers;
if (!_predicatesStore.TryGetValue(nameArity, out clauses))
{
- // Create an IndexedAnswers as the first clause of the predicate.
+ // Create an IndexedAnswers as the first clause of the predicate.
_predicatesStore[nameArity] = (clauses = new List());
clauses.Add(indexedAnswers = new IndexedAnswers());
}
@@ -1135,7 +1135,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog
List clauses;
if (!_predicatesStore.TryGetValue(new NameArity(name, arguments.Length), out clauses))
throw new UndefinedPredicateException
- ("Undefined fact: " + name + "/" + arguments.Length, name,
+ ("Undefined fact: " + name + "/" + arguments.Length, name,
arguments.Length);
if (clauses.Count == 1)
@@ -1209,7 +1209,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog
}
///
- /// Use YP.getFunctorName(Goal) and invoke the static method of this name in the
+ /// Use YP.getFunctorName(Goal) and invoke the static method of this name in the
/// declaringClass, using arguments from YP.getFunctorArgs(Goal).
/// Note that Goal must be a simple functor, not a complex expression.
/// If not found, this throws UndefinedPredicateException.
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/YPCompiler.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/YPCompiler.cs
index a0a92b6..d998bac 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/YPCompiler.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/YPCompiler.cs
@@ -1,20 +1,20 @@
/*
* Copyright (C) 2007-2008, Jeff Thompson
- *
+ *
* All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
+ *
+ * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright
+ *
+ * * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * * Neither the name of the copyright holder nor the names of its contributors
- * may be used to endorse or promote products derived from this software
+ * * Neither the name of the copyright holder nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
* without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
diff --git a/OpenSim/Region/ScriptEngine/XEngine/AsyncCommandManager.cs b/OpenSim/Region/ScriptEngine/XEngine/AsyncCommandManager.cs
index 4ec7916..fdad5b0 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/AsyncCommandManager.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/AsyncCommandManager.cs
@@ -184,7 +184,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
List data = new List();
Object[] listeners=m_Listener.GetSerializationData(itemID);
- if(listeners.Length > 0)
+ if (listeners.Length > 0)
{
data.Add("listener");
data.Add(listeners.Length);
@@ -192,7 +192,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
}
Object[] timers=m_Timer.GetSerializationData(itemID);
- if(timers.Length > 0)
+ if (timers.Length > 0)
{
data.Add("timer");
data.Add(timers.Length);
@@ -200,7 +200,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
}
Object[] sensors=m_SensorRepeat.GetSerializationData(itemID);
- if(sensors.Length > 0)
+ if (sensors.Length > 0)
{
data.Add("sensor");
data.Add(sensors.Length);
@@ -211,36 +211,36 @@ namespace OpenSim.Region.ScriptEngine.XEngine
}
public void CreateFromData(uint localID, LLUUID itemID, LLUUID hostID,
- Object[] data)
+ Object[] data)
{
- int idx=0;
+ int idx = 0;
int len;
- while(idx < data.Length)
+ while (idx < data.Length)
{
string type = data[idx].ToString();
len = (int)data[idx+1];
idx+=2;
- if(len > 0)
+ if (len > 0)
{
Object[] item = new Object[len];
Array.Copy(data, idx, item, 0, len);
idx+=len;
- switch(type)
+ switch (type)
{
case "listener":
m_Listener.CreateFromData(localID, itemID, hostID,
- item);
+ item);
break;
case "timer":
m_Timer.CreateFromData(localID, itemID, hostID, item);
break;
case "sensor":
m_SensorRepeat.CreateFromData(localID, itemID, hostID,
- item);
+ item);
break;
}
}
@@ -249,12 +249,10 @@ namespace OpenSim.Region.ScriptEngine.XEngine
#region Check llRemoteData channels
-
#endregion
#region Check llListeners
-
#endregion
///
diff --git a/OpenSim/Region/ScriptEngine/XEngine/AsyncCommandPlugins/Dataserver.cs b/OpenSim/Region/ScriptEngine/XEngine/AsyncCommandPlugins/Dataserver.cs
index 794a015..47ab420 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/AsyncCommandPlugins/Dataserver.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/AsyncCommandPlugins/Dataserver.cs
@@ -57,11 +57,11 @@ namespace OpenSim.Region.ScriptEngine.XEngine.AsyncCommandPlugins
}
public LLUUID RegisterRequest(uint localID, LLUUID itemID,
- string identifier)
+ string identifier)
{
- lock(DataserverRequests)
+ lock (DataserverRequests)
{
- if(DataserverRequests.ContainsKey(identifier))
+ if (DataserverRequests.ContainsKey(identifier))
return LLUUID.Zero;
DataserverRequest ds = new DataserverRequest();
@@ -84,9 +84,9 @@ namespace OpenSim.Region.ScriptEngine.XEngine.AsyncCommandPlugins
{
DataserverRequest ds;
- lock(DataserverRequests)
+ lock (DataserverRequests)
{
- if(!DataserverRequests.ContainsKey(identifier))
+ if (!DataserverRequests.ContainsKey(identifier))
return;
ds=DataserverRequests[identifier];
@@ -94,7 +94,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine.AsyncCommandPlugins
}
m_CmdManager.m_ScriptEngine.PostObjectEvent(ds.localID,
- new XEventParams( "dataserver", new Object[]
+ new XEventParams("dataserver", new Object[]
{ new LSL_Types.LSLString(ds.ID.ToString()),
new LSL_Types.LSLString(reply)},
new XDetectParams[0]));
@@ -102,11 +102,11 @@ namespace OpenSim.Region.ScriptEngine.XEngine.AsyncCommandPlugins
public void RemoveEvents(uint localID, LLUUID itemID)
{
- lock(DataserverRequests)
+ lock (DataserverRequests)
{
foreach (DataserverRequest ds in new List(DataserverRequests.Values))
{
- if(ds.itemID == itemID)
+ if (ds.itemID == itemID)
DataserverRequests.Remove(ds.handle);
}
}
@@ -114,11 +114,11 @@ namespace OpenSim.Region.ScriptEngine.XEngine.AsyncCommandPlugins
public void ExpireRequests()
{
- lock(DataserverRequests)
+ lock (DataserverRequests)
{
foreach (DataserverRequest ds in new List(DataserverRequests.Values))
{
- if(ds.startTime > DateTime.Now.AddSeconds(30))
+ if (ds.startTime > DateTime.Now.AddSeconds(30))
DataserverRequests.Remove(ds.handle);
}
}
diff --git a/OpenSim/Region/ScriptEngine/XEngine/AsyncCommandPlugins/Eventstream.cs b/OpenSim/Region/ScriptEngine/XEngine/AsyncCommandPlugins/Eventstream.cs
index 9112b9c..dab7a0a 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/AsyncCommandPlugins/Eventstream.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/AsyncCommandPlugins/Eventstream.cs
@@ -55,14 +55,13 @@ namespace OpenSim.Region.ScriptEngine.XEngine.AsyncCommandPlugins
public void AddObjectEvent(uint localID, string eventName, XDetectParams det)
{
SceneObjectPart part = m_CmdManager.m_ScriptEngine.World.
- GetSceneObjectPart(localID);
+ GetSceneObjectPart(localID);
- if(part == null) // Can't register events for non-prims
+ if (part == null) // Can't register events for non-prims
return;
- if(!part.ContainsScripts())
+ if (!part.ContainsScripts())
return;
-
}
public void RemoveObjectEvent(uint localID, string eventName, LLUUID id)
diff --git a/OpenSim/Region/ScriptEngine/XEngine/AsyncCommandPlugins/HttpRequest.cs b/OpenSim/Region/ScriptEngine/XEngine/AsyncCommandPlugins/HttpRequest.cs
index 977e3f9..089e016 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/AsyncCommandPlugins/HttpRequest.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/AsyncCommandPlugins/HttpRequest.cs
@@ -77,7 +77,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine.AsyncCommandPlugins
foreach (XEngine xe in XEngine.ScriptEngines)
{
- if(xe.PostObjectEvent(httpInfo.localID,
+ if (xe.PostObjectEvent(httpInfo.localID,
new XEventParams("http_response",
resobj, new XDetectParams[0])))
break;
diff --git a/OpenSim/Region/ScriptEngine/XEngine/AsyncCommandPlugins/SensorRepeat.cs b/OpenSim/Region/ScriptEngine/XEngine/AsyncCommandPlugins/SensorRepeat.cs
index 5a87bb0..dbd6c33 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/AsyncCommandPlugins/SensorRepeat.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/AsyncCommandPlugins/SensorRepeat.cs
@@ -69,7 +69,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine.AsyncCommandPlugins
private object SenseRepeatListLock = new object();
public void SetSenseRepeatEvent(uint m_localID, LLUUID m_itemID,
- string name, LLUUID keyID, int type, double range, double arc, double sec, SceneObjectPart host)
+ string name, LLUUID keyID, int type, double range,
+ double arc, double sec, SceneObjectPart host)
{
Console.WriteLine("SetSensorEvent");
@@ -319,7 +320,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine.AsyncCommandPlugins
new XDetectParams[SensedObjects.Length];
int idx;
- for(idx = 0 ; idx < SensedObjects.Length; idx++)
+ for (idx = 0; idx < SensedObjects.Length; idx++)
{
detect[idx].Key=(LLUUID)(SensedObjects.Data[idx]);
}
@@ -339,7 +340,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine.AsyncCommandPlugins
foreach (SenseRepeatClass ts in SenseRepeaters)
{
- if(ts.itemID == itemID)
+ if (ts.itemID == itemID)
{
data.Add(ts.interval);
data.Add(ts.name);
@@ -353,18 +354,18 @@ namespace OpenSim.Region.ScriptEngine.XEngine.AsyncCommandPlugins
}
public void CreateFromData(uint localID, LLUUID itemID, LLUUID objectID,
- Object[] data)
+ Object[] data)
{
SceneObjectPart part =
- m_CmdManager.m_ScriptEngine.World.GetSceneObjectPart(
+ m_CmdManager.m_ScriptEngine.World.GetSceneObjectPart(
objectID);
- if(part == null)
+ if (part == null)
return;
- int idx=0;
+ int idx = 0;
- while(idx < data.Length)
+ while (idx < data.Length)
{
SenseRepeatClass ts = new SenseRepeatClass();
@@ -380,12 +381,11 @@ namespace OpenSim.Region.ScriptEngine.XEngine.AsyncCommandPlugins
ts.host = part;
ts.next =
- DateTime.Now.ToUniversalTime().AddSeconds(ts.interval);
+ DateTime.Now.ToUniversalTime().AddSeconds(ts.interval);
SenseRepeaters.Add(ts);
idx += 6;
}
}
-
}
}
diff --git a/OpenSim/Region/ScriptEngine/XEngine/AsyncCommandPlugins/Timer.cs b/OpenSim/Region/ScriptEngine/XEngine/AsyncCommandPlugins/Timer.cs
index 09a5818..99be290 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/AsyncCommandPlugins/Timer.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/AsyncCommandPlugins/Timer.cs
@@ -131,7 +131,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine.AsyncCommandPlugins
{
foreach (TimerClass ts in Timers)
{
- if(ts.itemID == itemID)
+ if (ts.itemID == itemID)
{
data.Add(ts.interval);
data.Add(ts.next-DateTime.Now.Ticks);
@@ -142,11 +142,11 @@ namespace OpenSim.Region.ScriptEngine.XEngine.AsyncCommandPlugins
}
public void CreateFromData(uint localID, LLUUID itemID, LLUUID objectID,
- Object[] data)
+ Object[] data)
{
- int idx=0;
+ int idx = 0;
- while(idx < data.Length)
+ while (idx < data.Length)
{
TimerClass ts = new TimerClass();
diff --git a/OpenSim/Region/ScriptEngine/XEngine/AsyncCommandPlugins/XmlRequest.cs b/OpenSim/Region/ScriptEngine/XEngine/AsyncCommandPlugins/XmlRequest.cs
index 2714d11..288349e 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/AsyncCommandPlugins/XmlRequest.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/AsyncCommandPlugins/XmlRequest.cs
@@ -71,10 +71,10 @@ namespace OpenSim.Region.ScriptEngine.XEngine.AsyncCommandPlugins
foreach (XEngine xe in XEngine.ScriptEngines)
{
- if(xe.PostScriptEvent(
+ if (xe.PostScriptEvent(
rInfo.GetItemID(), new XEventParams(
- "remote_data", resobj,
- new XDetectParams[0])))
+ "remote_data", resobj,
+ new XDetectParams[0])))
break;
}
@@ -100,10 +100,10 @@ namespace OpenSim.Region.ScriptEngine.XEngine.AsyncCommandPlugins
foreach (XEngine xe in XEngine.ScriptEngines)
{
- if(xe.PostScriptEvent(
+ if (xe.PostScriptEvent(
srdInfo.m_itemID, new XEventParams(
- "remote_data", resobj,
- new XDetectParams[0])))
+ "remote_data", resobj,
+ new XDetectParams[0])))
break;
}
diff --git a/OpenSim/Region/ScriptEngine/XEngine/Compiler.cs b/OpenSim/Region/ScriptEngine/XEngine/Compiler.cs
index 980d9e6..3ff7ce0 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/Compiler.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/Compiler.cs
@@ -253,10 +253,10 @@ namespace OpenSim.Region.ScriptEngine.XEngine
string OutFile = Path.Combine(ScriptEnginesPath, Path.Combine(
m_scriptEngine.World.RegionInfo.RegionID.ToString(),
FilePrefix + "_compiled_" + asset + ".dll"));
-// string OutFile = Path.Combine(ScriptEnginesPath,
+// string OutFile = Path.Combine(ScriptEnginesPath,
// FilePrefix + "_compiled_" + asset + ".dll");
- if(File.Exists(OutFile))
+ if (File.Exists(OutFile))
return OutFile;
if (!Directory.Exists(ScriptEnginesPath))
@@ -271,7 +271,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
}
if (!Directory.Exists(Path.Combine(ScriptEnginesPath,
- m_scriptEngine.World.RegionInfo.RegionID.ToString())))
+ m_scriptEngine.World.RegionInfo.RegionID.ToString())))
{
try
{
@@ -284,7 +284,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine
enumCompileType l = DefaultCompileLanguage;
-
if (Script.StartsWith("//c#", true, CultureInfo.InvariantCulture))
l = enumCompileType.cs;
if (Script.StartsWith("//vb", true, CultureInfo.InvariantCulture))
@@ -334,7 +333,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine
// End of insert
-
switch (l)
{
case enumCompileType.cs:
@@ -368,27 +366,25 @@ namespace OpenSim.Region.ScriptEngine.XEngine
private static string CreateCSCompilerScript(string compileScript)
{
-
-
compileScript = String.Empty +
- "using OpenSim.Region.ScriptEngine.XEngine.Script; using System.Collections.Generic;\r\n" +
- String.Empty + "namespace SecondLife { " +
- String.Empty + "public class Script : OpenSim.Region.ScriptEngine.XEngine.Script.BuiltIn_Commands_BaseClass { \r\n" +
- @"public Script() { } " +
- compileScript +
- "} }\r\n";
+ "using OpenSim.Region.ScriptEngine.XEngine.Script; using System.Collections.Generic;\r\n" +
+ String.Empty + "namespace SecondLife { " +
+ String.Empty + "public class Script : OpenSim.Region.ScriptEngine.XEngine.Script.BuiltIn_Commands_BaseClass { \r\n" +
+ @"public Script() { } " +
+ compileScript +
+ "} }\r\n";
return compileScript;
}
private static string CreateVBCompilerScript(string compileScript)
{
compileScript = String.Empty +
- "Imports OpenSim.Region.ScriptEngine.XEngine.Script: Imports System.Collections.Generic: " +
- String.Empty + "NameSpace SecondLife:" +
- String.Empty + "Public Class Script: Inherits OpenSim.Region.ScriptEngine.XEngine.Script.BuiltIn_Commands_BaseClass: " +
- "\r\nPublic Sub New()\r\nEnd Sub: " +
- compileScript +
- ":End Class :End Namespace\r\n";
+ "Imports OpenSim.Region.ScriptEngine.XEngine.Script: Imports System.Collections.Generic: " +
+ String.Empty + "NameSpace SecondLife:" +
+ String.Empty + "Public Class Script: Inherits OpenSim.Region.ScriptEngine.XEngine.Script.BuiltIn_Commands_BaseClass: " +
+ "\r\nPublic Sub New()\r\nEnd Sub: " +
+ compileScript +
+ ":End Class :End Namespace\r\n";
return compileScript;
}
@@ -404,8 +400,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine
// Output assembly name
scriptCompileCounter++;
string OutFile = Path.Combine(ScriptEnginesPath, Path.Combine(
- m_scriptEngine.World.RegionInfo.RegionID.ToString(),
- FilePrefix + "_compiled_" + asset + ".dll"));
+ m_scriptEngine.World.RegionInfo.RegionID.ToString(),
+ FilePrefix + "_compiled_" + asset + ".dll"));
#if DEBUG
// m_scriptEngine.Log.Debug("[" + m_scriptEngine.ScriptEngineName + "]: Starting compile of \"" + OutFile + "\".");
#endif
@@ -490,8 +486,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine
foreach (CompilerError CompErr in results.Errors)
{
errtext += "Line number " + (CompErr.Line - LinesToRemoveOnError) +
- ", Error Number: " + CompErr.ErrorNumber +
- ", '" + CompErr.ErrorText + "'\r\n";
+ ", Error Number: " + CompErr.ErrorNumber +
+ ", '" + CompErr.ErrorText + "'\r\n";
}
if (!File.Exists(OutFile))
{
@@ -499,7 +495,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine
}
}
-
//
// NO ERRORS, BUT NO COMPILED FILE
//
diff --git a/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs b/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs
index 734c837..e9ec4be 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs
@@ -199,7 +199,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
public void on_rez(uint localID, LLUUID itemID, int startParam)
{
myScriptEngine.PostObjectEvent(localID, new XEventParams(
- "on_rez",new object[] {
+ "on_rez",new object[] {
new LSL_Types.LSLInteger(startParam)},
new XDetectParams[0]));
}
@@ -207,7 +207,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
public void control(uint localID, LLUUID itemID, LLUUID agentID, uint held, uint change)
{
myScriptEngine.PostObjectEvent(localID, new XEventParams(
- "control",new object[] {
+ "control",new object[] {
new LSL_Types.LSLString(agentID.ToString()),
new LSL_Types.LSLInteger(held),
new LSL_Types.LSLInteger(change)},
@@ -218,7 +218,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
string address, string subject, string message, int numLeft)
{
myScriptEngine.PostObjectEvent(localID, new XEventParams(
- "email",new object[] {
+ "email",new object[] {
new LSL_Types.LSLString(timeSent),
new LSL_Types.LSLString(address),
new LSL_Types.LSLString(subject),
diff --git a/OpenSim/Region/ScriptEngine/XEngine/Executor.cs b/OpenSim/Region/ScriptEngine/XEngine/Executor.cs
index 40075ec..29336ac 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/Executor.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/Executor.cs
@@ -79,7 +79,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
}
// Save the flags we just computed and return the result
- if(eventFlags != 0)
+ if (eventFlags != 0)
m_stateEvents.Add(m_Script.State, eventFlags);
//Console.WriteLine("Returning {0:x}", eventFlags);
@@ -130,7 +130,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine
#endif
// Found
ev.Invoke(m_Script, args);
-
}
}
}
diff --git a/OpenSim/Region/ScriptEngine/XEngine/LSL_ScriptCommands.cs b/OpenSim/Region/ScriptEngine/XEngine/LSL_ScriptCommands.cs
index ca209b6..0f2d2a5 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/LSL_ScriptCommands.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/LSL_ScriptCommands.cs
@@ -111,8 +111,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine
{
m_host.AddScriptLPS(1);
- if(text.Length > 1023)
- text=text.Substring(0, 1023);
+ if (text.Length > 1023)
+ text = text.Substring(0, 1023);
World.SimChat(Helpers.StringToField(text),
ChatTypeEnum.Say, channelID, m_host.AbsolutePosition, m_host.Name, m_host.UUID, false);
@@ -129,13 +129,13 @@ namespace OpenSim.Region.ScriptEngine.XEngine
private LLUUID InventorySelf()
{
- LLUUID invItemID=new LLUUID();
+ LLUUID invItemID = new LLUUID();
foreach (KeyValuePair inv in m_host.TaskInventory)
{
if (inv.Value.Type == 10 && inv.Value.ItemID == m_itemID)
{
- invItemID=inv.Key;
+ invItemID = inv.Key;
break;
}
}
@@ -300,7 +300,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine
return angle;
}
-
// Old implementation of llRot2Euler, now normalized
public LSL_Types.Vector3 llRot2Euler(LSL_Types.Quaternion r)
@@ -322,7 +321,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine
return new LSL_Types.Vector3(0.0, -Math.PI / 2, NormalizeAngle(Math.Atan2((r.z * r.s + r.x * r.y), 0.5 - t.x - t.z)));
}
-
// Xantor's newer llEuler2Rot() *try the second* inverted quaternions (-x,-y,-z,w) as LL seems to like
// New and improved, now actually works as described. Prim rotates as expected as does llRot2Euler.
@@ -363,7 +361,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine
return new LSL_Types.Quaternion(x, y, z, s);
}
-
public LSL_Types.Quaternion llAxes2Rot(LSL_Types.Vector3 fwd, LSL_Types.Vector3 left, LSL_Types.Vector3 up)
{
m_host.AddScriptLPS(1);
@@ -388,6 +385,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
m_host.AddScriptLPS(1);
return (new LSL_Types.Vector3(0, 0, 1) * r);
}
+
public LSL_Types.Quaternion llRotBetween(LSL_Types.Vector3 a, LSL_Types.Vector3 b)
{
//A and B should both be normalized
@@ -401,12 +399,13 @@ namespace OpenSim.Region.ScriptEngine.XEngine
return new LSL_Types.Quaternion(axis.x * s, axis.y * s, axis.z * s, (float)Math.Cos(angle / 2));
}
+
public void llWhisper(int channelID, string text)
{
m_host.AddScriptLPS(1);
- if(text.Length > 1023)
- text=text.Substring(0, 1023);
+ if (text.Length > 1023)
+ text = text.Substring(0, 1023);
World.SimChat(Helpers.StringToField(text),
ChatTypeEnum.Whisper, channelID, m_host.AbsolutePosition, m_host.Name, m_host.UUID, false);
@@ -419,8 +418,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine
{
m_host.AddScriptLPS(1);
- if(text.Length > 1023)
- text=text.Substring(0, 1023);
+ if (text.Length > 1023)
+ text = text.Substring(0, 1023);
World.SimChat(Helpers.StringToField(text),
ChatTypeEnum.Shout, channelID, m_host.AbsolutePosition, m_host.Name, m_host.UUID, true);
@@ -437,9 +436,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine
return;
}
-
- if(text.Length > 1023)
- text=text.Substring(0, 1023);
+ if (text.Length > 1023)
+ text = text.Substring(0, 1023);
m_host.AddScriptLPS(1);
@@ -486,7 +484,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
LLUUID.TryParse(id, out keyID);
m_ScriptEngine.m_ASYNCLSLCommandManager.m_SensorRepeat.SetSenseRepeatEvent(m_localID, m_itemID, name, keyID, type, range, arc, rate, m_host);
- }
+ }
public void llSensorRemove()
{
@@ -520,17 +518,16 @@ namespace OpenSim.Region.ScriptEngine.XEngine
if (SensedObject == null)
return String.Empty;
return SensedObject.Name;
-
}
public string llDetectedName(int number)
{
m_host.AddScriptLPS(1);
LLUUID sensedUUID = m_ScriptEngine.GetDetectID(m_itemID, number);
- if(sensedUUID != null)
+ if (sensedUUID != null)
return resolveName(sensedUUID);
return String.Empty;
- }
+ }
public LLUUID uuidDetectedKey(int number)
{
@@ -540,7 +537,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
public EntityBase entityDetectedKey(int number)
{
LLUUID sensedUUID = m_ScriptEngine.GetDetectID(m_itemID, number);
- if(sensedUUID != null)
+ if (sensedUUID != null)
{
EntityBase SensedObject = null;
lock (World.Entities)
@@ -567,7 +564,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
// returns UUID of owner of object detected
m_host.AddScriptLPS(1);
EntityBase SensedObject = entityDetectedKey(number);
- if (SensedObject ==null)
+ if (SensedObject == null)
return String.Empty;
LLUUID SensedUUID = uuidDetectedKey(number);
if (World.GetScenePresence(SensedUUID) == null)
@@ -575,7 +572,10 @@ namespace OpenSim.Region.ScriptEngine.XEngine
// sensed object is not an avatar
// so get the owner of the sensed object
SceneObjectPart SOP = World.GetSceneObjectPart(SensedUUID);
- if (SOP != null) { return SOP.ObjectOwner.ToString(); }
+ if (SOP != null)
+ {
+ return SOP.ObjectOwner.ToString();
+ }
}
else
{
@@ -583,9 +583,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
return SensedUUID.ToString();
}
-
return String.Empty;
-
}
public LSL_Types.LSLInteger llDetectedType(int number)
@@ -599,14 +597,18 @@ namespace OpenSim.Region.ScriptEngine.XEngine
LLUUID SensedUUID = uuidDetectedKey(number);
LSL_Types.Vector3 ZeroVector = new LSL_Types.Vector3(0, 0, 0);
- if (World.GetScenePresence(SensedUUID) != null) mask |= 0x01; // actor
+ if (World.GetScenePresence(SensedUUID) != null)
+ mask |= 0x01; // actor
+
if (SensedObject.Velocity.Equals(ZeroVector))
mask |= 0x04; // passive non-moving
else
mask |= 0x02; // active moving
- if (SensedObject is IScript) mask |= 0x08; // Scripted. It COULD have one hidden ...
- return mask;
+ if (SensedObject is IScript)
+ mask |= 0x08; // Scripted. It COULD have one hidden ...
+
+ return mask;
}
public LSL_Types.Vector3 llDetectedPos(int number)
@@ -627,7 +629,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
return new LSL_Types.Vector3(0, 0, 0);
return new LSL_Types.Vector3(SensedObject.Velocity.X, SensedObject.Velocity.Y, SensedObject.Velocity.Z);
- // return new LSL_Types.Vector3();
+ // return new LSL_Types.Vector3();
}
public LSL_Types.Vector3 llDetectedGrab(int number)
@@ -702,8 +704,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine
m_host.ScriptSetPhysicsStatus(true);
else
m_host.ScriptSetPhysicsStatus(false);
-
}
+
if ((status & BuiltIn_Commands_BaseClass.STATUS_PHANTOM) == BuiltIn_Commands_BaseClass.STATUS_PHANTOM)
{
if (value == 1)
@@ -711,27 +713,32 @@ namespace OpenSim.Region.ScriptEngine.XEngine
else
m_host.ScriptSetPhantomStatus(false);
}
+
if ((status & BuiltIn_Commands_BaseClass.STATUS_CAST_SHADOWS) == BuiltIn_Commands_BaseClass.STATUS_CAST_SHADOWS)
{
m_host.AddFlag(LLObject.ObjectFlags.CastShadows);
}
+
if ((status & BuiltIn_Commands_BaseClass.STATUS_ROTATE_X) == BuiltIn_Commands_BaseClass.STATUS_ROTATE_X)
{
statusrotationaxis |= BuiltIn_Commands_BaseClass.STATUS_ROTATE_X;
-
}
+
if ((status & BuiltIn_Commands_BaseClass.STATUS_ROTATE_Y) == BuiltIn_Commands_BaseClass.STATUS_ROTATE_Y)
{
statusrotationaxis |= BuiltIn_Commands_BaseClass.STATUS_ROTATE_Y;
}
+
if ((status & BuiltIn_Commands_BaseClass.STATUS_ROTATE_Z) == BuiltIn_Commands_BaseClass.STATUS_ROTATE_Z)
{
statusrotationaxis |= BuiltIn_Commands_BaseClass.STATUS_ROTATE_Z;
}
+
if ((status & BuiltIn_Commands_BaseClass.STATUS_BLOCK_GRAB) == BuiltIn_Commands_BaseClass.STATUS_BLOCK_GRAB)
{
NotImplemented("llSetStatus - STATUS_BLOCK_GRAB");
}
+
if ((status & BuiltIn_Commands_BaseClass.STATUS_DIE_AT_EDGE) == BuiltIn_Commands_BaseClass.STATUS_DIE_AT_EDGE)
{
if (value == 1)
@@ -739,18 +746,20 @@ namespace OpenSim.Region.ScriptEngine.XEngine
else
m_host.SetDieAtEdge(false);
}
+
if ((status & BuiltIn_Commands_BaseClass.STATUS_RETURN_AT_EDGE) == BuiltIn_Commands_BaseClass.STATUS_RETURN_AT_EDGE)
{
NotImplemented("llSetStatus - STATUS_RETURN_AT_EDGE");
}
+
if ((status & BuiltIn_Commands_BaseClass.STATUS_SANDBOX) == BuiltIn_Commands_BaseClass.STATUS_SANDBOX)
{
NotImplemented("llSetStatus - STATUS_SANDBOX");
}
+
if (statusrotationaxis != 0)
{
m_host.SetAxisRotation(statusrotationaxis, value);
-
}
}
@@ -766,23 +775,26 @@ namespace OpenSim.Region.ScriptEngine.XEngine
return 1;
}
return 0;
+
case BuiltIn_Commands_BaseClass.STATUS_PHANTOM:
if ((m_host.GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.Phantom) == (uint)LLObject.ObjectFlags.Phantom)
{
return 1;
}
return 0;
+
case BuiltIn_Commands_BaseClass.STATUS_CAST_SHADOWS:
if ((m_host.GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.CastShadows) == (uint)LLObject.ObjectFlags.CastShadows)
{
return 1;
}
return 0;
+
case BuiltIn_Commands_BaseClass.STATUS_BLOCK_GRAB:
NotImplemented("llGetStatus - STATUS_BLOCK_GRAB");
return 0;
- case BuiltIn_Commands_BaseClass.STATUS_DIE_AT_EDGE:
+ case BuiltIn_Commands_BaseClass.STATUS_DIE_AT_EDGE:
if (m_host.GetDieAtEdge())
return 1;
else
@@ -791,15 +803,19 @@ namespace OpenSim.Region.ScriptEngine.XEngine
case BuiltIn_Commands_BaseClass.STATUS_RETURN_AT_EDGE:
NotImplemented("llGetStatus - STATUS_RETURN_AT_EDGE");
return 0;
+
case BuiltIn_Commands_BaseClass.STATUS_ROTATE_X:
NotImplemented("llGetStatus - STATUS_ROTATE_X");
return 0;
+
case BuiltIn_Commands_BaseClass.STATUS_ROTATE_Y:
NotImplemented("llGetStatus - STATUS_ROTATE_Y");
return 0;
+
case BuiltIn_Commands_BaseClass.STATUS_ROTATE_Z:
NotImplemented("llGetStatus - STATUS_ROTATE_Z");
return 0;
+
case BuiltIn_Commands_BaseClass.STATUS_SANDBOX:
NotImplemented("llGetStatus - STATUS_SANDBOX");
return 0;
@@ -2499,17 +2515,17 @@ namespace OpenSim.Region.ScriptEngine.XEngine
string reply = String.Empty;
- switch(data)
+ switch (data)
{
case 1: // DATA_ONLINE (0|1)
// TODO: implement fetching of this information
-// if(userProfile.CurrentAgent.AgentOnline)
+// if (userProfile.CurrentAgent.AgentOnline)
// reply = "1";
// else
reply = "0";
break;
case 2: // DATA_NAME (First Last)
- reply = userProfile.FirstName+" "+userProfile.SurName;
+ reply = userProfile.FirstName + " " + userProfile.SurName;
break;
case 3: // DATA_BORN (YYYY-MM-DD)
DateTime born = new DateTime(1970, 1, 1, 0, 0, 0, 0);
@@ -2529,8 +2545,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine
LLUUID rq = LLUUID.Random();
LLUUID tid = m_ScriptEngine.m_ASYNCLSLCommandManager.
- m_Dataserver.RegisterRequest(m_localID,
- m_itemID, rq.ToString());
+ m_Dataserver.RegisterRequest(m_localID,
+ m_itemID, rq.ToString());
m_ScriptEngine.m_ASYNCLSLCommandManager.
m_Dataserver.DataserverReply(rq.ToString(), reply);
@@ -2547,8 +2563,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine
if (item.Type == 3 && item.Name == name)
{
LLUUID tid = m_ScriptEngine.m_ASYNCLSLCommandManager.
- m_Dataserver.RegisterRequest(m_localID,
- m_itemID, item.AssetID.ToString());
+ m_Dataserver.RegisterRequest(m_localID,
+ m_itemID, item.AssetID.ToString());
LLVector3 region = new LLVector3(
World.RegionInfo.RegionLocX * Constants.RegionSize,
@@ -2565,8 +2581,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine
string reply = region.ToString();
m_ScriptEngine.m_ASYNCLSLCommandManager.
- m_Dataserver.DataserverReply(i.ToString(),
- reply);
+ m_Dataserver.DataserverReply(i.ToString(),
+ reply);
}, false);
return tid.ToString();
@@ -3314,25 +3330,28 @@ namespace OpenSim.Region.ScriptEngine.XEngine
{
switch (src[i])
{
- case '<' :
+ case '<':
parens++;
length++;
break;
- case '>' :
+ case '>':
if (parens > 0)
parens--;
length++;
break;
- case ',' :
+ case ',':
if (parens == 0)
{
result.Add(src.Substring(start,length).Trim());
start += length+1;
length = 0;
- } else
+ }
+ else
+ {
length++;
+ }
break;
- default :
+ default:
length++;
break;
}
@@ -3341,7 +3360,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine
result.Add(src.Substring(start,length).Trim());
return result;
-
}
///
@@ -5290,11 +5308,12 @@ namespace OpenSim.Region.ScriptEngine.XEngine
if (active[j])
{
// scan all of the markers
- if ((offset[j] = src.IndexOf((string)spcarray[j-seplen],beginning)) == -1)
+ if ((offset[j] = src.IndexOf((string)spcarray[j-seplen], beginning)) == -1)
{
// not present at all
active[j] = false;
- } else
+ }
+ else
{
// present and correct
if (offset[j] < offset[best])
@@ -5313,7 +5332,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
{
// no markers were found on this pass
// so we're pretty much done
- tokens.Add(src.Substring(beginning, srclen-beginning));
+ tokens.Add(src.Substring(beginning, srclen - beginning));
break;
}
@@ -5322,15 +5341,15 @@ namespace OpenSim.Region.ScriptEngine.XEngine
tokens.Add(src.Substring(beginning,offset[best]-beginning));
- if (best output = new List();
string[] words;
- while(idx < input.Length)
+ while (idx < input.Length)
{
- if(input[idx] == "{")
+ if (input[idx] == "{")
{
level++;
idx++;
continue;
}
- if(input[idx]== "}")
+
+ if (input[idx]== "}")
{
level--;
idx++;
continue;
}
- switch(level)
+ switch (level)
{
case 0:
words = input[idx].Split(' '); // Linden text ver
int version = int.Parse(words[3]);
- if(version != 2)
+ if (version != 2)
return new String[0];
break;
case 1:
words = input[idx].Split(' ');
- if(words[0] == "LLEmbeddedItems")
+ if (words[0] == "LLEmbeddedItems")
break;
- if(words[0] == "Text")
+ if (words[0] == "Text")
{
int len = int.Parse(words[2]);
idx++;
- int count=-1;
+ int count = -1;
- while(count < len)
+ while (count < len)
{
int l = input[idx].Length;
string ln = input[idx];
int need = len-count-1;
- if(ln.Length > need)
- ln=ln.Substring(0, need);
+ if (ln.Length > need)
+ ln = ln.Substring(0, need);
output.Add(ln);
- count+=ln.Length+1;
+ count += ln.Length + 1;
idx++;
}
@@ -6401,10 +6420,10 @@ return LLUUID.Zero.ToString();
break;
case 2:
words = input[idx].Split(' '); // count
- if(words[0] == "count")
+ if (words[0] == "count")
{
int c = int.Parse(words[1]);
- if(c > 0)
+ if (c > 0)
return new String[0];
break;
}
@@ -6417,7 +6436,7 @@ return LLUUID.Zero.ToString();
public static bool IsCached(LLUUID assetID)
{
- lock(m_Notecards)
+ lock (m_Notecards)
{
return m_Notecards.ContainsKey(assetID);
}
@@ -6425,10 +6444,10 @@ return LLUUID.Zero.ToString();
public static int GetLines(LLUUID assetID)
{
- if(!IsCached(assetID))
+ if (!IsCached(assetID))
return -1;
- lock(m_Notecards)
+ lock (m_Notecards)
{
m_Notecards[assetID].lastRef = DateTime.Now;
return m_Notecards[assetID].text.Length;
@@ -6437,23 +6456,23 @@ return LLUUID.Zero.ToString();
public static string GetLine(LLUUID assetID, int line)
{
- if(line < 0)
+ if (line < 0)
return "";
string data;
- if(!IsCached(assetID))
+ if (!IsCached(assetID))
return "";
- lock(m_Notecards)
+ lock (m_Notecards)
{
m_Notecards[assetID].lastRef = DateTime.Now;
- if(line >= m_Notecards[assetID].text.Length)
+ if (line >= m_Notecards[assetID].text.Length)
return "\n\n\n";
- data=m_Notecards[assetID].text[line];
- if(data.Length > 255)
+ data = m_Notecards[assetID].text[line];
+ if (data.Length > 255)
data = data.Substring(0, 255);
return data;
@@ -6465,10 +6484,9 @@ return LLUUID.Zero.ToString();
foreach (LLUUID key in new List(m_Notecards.Keys))
{
Notecard nc = m_Notecards[key];
- if(nc.lastRef.AddSeconds(30) < DateTime.Now)
+ if (nc.lastRef.AddSeconds(30) < DateTime.Now)
m_Notecards.Remove(key);
}
}
-
}
}
diff --git a/OpenSim/Region/ScriptEngine/XEngine/Script/AssemblyResolver.cs b/OpenSim/Region/ScriptEngine/XEngine/Script/AssemblyResolver.cs
index 8107788..cf15b67 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/Script/AssemblyResolver.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/Script/AssemblyResolver.cs
@@ -37,25 +37,25 @@ namespace OpenSim.Region.ScriptEngine.XEngine.Script
public static Assembly OnAssemblyResolve(object sender,
ResolveEventArgs args)
{
- if(!(sender is System.AppDomain))
+ if (!(sender is System.AppDomain))
return null;
AppDomain myDomain = (AppDomain)sender;
string dirName = myDomain.FriendlyName;
- string[] pathList=new string[] {"bin", "ScriptEngines",
- Path.Combine("ScriptEngines", dirName)};
+ string[] pathList = new string[] {"bin", "ScriptEngines",
+ Path.Combine("ScriptEngines", dirName)};
string assemblyName = args.Name;
- if(assemblyName.IndexOf(",") != -1)
- assemblyName=args.Name.Substring(0, args.Name.IndexOf(","));
+ if (assemblyName.IndexOf(",") != -1)
+ assemblyName = args.Name.Substring(0, args.Name.IndexOf(","));
foreach (string s in pathList)
{
- string path=Path.Combine(Directory.GetCurrentDirectory(),
+ string path = Path.Combine(Directory.GetCurrentDirectory(),
Path.Combine(s, assemblyName))+".dll";
- if(File.Exists(path))
+ if (File.Exists(path))
return Assembly.LoadFrom(path);
}
diff --git a/OpenSim/Region/ScriptEngine/XEngine/Script/BuiltIn_Commands_BaseClass.cs b/OpenSim/Region/ScriptEngine/XEngine/Script/BuiltIn_Commands_BaseClass.cs
index bae8192..ebe4fc5 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/Script/BuiltIn_Commands_BaseClass.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/Script/BuiltIn_Commands_BaseClass.cs
@@ -106,7 +106,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine.Script
{
foreach (KeyValuePair var in vars)
{
- if(m_Fields.ContainsKey(var.Key))
+ if (m_Fields.ContainsKey(var.Key))
{
m_Fields[var.Key].SetValue(this, var.Value);
}
diff --git a/OpenSim/Region/ScriptEngine/XEngine/Script/LSL_Types.cs b/OpenSim/Region/ScriptEngine/XEngine/Script/LSL_Types.cs
index 2d5d2b8..a3dcfaf 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/Script/LSL_Types.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/Script/LSL_Types.cs
@@ -1212,8 +1212,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine.Script
public LSLInteger(Object o)
{
- if(!(o is Int32))
- value=0;
+ if (!(o is Int32))
+ value = 0;
else
value = (int)o;
}
@@ -1327,11 +1327,11 @@ namespace OpenSim.Region.ScriptEngine.XEngine.Script
public override bool Equals(object o)
{
- if(o is Int32)
+ if (o is Int32)
{
return value == (Int32)o;
}
- if(o is LSLInteger)
+ if (o is LSLInteger)
{
return value == ((LSLInteger)o).value;
}
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
index cbcf5ea..0fe1f46 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
@@ -106,7 +106,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
m_ScriptConfig = configSource.Configs["XEngine"];
- if(m_ScriptConfig == null)
+ if (m_ScriptConfig == null)
{
m_log.ErrorFormat("[XEngine] No script configuration found. Scripts disabled");
return;
@@ -126,7 +126,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
int saveTime = m_ScriptConfig.GetInt("SaveInterval", 300)*1000;
ThreadPriority prio = ThreadPriority.BelowNormal;
- switch(priority)
+ switch (priority)
{
case "Lowest":
prio=ThreadPriority.Lowest;
@@ -149,7 +149,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
break;
}
- lock(m_ScriptEngines)
+ lock (m_ScriptEngines)
{
m_ScriptEngines.Add(this);
}
@@ -166,17 +166,17 @@ namespace OpenSim.Region.ScriptEngine.XEngine
m_Scene.EventManager.OnRemoveScript += OnRemoveScript;
m_Scene.EventManager.OnScriptReset += OnScriptReset;
- if(sleepTime > 0)
+ if (sleepTime > 0)
{
m_ThreadPool.QueueWorkItem(new WorkItemCallback(
- this.DoMaintenance), new Object[]
- { sleepTime });
+ this.DoMaintenance), new Object[]
+ { sleepTime });
}
- if(saveTime > 0)
+ if (saveTime > 0)
{
m_ThreadPool.QueueWorkItem(new WorkItemCallback(
- this.DoBackup), new Object[] { saveTime });
+ this.DoBackup), new Object[] { saveTime });
}
}
@@ -187,9 +187,9 @@ namespace OpenSim.Region.ScriptEngine.XEngine
public void Close()
{
- lock(m_ScriptEngines)
+ lock (m_ScriptEngines)
{
- if(m_ScriptEngines.Contains(this))
+ if (m_ScriptEngines.Contains(this))
m_ScriptEngines.Remove(this);
}
}
@@ -205,7 +205,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
List instances = new List();
- lock(m_Scripts)
+ lock (m_Scripts)
{
foreach (XScriptInstance instance in m_Scripts.Values)
instances.Add(instance);
@@ -215,9 +215,9 @@ namespace OpenSim.Region.ScriptEngine.XEngine
{
string assembly = String.Empty;
- lock(m_Scripts)
+ lock (m_Scripts)
{
- if(!m_Assemblies.ContainsKey(i.AssetID))
+ if (!m_Assemblies.ContainsKey(i.AssetID))
continue;
assembly = m_Assemblies[i.AssetID];
}
@@ -240,10 +240,10 @@ namespace OpenSim.Region.ScriptEngine.XEngine
foreach (XScriptInstance inst in m_Scripts.Values)
{
- if(inst.EventTime() > m_EventLimit)
+ if (inst.EventTime() > m_EventLimit)
{
inst.Stop(100);
- if(!m_KillTimedOutScripts)
+ if (!m_KillTimedOutScripts)
inst.Start();
}
}
@@ -251,7 +251,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
System.Threading.Thread.Sleep(sleepTime);
m_ThreadPool.QueueWorkItem(new WorkItemCallback(
- this.DoMaintenance), new Object[]
+ this.DoMaintenance), new Object[]
{ sleepTime });
return 0;
@@ -281,7 +281,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
public void OnRezScript(uint localID, LLUUID itemID, string script)
{
m_ThreadPool.QueueWorkItem(new WorkItemCallback(
- this.DoOnRezScript), new Object[]
+ this.DoOnRezScript), new Object[]
{ localID, itemID, script});
}
@@ -296,25 +296,25 @@ namespace OpenSim.Region.ScriptEngine.XEngine
// already have it.
SceneObjectPart part = m_Scene.GetSceneObjectPart(localID);
- if(part == null)
+ if (part == null)
return false;
TaskInventoryItem item = part.GetInventoryItem(itemID);
- if(item == null)
+ if (item == null)
return false;
-
- LLUUID assetID=item.AssetID;
+
+ LLUUID assetID = item.AssetID;
// m_log.DebugFormat("[XEngine] Compiling script {0} ({1})",
// item.Name, itemID.ToString());
- string assembly="";
+ string assembly = "";
try
{
- assembly=m_Compiler.PerformScriptCompile(script,
- assetID.ToString());
+ assembly = m_Compiler.PerformScriptCompile(script,
+ assetID.ToString());
m_log.DebugFormat("[XEngine] Loaded script {0}.{1}",
- part.ParentGroup.RootPart.Name, item.Name);
+ part.ParentGroup.RootPart.Name, item.Name);
}
catch (Exception e)
{
@@ -325,9 +325,9 @@ namespace OpenSim.Region.ScriptEngine.XEngine
if (text.Length > 1400)
text = text.Substring(0, 1400);
World.SimChat(Helpers.StringToField(text),
- ChatTypeEnum.DebugChannel, 2147483647,
- part.AbsolutePosition,
- part.Name, part.UUID, false);
+ ChatTypeEnum.DebugChannel, 2147483647,
+ part.AbsolutePosition,
+ part.Name, part.UUID, false);
}
catch (Exception e2) // LEGIT: User Scripting
{
@@ -342,28 +342,28 @@ namespace OpenSim.Region.ScriptEngine.XEngine
return false;
}
- lock(m_Scripts)
+ lock (m_Scripts)
{
// Create the object record
-
- if(!m_PrimObjects.ContainsKey(localID))
+
+ if (!m_PrimObjects.ContainsKey(localID))
m_PrimObjects[localID] = new List();
- if(!m_PrimObjects[localID].Contains(itemID))
+ if (!m_PrimObjects[localID].Contains(itemID))
m_PrimObjects[localID].Add(itemID);
- if(!m_Assemblies.ContainsKey(assetID))
+ if (!m_Assemblies.ContainsKey(assetID))
m_Assemblies[assetID] = assembly;
- if((!m_Scripts.ContainsKey(itemID)) ||
- (m_Scripts[itemID].AssetID != assetID))
+ if ((!m_Scripts.ContainsKey(itemID)) ||
+ (m_Scripts[itemID].AssetID != assetID))
{
LLUUID appDomain=assetID;
- if(part.ParentGroup.RootPart.m_IsAttachment)
- appDomain=part.ParentGroup.RootPart.UUID;
-
- if(!m_AppDomains.ContainsKey(appDomain))
+ if (part.ParentGroup.RootPart.m_IsAttachment)
+ appDomain = part.ParentGroup.RootPart.UUID;
+
+ if (!m_AppDomains.ContainsKey(appDomain))
{
try
{
@@ -373,16 +373,16 @@ namespace OpenSim.Region.ScriptEngine.XEngine
// m_Scene.RegionInfo.RegionID.ToString());
Evidence baseEvidence =
- AppDomain.CurrentDomain.Evidence;
+ AppDomain.CurrentDomain.Evidence;
Evidence evidence = new Evidence(baseEvidence);
m_AppDomains[appDomain] =
AppDomain.CreateDomain(
- m_Scene.RegionInfo.RegionID.ToString(),
- evidence, appSetup);
+ m_Scene.RegionInfo.RegionID.ToString(),
+ evidence, appSetup);
m_AppDomains[appDomain].AssemblyResolve +=
- new ResolveEventHandler(
+ new ResolveEventHandler(
AssemblyResolver.OnAssemblyResolve);
m_DomainScripts[appDomain] = new List();
}
@@ -394,10 +394,9 @@ namespace OpenSim.Region.ScriptEngine.XEngine
}
m_DomainScripts[appDomain].Add(itemID);
-
XScriptInstance instance = new XScriptInstance(this,localID,
- part.UUID, itemID, assetID, assembly,
- m_AppDomains[appDomain]);
+ part.UUID, itemID, assetID, assembly,
+ m_AppDomains[appDomain]);
instance.AppDomain = appDomain;
@@ -409,10 +408,10 @@ namespace OpenSim.Region.ScriptEngine.XEngine
public void OnRemoveScript(uint localID, LLUUID itemID)
{
- lock(m_Scripts)
+ lock (m_Scripts)
{
// Do we even have it?
- if(!m_Scripts.ContainsKey(itemID))
+ if (!m_Scripts.ContainsKey(itemID))
return;
m_ASYNCLSLCommandManager.RemoveScript(localID, itemID);
@@ -424,27 +423,27 @@ namespace OpenSim.Region.ScriptEngine.XEngine
instance.Stop(0);
SceneObjectPart part =
- m_Scene.GetSceneObjectPart(localID);
+ m_Scene.GetSceneObjectPart(localID);
- if(part != null)
+ if (part != null)
part.RemoveScriptEvents(itemID);
// Remove the script from it's prim
- if(m_PrimObjects.ContainsKey(localID))
+ if (m_PrimObjects.ContainsKey(localID))
{
// Remove inventory item record
- if(m_PrimObjects[localID].Contains(itemID))
+ if (m_PrimObjects[localID].Contains(itemID))
m_PrimObjects[localID].Remove(itemID);
// If there are no more scripts, remove prim
- if(m_PrimObjects[localID].Count == 0)
+ if (m_PrimObjects[localID].Count == 0)
{
m_PrimObjects.Remove(localID);
}
}
m_DomainScripts[instance.AppDomain].Remove(instance.ItemID);
- if(m_DomainScripts[instance.AppDomain].Count == 0)
+ if (m_DomainScripts[instance.AppDomain].Count == 0)
{
m_DomainScripts.Remove(instance.AppDomain);
UnloadAppDomain(instance.AppDomain);
@@ -467,7 +466,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
foreach (XScriptInstance i in m_Scripts.Values)
{
- if(assetIDList.Contains(i.AssetID))
+ if (assetIDList.Contains(i.AssetID))
assetIDList.Remove(i.AssetID);
}
@@ -476,11 +475,13 @@ namespace OpenSim.Region.ScriptEngine.XEngine
// m_log.DebugFormat("[XEngine] Removing unreferenced assembly {0}", m_Assemblies[assetID]);
try
{
- if(File.Exists(m_Assemblies[assetID]))
+ if (File.Exists(m_Assemblies[assetID]))
File.Delete(m_Assemblies[assetID]);
- if(File.Exists(m_Assemblies[assetID]+".state"))
+
+ if (File.Exists(m_Assemblies[assetID]+".state"))
File.Delete(m_Assemblies[assetID]+".state");
- if(File.Exists(m_Assemblies[assetID]+".mdb"))
+
+ if (File.Exists(m_Assemblies[assetID]+".mdb"))
File.Delete(m_Assemblies[assetID]+".mdb");
}
catch (Exception e)
@@ -492,9 +493,9 @@ namespace OpenSim.Region.ScriptEngine.XEngine
private void UnloadAppDomain(LLUUID id)
{
- if(m_AppDomains.ContainsKey(id))
+ if (m_AppDomains.ContainsKey(id))
{
- AppDomain domain=m_AppDomains[id];
+ AppDomain domain = m_AppDomains[id];
m_AppDomains.Remove(id);
AppDomain.Unload(domain);
@@ -507,10 +508,10 @@ namespace OpenSim.Region.ScriptEngine.XEngine
// Start processing
//
private void StartEngine(int minThreads, int maxThreads,
- int idleTimeout, ThreadPriority threadPriority,
- int maxScriptQueue, int stackSize)
+ int idleTimeout, ThreadPriority threadPriority,
+ int maxScriptQueue, int stackSize)
{
- m_MaxScriptQueue=maxScriptQueue;
+ m_MaxScriptQueue = maxScriptQueue;
STPStartInfo startInfo = new STPStartInfo();
startInfo.IdleTimeout = idleTimeout;
@@ -519,7 +520,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
startInfo.ThreadPriority = threadPriority;
startInfo.StackSize = stackSize;
startInfo.StartSuspended = true;
-
+
m_ThreadPool = new SmartThreadPool(startInfo);
}
@@ -529,7 +530,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
public IWorkItemResult QueueEventHandler(object parms)
{
return m_ThreadPool.QueueWorkItem(new WorkItemCallback(
- this.ProcessEventHandler), parms);
+ this.ProcessEventHandler), parms);
}
//
@@ -537,8 +538,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine
//
private object ProcessEventHandler(object parms)
{
- XScriptInstance instance=(XScriptInstance)parms;
-
+ XScriptInstance instance = (XScriptInstance) parms;
+
return instance.EventProcessor();
}
@@ -549,15 +550,15 @@ namespace OpenSim.Region.ScriptEngine.XEngine
{
bool result = false;
- if(!m_PrimObjects.ContainsKey(localID))
+ if (!m_PrimObjects.ContainsKey(localID))
return false;
foreach (LLUUID itemID in m_PrimObjects[localID])
{
- if(m_Scripts.ContainsKey(itemID))
+ if (m_Scripts.ContainsKey(itemID))
{
XScriptInstance instance = m_Scripts[itemID];
- if(instance != null)
+ if (instance != null)
{
instance.PostEvent(p);
result = true;
@@ -572,10 +573,10 @@ namespace OpenSim.Region.ScriptEngine.XEngine
//
public bool PostScriptEvent(LLUUID itemID, XEventParams p)
{
- if(m_Scripts.ContainsKey(itemID))
+ if (m_Scripts.ContainsKey(itemID))
{
XScriptInstance instance = m_Scripts[itemID];
- if(instance != null)
+ if (instance != null)
instance.PostEvent(p);
return true;
}
@@ -583,25 +584,25 @@ namespace OpenSim.Region.ScriptEngine.XEngine
}
public Assembly OnAssemblyResolve(object sender,
- ResolveEventArgs args)
+ ResolveEventArgs args)
{
- if(!(sender is System.AppDomain))
+ if (!(sender is System.AppDomain))
return null;
- string[] pathList=new string[] {"bin", "ScriptEngines",
- Path.Combine("ScriptEngines",
- m_Scene.RegionInfo.RegionID.ToString())};
+ string[] pathList = new string[] {"bin", "ScriptEngines",
+ Path.Combine("ScriptEngines",
+ m_Scene.RegionInfo.RegionID.ToString())};
string assemblyName = args.Name;
- if(assemblyName.IndexOf(",") != -1)
- assemblyName=args.Name.Substring(0, args.Name.IndexOf(","));
+ if (assemblyName.IndexOf(",") != -1)
+ assemblyName = args.Name.Substring(0, args.Name.IndexOf(","));
foreach (string s in pathList)
{
- string path=Path.Combine(Directory.GetCurrentDirectory(),
- Path.Combine(s, assemblyName))+".dll";
+ string path = Path.Combine(Directory.GetCurrentDirectory(),
+ Path.Combine(s, assemblyName))+".dll";
- if(File.Exists(path))
+ if (File.Exists(path))
return Assembly.LoadFrom(path);
}
@@ -611,9 +612,9 @@ namespace OpenSim.Region.ScriptEngine.XEngine
private XScriptInstance GetInstance(LLUUID itemID)
{
XScriptInstance instance;
- lock(m_Scripts)
+ lock (m_Scripts)
{
- if(!m_Scripts.ContainsKey(itemID))
+ if (!m_Scripts.ContainsKey(itemID))
return null;
instance = m_Scripts[itemID];
}
@@ -623,9 +624,9 @@ namespace OpenSim.Region.ScriptEngine.XEngine
public void SetScriptState(LLUUID itemID, bool running)
{
XScriptInstance instance = GetInstance(itemID);
- if(instance != null)
+ if (instance != null)
{
- if(running)
+ if (running)
instance.Start();
else
instance.Stop(500);
@@ -635,7 +636,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
public bool GetScriptState(LLUUID itemID)
{
XScriptInstance instance = GetInstance(itemID);
- if(instance != null)
+ if (instance != null)
return instance.Running;
return false;
}
@@ -643,14 +644,14 @@ namespace OpenSim.Region.ScriptEngine.XEngine
public void ResetScript(LLUUID itemID)
{
XScriptInstance instance = GetInstance(itemID);
- if(instance != null)
+ if (instance != null)
instance.ResetScript();
}
public XDetectParams GetDetectParams(LLUUID itemID, int idx)
{
XScriptInstance instance = GetInstance(itemID);
- if(instance != null)
+ if (instance != null)
return instance.GetDetectParams(idx);
return new XDetectParams();
}
@@ -658,7 +659,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
public LLUUID GetDetectID(LLUUID itemID, int idx)
{
XScriptInstance instance = GetInstance(itemID);
- if(instance != null)
+ if (instance != null)
return instance.GetDetectID(idx);
return LLUUID.Zero;
}
@@ -688,8 +689,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine
{
private XEngine m_Engine;
private IWorkItemResult m_CurrentResult=null;
- private Queue m_EventQueue=new Queue(32);
- private bool m_RunEvents=false;
+ private Queue m_EventQueue = new Queue(32);
+ private bool m_RunEvents = false;
private LLUUID m_ItemID;
private uint m_LocalID;
private LLUUID m_ObjectID;
@@ -765,7 +766,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
public XScriptInstance(XEngine engine, uint localID, LLUUID objectID,
LLUUID itemID, LLUUID assetID, string assembly, AppDomain dom)
{
- m_Engine=engine;
+ m_Engine = engine;
m_LocalID = localID;
m_ObjectID = objectID;
@@ -773,22 +774,22 @@ namespace OpenSim.Region.ScriptEngine.XEngine
m_AssetID = assetID;
SceneObjectPart part=engine.World.GetSceneObjectPart(localID);
- if(part == null)
+ if (part == null)
{
engine.Log.Error("[XEngine] SceneObjectPart unavailable. Script NOT started.");
return;
}
m_LSLCommands = new LSL_ScriptCommands(engine, this, part, localID,
- itemID);
+ itemID);
m_OSSLCommands = new OSSL_ScriptCommands(engine, this, part,
- localID, itemID);
+ localID, itemID);
try
{
m_Script = (IScript)dom.CreateInstanceAndUnwrap(
- Path.GetFileNameWithoutExtension(assembly),
- "SecondLife.Script");
+ Path.GetFileNameWithoutExtension(assembly),
+ "SecondLife.Script");
}
catch (Exception e)
{
@@ -804,15 +805,15 @@ namespace OpenSim.Region.ScriptEngine.XEngine
// m_Engine.Log.Debug("[XEngine] Script instance created");
part.SetScriptEvents(m_ItemID,
- (int)m_Executor.GetStateEventFlags());
+ (int)m_Executor.GetStateEventFlags());
}
catch (Exception e)
{
m_Engine.Log.Error("Error loading script instance\n"+e.ToString());
}
- string savedState = assembly+".state";
- if(File.Exists(savedState))
+ string savedState = assembly + ".state";
+ if (File.Exists(savedState))
{
string xml = String.Empty;
@@ -820,44 +821,44 @@ namespace OpenSim.Region.ScriptEngine.XEngine
{
FileInfo fi = new FileInfo(savedState);
int size=(int)fi.Length;
- if(size < 130000)
+ if (size < 130000)
{
using (FileStream fs = File.Open(savedState,
- FileMode.Open, FileAccess.Read, FileShare.None))
+ FileMode.Open, FileAccess.Read, FileShare.None))
{
System.Text.ASCIIEncoding enc =
- new System.Text.ASCIIEncoding();
+ new System.Text.ASCIIEncoding();
- Byte[] data=new Byte[size];
+ Byte[] data = new Byte[size];
fs.Read(data, 0, size);
- xml=enc.GetString(data);
+ xml = enc.GetString(data);
ScriptSerializer.Deserialize(xml, this);
m_Engine.m_ASYNCLSLCommandManager.CreateFromData(
- m_LocalID, m_ItemID, m_ObjectID,
- PluginData);
+ m_LocalID, m_ItemID, m_ObjectID,
+ PluginData);
}
}
else
{
m_Engine.Log.Error("Unable to load script state: Memory limit exceeded");
PostEvent(new XEventParams("state_entry",
- new Object[0], new XDetectParams[0]));
+ new Object[0], new XDetectParams[0]));
}
}
catch (Exception e)
{
m_Engine.Log.ErrorFormat("Unable to load script state from xml: {0}\n"+e.ToString(), xml);
PostEvent(new XEventParams("state_entry",
- new Object[0], new XDetectParams[0]));
+ new Object[0], new XDetectParams[0]));
}
}
else
{
PostEvent(new XEventParams("state_entry",
- new Object[0], new XDetectParams[0]));
+ new Object[0], new XDetectParams[0]));
}
Start();
}
@@ -868,23 +869,23 @@ namespace OpenSim.Region.ScriptEngine.XEngine
foreach (KeyValuePair v in vars)
{
Console.WriteLine("Variable: {0} = '{1}'", v. Key,
- v.Value.ToString());
+ v.Value.ToString());
}
}
public void Start()
{
- lock(m_EventQueue)
+ lock (m_EventQueue)
{
- if(Running)
+ if (Running)
return;
- m_RunEvents=true;
+ m_RunEvents = true;
- if(m_EventQueue.Count > 0)
+ if (m_EventQueue.Count > 0)
{
- if(m_CurrentResult == null)
- m_CurrentResult=m_Engine.QueueEventHandler(this);
+ if (m_CurrentResult == null)
+ m_CurrentResult = m_Engine.QueueEventHandler(this);
}
}
}
@@ -893,36 +894,36 @@ namespace OpenSim.Region.ScriptEngine.XEngine
{
IWorkItemResult result;
- lock(m_EventQueue)
+ lock (m_EventQueue)
{
- if(!Running)
+ if (!Running)
return true;
- if(m_CurrentResult == null)
+ if (m_CurrentResult == null)
{
- m_RunEvents=false;
+ m_RunEvents = false;
return true;
}
- if(m_CurrentResult.Cancel())
+ if (m_CurrentResult.Cancel())
{
- m_CurrentResult=null;
- m_RunEvents=false;
+ m_CurrentResult = null;
+ m_RunEvents = false;
return true;
}
- result=m_CurrentResult;
- m_RunEvents=false;
+ result = m_CurrentResult;
+ m_RunEvents = false;
}
- if(SmartThreadPool.WaitAll(new IWorkItemResult[] {result}, new TimeSpan((long)timeout*100000), false))
+ if (SmartThreadPool.WaitAll(new IWorkItemResult[] {result}, new TimeSpan((long)timeout * 100000), false))
{
return true;
}
- lock(m_EventQueue)
+ lock (m_EventQueue)
{
- if(m_CurrentResult != null)
+ if (m_CurrentResult != null)
m_CurrentResult.Abort();
else
return true;
@@ -934,75 +935,75 @@ namespace OpenSim.Region.ScriptEngine.XEngine
public void SetState(string state)
{
PostEvent(new XEventParams("state_exit", new Object[0],
- new XDetectParams[0]));
+ new XDetectParams[0]));
PostEvent(new XEventParams("state", new Object[] { state },
- new XDetectParams[0]));
+ new XDetectParams[0]));
PostEvent(new XEventParams("state_entry", new Object[0],
- new XDetectParams[0]));
+ new XDetectParams[0]));
}
public void PostEvent(XEventParams data)
{
- lock(m_EventQueue)
+ lock (m_EventQueue)
{
- if(m_EventQueue.Count >= m_Engine.MaxScriptQueue)
+ if (m_EventQueue.Count >= m_Engine.MaxScriptQueue)
return;
m_EventQueue.Enqueue(data);
- if(data.EventName == "timer")
+ if (data.EventName == "timer")
{
- if(m_TimerQueued)
+ if (m_TimerQueued)
return;
m_TimerQueued = true;
}
- if(!m_RunEvents)
+ if (!m_RunEvents)
return;
- if(m_CurrentResult == null)
+ if (m_CurrentResult == null)
{
- m_CurrentResult=m_Engine.QueueEventHandler(this);
+ m_CurrentResult = m_Engine.QueueEventHandler(this);
}
}
}
public object EventProcessor()
{
- XEventParams data=null;
+ XEventParams data = null;
- lock(m_EventQueue)
+ lock (m_EventQueue)
{
- data=(XEventParams)m_EventQueue.Dequeue();
- if(data == null) // Shouldn't happen
+ data = (XEventParams) m_EventQueue.Dequeue();
+ if (data == null) // Shouldn't happen
{
- m_CurrentResult=null;
+ m_CurrentResult = null;
return 0;
}
- if(data.EventName == "timer")
+ if (data.EventName == "timer")
m_TimerQueued = false;
}
- m_DetectParams=data.DetectParams;
+ m_DetectParams = data.DetectParams;
- if(data.EventName == "state") // Hardcoded state change
+ if (data.EventName == "state") // Hardcoded state change
{
m_State=data.Params[0].ToString();
m_Engine.m_ASYNCLSLCommandManager.RemoveScript(
- m_LocalID, m_ItemID);
+ m_LocalID, m_ItemID);
- SceneObjectPart part=m_Engine.World.GetSceneObjectPart(
- m_LocalID);
- if(part != null)
+ SceneObjectPart part = m_Engine.World.GetSceneObjectPart(
+ m_LocalID);
+ if (part != null)
{
part.SetScriptEvents(m_ItemID,
- (int)m_Executor.GetStateEventFlags());
+ (int)m_Executor.GetStateEventFlags());
}
}
else
{
// m_Engine.Log.DebugFormat("[XEngine] Processed event {0}", data.EventName);
- SceneObjectPart part=m_Engine.World.GetSceneObjectPart(
- m_LocalID);
+ SceneObjectPart part = m_Engine.World.GetSceneObjectPart(
+ m_LocalID);
try
{
m_EventStart = DateTime.Now;
@@ -1013,21 +1014,21 @@ namespace OpenSim.Region.ScriptEngine.XEngine
catch (Exception e)
{
m_InEvent = false;
- if(e is System.Threading.ThreadAbortException)
+ if (e is System.Threading.ThreadAbortException)
{
- lock(m_EventQueue)
+ lock (m_EventQueue)
{
- if((m_EventQueue.Count > 0) && m_RunEvents)
+ if ((m_EventQueue.Count > 0) && m_RunEvents)
{
m_CurrentResult=m_Engine.QueueEventHandler(this);
}
else
{
- m_CurrentResult=null;
+ m_CurrentResult = null;
}
}
- m_DetectParams=null;
+ m_DetectParams = null;
return 0;
}
@@ -1039,42 +1040,42 @@ namespace OpenSim.Region.ScriptEngine.XEngine
if (text.Length > 1400)
text = text.Substring(0, 1400);
m_Engine.World.SimChat(Helpers.StringToField(text),
- ChatTypeEnum.DebugChannel, 2147483647,
- part.AbsolutePosition,
- part.Name, part.UUID, false);
+ ChatTypeEnum.DebugChannel, 2147483647,
+ part.AbsolutePosition,
+ part.Name, part.UUID, false);
}
catch (Exception e2) // LEGIT: User Scripting
{
m_Engine.Log.Error("[XEngine]: "+
- "Error displaying error in-world: " +
- e2.ToString());
+ "Error displaying error in-world: " +
+ e2.ToString());
m_Engine.Log.Error("[XEngine]: " +
- "Errormessage: Error compiling script:\r\n" +
- e.ToString());
+ "Errormessage: Error compiling script:\r\n" +
+ e.ToString());
}
}
}
- lock(m_EventQueue)
+ lock (m_EventQueue)
{
- if((m_EventQueue.Count > 0) && m_RunEvents)
+ if ((m_EventQueue.Count > 0) && m_RunEvents)
{
- m_CurrentResult=m_Engine.QueueEventHandler(this);
+ m_CurrentResult = m_Engine.QueueEventHandler(this);
}
else
{
- m_CurrentResult=null;
+ m_CurrentResult = null;
}
}
- m_DetectParams=null;
+ m_DetectParams = null;
return 0;
}
public int EventTime()
{
- if(!m_InEvent)
+ if (!m_InEvent)
return 0;
return (DateTime.Now - m_EventStart).Seconds;
@@ -1082,14 +1083,14 @@ namespace OpenSim.Region.ScriptEngine.XEngine
public void ResetScript()
{
- bool running=Running;
+ bool running = Running;
Stop(0);
m_Engine.m_ASYNCLSLCommandManager.RemoveScript(m_LocalID, m_ItemID);
m_EventQueue.Clear();
m_Script.ResetVars();
m_State = "default";
- if(running)
+ if (running)
Start();
PostEvent(new XEventParams("state_entry",
new Object[0], new XDetectParams[0]));
@@ -1107,7 +1108,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
public XDetectParams GetDetectParams(int idx)
{
- if(idx < 0 || idx >= m_DetectParams.Length)
+ if (idx < 0 || idx >= m_DetectParams.Length)
return new XDetectParams();
return m_DetectParams[idx];
@@ -1115,7 +1116,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
public LLUUID GetDetectID(int idx)
{
- if(idx < 0 || idx >= m_DetectParams.Length)
+ if (idx < 0 || idx >= m_DetectParams.Length)
return LLUUID.Zero;
return m_DetectParams[idx].Key;
@@ -1124,22 +1125,21 @@ namespace OpenSim.Region.ScriptEngine.XEngine
public void SaveState(string assembly)
{
PluginData =
- m_Engine.m_ASYNCLSLCommandManager.GetSerializationData(
+ m_Engine.m_ASYNCLSLCommandManager.GetSerializationData(
m_ItemID);
- string xml=ScriptSerializer.Serialize(this);
+ string xml = ScriptSerializer.Serialize(this);
try
{
- FileStream fs = File.Create(assembly+".state");
+ FileStream fs = File.Create(assembly + ".state");
System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding();
- Byte[] buf=enc.GetBytes(xml);
+ Byte[] buf = enc.GetBytes(xml);
fs.Write(buf, 0, buf.Length);
fs.Close();
}
catch(Exception)
{
- return;
}
}
}
@@ -1153,11 +1153,11 @@ namespace OpenSim.Region.ScriptEngine.XEngine
XmlDocument xmldoc = new XmlDocument();
XmlNode xmlnode = xmldoc.CreateNode(XmlNodeType.XmlDeclaration,
- "", "");
+ "", "");
xmldoc.AppendChild(xmlnode);
XmlElement rootElement = xmldoc.CreateElement("", "ScriptState",
- "");
+ "");
xmldoc.AppendChild(rootElement);
XmlElement state = xmldoc.CreateElement("", "State", "");
@@ -1171,15 +1171,15 @@ namespace OpenSim.Region.ScriptEngine.XEngine
foreach (KeyValuePair var in vars)
WriteTypedValue(xmldoc, variables, "Variable", var.Key,
- var.Value);
+ var.Value);
rootElement.AppendChild(variables);
XmlElement queue = xmldoc.CreateElement("", "Queue", "");
int count = instance.EventQueue.Count;
-
- while(count > 0)
+
+ while (count > 0)
{
XEventParams ep = (XEventParams)instance.EventQueue.Dequeue();
instance.EventQueue.Enqueue(ep);
@@ -1187,8 +1187,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine
XmlElement item = xmldoc.CreateElement("", "Item", "");
XmlAttribute itemEvent = xmldoc.CreateAttribute("", "event",
- "");
- itemEvent.Value=ep.EventName;
+ "");
+ itemEvent.Value = ep.EventName;
item.Attributes.Append(itemEvent);
XmlElement parms = xmldoc.CreateElement("", "Params", "");
@@ -1203,12 +1203,12 @@ namespace OpenSim.Region.ScriptEngine.XEngine
foreach (XDetectParams det in ep.DetectParams)
{
XmlElement objectElem = xmldoc.CreateElement("", "Object",
- "");
+ "");
XmlAttribute pos = xmldoc.CreateAttribute("", "pos", "");
- pos.Value=det.OffsetPos.ToString();
+ pos.Value = det.OffsetPos.ToString();
objectElem.Attributes.Append(pos);
objectElem.AppendChild(
- xmldoc.CreateTextNode(det.Key.ToString()));
+ xmldoc.CreateTextNode(det.Key.ToString()));
detect.AppendChild(objectElem);
}
@@ -1221,9 +1221,9 @@ namespace OpenSim.Region.ScriptEngine.XEngine
rootElement.AppendChild(queue);
XmlNode plugins = xmldoc.CreateElement("", "Plugins", "");
- if(instance.PluginData.Length > 0)
+ if (instance.PluginData.Length > 0)
DumpList(xmldoc, plugins,
- new LSL_Types.list(instance.PluginData));
+ new LSL_Types.list(instance.PluginData));
rootElement.AppendChild(plugins);
@@ -1241,22 +1241,22 @@ namespace OpenSim.Region.ScriptEngine.XEngine
instance.PluginData = new Object[0];
doc.LoadXml(xml);
-
+
XmlNodeList rootL = doc.GetElementsByTagName("ScriptState");
- if(rootL.Count != 1)
+ if (rootL.Count != 1)
{
return;
}
XmlNode rootNode = rootL[0];
- if(rootNode != null)
+ if (rootNode != null)
{
object varValue;
XmlNodeList partL = rootNode.ChildNodes;
foreach (XmlNode part in partL)
{
- switch(part.Name)
+ switch (part.Name)
{
case "State":
instance.State=part.InnerText;
@@ -1268,7 +1268,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
string varName;
varValue=ReadTypedValue(var, out varName);
- if(vars.ContainsKey(varName))
+ if (vars.ContainsKey(varName))
vars[varName] = varValue;
}
instance.SetVars(vars);
@@ -1286,7 +1286,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
XmlNodeList eventL = item.ChildNodes;
foreach (XmlNode evt in eventL)
{
- switch(evt.Name)
+ switch (evt.Name)
{
case "Params":
XmlNodeList prms = evt.ChildNodes;
@@ -1342,7 +1342,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
List olist = new List();
XmlNodeList itemL = parent.ChildNodes;
- foreach(XmlNode item in itemL)
+ foreach (XmlNode item in itemL)
olist.Add(ReadTypedValue(item));
return new LSL_Types.list(olist.ToArray());
@@ -1355,14 +1355,14 @@ namespace OpenSim.Region.ScriptEngine.XEngine
XmlAttribute typ = doc.CreateAttribute("", "type", "");
XmlNode n = doc.CreateElement("", tag, "");
- if(value is LSL_Types.list)
+ if (value is LSL_Types.list)
{
typ.Value = "list";
n.Attributes.Append(typ);
DumpList(doc, n, (LSL_Types.list) value);
- if(name != String.Empty)
+ if (name != String.Empty)
{
XmlAttribute nam = doc.CreateAttribute("", "name", "");
nam.Value = name;
@@ -1377,7 +1377,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
typ.Value = t.ToString();
n.Attributes.Append(typ);
- if(name != String.Empty)
+ if (name != String.Empty)
{
XmlAttribute nam = doc.CreateAttribute("", "name", "");
nam.Value = name;
@@ -1401,31 +1401,31 @@ namespace OpenSim.Region.ScriptEngine.XEngine
string itemType = tag.Attributes.GetNamedItem("type").Value;
- if(itemType == "list")
+ if (itemType == "list")
return ReadList(tag);
- if(itemType == "libsecondlife.LLUUID")
+ if (itemType == "libsecondlife.LLUUID")
{
LLUUID val = new LLUUID();
LLUUID.TryParse(tag.InnerText, out val);
-
+
return val;
}
Type itemT = Type.GetType(itemType);
- if(itemT == null)
+ if (itemT == null)
{
Object[] args =
new Object[] { tag.InnerText };
assembly = itemType+", OpenSim.Region.ScriptEngine.XEngine.Script";
itemT = Type.GetType(assembly);
- if(itemT == null)
+ if (itemT == null)
return null;
varValue = Activator.CreateInstance(itemT, args);
- if(varValue == null)
+ if (varValue == null)
return null;
}
else
--
cgit v1.1