* Rex merges, Grid Script Server
parent
ab27cd5513
commit
ce0d1132f8
|
@ -13,7 +13,7 @@
|
||||||
* names of its contributors may be used to endorse or promote products
|
* names of its contributors may be used to endorse or promote products
|
||||||
* derived from this software without specific prior written permission.
|
* derived from this software without specific prior written permission.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS AS IS AND ANY
|
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
* names of its contributors may be used to endorse or promote products
|
* names of its contributors may be used to endorse or promote products
|
||||||
* derived from this software without specific prior written permission.
|
* derived from this software without specific prior written permission.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS AS IS AND ANY
|
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
* names of its contributors may be used to endorse or promote products
|
* names of its contributors may be used to endorse or promote products
|
||||||
* derived from this software without specific prior written permission.
|
* derived from this software without specific prior written permission.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS AS IS AND ANY
|
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||||
|
|
|
@ -1,3 +1,31 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) Contributors, http://opensimulator.org/
|
||||||
|
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
* 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
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
* * Neither the name of the OpenSim Project 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 DEVELOPERS ``AS IS'' AND ANY
|
||||||
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||||
|
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
* names of its contributors may be used to endorse or promote products
|
* names of its contributors may be used to endorse or promote products
|
||||||
* derived from this software without specific prior written permission.
|
* derived from this software without specific prior written permission.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS AS IS AND ANY
|
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||||
|
@ -105,7 +105,7 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine
|
||||||
|
|
||||||
Console.WriteLine("Scripts loaded in this Appdomain: " + currentAD.ScriptsLoaded);
|
Console.WriteLine("Scripts loaded in this Appdomain: " + currentAD.ScriptsLoaded);
|
||||||
return currentAD;
|
return currentAD;
|
||||||
} // lock
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private int AppDomainNameCount;
|
private int AppDomainNameCount;
|
||||||
|
@ -169,10 +169,9 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} // foreach
|
|
||||||
} // lock
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public LSL_BaseClass LoadScript(string FileName)
|
public LSL_BaseClass LoadScript(string FileName)
|
||||||
{
|
{
|
||||||
|
@ -189,7 +188,6 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine
|
||||||
return mbrt;
|
return mbrt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Increase "dead script" counter for an AppDomain
|
/// Increase "dead script" counter for an AppDomain
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -217,8 +215,8 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine
|
||||||
ads.ScriptsWaitingUnload++;
|
ads.ScriptsWaitingUnload++;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} // foreach
|
}
|
||||||
} // lock
|
}
|
||||||
|
|
||||||
UnloadAppDomains(); // Outsite lock, has its own GetLock
|
UnloadAppDomains(); // Outsite lock, has its own GetLock
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,10 +26,13 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
/* Original code: Tedd Hansen */
|
/* Original code: Tedd Hansen */
|
||||||
|
|
||||||
namespace OpenSim.Grid.ScriptEngine.DotNetEngine
|
namespace OpenSim.Grid.ScriptEngine.DotNetEngine
|
||||||
{
|
{
|
||||||
public static class Common
|
public static class Common
|
||||||
{
|
{
|
||||||
|
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
|
||||||
public static bool debug = true;
|
public static bool debug = true;
|
||||||
public static ScriptEngine mySE;
|
public static ScriptEngine mySE;
|
||||||
|
|
||||||
|
@ -41,14 +44,14 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine
|
||||||
public static void SendToDebug(string Message)
|
public static void SendToDebug(string Message)
|
||||||
{
|
{
|
||||||
//if (Debug == true)
|
//if (Debug == true)
|
||||||
mySE.Log.Verbose("ScriptEngine", "Debug: " + Message);
|
mySE.m_log.Info("[ScriptEngine]: Debug: " + Message);
|
||||||
//SendToDebugEvent("\r\n" + DateTime.Now.ToString("[HH:mm:ss] ") + Message);
|
//SendToDebugEvent("\r\n" + DateTime.Now.ToString("[HH:mm:ss] ") + Message);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void SendToLog(string Message)
|
public static void SendToLog(string Message)
|
||||||
{
|
{
|
||||||
//if (Debug == true)
|
//if (Debug == true)
|
||||||
mySE.Log.Verbose("ScriptEngine", "LOG: " + Message);
|
mySE.m_log.Info("[ScriptEngine]: LOG: " + Message);
|
||||||
//SendToLogEvent("\r\n" + DateTime.Now.ToString("[HH:mm:ss] ") + Message);
|
//SendToLogEvent("\r\n" + DateTime.Now.ToString("[HH:mm:ss] ") + Message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
* names of its contributors may be used to endorse or promote products
|
* names of its contributors may be used to endorse or promote products
|
||||||
* derived from this software without specific prior written permission.
|
* derived from this software without specific prior written permission.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS AS IS AND ANY
|
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
* names of its contributors may be used to endorse or promote products
|
* names of its contributors may be used to endorse or promote products
|
||||||
* derived from this software without specific prior written permission.
|
* derived from this software without specific prior written permission.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS AS IS AND ANY
|
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
* names of its contributors may be used to endorse or promote products
|
* names of its contributors may be used to endorse or promote products
|
||||||
* derived from this software without specific prior written permission.
|
* derived from this software without specific prior written permission.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS AS IS AND ANY
|
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||||
|
@ -41,6 +41,8 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine.Compiler.LSL
|
||||||
//[Serializable]
|
//[Serializable]
|
||||||
public class LSL_BaseClass : MarshalByRefObject, LSL_BuiltIn_Commands_Interface, IScript
|
public class LSL_BaseClass : MarshalByRefObject, LSL_BuiltIn_Commands_Interface, IScript
|
||||||
{
|
{
|
||||||
|
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
|
||||||
// Object never expires
|
// Object never expires
|
||||||
public override Object InitializeLifetimeService()
|
public override Object InitializeLifetimeService()
|
||||||
{
|
{
|
||||||
|
@ -87,7 +89,7 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine.Compiler.LSL
|
||||||
{
|
{
|
||||||
m_LSL_Functions = LSL_Functions;
|
m_LSL_Functions = LSL_Functions;
|
||||||
|
|
||||||
//MainLog.Instance.Notice("ScriptEngine", "LSL_BaseClass.Start() called.");
|
//m_log.Info("[ScriptEngine]: LSL_BaseClass.Start() called.");
|
||||||
|
|
||||||
// Get this AppDomain's settings and display some of them.
|
// Get this AppDomain's settings and display some of them.
|
||||||
AppDomainSetup ads = AppDomain.CurrentDomain.SetupInformation;
|
AppDomainSetup ads = AppDomain.CurrentDomain.SetupInformation;
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
* names of its contributors may be used to endorse or promote products
|
* names of its contributors may be used to endorse or promote products
|
||||||
* derived from this software without specific prior written permission.
|
* derived from this software without specific prior written permission.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS AS IS AND ANY
|
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
* names of its contributors may be used to endorse or promote products
|
* names of its contributors may be used to endorse or promote products
|
||||||
* derived from this software without specific prior written permission.
|
* derived from this software without specific prior written permission.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS AS IS AND ANY
|
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
* names of its contributors may be used to endorse or promote products
|
* names of its contributors may be used to endorse or promote products
|
||||||
* derived from this software without specific prior written permission.
|
* derived from this software without specific prior written permission.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS AS IS AND ANY
|
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
* names of its contributors may be used to endorse or promote products
|
* names of its contributors may be used to endorse or promote products
|
||||||
* derived from this software without specific prior written permission.
|
* derived from this software without specific prior written permission.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS AS IS AND ANY
|
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||||
|
@ -52,6 +52,8 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine.Compiler
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class LSL_BuiltIn_Commands : MarshalByRefObject, LSL_BuiltIn_Commands_Interface
|
public class LSL_BuiltIn_Commands : MarshalByRefObject, LSL_BuiltIn_Commands_Interface
|
||||||
{
|
{
|
||||||
|
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
|
||||||
private ASCIIEncoding enc = new ASCIIEncoding();
|
private ASCIIEncoding enc = new ASCIIEncoding();
|
||||||
private ScriptEngine m_ScriptEngine;
|
private ScriptEngine m_ScriptEngine;
|
||||||
private SceneObjectPart m_host;
|
private SceneObjectPart m_host;
|
||||||
|
@ -68,7 +70,7 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine.Compiler
|
||||||
m_itemID = itemID;
|
m_itemID = itemID;
|
||||||
|
|
||||||
|
|
||||||
//MainLog.Instance.Notice("ScriptEngine", "LSL_BaseClass.Start() called. Hosted by [" + m_host.Name + ":" + m_host.UUID + "@" + m_host.AbsolutePosition + "]");
|
//m_log.Info("[ScriptEngine]: LSL_BaseClass.Start() called. Hosted by [" + m_host.Name + ":" + m_host.UUID + "@" + m_host.AbsolutePosition + "]");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -38,17 +38,19 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine
|
||||||
[Serializable]
|
[Serializable]
|
||||||
internal class EventManager
|
internal class EventManager
|
||||||
{
|
{
|
||||||
|
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
|
||||||
private ScriptEngine myScriptEngine;
|
private ScriptEngine myScriptEngine;
|
||||||
//public IScriptHost TEMP_OBJECT_ID;
|
//public IScriptHost TEMP_OBJECT_ID;
|
||||||
public EventManager(ScriptEngine _ScriptEngine)
|
public EventManager(ScriptEngine _ScriptEngine)
|
||||||
{
|
{
|
||||||
myScriptEngine = _ScriptEngine;
|
myScriptEngine = _ScriptEngine;
|
||||||
// TODO: HOOK EVENTS UP TO SERVER!
|
// TODO: HOOK EVENTS UP TO SERVER!
|
||||||
//myScriptEngine.m_logger.Verbose("ScriptEngine", "EventManager Start");
|
//myScriptEngine.m_log.Info("[ScriptEngine]: EventManager Start");
|
||||||
// TODO: ADD SERVER HOOK TO LOAD A SCRIPT THROUGH myScriptEngine.ScriptManager
|
// TODO: ADD SERVER HOOK TO LOAD A SCRIPT THROUGH myScriptEngine.ScriptManager
|
||||||
|
|
||||||
// Hook up a test event to our test form
|
// Hook up a test event to our test form
|
||||||
myScriptEngine.Log.Verbose("ScriptEngine", "Hooking up to server events");
|
myScriptEngine.m_log.Info("[ScriptEngine]: Hooking up to server events");
|
||||||
myScriptEngine.World.EventManager.OnObjectGrab += touch_start;
|
myScriptEngine.World.EventManager.OnObjectGrab += touch_start;
|
||||||
myScriptEngine.World.EventManager.OnRezScript += OnRezScript;
|
myScriptEngine.World.EventManager.OnRezScript += OnRezScript;
|
||||||
myScriptEngine.World.EventManager.OnRemoveScript += OnRemoveScript;
|
myScriptEngine.World.EventManager.OnRemoveScript += OnRemoveScript;
|
||||||
|
@ -57,7 +59,7 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine
|
||||||
public void touch_start(uint localID, LLVector3 offsetPos, IClientAPI remoteClient)
|
public void touch_start(uint localID, LLVector3 offsetPos, IClientAPI remoteClient)
|
||||||
{
|
{
|
||||||
// Add to queue for all scripts in ObjectID object
|
// Add to queue for all scripts in ObjectID object
|
||||||
//myScriptEngine.m_logger.Verbose("ScriptEngine", "EventManager Event: touch_start");
|
//myScriptEngine.m_log.Info("[ScriptEngine]: EventManager Event: touch_start");
|
||||||
//Console.WriteLine("touch_start localID: " + localID);
|
//Console.WriteLine("touch_start localID: " + localID);
|
||||||
myScriptEngine.m_EventQueueManager.AddToObjectQueue(localID, "touch_start", new object[] {(int) 1});
|
myScriptEngine.m_EventQueueManager.AddToObjectQueue(localID, "touch_start", new object[] {(int) 1});
|
||||||
}
|
}
|
||||||
|
@ -91,7 +93,7 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine
|
||||||
// then queued in EventQueueManager.
|
// then queued in EventQueueManager.
|
||||||
// When queued in EventQueueManager they need to be LSL compatible (name and params)
|
// When queued in EventQueueManager they need to be LSL compatible (name and params)
|
||||||
|
|
||||||
//public void state_entry() { } //
|
//public void state_entry() { }
|
||||||
public void state_exit()
|
public void state_exit()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,6 +44,8 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine
|
||||||
[Serializable]
|
[Serializable]
|
||||||
internal class EventQueueManager
|
internal class EventQueueManager
|
||||||
{
|
{
|
||||||
|
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// List of threads processing event queue
|
/// List of threads processing event queue
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -118,7 +120,7 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
//myScriptEngine.Log.Verbose("ScriptEngine", "EventQueueManager Exception killing worker thread: " + e.ToString());
|
//myScriptEngine.m_log.Info("[ScriptEngine]: EventQueueManager Exception killing worker thread: " + e.ToString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -132,7 +134,7 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private void EventQueueThreadLoop()
|
private void EventQueueThreadLoop()
|
||||||
{
|
{
|
||||||
//myScriptEngine.m_logger.Verbose("ScriptEngine", "EventQueueManager Worker thread spawned");
|
//myScriptEngine.m_log.Info("[ScriptEngine]: EventQueueManager Worker thread spawned");
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
QueueItemStruct BlankQIS = new QueueItemStruct();
|
QueueItemStruct BlankQIS = new QueueItemStruct();
|
||||||
|
@ -151,7 +153,7 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Something in queue, process
|
// Something in queue, process
|
||||||
//myScriptEngine.m_logger.Verbose("ScriptEngine", "Processing event for localID: " + QIS.localID + ", itemID: " + QIS.itemID + ", FunctionName: " + QIS.FunctionName);
|
//myScriptEngine.m_log.Info("[ScriptEngine]: Processing event for localID: " + QIS.localID + ", itemID: " + QIS.itemID + ", FunctionName: " + QIS.FunctionName);
|
||||||
|
|
||||||
// OBJECT BASED LOCK - TWO THREADS WORKING ON SAME OBJECT IS NOT GOOD
|
// OBJECT BASED LOCK - TWO THREADS WORKING ON SAME OBJECT IS NOT GOOD
|
||||||
lock (queueLock)
|
lock (queueLock)
|
||||||
|
@ -174,8 +176,8 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine
|
||||||
GotItem = true;
|
GotItem = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} // go through queue
|
}
|
||||||
} // lock
|
}
|
||||||
|
|
||||||
if (GotItem == true)
|
if (GotItem == true)
|
||||||
{
|
{
|
||||||
|
@ -223,7 +225,7 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine
|
||||||
ReleaseLock(QIS.localID);
|
ReleaseLock(QIS.localID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} // Something in queue
|
}
|
||||||
}
|
}
|
||||||
catch (ThreadAbortException tae)
|
catch (ThreadAbortException tae)
|
||||||
{
|
{
|
||||||
|
@ -233,11 +235,11 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine
|
||||||
{
|
{
|
||||||
Console.WriteLine("Exception in EventQueueThreadLoop: " + e.ToString());
|
Console.WriteLine("Exception in EventQueueThreadLoop: " + e.ToString());
|
||||||
}
|
}
|
||||||
} // while
|
}
|
||||||
} // try
|
}
|
||||||
catch (ThreadAbortException)
|
catch (ThreadAbortException)
|
||||||
{
|
{
|
||||||
//myScriptEngine.Log.Verbose("ScriptEngine", "EventQueueManager Worker thread killed: " + tae.Message);
|
//myScriptEngine.m_log.Info("[ScriptEngine]: EventQueueManager Worker thread killed: " + tae.Message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -277,7 +279,6 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Add event to event execution queue
|
/// Add event to event execution queue
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -287,7 +288,7 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine
|
||||||
public void AddToObjectQueue(uint localID, string FunctionName, object[] param)
|
public void AddToObjectQueue(uint localID, string FunctionName, object[] param)
|
||||||
{
|
{
|
||||||
// Determine all scripts in Object and add to their queue
|
// Determine all scripts in Object and add to their queue
|
||||||
//myScriptEngine.m_logger.Verbose("ScriptEngine", "EventQueueManager Adding localID: " + localID + ", FunctionName: " + FunctionName);
|
//myScriptEngine.m_log.Info("[ScriptEngine]: EventQueueManager Adding localID: " + localID + ", FunctionName: " + FunctionName);
|
||||||
|
|
||||||
|
|
||||||
// Do we have any scripts in this object at all? If not, return
|
// Do we have any scripts in this object at all? If not, return
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
* names of its contributors may be used to endorse or promote products
|
* names of its contributors may be used to endorse or promote products
|
||||||
* derived from this software without specific prior written permission.
|
* derived from this software without specific prior written permission.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS AS IS AND ANY
|
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||||
|
@ -191,7 +191,7 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine
|
||||||
ts.next = DateTime.Now.ToUniversalTime().AddSeconds(ts.interval);
|
ts.next = DateTime.Now.ToUniversalTime().AddSeconds(ts.interval);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} // lock
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
@ -305,7 +305,7 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine
|
||||||
StopHttpRequest(ts.localID, ts.itemID);
|
StopHttpRequest(ts.localID, ts.itemID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} // lock
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
|
@ -1,3 +1,31 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) Contributors, http://opensimulator.org/
|
||||||
|
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
* 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
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
* * Neither the name of the OpenSim Project 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 DEVELOPERS ``AS IS'' AND ANY
|
||||||
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||||
|
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
|
|
|
@ -40,6 +40,8 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class ScriptEngine : IRegionModule
|
public class ScriptEngine : IRegionModule
|
||||||
{
|
{
|
||||||
|
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
|
||||||
internal Scene World;
|
internal Scene World;
|
||||||
internal EventManager m_EventManager; // Handles and queues incoming events from OpenSim
|
internal EventManager m_EventManager; // Handles and queues incoming events from OpenSim
|
||||||
internal EventQueueManager m_EventQueueManager; // Executes events
|
internal EventQueueManager m_EventQueueManager; // Executes events
|
||||||
|
@ -47,7 +49,6 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine
|
||||||
internal AppDomainManager m_AppDomainManager;
|
internal AppDomainManager m_AppDomainManager;
|
||||||
internal LSLLongCmdHandler m_LSLLongCmdHandler;
|
internal LSLLongCmdHandler m_LSLLongCmdHandler;
|
||||||
|
|
||||||
private LogBase m_log;
|
|
||||||
|
|
||||||
public ScriptEngine()
|
public ScriptEngine()
|
||||||
{
|
{
|
||||||
|
@ -55,19 +56,13 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine
|
||||||
Common.mySE = this;
|
Common.mySE = this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public LogBase Log
|
public void InitializeEngine(Scene Sceneworld)
|
||||||
{
|
|
||||||
get { return m_log; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public void InitializeEngine(Scene Sceneworld, LogBase logger)
|
|
||||||
{
|
{
|
||||||
World = Sceneworld;
|
World = Sceneworld;
|
||||||
m_log = logger;
|
|
||||||
|
|
||||||
Log.Verbose("ScriptEngine", "DotNet & LSL ScriptEngine initializing");
|
m_log.Info("[ScriptEngine]: DotNet & LSL ScriptEngine initializing");
|
||||||
|
|
||||||
//m_logger.Status("ScriptEngine", "InitializeEngine");
|
//m_log.Info("[ScriptEngine]: InitializeEngine");
|
||||||
|
|
||||||
// Create all objects we'll be using
|
// Create all objects we'll be using
|
||||||
m_EventQueueManager = new EventQueueManager(this);
|
m_EventQueueManager = new EventQueueManager(this);
|
||||||
|
@ -90,7 +85,7 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine
|
||||||
//public void StartScript(string ScriptID, IScriptHost ObjectID)
|
//public void StartScript(string ScriptID, IScriptHost ObjectID)
|
||||||
//{
|
//{
|
||||||
// this.myEventManager.TEMP_OBJECT_ID = ObjectID;
|
// this.myEventManager.TEMP_OBJECT_ID = ObjectID;
|
||||||
// Log.Status("ScriptEngine", "DEBUG FUNCTION: StartScript: " + ScriptID);
|
// m_log.Info("[ScriptEngine]: DEBUG FUNCTION: StartScript: " + ScriptID);
|
||||||
// myScriptManager.StartScript(ScriptID, ObjectID);
|
// myScriptManager.StartScript(ScriptID, ObjectID);
|
||||||
//}
|
//}
|
||||||
|
|
||||||
|
@ -98,7 +93,7 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine
|
||||||
|
|
||||||
public void Initialise(Scene scene, IConfigSource config)
|
public void Initialise(Scene scene, IConfigSource config)
|
||||||
{
|
{
|
||||||
InitializeEngine(scene, MainLog.Instance);
|
InitializeEngine(scene);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void PostInitialise()
|
public void PostInitialise()
|
||||||
|
|
|
@ -48,6 +48,8 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class ScriptManager
|
public class ScriptManager
|
||||||
{
|
{
|
||||||
|
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
|
||||||
#region Declares
|
#region Declares
|
||||||
|
|
||||||
private Thread scriptLoadUnloadThread;
|
private Thread scriptLoadUnloadThread;
|
||||||
|
@ -312,7 +314,7 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
//m_scriptEngine.Log.Error("ScriptEngine", "Error compiling script: " + e.ToString());
|
//m_scriptEngine.m_log.Error("[ScriptEngine]: Error compiling script: " + e.ToString());
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// DISPLAY ERROR INWORLD
|
// DISPLAY ERROR INWORLD
|
||||||
|
@ -323,7 +325,7 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine
|
||||||
}
|
}
|
||||||
catch (Exception e2)
|
catch (Exception e2)
|
||||||
{
|
{
|
||||||
m_scriptEngine.Log.Error("ScriptEngine", "Error displaying error in-world: " + e2.ToString());
|
m_scriptEngine.m_log.Error("[ScriptEngine]: Error displaying error in-world: " + e2.ToString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -384,7 +386,7 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine
|
||||||
internal void ExecuteEvent(uint localID, LLUUID itemID, string FunctionName, object[] args)
|
internal void ExecuteEvent(uint localID, LLUUID itemID, string FunctionName, object[] args)
|
||||||
{
|
{
|
||||||
// Execute a function in the script
|
// Execute a function in the script
|
||||||
//m_scriptEngine.Log.Verbose("ScriptEngine", "Executing Function localID: " + localID + ", itemID: " + itemID + ", FunctionName: " + FunctionName);
|
//m_scriptEngine.m_log.Info("[ScriptEngine]: Executing Function localID: " + localID + ", itemID: " + itemID + ", FunctionName: " + FunctionName);
|
||||||
LSL_BaseClass Script = m_scriptEngine.m_ScriptManager.GetScript(localID, itemID);
|
LSL_BaseClass Script = m_scriptEngine.m_ScriptManager.GetScript(localID, itemID);
|
||||||
if (Script == null)
|
if (Script == null)
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
* names of its contributors may be used to endorse or promote products
|
* names of its contributors may be used to endorse or promote products
|
||||||
* derived from this software without specific prior written permission.
|
* derived from this software without specific prior written permission.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS AS IS AND ANY
|
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||||
|
|
Loading…
Reference in New Issue