From 5b8620d82fa1fa17bcd8b2ff6050c58d34509c77 Mon Sep 17 00:00:00 2001 From: Tedd Hansen Date: Sun, 30 Dec 2007 22:57:27 +0000 Subject: [PATCH] Comments + fix = in theory stand alone script server + "RemoteSevrver" ScriptEngine (as opposed to "DotNetEngine") should work for a single region. It will however not work because it doesn't have two-way communication. --- OpenSim/Grid/ScriptServer/RemotingObject.cs | 3 ++- OpenSim/Grid/ScriptServer/ScriptServerMain.cs | 15 ++++++++++++--- .../ScriptEngine/RemoteServer/EventManager.cs | 1 + .../ScriptEngine/RemoteServer/RemoteServer.cs | 2 ++ .../ScriptEngine/RemoteServer/ScriptEngine.cs | 4 ++-- 5 files changed, 19 insertions(+), 6 deletions(-) diff --git a/OpenSim/Grid/ScriptServer/RemotingObject.cs b/OpenSim/Grid/ScriptServer/RemotingObject.cs index f095ca4e45..4c5a1762f4 100644 --- a/OpenSim/Grid/ScriptServer/RemotingObject.cs +++ b/OpenSim/Grid/ScriptServer/RemotingObject.cs @@ -9,7 +9,8 @@ namespace OpenSim.Grid.ScriptServer { // This object will be exposed over remoting. It is a singleton, so it exists only in as one instance. - // Expose ScriptEngine + // 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(); /// diff --git a/OpenSim/Grid/ScriptServer/ScriptServerMain.cs b/OpenSim/Grid/ScriptServer/ScriptServerMain.cs index 17493769dc..8bba38a80e 100644 --- a/OpenSim/Grid/ScriptServer/ScriptServerMain.cs +++ b/OpenSim/Grid/ScriptServer/ScriptServerMain.cs @@ -34,17 +34,26 @@ namespace OpenSim.Grid.ScriptServer { public class ScriptServerMain : conscmd_callback { + // + // Root object. Creates objects used. + // + private int listenPort = 1234; private readonly string m_logFilename = ("region-console.log"); - internal RegionCommManager RegionScriptDaemon; // Listen for incoming from region - internal ScriptEngineManager ScriptEngines; // Loads scriptengines private LogBase m_log; + // Objects we use + internal RegionCommManager RegionScriptDaemon; // Listen for incoming from region + //internal ScriptEngineManager ScriptEngines; // Loads scriptengines + internal RemotingServer m_RemotingServer; + public ScriptServerMain() { m_log = CreateLog(); RegionScriptDaemon = new RegionCommManager(this, m_log); - ScriptEngines = new ScriptEngineManager(this, m_log); + //ScriptEngines = new ScriptEngineManager(this, m_log); + m_RemotingServer = new RemotingServer(); + m_RemotingServer.CreateServer(listenPort, "DotNetEngine"); } ~ScriptServerMain() diff --git a/OpenSim/Region/ScriptEngine/RemoteServer/EventManager.cs b/OpenSim/Region/ScriptEngine/RemoteServer/EventManager.cs index f0a3aa1cad..d539dc47c1 100644 --- a/OpenSim/Region/ScriptEngine/RemoteServer/EventManager.cs +++ b/OpenSim/Region/ScriptEngine/RemoteServer/EventManager.cs @@ -33,6 +33,7 @@ using OpenSim.Framework; namespace OpenSim.Region.ScriptEngine.RemoteServer { /// + /// Handles events from OpenSim. Uses RemoteServer to send commands. /// [Serializable] internal class EventManager diff --git a/OpenSim/Region/ScriptEngine/RemoteServer/RemoteServer.cs b/OpenSim/Region/ScriptEngine/RemoteServer/RemoteServer.cs index 423e6be948..1a528c843b 100644 --- a/OpenSim/Region/ScriptEngine/RemoteServer/RemoteServer.cs +++ b/OpenSim/Region/ScriptEngine/RemoteServer/RemoteServer.cs @@ -9,6 +9,8 @@ namespace OpenSim.Region.ScriptEngine.RemoteServer { class RemoteServer { + // Handles connections to servers + // Create and returns server object public OpenSim.Grid.ScriptServer.RemotingObject Connect(string hostname, int port) { diff --git a/OpenSim/Region/ScriptEngine/RemoteServer/ScriptEngine.cs b/OpenSim/Region/ScriptEngine/RemoteServer/ScriptEngine.cs index 679d5d41c2..1853b65be2 100644 --- a/OpenSim/Region/ScriptEngine/RemoteServer/ScriptEngine.cs +++ b/OpenSim/Region/ScriptEngine/RemoteServer/ScriptEngine.cs @@ -35,7 +35,7 @@ using OpenSim.Region.Environment.Scenes; namespace OpenSim.Region.ScriptEngine.RemoteServer { /// - /// This is the root object for ScriptEngine. Objects access each other trough this class. + /// This is the root object for RemoteServer. Objects access each other trough this class. /// /// [Serializable] @@ -43,7 +43,7 @@ namespace OpenSim.Region.ScriptEngine.RemoteServer { internal Scene World; internal EventManager m_EventManager; // Handles and queues incoming events from OpenSim - internal RemoteServer m_RemoteServer; + internal RemoteServer m_RemoteServer; // Handles connections to remote servers private LogBase m_log;