More structural changes to new SE

afrisby
Tedd Hansen 2007-09-24 13:57:16 +00:00
parent 323234f82a
commit 0eac34b7ab
6 changed files with 61 additions and 34 deletions

View File

@ -5,7 +5,7 @@ using System.Text;
namespace OpenSim.Grid.ScriptServer namespace OpenSim.Grid.ScriptServer
{ {
// Maintains connection and communication to a region // Maintains connection and communication to a region
class RegionConnectionManager internal class RegionConnectionManager
{ {
public RegionConnectionManager() public RegionConnectionManager()

View File

@ -29,20 +29,25 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Text; using System.Text;
using System.Threading; using System.Threading;
using OpenSim.Framework.Console;
namespace OpenSim.Grid.ScriptServer namespace OpenSim.Grid.ScriptServer
{ {
// Waiting for incoming script requests from region // Waiting for incoming script requests from region
internal class RegionScriptDaemon internal class RegionCommManager
{ {
private Thread listenThread; private Thread listenThread;
public ScriptServerMain m_ScriptServer; private List<RegionConnectionManager> Regions = new List<RegionConnectionManager>();
public RegionScriptDaemon(ScriptServerMain scriptServer)
private LogBase m_log;
private ScriptServerMain m_ScriptServerMain;
public RegionCommManager(ScriptServerMain scm, LogBase logger)
{ {
m_ScriptServer = scriptServer; m_ScriptServerMain = scm;
m_log = logger;
} }
~RegionScriptDaemon() ~RegionCommManager()
{ {
Stop(); Stop();
} }

View File

@ -1,19 +0,0 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace OpenSim.Grid.ScriptServer
{
// Maintains all regions
class RegionsManager
{
private List<RegionConnectionManager> Regions = new List<RegionConnectionManager>();
public ScriptServerMain m_ScriptServer;
public RegionsManager(ScriptServerMain scriptServer)
{
m_ScriptServer = scriptServer;
}
}
}

View File

@ -32,13 +32,14 @@ using OpenSim.Framework.Console;
namespace OpenSim.Grid.ScriptServer namespace OpenSim.Grid.ScriptServer
{ {
public class ScriptEngineLoader internal class ScriptEngineLoader
{ {
private LogBase m_log; private LogBase m_log;
public ScriptEngineLoader(LogBase logger) public ScriptEngineLoader(LogBase logger)
{ {
m_log = logger; m_log = logger;
} }
public ScriptEngineInterface LoadScriptEngine(string EngineName) public ScriptEngineInterface LoadScriptEngine(string EngineName)

View File

@ -0,0 +1,41 @@
using System;
using System.Collections.Generic;
using System.Text;
using OpenSim.Framework.Console;
namespace OpenSim.Grid.ScriptServer
{
internal class ScriptEngines
{
private LogBase m_log;
private ScriptEngineLoader ScriptEngineLoader;
private List<ScriptEngineInterface> scriptEngines = new List<ScriptEngineInterface>();
private ScriptServerMain m_ScriptServerMain;
// Initialize
public ScriptEngines(ScriptServerMain scm, LogBase logger)
{
m_ScriptServerMain = scm;
m_log = logger;
ScriptEngineLoader = new ScriptEngineLoader(m_log);
// Temp - we should not load during initialize... Loading should be done later.
LoadEngine("DotNetScriptEngine");
}
~ScriptEngines()
{
}
public void LoadEngine(string engineName)
{
// Load and add to list of ScriptEngines
ScriptEngineInterface sei = ScriptEngineLoader.LoadScriptEngine(engineName);
if (sei != null)
{
scriptEngines.Add(sei);
}
}
}
}

View File

@ -7,21 +7,20 @@ using OpenSim.Framework.Utilities;
namespace OpenSim.Grid.ScriptServer namespace OpenSim.Grid.ScriptServer
{ {
class ScriptServerMain : conscmd_callback public class ScriptServerMain : conscmd_callback
{ {
private readonly string m_logFilename = ("region-console.log"); private readonly string m_logFilename = ("region-console.log");
public RegionScriptDaemon RegionScriptDaemon; // Listen for incoming from region internal RegionCommManager RegionScriptDaemon; // Listen for incoming from region
public RegionsManager RegionManager; // Handle regions internal ScriptEngines ScriptEngines; // Loads scriptengines
public ScriptEngineLoader ScriptEngineLoader; // Loads scriptengines
private LogBase m_log; private LogBase m_log;
public ScriptServerMain() public ScriptServerMain()
{ {
m_log = CreateLog(); m_log = CreateLog();
RegionScriptDaemon = new RegionScriptDaemon(this); RegionScriptDaemon = new RegionCommManager(this, m_log);
RegionManager = new RegionsManager(this); ScriptEngines = new ScriptEngines(this, m_log);
ScriptEngineLoader = new ScriptEngineLoader(m_log);
} }
~ScriptServerMain() ~ScriptServerMain()