Added ScriptEngine.RemoteServer module

afrisby
Tedd Hansen 2007-12-30 19:08:22 +00:00
parent 7d04cf8d4e
commit c084c54fb5
5 changed files with 457 additions and 0 deletions

View File

@ -0,0 +1,57 @@
/*
* 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.
*
*/
/* Original code: Tedd Hansen */
namespace OpenSim.Region.ScriptEngine.RemoteServer
{
public static class Common
{
public static bool debug = true;
public static ScriptEngine mySE;
// This class just contains some static log stuff used for debugging.
//public delegate void SendToDebugEventDelegate(string Message);
//public delegate void SendToLogEventDelegate(string Message);
//static public event SendToDebugEventDelegate SendToDebugEvent;
//static public event SendToLogEventDelegate SendToLogEvent;
public static void SendToDebug(string Message)
{
//if (Debug == true)
mySE.Log.Verbose("ScriptEngine", "Debug: " + Message);
//SendToDebugEvent("\r\n" + DateTime.Now.ToString("[HH:mm:ss] ") + Message);
}
public static void SendToLog(string Message)
{
//if (Debug == true)
mySE.Log.Verbose("ScriptEngine", "LOG: " + Message);
//SendToLogEvent("\r\n" + DateTime.Now.ToString("[HH:mm:ss] ") + Message);
}
}
}

View File

@ -0,0 +1,226 @@
/*
* 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.
*
*/
/* Original code: Tedd Hansen */
using System;
using libsecondlife;
using OpenSim.Framework;
namespace OpenSim.Region.ScriptEngine.RemoteServer
{
/// <summary>
/// </summary>
[Serializable]
internal class EventManager
{
System.Collections.Generic.Dictionary<uint, EventManager> remoteScript = new System.Collections.Generic.Dictionary<uint, EventManager>();
private ScriptEngine myScriptEngine;
public EventManager(ScriptEngine _ScriptEngine)
{
myScriptEngine = _ScriptEngine;
myScriptEngine.Log.Verbose("RemoteEngine", "Hooking up to server events");
myScriptEngine.World.EventManager.OnObjectGrab += touch_start;
myScriptEngine.World.EventManager.OnRezScript += OnRezScript;
myScriptEngine.World.EventManager.OnRemoveScript += OnRemoveScript;
}
public void touch_start(uint localID, LLVector3 offsetPos, IClientAPI remoteClient)
{
remoteScript[localID].touch_start(localID, offsetPos, remoteClient);
}
public void OnRezScript(uint localID, LLUUID itemID, string script)
{
remoteScript[localID].OnRezScript(localID, itemID, script);
}
public void OnRemoveScript(uint localID, LLUUID itemID)
{
remoteScript[localID].OnRemoveScript(localID, itemID);
}
public void state_exit(uint localID, LLUUID itemID)
{
remoteScript[localID].state_exit(localID, itemID);
}
public void touch(uint localID, LLUUID itemID)
{
remoteScript[localID].touch(localID, itemID);
}
public void touch_end(uint localID, LLUUID itemID)
{
remoteScript[localID].touch_end(localID, itemID);
}
public void collision_start(uint localID, LLUUID itemID)
{
remoteScript[localID].collision_start(localID, itemID);
}
public void collision(uint localID, LLUUID itemID)
{
remoteScript[localID].collision(localID, itemID);
}
public void collision_end(uint localID, LLUUID itemID)
{
remoteScript[localID].collision_end(localID, itemID);
}
public void land_collision_start(uint localID, LLUUID itemID)
{
remoteScript[localID].land_collision_start(localID, itemID);
}
public void land_collision(uint localID, LLUUID itemID)
{
remoteScript[localID].land_collision(localID, itemID);
}
public void land_collision_end(uint localID, LLUUID itemID)
{
remoteScript[localID].land_collision_end(localID, itemID);
}
public void timer(uint localID, LLUUID itemID)
{
remoteScript[localID].timer(localID, itemID);
}
public void listen(uint localID, LLUUID itemID)
{
remoteScript[localID].listen(localID, itemID);
}
public void on_rez(uint localID, LLUUID itemID)
{
remoteScript[localID].on_rez(localID, itemID);
}
public void sensor(uint localID, LLUUID itemID)
{
remoteScript[localID].sensor(localID, itemID);
}
public void no_sensor(uint localID, LLUUID itemID)
{
remoteScript[localID].no_sensor(localID, itemID);
}
public void control(uint localID, LLUUID itemID)
{
remoteScript[localID].control(localID, itemID);
}
public void money(uint localID, LLUUID itemID)
{
remoteScript[localID].money(localID, itemID);
}
public void email(uint localID, LLUUID itemID)
{
remoteScript[localID].email(localID, itemID);
}
public void at_target(uint localID, LLUUID itemID)
{
remoteScript[localID].at_target(localID, itemID);
}
public void not_at_target(uint localID, LLUUID itemID)
{
remoteScript[localID].not_at_target(localID, itemID);
}
public void at_rot_target(uint localID, LLUUID itemID)
{
remoteScript[localID].at_rot_target(localID, itemID);
}
public void not_at_rot_target(uint localID, LLUUID itemID)
{
remoteScript[localID].not_at_rot_target(localID, itemID);
}
public void run_time_permissions(uint localID, LLUUID itemID)
{
remoteScript[localID].run_time_permissions(localID, itemID);
}
public void changed(uint localID, LLUUID itemID)
{
remoteScript[localID].changed(localID, itemID);
}
public void attach(uint localID, LLUUID itemID)
{
remoteScript[localID].attach(localID, itemID);
}
public void dataserver(uint localID, LLUUID itemID)
{
remoteScript[localID].dataserver(localID, itemID);
}
public void link_message(uint localID, LLUUID itemID)
{
remoteScript[localID].link_message(localID, itemID);
}
public void moving_start(uint localID, LLUUID itemID)
{
remoteScript[localID].moving_start(localID, itemID);
}
public void moving_end(uint localID, LLUUID itemID)
{
remoteScript[localID].moving_end(localID, itemID);
}
public void object_rez(uint localID, LLUUID itemID)
{
remoteScript[localID].object_rez(localID, itemID);
}
public void remote_data(uint localID, LLUUID itemID)
{
remoteScript[localID].remote_data(localID, itemID);
}
public void http_response(uint localID, LLUUID itemID)
{
remoteScript[localID].http_response(localID, itemID);
}
}
}

View File

@ -0,0 +1,38 @@
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly : AssemblyTitle("OpenSim.Region.ScriptEngine.RemoteServer")]
[assembly : AssemblyDescription("")]
[assembly : AssemblyConfiguration("")]
[assembly : AssemblyCompany("")]
[assembly : AssemblyProduct("OpenSim.Region.ScriptEngine.RemoteServer")]
[assembly : AssemblyCopyright("Copyright © 2007")]
[assembly : AssemblyTrademark("")]
[assembly : AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly : ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly : Guid("2842257e-6fde-4460-9368-4cde57fa9cc4")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly : AssemblyVersion("1.0.0.0")]
[assembly : AssemblyFileVersion("1.0.0.0")]

View File

@ -0,0 +1,103 @@
/*
* 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.
*
*/
/* Original code: Tedd Hansen */
using System;
using Nini.Config;
using OpenSim.Framework.Console;
using OpenSim.Region.Environment.Interfaces;
using OpenSim.Region.Environment.Scenes;
namespace OpenSim.Region.ScriptEngine.RemoteServer
{
/// <summary>
/// This is the root object for ScriptEngine. Objects access each other trough this class.
/// </summary>
///
[Serializable]
public class ScriptEngine : IRegionModule
{
internal Scene World;
internal EventManager m_EventManager; // Handles and queues incoming events from OpenSim
private LogBase m_log;
public ScriptEngine()
{
Common.mySE = this;
}
public LogBase Log
{
get { return m_log; }
}
public void InitializeEngine(Scene Sceneworld, LogBase logger)
{
World = Sceneworld;
m_log = logger;
Log.Verbose("ScriptEngine", "RemoteEngine (Remote Script Server) initializing");
// Create all objects we'll be using
m_EventManager = new EventManager(this);
}
public void Shutdown()
{
// We are shutting down
}
#region IRegionModule
public void Initialise(Scene scene, IConfigSource config)
{
InitializeEngine(scene, MainLog.Instance);
}
public void PostInitialise()
{
}
public void Close()
{
}
public string Name
{
get { return "LSLScriptingModule"; }
}
public bool IsSharedModule
{
get { return false; }
}
#endregion
}
}

View File

@ -1151,6 +1151,39 @@
</Files> </Files>
</Project> </Project>
<Project name="OpenSim.Region.ScriptEngine.RemoteServer" path="OpenSim/Region/ScriptEngine/RemoteServer" type="Library">
<Configuration name="Debug">
<Options>
<OutputPath>../../../../bin/ScriptEngines/</OutputPath>
</Options>
</Configuration>
<Configuration name="Release">
<Options>
<OutputPath>../../../../bin/ScriptEngines/</OutputPath>
</Options>
</Configuration>
<ReferencePath>../../../../bin/</ReferencePath>
<ReferencePath>../../../../bin/ScriptEngines/</ReferencePath>
<Reference name="System" localCopy="false"/>
<Reference name="System.Data" localCopy="false"/>
<Reference name="System.Xml" localCopy="false"/>
<Reference name="System.Runtime.Remoting" localCopy="false"/>
<Reference name="OpenSim.Region.Environment" />
<Reference name="libsecondlife.dll"/>
<Reference name="RAIL.dll"/>
<Reference name="OpenSim.Framework"/>
<Reference name="OpenSim.Framework.Console"/>
<Reference name="OpenSim.Region.ScriptEngine.Common"/>
<Reference name="OpenSim.Region.Terrain.BasicTerrain"/>
<Reference name="Axiom.MathLib.dll" localCopy="false"/>
<Reference name="Nini.dll" />
<Files>
<Match pattern="*.cs" recurse="true"/>
</Files>
</Project>
<Project name="OpenSim.Grid.ScriptServer" path="OpenSim/Grid/ScriptServer" type="Exe"> <Project name="OpenSim.Grid.ScriptServer" path="OpenSim/Grid/ScriptServer" type="Exe">