From 966f639ad6c83828d8e60ef9103ad61c360f9c3b Mon Sep 17 00:00:00 2001 From: Tedd Hansen Date: Sat, 5 Jan 2008 15:48:02 +0000 Subject: [PATCH] Changes to ScriptServer to (hopefully) make it compile on both .Net and Mono. Some debug info for startup added to find bugs. ++ --- .../LoadRegions/LoadRegionsPlugin.cs | 4 +- OpenSim/Framework/ConfigurationMember.cs | 7 + OpenSim/Grid/ScriptServer/RemotingObject.cs | 18 +- OpenSim/Region/Application/OpenSimMain.cs | 8 +- .../Communications/OGS1/OGS1GridServices.cs | 4 +- .../Common/ScriptServerInterfaces.cs | 52 ++ .../ScriptEngine/DotNetEngine/EventManager.cs | 2 +- .../ScriptEngine/RemoteServer/EventManager.cs | 513 +++++------------- .../ScriptEngine/RemoteServer/RemoteServer.cs | 7 +- .../ScriptEngine/RemoteServer/ScriptEngine.cs | 2 +- bin/OpenSim.ini.example | 2 +- prebuild.xml | 26 +- 12 files changed, 233 insertions(+), 412 deletions(-) create mode 100644 OpenSim/Region/ScriptEngine/Common/ScriptServerInterfaces.cs diff --git a/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs b/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs index b897c60617..4c1c1d2f55 100644 --- a/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs +++ b/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs @@ -63,7 +63,7 @@ namespace OpenSim.ApplicationPlugins.LoadRegions for (int i = 0; i < regionsToLoad.Length; i++) { - MainLog.Instance.Debug("LOADREGIONS", "Creating Region: " + regionsToLoad[i].RegionName); + MainLog.Instance.Debug("LOADREGIONS", "Creating Region: " + regionsToLoad[i].RegionName + " (ThreadID: " + System.Threading.Thread.CurrentThread.ManagedThreadId.ToString() + ")"); openSim.CreateRegion(regionsToLoad[i]); } @@ -93,7 +93,7 @@ namespace OpenSim.ApplicationPlugins.LoadRegions { if (regionhandle == regionsToLoad[i].RegionHandle) { - MainLog.Instance.Debug("LOADREGIONS", "Creating Region: " + regionsToLoad[i].RegionName); + MainLog.Instance.Debug("LOADREGIONS", "Creating Region: " + regionsToLoad[i].RegionName + " (ThreadID: " + System.Threading.Thread.CurrentThread.ManagedThreadId.ToString() + ")"); openSim.CreateRegion(regionsToLoad[i]); } } diff --git a/OpenSim/Framework/ConfigurationMember.cs b/OpenSim/Framework/ConfigurationMember.cs index 2def0705e0..4ae59d6e49 100644 --- a/OpenSim/Framework/ConfigurationMember.cs +++ b/OpenSim/Framework/ConfigurationMember.cs @@ -147,8 +147,15 @@ namespace OpenSim.Framework checkAndAddConfigOption(configOption); } + + // TEMP - REMOVE + private int cE = 0; public void performConfigurationRetrieve() { + if (cE > 1) + MainLog.Instance.Error("READING CONFIGURATION COUT: " + cE.ToString()); + + configurationPlugin = LoadConfigDll(configurationPluginFilename); configurationOptions.Clear(); if (loadFunction == null) diff --git a/OpenSim/Grid/ScriptServer/RemotingObject.cs b/OpenSim/Grid/ScriptServer/RemotingObject.cs index 2d5936ebea..915d0207ee 100644 --- a/OpenSim/Grid/ScriptServer/RemotingObject.cs +++ b/OpenSim/Grid/ScriptServer/RemotingObject.cs @@ -2,26 +2,26 @@ using System.Collections.Generic; using System.Text; using OpenSim.Region.Environment.Interfaces; -using OpenSim.Region.ScriptEngine.DotNetEngine; +using OpenSim.Region.ScriptEngine.Common; namespace OpenSim.Grid.ScriptServer { - public class RemotingObject : MarshalByRefObject + public class RemotingObject : MarshalByRefObject, ScriptServerInterfaces.ServerRemotingObject { // This object will be exposed over remoting. It is a singleton, so it exists only in as one instance. // Expose ScriptEngine directly for now ... this is not very secure :) // NOTE! CURRENTLY JUST HARDWIRED DOTNETENGINE! - public OpenSim.Region.ScriptEngine.DotNetEngine.ScriptEngine ScriptEngine = new OpenSim.Region.ScriptEngine.DotNetEngine.ScriptEngine(); + //private OpenSim.Region.ScriptEngine.DotNetEngine.ScriptEngine SE = + // new OpenSim.Region.ScriptEngine.DotNetEngine.ScriptEngine(); + //public OpenSim.Region.ScriptEngine.Common.ScriptServerInterfaces.RemoteEvents Events = + // (OpenSim.Region.ScriptEngine.Common.ScriptServerInterfaces.RemoteEvents)SE.m_EventManager; + //private ScriptServerInterfaces.RemoteEvents _events = new abc; - /// - /// Receives calls from remote grids. - /// - /// - public OpenSim.Region.ScriptEngine.DotNetEngine.ScriptEngine GetScriptEngine() + ScriptServerInterfaces.RemoteEvents ScriptServerInterfaces.ServerRemotingObject.Events() { - return ScriptEngine; + return null; } } } diff --git a/OpenSim/Region/Application/OpenSimMain.cs b/OpenSim/Region/Application/OpenSimMain.cs index 831db22ea2..e8453bcd50 100644 --- a/OpenSim/Region/Application/OpenSimMain.cs +++ b/OpenSim/Region/Application/OpenSimMain.cs @@ -331,8 +331,9 @@ namespace OpenSim MainLog.Instance.Verbose("PLUGINS", "Loading {0} OpenSim application plugins", nodes.Count); foreach (TypeExtensionNode node in nodes) - { - IApplicationPlugin plugin = (IApplicationPlugin) node.CreateInstance(); + { + MainLog.Instance.Verbose("PLUGINS", "Loading OpenSim application plugin: ", node.GetType().AssemblyQualifiedName.ToString()); + IApplicationPlugin plugin = (IApplicationPlugin)node.CreateInstance(); plugin.Initialise(this); m_plugins.Add(plugin); @@ -375,7 +376,10 @@ namespace OpenSim m_moduleLoader.PickupModules(scene, "."); //m_moduleLoader.PickupModules(scene, "ScriptEngines"); + //m_moduleLoader.LoadRegionModules(Path.Combine("ScriptEngines", m_scriptEngine), scene); + MainLog.Instance.Verbose("MODULES", "Loading scripting engine modules"); m_moduleLoader.LoadRegionModules(Path.Combine("ScriptEngines", m_scriptEngine), scene); + m_moduleLoader.InitialiseSharedModules(scene); diff --git a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs index 2b324f8dc8..653139d14d 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs @@ -121,8 +121,8 @@ namespace OpenSim.Region.Communications.OGS1 GridResp = GridReq.Send(serversInfo.GridURL, 10000); } catch (Exception ex) { - MainLog.Instance.Error("Unable to connect to grid (Grid server not running?): " + ex.ToString()); - return null; + MainLog.Instance.Error("Unable to connect to grid. Grid server not running?"); + throw(ex); } Hashtable GridRespData = (Hashtable)GridResp.Value; Hashtable griddatahash = GridRespData; diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptServerInterfaces.cs b/OpenSim/Region/ScriptEngine/Common/ScriptServerInterfaces.cs new file mode 100644 index 0000000000..1e8917cbed --- /dev/null +++ b/OpenSim/Region/ScriptEngine/Common/ScriptServerInterfaces.cs @@ -0,0 +1,52 @@ +using libsecondlife; +using OpenSim.Framework; + +namespace OpenSim.Region.ScriptEngine.Common +{ + public class ScriptServerInterfaces + { + public interface RemoteEvents + { + void touch_start(uint localID, LLVector3 offsetPos, IClientAPI remoteClient); + void OnRezScript(uint localID, LLUUID itemID, string script); + void OnRemoveScript(uint localID, LLUUID itemID); + void state_exit(uint localID, LLUUID itemID); + void touch(uint localID, LLUUID itemID); + void touch_end(uint localID, LLUUID itemID); + void collision_start(uint localID, LLUUID itemID); + void collision(uint localID, LLUUID itemID); + void collision_end(uint localID, LLUUID itemID); + void land_collision_start(uint localID, LLUUID itemID); + void land_collision(uint localID, LLUUID itemID); + void land_collision_end(uint localID, LLUUID itemID); + void timer(uint localID, LLUUID itemID); + void listen(uint localID, LLUUID itemID); + void on_rez(uint localID, LLUUID itemID); + void sensor(uint localID, LLUUID itemID); + void no_sensor(uint localID, LLUUID itemID); + void control(uint localID, LLUUID itemID); + void money(uint localID, LLUUID itemID); + void email(uint localID, LLUUID itemID); + void at_target(uint localID, LLUUID itemID); + void not_at_target(uint localID, LLUUID itemID); + void at_rot_target(uint localID, LLUUID itemID); + void not_at_rot_target(uint localID, LLUUID itemID); + void run_time_permissions(uint localID, LLUUID itemID); + void changed(uint localID, LLUUID itemID); + void attach(uint localID, LLUUID itemID); + void dataserver(uint localID, LLUUID itemID); + void link_message(uint localID, LLUUID itemID); + void moving_start(uint localID, LLUUID itemID); + void moving_end(uint localID, LLUUID itemID); + void object_rez(uint localID, LLUUID itemID); + void remote_data(uint localID, LLUUID itemID); + void http_response(uint localID, LLUUID itemID); + } + + public interface ServerRemotingObject + { + RemoteEvents Events(); + } + + } +} diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/EventManager.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/EventManager.cs index 16182f9d03..ad29feb51d 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/EventManager.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/EventManager.cs @@ -36,7 +36,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine /// Prepares events so they can be directly executed upon a script by EventQueueManager, then queues it. /// [Serializable] - public class EventManager + public class EventManager : OpenSim.Region.ScriptEngine.Common.ScriptServerInterfaces.RemoteEvents { // diff --git a/OpenSim/Region/ScriptEngine/RemoteServer/EventManager.cs b/OpenSim/Region/ScriptEngine/RemoteServer/EventManager.cs index 812b1c0a8a..d56c1fbd95 100644 --- a/OpenSim/Region/ScriptEngine/RemoteServer/EventManager.cs +++ b/OpenSim/Region/ScriptEngine/RemoteServer/EventManager.cs @@ -29,8 +29,7 @@ using System; using libsecondlife; using OpenSim.Framework; -using OpenSim.Grid.ScriptServer; -using OpenSim.Region.ScriptEngine.DotNetEngine; +using OpenSim.Region.ScriptEngine.Common; namespace OpenSim.Region.ScriptEngine.RemoteServer { @@ -41,7 +40,7 @@ namespace OpenSim.Region.ScriptEngine.RemoteServer internal class EventManager { - System.Collections.Generic.Dictionary remoteScript = new System.Collections.Generic.Dictionary(); + System.Collections.Generic.Dictionary remoteScript = new System.Collections.Generic.Dictionary(); private ScriptEngine myScriptEngine; @@ -61,413 +60,183 @@ namespace OpenSim.Region.ScriptEngine.RemoteServer public void OnRezScript(uint localID, LLUUID itemID, string script) { // WE ARE CREATING A NEW SCRIPT ... CREATE SCRIPT, GET A REMOTEID THAT WE MAP FROM LOCALID - OpenSim.Grid.ScriptServer.RemotingObject obj = myScriptEngine.m_RemoteServer.Connect("localhost", 1234); + myScriptEngine.Log.Verbose("RemoteEngine", "Creating new script (with connection)"); + ScriptServerInterfaces.ServerRemotingObject obj = myScriptEngine.m_RemoteServer.Connect("localhost", 1234); + remoteScript.Add(localID, obj); - try - { - remoteScript[localID].ScriptEngine.m_EventManager.OnRezScript(localID, itemID, script); - } - catch (System.NullReferenceException) - { - OpenSim.Framework.Console.MainLog.Instance.Error("SCRIPTS", "Error Connecting to Remote Script Server. Is it running?"); - } + //remoteScript[localID].Events.OnRezScript(localID, itemID, script); + } public void touch_start(uint localID, LLVector3 offsetPos, IClientAPI remoteClient) { - try - { - remoteScript[localID].ScriptEngine.m_EventManager.touch_start(localID, offsetPos, remoteClient); - } - catch (System.NullReferenceException) - { - OpenSim.Framework.Console.MainLog.Instance.Error("SCRIPTS", "Error Connecting to Remote Script Server. Is it running?"); - } + //remoteScript[localID].Events.touch_start(localID, offsetPos, remoteClient); } - public void OnRemoveScript(uint localID, LLUUID itemID) - { - try - { - remoteScript[localID].ScriptEngine.m_EventManager.OnRemoveScript(localID, itemID); - } - catch (System.NullReferenceException) - { - OpenSim.Framework.Console.MainLog.Instance.Error("SCRIPTS", "Error Connecting to Remote Script Server. Is it running?"); - } - } - public void state_exit(uint localID, LLUUID itemID) - { - try - { - remoteScript[localID].ScriptEngine.m_EventManager.state_exit(localID, itemID); - } - catch (System.NullReferenceException) - { - OpenSim.Framework.Console.MainLog.Instance.Error("SCRIPTS", "Error Connecting to Remote Script Server. Is it running?"); - } - } - public void touch(uint localID, LLUUID itemID) - { - try - { - remoteScript[localID].ScriptEngine.m_EventManager.touch(localID, itemID); - } - catch (System.NullReferenceException) - { - OpenSim.Framework.Console.MainLog.Instance.Error("SCRIPTS", "Error Connecting to Remote Script Server. Is it running?"); - } - } + // PLACEHOLDERS -- CODE WILL CHANGE! - public void touch_end(uint localID, LLUUID itemID) - { - try - { - remoteScript[localID].ScriptEngine.m_EventManager.touch_end(localID, itemID); - } - catch (System.NullReferenceException) - { - OpenSim.Framework.Console.MainLog.Instance.Error("SCRIPTS", "Error Connecting to Remote Script Server. Is it running?"); - } - } - public void collision_start(uint localID, LLUUID itemID) - { - try - { - remoteScript[localID].ScriptEngine.m_EventManager.collision_start(localID, itemID); - } - catch (System.NullReferenceException) - { - OpenSim.Framework.Console.MainLog.Instance.Error("SCRIPTS", "Error Connecting to Remote Script Server. Is it running?"); - } - } + //public void OnRemoveScript(uint localID, LLUUID itemID) + //{ + // remoteScript[localID].Events.OnRemoveScript(localID, itemID); + //} - public void collision(uint localID, LLUUID itemID) - { - try - { - remoteScript[localID].ScriptEngine.m_EventManager.collision(localID, itemID); - } - catch (System.NullReferenceException) - { - OpenSim.Framework.Console.MainLog.Instance.Error("SCRIPTS", "Error Connecting to Remote Script Server. Is it running?"); - } - } + //public void state_exit(uint localID, LLUUID itemID) + //{ + // remoteScript[localID].Events.state_exit(localID, itemID); + //} - public void collision_end(uint localID, LLUUID itemID) - { - try - { - remoteScript[localID].ScriptEngine.m_EventManager.collision_end(localID, itemID); - } - catch (System.NullReferenceException) - { - OpenSim.Framework.Console.MainLog.Instance.Error("SCRIPTS", "Error Connecting to Remote Script Server. Is it running?"); - } - } + //public void touch(uint localID, LLUUID itemID) + //{ + // remoteScript[localID].Events.touch(localID, itemID); + //} - public void land_collision_start(uint localID, LLUUID itemID) - { - try - { - remoteScript[localID].ScriptEngine.m_EventManager.land_collision_start(localID, itemID); - } - catch (System.NullReferenceException) - { - OpenSim.Framework.Console.MainLog.Instance.Error("SCRIPTS", "Error Connecting to Remote Script Server. Is it running?"); - } - } + //public void touch_end(uint localID, LLUUID itemID) + //{ + // remoteScript[localID].Events.touch_end(localID, itemID); + //} - public void land_collision(uint localID, LLUUID itemID) - { - try - { - remoteScript[localID].ScriptEngine.m_EventManager.land_collision(localID, itemID); - } - catch (System.NullReferenceException) - { - OpenSim.Framework.Console.MainLog.Instance.Error("SCRIPTS", "Error Connecting to Remote Script Server. Is it running?"); - } - } + //public void collision_start(uint localID, LLUUID itemID) + //{ + // remoteScript[localID].Events.collision_start(localID, itemID); + //} - public void land_collision_end(uint localID, LLUUID itemID) - { - try - { - remoteScript[localID].ScriptEngine.m_EventManager.land_collision_end(localID, itemID); - } - catch (System.NullReferenceException) - { - OpenSim.Framework.Console.MainLog.Instance.Error("SCRIPTS", "Error Connecting to Remote Script Server. Is it running?"); - } - } + //public void collision(uint localID, LLUUID itemID) + //{ + // remoteScript[localID].Events.collision(localID, itemID); + //} - public void timer(uint localID, LLUUID itemID) - { - try - { - remoteScript[localID].ScriptEngine.m_EventManager.timer(localID, itemID); - } - catch (System.NullReferenceException) - { - OpenSim.Framework.Console.MainLog.Instance.Error("SCRIPTS", "Error Connecting to Remote Script Server. Is it running?"); - } - } + //public void collision_end(uint localID, LLUUID itemID) + //{ + // remoteScript[localID].Events.collision_end(localID, itemID); + //} - public void listen(uint localID, LLUUID itemID) - { - try - { - remoteScript[localID].ScriptEngine.m_EventManager.listen(localID, itemID); - } - catch (System.NullReferenceException) - { - OpenSim.Framework.Console.MainLog.Instance.Error("SCRIPTS", "Error Connecting to Remote Script Server. Is it running?"); - } - } + //public void land_collision_start(uint localID, LLUUID itemID) + //{ + // remoteScript[localID].Events.land_collision_start(localID, itemID); + //} - public void on_rez(uint localID, LLUUID itemID) - { - try - { - remoteScript[localID].ScriptEngine.m_EventManager.on_rez(localID, itemID); - } - catch (System.NullReferenceException) - { - OpenSim.Framework.Console.MainLog.Instance.Error("SCRIPTS", "Error Connecting to Remote Script Server. Is it running?"); - } - } + //public void land_collision(uint localID, LLUUID itemID) + //{ + // remoteScript[localID].Events.land_collision(localID, itemID); + //} - public void sensor(uint localID, LLUUID itemID) - { - try - { - remoteScript[localID].ScriptEngine.m_EventManager.sensor(localID, itemID); - } - catch (System.NullReferenceException) - { - OpenSim.Framework.Console.MainLog.Instance.Error("SCRIPTS", "Error Connecting to Remote Script Server. Is it running?"); - } - } + //public void land_collision_end(uint localID, LLUUID itemID) + //{ + // remoteScript[localID].Events.land_collision_end(localID, itemID); + //} - public void no_sensor(uint localID, LLUUID itemID) - { - try - { - remoteScript[localID].ScriptEngine.m_EventManager.no_sensor(localID, itemID); - } - catch (System.NullReferenceException) - { - OpenSim.Framework.Console.MainLog.Instance.Error("SCRIPTS", "Error Connecting to Remote Script Server. Is it running?"); - } - } + //public void timer(uint localID, LLUUID itemID) + //{ + // remoteScript[localID].Events.timer(localID, itemID); + //} - public void control(uint localID, LLUUID itemID) - { - try - { - remoteScript[localID].ScriptEngine.m_EventManager.control(localID, itemID); - } - catch (System.NullReferenceException) - { - OpenSim.Framework.Console.MainLog.Instance.Error("SCRIPTS", "Error Connecting to Remote Script Server. Is it running?"); - } - } + //public void listen(uint localID, LLUUID itemID) + //{ + // remoteScript[localID].Events.listen(localID, itemID); + //} - public void money(uint localID, LLUUID itemID) - { - try - { - remoteScript[localID].ScriptEngine.m_EventManager.money(localID, itemID); - } - catch (System.NullReferenceException) - { - OpenSim.Framework.Console.MainLog.Instance.Error("SCRIPTS", "Error Connecting to Remote Script Server. Is it running?"); - } - } + //public void on_rez(uint localID, LLUUID itemID) + //{ + // remoteScript[localID].Events.on_rez(localID, itemID); + //} - public void email(uint localID, LLUUID itemID) - { - try - { - remoteScript[localID].ScriptEngine.m_EventManager.email(localID, itemID); - } - catch (System.NullReferenceException) - { - OpenSim.Framework.Console.MainLog.Instance.Error("SCRIPTS", "Error Connecting to Remote Script Server. Is it running?"); - } - } + //public void sensor(uint localID, LLUUID itemID) + //{ + // remoteScript[localID].Events.sensor(localID, itemID); + //} - public void at_target(uint localID, LLUUID itemID) - { - try - { - remoteScript[localID].ScriptEngine.m_EventManager.at_target(localID, itemID); - } - catch (System.NullReferenceException) - { - OpenSim.Framework.Console.MainLog.Instance.Error("SCRIPTS", "Error Connecting to Remote Script Server. Is it running?"); - } - } + //public void no_sensor(uint localID, LLUUID itemID) + //{ + // remoteScript[localID].Events.no_sensor(localID, itemID); + //} - public void not_at_target(uint localID, LLUUID itemID) - { - try - { - remoteScript[localID].ScriptEngine.m_EventManager.not_at_target(localID, itemID); - } - catch (System.NullReferenceException) - { - OpenSim.Framework.Console.MainLog.Instance.Error("SCRIPTS", "Error Connecting to Remote Script Server. Is it running?"); - } - } + //public void control(uint localID, LLUUID itemID) + //{ + // remoteScript[localID].Events.control(localID, itemID); + //} - public void at_rot_target(uint localID, LLUUID itemID) - { - try - { - remoteScript[localID].ScriptEngine.m_EventManager.at_rot_target(localID, itemID); - } - catch (System.NullReferenceException) - { - OpenSim.Framework.Console.MainLog.Instance.Error("SCRIPTS", "Error Connecting to Remote Script Server. Is it running?"); - } - } + //public void money(uint localID, LLUUID itemID) + //{ + // remoteScript[localID].Events.money(localID, itemID); + //} - public void not_at_rot_target(uint localID, LLUUID itemID) - { - try - { - remoteScript[localID].ScriptEngine.m_EventManager.not_at_rot_target(localID, itemID); - } - catch (System.NullReferenceException) - { - OpenSim.Framework.Console.MainLog.Instance.Error("SCRIPTS", "Error Connecting to Remote Script Server. Is it running?"); - } - } + //public void email(uint localID, LLUUID itemID) + //{ + // remoteScript[localID].Events.email(localID, itemID); + //} - public void run_time_permissions(uint localID, LLUUID itemID) - { - try - { - remoteScript[localID].ScriptEngine.m_EventManager.run_time_permissions(localID, itemID); - } - catch (System.NullReferenceException) - { - OpenSim.Framework.Console.MainLog.Instance.Error("SCRIPTS", "Error Connecting to Remote Script Server. Is it running?"); - } - } + //public void at_target(uint localID, LLUUID itemID) + //{ + // remoteScript[localID].Events.at_target(localID, itemID); + //} - public void changed(uint localID, LLUUID itemID) - { - try - { - remoteScript[localID].ScriptEngine.m_EventManager.changed(localID, itemID); - } - catch (System.NullReferenceException) - { - OpenSim.Framework.Console.MainLog.Instance.Error("SCRIPTS", "Error Connecting to Remote Script Server. Is it running?"); - } - } + //public void not_at_target(uint localID, LLUUID itemID) + //{ + // remoteScript[localID].Events.not_at_target(localID, itemID); + //} - public void attach(uint localID, LLUUID itemID) - { - try - { - remoteScript[localID].ScriptEngine.m_EventManager.attach(localID, itemID); - } - catch (System.NullReferenceException) - { - OpenSim.Framework.Console.MainLog.Instance.Error("SCRIPTS", "Error Connecting to Remote Script Server. Is it running?"); - } - } + //public void at_rot_target(uint localID, LLUUID itemID) + //{ + // remoteScript[localID].Events.at_rot_target(localID, itemID); + //} - public void dataserver(uint localID, LLUUID itemID) - { - try - { - remoteScript[localID].ScriptEngine.m_EventManager.dataserver(localID, itemID); - } - catch (System.NullReferenceException) - { - OpenSim.Framework.Console.MainLog.Instance.Error("SCRIPTS", "Error Connecting to Remote Script Server. Is it running?"); - } - } + //public void not_at_rot_target(uint localID, LLUUID itemID) + //{ + // remoteScript[localID].Events.not_at_rot_target(localID, itemID); + //} - public void link_message(uint localID, LLUUID itemID) - { - try - { - remoteScript[localID].ScriptEngine.m_EventManager.link_message(localID, itemID); - } - catch (System.NullReferenceException) - { - OpenSim.Framework.Console.MainLog.Instance.Error("SCRIPTS", "Error Connecting to Remote Script Server. Is it running?"); - } - } + //public void run_time_permissions(uint localID, LLUUID itemID) + //{ + // remoteScript[localID].Events.run_time_permissions(localID, itemID); + //} - public void moving_start(uint localID, LLUUID itemID) - { - try - { - remoteScript[localID].ScriptEngine.m_EventManager.moving_start(localID, itemID); - } - catch (System.NullReferenceException) - { - OpenSim.Framework.Console.MainLog.Instance.Error("SCRIPTS", "Error Connecting to Remote Script Server. Is it running?"); - } - } + //public void changed(uint localID, LLUUID itemID) + //{ + // remoteScript[localID].Events.changed(localID, itemID); + //} - public void moving_end(uint localID, LLUUID itemID) - { - try - { - remoteScript[localID].ScriptEngine.m_EventManager.moving_end(localID, itemID); - } - catch (System.NullReferenceException) - { - OpenSim.Framework.Console.MainLog.Instance.Error("SCRIPTS", "Error Connecting to Remote Script Server. Is it running?"); - } - } + //public void attach(uint localID, LLUUID itemID) + //{ + // remoteScript[localID].Events.attach(localID, itemID); + //} - public void object_rez(uint localID, LLUUID itemID) - { - try - { - remoteScript[localID].ScriptEngine.m_EventManager.object_rez(localID, itemID); - } - catch (System.NullReferenceException) - { - OpenSim.Framework.Console.MainLog.Instance.Error("SCRIPTS", "Error Connecting to Remote Script Server. Is it running?"); - } - } + //public void dataserver(uint localID, LLUUID itemID) + //{ + // remoteScript[localID].Events.dataserver(localID, itemID); + //} - public void remote_data(uint localID, LLUUID itemID) - { - try - { - remoteScript[localID].ScriptEngine.m_EventManager.remote_data(localID, itemID); - } - catch (System.NullReferenceException) - { - OpenSim.Framework.Console.MainLog.Instance.Error("SCRIPTS", "Error Connecting to Remote Script Server. Is it running?"); - } - } + //public void link_message(uint localID, LLUUID itemID) + //{ + // remoteScript[localID].Events.link_message(localID, itemID); + //} - public void http_response(uint localID, LLUUID itemID) - { - try - { - remoteScript[localID].ScriptEngine.m_EventManager.http_response(localID, itemID); - } - catch (System.NullReferenceException) - { - OpenSim.Framework.Console.MainLog.Instance.Error("SCRIPTS", "Error Connecting to Remote Script Server. Is it running?"); - } - } + //public void moving_start(uint localID, LLUUID itemID) + //{ + // remoteScript[localID].Events.moving_start(localID, itemID); + //} + + //public void moving_end(uint localID, LLUUID itemID) + //{ + // remoteScript[localID].Events.moving_end(localID, itemID); + //} + + //public void object_rez(uint localID, LLUUID itemID) + //{ + // remoteScript[localID].Events.object_rez(localID, itemID); + //} + + //public void remote_data(uint localID, LLUUID itemID) + //{ + // remoteScript[localID].Events.remote_data(localID, itemID); + //} + + //public void http_response(uint localID, LLUUID itemID) + //{ + // remoteScript[localID].Events.http_response(localID, itemID); + //} } } \ No newline at end of file diff --git a/OpenSim/Region/ScriptEngine/RemoteServer/RemoteServer.cs b/OpenSim/Region/ScriptEngine/RemoteServer/RemoteServer.cs index 3c88c4181a..6fc6c5c21a 100644 --- a/OpenSim/Region/ScriptEngine/RemoteServer/RemoteServer.cs +++ b/OpenSim/Region/ScriptEngine/RemoteServer/RemoteServer.cs @@ -4,6 +4,7 @@ using System.Text; using System.Runtime.Remoting; using System.Runtime.Remoting.Channels; using System.Runtime.Remoting.Channels.Tcp; +using OpenSim.Region.ScriptEngine.Common; namespace OpenSim.Region.ScriptEngine.RemoteServer { @@ -12,7 +13,7 @@ namespace OpenSim.Region.ScriptEngine.RemoteServer // Handles connections to servers // Create and returns server object - public OpenSim.Grid.ScriptServer.RemotingObject Connect(string hostname, int port) + public ScriptServerInterfaces.ServerRemotingObject Connect(string hostname, int port) { // Create a channel for communicating w/ the remote object // Notice no port is specified on the client @@ -29,8 +30,8 @@ namespace OpenSim.Region.ScriptEngine.RemoteServer { // Create an instance of the remote object - OpenSim.Grid.ScriptServer.RemotingObject obj = (OpenSim.Grid.ScriptServer.RemotingObject)Activator.GetObject( - typeof(OpenSim.Grid.ScriptServer.RemotingObject), + ScriptServerInterfaces.ServerRemotingObject obj = (ScriptServerInterfaces.ServerRemotingObject)Activator.GetObject( + typeof(ScriptServerInterfaces.ServerRemotingObject), "tcp://" + hostname + ":" + port + "/DotNetEngine"); // Use the object diff --git a/OpenSim/Region/ScriptEngine/RemoteServer/ScriptEngine.cs b/OpenSim/Region/ScriptEngine/RemoteServer/ScriptEngine.cs index 9d3b98908b..d0dc7ab394 100644 --- a/OpenSim/Region/ScriptEngine/RemoteServer/ScriptEngine.cs +++ b/OpenSim/Region/ScriptEngine/RemoteServer/ScriptEngine.cs @@ -92,7 +92,7 @@ namespace OpenSim.Region.ScriptEngine.RemoteServer public string Name { - get { return "LSLScriptingModule"; } + get { return "RemoteServerScriptingModule"; } } public bool IsSharedModule diff --git a/bin/OpenSim.ini.example b/bin/OpenSim.ini.example index e081d4e8cf..08ce5cdd62 100644 --- a/bin/OpenSim.ini.example +++ b/bin/OpenSim.ini.example @@ -44,7 +44,7 @@ verbose = true ; ScriptEngine script_engine = OpenSim.Region.ScriptEngine.DotNetEngine.dll ;Experimental remote ScriptServer plugin: -;script_engine = OpenSim.Region.ScriptEngine.RemoteEngine.dll +;script_engine = OpenSim.Region.ScriptEngine.RemoteServer.dll ; if you would like to allow prim to be physical and move by physics with the physical checkbox in the client set this to true. diff --git a/prebuild.xml b/prebuild.xml index b65466c165..ad726bdf13 100644 --- a/prebuild.xml +++ b/prebuild.xml @@ -1140,6 +1140,8 @@ + + @@ -1195,7 +1197,7 @@ ../../../bin/ - ../../../bin/ScriptEngines/ + ../../../bin/ScriptEngines/ @@ -1206,13 +1208,6 @@ - - - - @@ -1223,6 +1218,7 @@ + @@ -1243,21 +1239,13 @@ - - - - - - - - + + +