mirror of
https://github.com/opensim/opensim.git
synced 2026-08-03 07:26:16 +08:00
* Optimized usings
* Shortened type references * Removed redundant 'this' qualifier
This commit is contained in:
@@ -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());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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")]
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Stops listening for region requests
|
||||
/// </summary>
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -121,5 +121,4 @@ namespace OpenSim.Grid.ScriptServer
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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)
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user