* Cleaning code still.

This commit is contained in:
Adam Frisby
2008-05-01 16:41:01 +00:00
parent c803e0cca1
commit fc6c4dc399
41 changed files with 845 additions and 809 deletions

View File

@@ -39,7 +39,7 @@ namespace OpenSim.Grid.ScriptServer
XmlConfigurator.Configure();
AppDomain.CurrentDomain.UnhandledException +=
new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
CurrentDomain_UnhandledException;
// Application is starting
SE = new ScriptServerMain();
@@ -50,9 +50,9 @@ namespace OpenSim.Grid.ScriptServer
Console.WriteLine(String.Empty);
Console.WriteLine("APPLICATION EXCEPTION DETECTED");
Console.WriteLine(String.Empty);
Console.WriteLine("Application is terminating: " + e.IsTerminating.ToString());
Console.WriteLine("Application is terminating: " + e.IsTerminating);
//Console.WriteLine("Exception:");
//Console.WriteLine(e.ExceptionObject.ToString());
}
}
}
}

View File

@@ -34,7 +34,7 @@ using OpenSim.Region.Environment.Scenes;
namespace OpenSim.Grid.ScriptServer
{
public class FakeScene: Scene
public class FakeScene : Scene
{
public FakeScene(RegionInfo regInfo, AgentCircuitManager authen, PermissionManager permissionManager,
CommunicationsManager commsMan, SceneCommunicationService sceneGridService,
@@ -48,4 +48,4 @@ namespace OpenSim.Grid.ScriptServer
// What does a scene have to do? :P
}
}
}

View File

@@ -60,4 +60,4 @@ using System.Runtime.InteropServices;
//
[assembly : AssemblyVersion("1.0.0.0")]
[assembly : AssemblyFileVersion("1.0.0.0")]
[assembly : AssemblyFileVersion("1.0.0.0")]

View File

@@ -34,9 +34,13 @@ namespace OpenSim.Grid.ScriptServer
{
// This object will be exposed over remoting. It is a singleton, so it exists only in as one instance.
#region ServerRemotingObject Members
ScriptServerInterfaces.RemoteEvents ScriptServerInterfaces.ServerRemotingObject.Events()
{
return ScriptServerMain.Engine.EventManager();
}
#endregion
}
}
}

View File

@@ -31,9 +31,10 @@ using System.Runtime.Remoting.Channels.Tcp;
namespace OpenSim.Grid.ScriptServer
{
class RemotingServer
internal class RemotingServer
{
TcpChannel channel;
private readonly TcpChannel channel;
public RemotingServer(int port, string instanceName)
{
// Create an instance of a channel
@@ -42,9 +43,9 @@ namespace OpenSim.Grid.ScriptServer
// Register as an available service with the name HelloWorld
RemotingConfiguration.RegisterWellKnownServiceType(
typeof(RemotingObject),
typeof (RemotingObject),
instanceName,
WellKnownObjectMode.Singleton);
}
}
}
}

View File

@@ -32,8 +32,13 @@ namespace OpenSim.Grid.ScriptServer.ScriptServer.Region
// These are events that the region needs to have
// TEMP: Using System.Delegate -- needs replacing with a real delegate
#region Delegates
public delegate void DefaultDelegate();
#endregion
public event DefaultDelegate onScriptRez;
public event DefaultDelegate onstate_entry;
public event DefaultDelegate onstate_exit;

View File

@@ -29,8 +29,8 @@ namespace OpenSim.Grid.ScriptServer.ScriptServer.Region
{
public class RegionConnectionManager : RegionBase
{
private ScriptServerMain m_ScriptServerMain;
private object m_Connection;
private ScriptServerMain m_ScriptServerMain;
public RegionConnectionManager(ScriptServerMain scm, object Connection)
{

View File

@@ -34,12 +34,10 @@ namespace OpenSim.Grid.ScriptServer.ScriptServer
{
internal class RegionCommManager
{
private readonly ScriptServerMain m_ScriptServerMain;
private readonly List<RegionConnectionManager> Regions = new List<RegionConnectionManager>();
private Thread listenThread;
private List<RegionConnectionManager> Regions = new List<RegionConnectionManager>();
private ScriptServerMain m_ScriptServerMain;
public RegionCommManager(ScriptServerMain scm)
{
m_ScriptServerMain = scm;

View File

@@ -51,7 +51,7 @@ namespace OpenSim.Grid.ScriptServer.ScriptServer
{
m_log.Error("[ScriptEngine]: " +
"Error loading assembly \"" + EngineName + "\": " + e.Message + ", " +
e.StackTrace.ToString());
e.StackTrace);
}
return ret;
}
@@ -104,7 +104,7 @@ namespace OpenSim.Grid.ScriptServer.ScriptServer
ScriptServerInterfaces.ScriptEngine ret;
//try
//{
ret = (ScriptServerInterfaces.ScriptEngine)Activator.CreateInstance(t);
ret = (ScriptServerInterfaces.ScriptEngine) Activator.CreateInstance(t);
//}
//catch (Exception e)
//{
@@ -114,4 +114,4 @@ namespace OpenSim.Grid.ScriptServer.ScriptServer
return ret;
}
}
}
}

View File

@@ -32,8 +32,8 @@ namespace OpenSim.Grid.ScriptServer.ScriptServer
{
internal class ScriptEngineManager
{
private ScriptEngineLoader ScriptEngineLoader;
private List<ScriptServerInterfaces.ScriptEngine> scriptEngines = new List<ScriptServerInterfaces.ScriptEngine>();
private readonly ScriptEngineLoader ScriptEngineLoader;
private readonly List<ScriptServerInterfaces.ScriptEngine> scriptEngines = new List<ScriptServerInterfaces.ScriptEngine>();
private ScriptServerMain m_ScriptServerMain;
// Initialize
@@ -58,4 +58,4 @@ namespace OpenSim.Grid.ScriptServer.ScriptServer
return sei;
}
}
}
}

View File

@@ -44,20 +44,20 @@ namespace OpenSim.Grid.ScriptServer
//
// Root object. Creates objects used.
//
private int listenPort = 8010;
// TEMP
public static ScriptServerInterfaces.ScriptEngine Engine;
private int listenPort = 8010;
//public static FakeScene m_Scene = new FakeScene(null,null,null,null,null,null,null,null,null,false, false, false);
// Objects we use
internal RegionCommManager RegionScriptDaemon; // Listen for incoming from region
internal ScriptEngineManager ScriptEngines; // Loads scriptengines
//internal RemotingServer m_RemotingServer;
internal TCPServer m_TCPServer;
internal RegionCommManager RegionScriptDaemon; // Listen for incoming from region
internal TRPC_Remote RPC;
internal ScriptEngineManager ScriptEngines; // Loads scriptengines
public ScriptServerMain()
public ScriptServerMain()
{
m_console = CreateConsole();
@@ -68,13 +68,13 @@ namespace OpenSim.Grid.ScriptServer
Engine = ScriptEngines.LoadEngine("DotNetEngine");
Engine.InitializeEngine(null, null, false, Engine.GetScriptManager());
// Set up server
//m_RemotingServer = new RemotingServer(listenPort, "DotNetEngine");
m_TCPServer = new TCPServer(listenPort);
RPC = new TRPC_Remote(m_TCPServer);
RPC.ReceiveCommand += new TRPC_Remote.ReceiveCommandDelegate(RPC_ReceiveCommand);
RPC.ReceiveCommand += RPC_ReceiveCommand;
m_TCPServer.StartListen();
Console.ReadLine();
@@ -93,7 +93,7 @@ namespace OpenSim.Grid.ScriptServer
if (Command == "OnRezScript")
{
Engine.EventManager().OnRezScript((uint)p[0], new LLUUID((string)p[1]), (string)p[2]);
Engine.EventManager().OnRezScript((uint) p[0], new LLUUID((string) p[1]), (string) p[2]);
}
}
@@ -106,4 +106,4 @@ namespace OpenSim.Grid.ScriptServer
return new ConsoleBase("ScriptServer", this);
}
}
}
}