From 67e12b95ea7b68f4904a7484d77ecfd787d16d0c Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Tue, 30 Oct 2007 09:05:31 +0000 Subject: * Optimized usings * Shortened type references * Removed redundant 'this' qualifier --- OpenSim/Grid/ScriptServer/Application.cs | 17 +- .../Grid/ScriptServer/Properties/AssemblyInfo.cs | 31 +-- .../ScriptServer/ScriptServer/Region/RegionBase.cs | 214 +++++++++++++++++---- .../ScriptServer/Region/RegionConnectionManager.cs | 12 +- .../ScriptServer/ScriptServer/RegionCommManager.cs | 12 +- .../ScriptEngineManager/ScriptEngineLoader.cs | 3 +- .../ScriptServer/ScriptEnginesManager.cs | 9 +- OpenSim/Grid/ScriptServer/ScriptServerMain.cs | 14 +- 8 files changed, 216 insertions(+), 96 deletions(-) (limited to 'OpenSim/Grid/ScriptServer') diff --git a/OpenSim/Grid/ScriptServer/Application.cs b/OpenSim/Grid/ScriptServer/Application.cs index 7fc9a53..e049fd7 100644 --- a/OpenSim/Grid/ScriptServer/Application.cs +++ b/OpenSim/Grid/ScriptServer/Application.cs @@ -26,25 +26,23 @@ * */ using System; -using System.Collections.Generic; -using System.Text; namespace OpenSim.Grid.ScriptServer { - class OpenScript_Main + internal class OpenScript_Main { - public static ScriptServerMain SE; - - static void Main(string[] args) + + private static void Main(string[] args) { // Application is starting SE = new ScriptServerMain(); - System.AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); + AppDomain.CurrentDomain.UnhandledException += + new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); } - static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) + private static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) { Console.WriteLine(""); Console.WriteLine("APPLICATION EXCEPTION DETECTED"); @@ -53,6 +51,5 @@ namespace OpenSim.Grid.ScriptServer Console.WriteLine("Exception:"); Console.WriteLine(e.ExceptionObject.ToString()); } - } -} +} \ No newline at end of file diff --git a/OpenSim/Grid/ScriptServer/Properties/AssemblyInfo.cs b/OpenSim/Grid/ScriptServer/Properties/AssemblyInfo.cs index 63f40d4..2886ec7 100644 --- a/OpenSim/Grid/ScriptServer/Properties/AssemblyInfo.cs +++ b/OpenSim/Grid/ScriptServer/Properties/AssemblyInfo.cs @@ -1,26 +1,28 @@ -using System.Reflection; -using System.Runtime.CompilerServices; +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.Grid.ScriptServer")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("OpenSim.Grid.ScriptServer")] -[assembly: AssemblyCopyright("Copyright © 2007")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] + +[assembly : AssemblyTitle("OpenSim.Grid.ScriptServer")] +[assembly : AssemblyDescription("")] +[assembly : AssemblyConfiguration("")] +[assembly : AssemblyCompany("")] +[assembly : AssemblyProduct("OpenSim.Grid.ScriptServer")] +[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)] + +[assembly : ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("b6861b87-5203-4040-b756-fd4774932f82")] + +[assembly : Guid("b6861b87-5203-4040-b756-fd4774932f82")] // Version information for an assembly consists of the following four values: // @@ -29,5 +31,6 @@ using System.Runtime.InteropServices; // Build Number // Revision // -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] + +[assembly : AssemblyVersion("1.0.0.0")] +[assembly : AssemblyFileVersion("1.0.0.0")] \ No newline at end of file diff --git a/OpenSim/Grid/ScriptServer/ScriptServer/Region/RegionBase.cs b/OpenSim/Grid/ScriptServer/ScriptServer/Region/RegionBase.cs index b18bda2..cb6734f 100644 --- a/OpenSim/Grid/ScriptServer/ScriptServer/Region/RegionBase.cs +++ b/OpenSim/Grid/ScriptServer/ScriptServer/Region/RegionBase.cs @@ -26,10 +26,6 @@ * */ -using System; -using System.Collections.Generic; -using System.Text; - namespace OpenSim.Grid.ScriptServer { public abstract class RegionBase @@ -73,42 +69,176 @@ namespace OpenSim.Grid.ScriptServer public event DefaultDelegate onobject_rez; public event DefaultDelegate onremote_data; public event DefaultDelegate onhttp_response; - - - public void ScriptRez() { onScriptRez(); } - public void state_entry() { onstate_entry(); } - public void state_exit() { onstate_exit(); } - public void touch_start() { ontouch_start(); } - public void touch() { ontouch(); } - public void touch_end() { ontouch_end(); } - public void collision_start() { oncollision_start(); } - public void collision() { oncollision(); } - public void collision_end() { oncollision_end(); } - public void land_collision_start() { onland_collision_start(); } - public void land_collision() { onland_collision(); } - public void land_collision_end() { onland_collision_end(); } - public void timer() { ontimer(); } - public void listen() { onlisten(); } - public void on_rez() { onon_rez(); } - public void sensor() { onsensor(); } - public void no_sensor() { onno_sensor(); } - public void control() { oncontrol(); } - public void money() { onmoney(); } - public void email() { onemail(); } - public void at_target() { onat_target(); } - public void not_at_target() { onnot_at_target(); } - public void at_rot_target() { onat_rot_target(); } - public void not_at_rot_target() { onnot_at_rot_target(); } - public void run_time_permissions() { onrun_time_permissions(); } - public void changed() { onchanged(); } - public void attach() { onattach(); } - public void dataserver() { ondataserver(); } - public void link_message() { onlink_message(); } - public void moving_start() { onmoving_start(); } - public void moving_end() { onmoving_end(); } - public void object_rez() { onobject_rez(); } - public void remote_data() { onremote_data(); } - public void http_response() { onhttp_response(); } - + + + public void ScriptRez() + { + onScriptRez(); + } + + public void state_entry() + { + onstate_entry(); + } + + public void state_exit() + { + onstate_exit(); + } + + public void touch_start() + { + ontouch_start(); + } + + public void touch() + { + ontouch(); + } + + public void touch_end() + { + ontouch_end(); + } + + public void collision_start() + { + oncollision_start(); + } + + public void collision() + { + oncollision(); + } + + public void collision_end() + { + oncollision_end(); + } + + public void land_collision_start() + { + onland_collision_start(); + } + + public void land_collision() + { + onland_collision(); + } + + public void land_collision_end() + { + onland_collision_end(); + } + + public void timer() + { + ontimer(); + } + + public void listen() + { + onlisten(); + } + + public void on_rez() + { + onon_rez(); + } + + public void sensor() + { + onsensor(); + } + + public void no_sensor() + { + onno_sensor(); + } + + public void control() + { + oncontrol(); + } + + public void money() + { + onmoney(); + } + + public void email() + { + onemail(); + } + + public void at_target() + { + onat_target(); + } + + public void not_at_target() + { + onnot_at_target(); + } + + public void at_rot_target() + { + onat_rot_target(); + } + + public void not_at_rot_target() + { + onnot_at_rot_target(); + } + + public void run_time_permissions() + { + onrun_time_permissions(); + } + + public void changed() + { + onchanged(); + } + + public void attach() + { + onattach(); + } + + public void dataserver() + { + ondataserver(); + } + + public void link_message() + { + onlink_message(); + } + + public void moving_start() + { + onmoving_start(); + } + + public void moving_end() + { + onmoving_end(); + } + + public void object_rez() + { + onobject_rez(); + } + + public void remote_data() + { + onremote_data(); + } + + public void http_response() + { + onhttp_response(); + } } -} +} \ No newline at end of file diff --git a/OpenSim/Grid/ScriptServer/ScriptServer/Region/RegionConnectionManager.cs b/OpenSim/Grid/ScriptServer/ScriptServer/Region/RegionConnectionManager.cs index fa13807..819a037 100644 --- a/OpenSim/Grid/ScriptServer/ScriptServer/Region/RegionConnectionManager.cs +++ b/OpenSim/Grid/ScriptServer/ScriptServer/Region/RegionConnectionManager.cs @@ -26,19 +26,17 @@ * */ -using System; -using System.Collections.Generic; -using System.Text; using OpenSim.Framework.Console; namespace OpenSim.Grid.ScriptServer { // Maintains connection and communication to a region - public class RegionConnectionManager: RegionBase + public class RegionConnectionManager : RegionBase { - private LogBase m_log; + private LogBase m_log; private ScriptServerMain m_ScriptServerMain; private object m_Connection; + public RegionConnectionManager(ScriptServerMain scm, LogBase logger, object Connection) { m_ScriptServerMain = scm; @@ -56,8 +54,6 @@ namespace OpenSim.Grid.ScriptServer // EVENT? DELIVER EVENT DIRECTLY TO SCRIPTENGINE touch_start(); - } - } -} +} \ No newline at end of file diff --git a/OpenSim/Grid/ScriptServer/ScriptServer/RegionCommManager.cs b/OpenSim/Grid/ScriptServer/ScriptServer/RegionCommManager.cs index ac56fbe..45bf88d 100644 --- a/OpenSim/Grid/ScriptServer/ScriptServer/RegionCommManager.cs +++ b/OpenSim/Grid/ScriptServer/ScriptServer/RegionCommManager.cs @@ -25,9 +25,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ -using System; using System.Collections.Generic; -using System.Text; using System.Threading; using OpenSim.Framework.Console; @@ -42,11 +40,13 @@ namespace OpenSim.Grid.ScriptServer private LogBase m_log; private ScriptServerMain m_ScriptServerMain; + public RegionCommManager(ScriptServerMain scm, LogBase logger) { m_ScriptServerMain = scm; m_log = logger; } + ~RegionCommManager() { Stop(); @@ -64,6 +64,7 @@ namespace OpenSim.Grid.ScriptServer listenThread.IsBackground = true; listenThread.Start(); } + /// /// Stops listening for region requests /// @@ -78,7 +79,9 @@ namespace OpenSim.Grid.ScriptServer listenThread.Abort(); listenThread.Join(1000); // Wait 1 second for thread to shut down } - catch { } + catch + { + } listenThread = null; } } @@ -97,6 +100,5 @@ namespace OpenSim.Grid.ScriptServer // TODO: FAKING A CONNECTION Regions.Add(new RegionConnectionManager(m_ScriptServerMain, m_log, null)); } - } -} +} \ No newline at end of file diff --git a/OpenSim/Grid/ScriptServer/ScriptServer/ScriptEngineManager/ScriptEngineLoader.cs b/OpenSim/Grid/ScriptServer/ScriptServer/ScriptEngineManager/ScriptEngineLoader.cs index a259b1b..3dbd42d 100644 --- a/OpenSim/Grid/ScriptServer/ScriptServer/ScriptEngineManager/ScriptEngineLoader.cs +++ b/OpenSim/Grid/ScriptServer/ScriptServer/ScriptEngineManager/ScriptEngineLoader.cs @@ -121,5 +121,4 @@ namespace OpenSim.Grid.ScriptServer return ret; } } -} - +} \ No newline at end of file diff --git a/OpenSim/Grid/ScriptServer/ScriptServer/ScriptEnginesManager.cs b/OpenSim/Grid/ScriptServer/ScriptServer/ScriptEnginesManager.cs index 4ec2b35..7b49127 100644 --- a/OpenSim/Grid/ScriptServer/ScriptServer/ScriptEnginesManager.cs +++ b/OpenSim/Grid/ScriptServer/ScriptServer/ScriptEnginesManager.cs @@ -26,9 +26,7 @@ * */ -using System; using System.Collections.Generic; -using System.Text; using OpenSim.Framework.Console; namespace OpenSim.Grid.ScriptServer @@ -46,10 +44,11 @@ namespace OpenSim.Grid.ScriptServer 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"); } + ~ScriptEngineManager() { } @@ -63,7 +62,5 @@ namespace OpenSim.Grid.ScriptServer scriptEngines.Add(sei); } } - - } -} +} \ No newline at end of file diff --git a/OpenSim/Grid/ScriptServer/ScriptServerMain.cs b/OpenSim/Grid/ScriptServer/ScriptServerMain.cs index 82035ac..1749376 100644 --- a/OpenSim/Grid/ScriptServer/ScriptServerMain.cs +++ b/OpenSim/Grid/ScriptServer/ScriptServerMain.cs @@ -26,20 +26,17 @@ * */ -using System; -using System.Collections.Generic; -using System.Text; using System.IO; -using OpenSim.Framework.Console; using OpenSim.Framework; +using OpenSim.Framework.Console; namespace OpenSim.Grid.ScriptServer { public class ScriptServerMain : conscmd_callback { private readonly string m_logFilename = ("region-console.log"); - internal RegionCommManager RegionScriptDaemon; // Listen for incoming from region - internal ScriptEngineManager ScriptEngines; // Loads scriptengines + internal RegionCommManager RegionScriptDaemon; // Listen for incoming from region + internal ScriptEngineManager ScriptEngines; // Loads scriptengines private LogBase m_log; public ScriptServerMain() @@ -48,7 +45,6 @@ namespace OpenSim.Grid.ScriptServer RegionScriptDaemon = new RegionCommManager(this, m_log); ScriptEngines = new ScriptEngineManager(this, m_log); - } ~ScriptServerMain() @@ -68,9 +64,9 @@ namespace OpenSim.Grid.ScriptServer public void RunCmd(string command, string[] cmdparams) { } + public void Show(string ShowWhat) { } - } -} +} \ No newline at end of file -- cgit v1.1