aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Grid/ScriptServer
diff options
context:
space:
mode:
authorTedd Hansen2007-10-05 19:56:44 +0000
committerTedd Hansen2007-10-05 19:56:44 +0000
commit6dd923b01d6864ffcb17030c9de17224f45b4c2a (patch)
tree83d00d90a13f6803b38988049096296caf9f4c17 /OpenSim/Grid/ScriptServer
parentCode from Illumious Beltran (IBM) implementing more LSL (diff)
downloadopensim-SC_OLD-6dd923b01d6864ffcb17030c9de17224f45b4c2a.zip
opensim-SC_OLD-6dd923b01d6864ffcb17030c9de17224f45b4c2a.tar.gz
opensim-SC_OLD-6dd923b01d6864ffcb17030c9de17224f45b4c2a.tar.bz2
opensim-SC_OLD-6dd923b01d6864ffcb17030c9de17224f45b4c2a.tar.xz
Some more work on new ScriptEngine.
Diffstat (limited to 'OpenSim/Grid/ScriptServer')
-rw-r--r--OpenSim/Grid/ScriptServer/ScriptServer/Region/RegionBase.cs86
-rw-r--r--OpenSim/Grid/ScriptServer/ScriptServer/Region/RegionConnectionManager.cs29
-rw-r--r--OpenSim/Grid/ScriptServer/ScriptServer/RegionCommManager.cs5
-rw-r--r--OpenSim/Grid/ScriptServer/ScriptServer/ScriptEngineManager/ScriptEngineInterface.cs2
4 files changed, 115 insertions, 7 deletions
diff --git a/OpenSim/Grid/ScriptServer/ScriptServer/Region/RegionBase.cs b/OpenSim/Grid/ScriptServer/ScriptServer/Region/RegionBase.cs
new file mode 100644
index 0000000..8138728
--- /dev/null
+++ b/OpenSim/Grid/ScriptServer/ScriptServer/Region/RegionBase.cs
@@ -0,0 +1,86 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4
5namespace OpenSim.Grid.ScriptServer
6{
7 public abstract class RegionBase
8 {
9 // These are events that the region needs to have
10
11 // TEMP: Using System.Delegate -- needs replacing with a real delegate
12 public delegate void DefaultDelegate();
13
14 public event DefaultDelegate onScriptRez;
15 public event DefaultDelegate onstate_entry;
16 public event DefaultDelegate onstate_exit;
17 public event DefaultDelegate ontouch_start;
18 public event DefaultDelegate ontouch;
19 public event DefaultDelegate ontouch_end;
20 public event DefaultDelegate oncollision_start;
21 public event DefaultDelegate oncollision;
22 public event DefaultDelegate oncollision_end;
23 public event DefaultDelegate onland_collision_start;
24 public event DefaultDelegate onland_collision;
25 public event DefaultDelegate onland_collision_end;
26 public event DefaultDelegate ontimer;
27 public event DefaultDelegate onlisten;
28 public event DefaultDelegate onon_rez;
29 public event DefaultDelegate onsensor;
30 public event DefaultDelegate onno_sensor;
31 public event DefaultDelegate oncontrol;
32 public event DefaultDelegate onmoney;
33 public event DefaultDelegate onemail;
34 public event DefaultDelegate onat_target;
35 public event DefaultDelegate onnot_at_target;
36 public event DefaultDelegate onat_rot_target;
37 public event DefaultDelegate onnot_at_rot_target;
38 public event DefaultDelegate onrun_time_permissions;
39 public event DefaultDelegate onchanged;
40 public event DefaultDelegate onattach;
41 public event DefaultDelegate ondataserver;
42 public event DefaultDelegate onlink_message;
43 public event DefaultDelegate onmoving_start;
44 public event DefaultDelegate onmoving_end;
45 public event DefaultDelegate onobject_rez;
46 public event DefaultDelegate onremote_data;
47 public event DefaultDelegate onhttp_response;
48
49
50 public void ScriptRez() { onScriptRez(); }
51 public void state_entry() { onstate_entry(); }
52 public void state_exit() { onstate_exit(); }
53 public void touch_start() { ontouch_start(); }
54 public void touch() { ontouch(); }
55 public void touch_end() { ontouch_end(); }
56 public void collision_start() { oncollision_start(); }
57 public void collision() { oncollision(); }
58 public void collision_end() { oncollision_end(); }
59 public void land_collision_start() { onland_collision_start(); }
60 public void land_collision() { onland_collision(); }
61 public void land_collision_end() { onland_collision_end(); }
62 public void timer() { ontimer(); }
63 public void listen() { onlisten(); }
64 public void on_rez() { onon_rez(); }
65 public void sensor() { onsensor(); }
66 public void no_sensor() { onno_sensor(); }
67 public void control() { oncontrol(); }
68 public void money() { onmoney(); }
69 public void email() { onemail(); }
70 public void at_target() { onat_target(); }
71 public void not_at_target() { onnot_at_target(); }
72 public void at_rot_target() { onat_rot_target(); }
73 public void not_at_rot_target() { onnot_at_rot_target(); }
74 public void run_time_permissions() { onrun_time_permissions(); }
75 public void changed() { onchanged(); }
76 public void attach() { onattach(); }
77 public void dataserver() { ondataserver(); }
78 public void link_message() { onlink_message(); }
79 public void moving_start() { onmoving_start(); }
80 public void moving_end() { onmoving_end(); }
81 public void object_rez() { onobject_rez(); }
82 public void remote_data() { onremote_data(); }
83 public void http_response() { onhttp_response(); }
84
85 }
86}
diff --git a/OpenSim/Grid/ScriptServer/ScriptServer/Region/RegionConnectionManager.cs b/OpenSim/Grid/ScriptServer/ScriptServer/Region/RegionConnectionManager.cs
index e808f82..09e6f7b 100644
--- a/OpenSim/Grid/ScriptServer/ScriptServer/Region/RegionConnectionManager.cs
+++ b/OpenSim/Grid/ScriptServer/ScriptServer/Region/RegionConnectionManager.cs
@@ -1,15 +1,34 @@
1using System; 1using System;
2using System.Collections.Generic; 2using System.Collections.Generic;
3using System.Text; 3using System.Text;
4using OpenSim.Framework.Console;
4 5
5namespace OpenSim.Grid.ScriptServer 6namespace OpenSim.Grid.ScriptServer
6{ 7{
7 // Maintains connection and communication to a region 8 // Maintains connection and communication to a region
8 internal class RegionConnectionManager 9 public class RegionConnectionManager: RegionBase
9 { 10 {
10 11 private LogBase m_log;
11 public RegionConnectionManager() 12 private ScriptServerMain m_ScriptServerMain;
13 private object m_Connection;
14 public RegionConnectionManager(ScriptServerMain scm, LogBase logger, object Connection)
12 { 15 {
16 m_ScriptServerMain = scm;
17 m_log = logger;
18 m_Connection = Connection;
19 }
20
21 private void DataReceived(object objectID, object scriptID)
22 {
23 // TODO: HOW DO WE RECEIVE DATA? ASYNC?
24 // ANYHOW WE END UP HERE?
25
26 // NEW SCRIPT? ASK SCRIPTENGINE TO INITIALIZE IT
27 ScriptRez();
28
29 // EVENT? DELIVER EVENT DIRECTLY TO SCRIPTENGINE
30 touch_start();
31
13 } 32 }
14 33
15 } 34 }
diff --git a/OpenSim/Grid/ScriptServer/ScriptServer/RegionCommManager.cs b/OpenSim/Grid/ScriptServer/ScriptServer/RegionCommManager.cs
index c6564ad..63701db 100644
--- a/OpenSim/Grid/ScriptServer/ScriptServer/RegionCommManager.cs
+++ b/OpenSim/Grid/ScriptServer/ScriptServer/RegionCommManager.cs
@@ -38,7 +38,7 @@ namespace OpenSim.Grid.ScriptServer
38 { 38 {
39 private Thread listenThread; 39 private Thread listenThread;
40 40
41 private List<RegionConnectionManager> Regions = new List<RegionConnectionManager>(); 41 private List<RegionConnectionManager> Regions = new List<RegionConnectionManager>();
42 42
43 private LogBase m_log; 43 private LogBase m_log;
44 private ScriptServerMain m_ScriptServerMain; 44 private ScriptServerMain m_ScriptServerMain;
@@ -93,6 +93,9 @@ namespace OpenSim.Grid.ScriptServer
93 // ~ ask scriptengines if they will accept script? 93 // ~ ask scriptengines if they will accept script?
94 // - Add script to shared communication channel towards that region 94 // - Add script to shared communication channel towards that region
95 95
96
97 // TODO: FAKING A CONNECTION
98 Regions.Add(new RegionConnectionManager(m_ScriptServerMain, m_log, null));
96 } 99 }
97 100
98 } 101 }
diff --git a/OpenSim/Grid/ScriptServer/ScriptServer/ScriptEngineManager/ScriptEngineInterface.cs b/OpenSim/Grid/ScriptServer/ScriptServer/ScriptEngineManager/ScriptEngineInterface.cs
index 7440bcb..ba82866 100644
--- a/OpenSim/Grid/ScriptServer/ScriptServer/ScriptEngineManager/ScriptEngineInterface.cs
+++ b/OpenSim/Grid/ScriptServer/ScriptServer/ScriptEngineManager/ScriptEngineInterface.cs
@@ -31,7 +31,7 @@ namespace OpenSim.Grid.ScriptServer
31{ 31{
32 public interface ScriptEngineInterface 32 public interface ScriptEngineInterface
33 { 33 {
34 //void InitializeEngine(Scene Sceneworld, LogBase logger); 34 void InitializeEngine(RegionConnectionManager Region, LogBase logger);
35 void Shutdown(); 35 void Shutdown();
36// void StartScript(string ScriptID, IScriptHost ObjectID); 36// void StartScript(string ScriptID, IScriptHost ObjectID);
37 } 37 }