diff options
author | Tedd Hansen | 2007-12-30 22:37:07 +0000 |
---|---|---|
committer | Tedd Hansen | 2007-12-30 22:37:07 +0000 |
commit | 6055db2bc3beadcfd3e06c74b0fffb42ae4545a7 (patch) | |
tree | debac78168e81bc1995c39ffd8134f61613652c1 | |
parent | Add an extra check that we don't create new inventory folders for a user that... (diff) | |
download | opensim-SC-6055db2bc3beadcfd3e06c74b0fffb42ae4545a7.zip opensim-SC-6055db2bc3beadcfd3e06c74b0fffb42ae4545a7.tar.gz opensim-SC-6055db2bc3beadcfd3e06c74b0fffb42ae4545a7.tar.bz2 opensim-SC-6055db2bc3beadcfd3e06c74b0fffb42ae4545a7.tar.xz |
server->script event path almost ready for remote scriptengine (translation table between local script ID and remote script ID missing)
7 files changed, 179 insertions, 85 deletions
diff --git a/OpenSim/Grid/ScriptServer/RemotingObject.cs b/OpenSim/Grid/ScriptServer/RemotingObject.cs new file mode 100644 index 0000000..f095ca4 --- /dev/null +++ b/OpenSim/Grid/ScriptServer/RemotingObject.cs | |||
@@ -0,0 +1,24 @@ | |||
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using System.Text; | ||
4 | using OpenSim.Region.Environment.Interfaces; | ||
5 | |||
6 | namespace OpenSim.Grid.ScriptServer | ||
7 | { | ||
8 | public class RemotingObject : MarshalByRefObject | ||
9 | { | ||
10 | // This object will be exposed over remoting. It is a singleton, so it exists only in as one instance. | ||
11 | |||
12 | // Expose ScriptEngine | ||
13 | public OpenSim.Region.ScriptEngine.DotNetEngine.ScriptEngine ScriptEngine = new OpenSim.Region.ScriptEngine.DotNetEngine.ScriptEngine(); | ||
14 | |||
15 | /// <summary> | ||
16 | /// Receives calls from remote grids. | ||
17 | /// </summary> | ||
18 | /// <returns></returns> | ||
19 | public OpenSim.Region.ScriptEngine.DotNetEngine.ScriptEngine GetScriptEngine() | ||
20 | { | ||
21 | return ScriptEngine; | ||
22 | } | ||
23 | } | ||
24 | } | ||
diff --git a/OpenSim/Grid/ScriptServer/RemotingServer.cs b/OpenSim/Grid/ScriptServer/RemotingServer.cs new file mode 100644 index 0000000..3ec3e64 --- /dev/null +++ b/OpenSim/Grid/ScriptServer/RemotingServer.cs | |||
@@ -0,0 +1,28 @@ | |||
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using System.Text; | ||
4 | using System.Runtime.Remoting; | ||
5 | using System.Runtime.Remoting.Channels; | ||
6 | using System.Runtime.Remoting.Channels.Tcp; | ||
7 | |||
8 | |||
9 | namespace OpenSim.Grid.ScriptServer | ||
10 | { | ||
11 | class RemotingServer | ||
12 | { | ||
13 | |||
14 | public void CreateServer(int port, string instanceName) | ||
15 | { | ||
16 | // Create an instance of a channel | ||
17 | TcpChannel channel = new TcpChannel(port); | ||
18 | ChannelServices.RegisterChannel(channel, true); | ||
19 | |||
20 | // Register as an available service with the name HelloWorld | ||
21 | RemotingConfiguration.RegisterWellKnownServiceType( | ||
22 | typeof(RemotingObject), | ||
23 | instanceName, | ||
24 | WellKnownObjectMode.Singleton); | ||
25 | |||
26 | } | ||
27 | } | ||
28 | } | ||
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/EventManager.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/EventManager.cs index ced5025..16182f9 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/EventManager.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/EventManager.cs | |||
@@ -36,7 +36,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine | |||
36 | /// Prepares events so they can be directly executed upon a script by EventQueueManager, then queues it. | 36 | /// Prepares events so they can be directly executed upon a script by EventQueueManager, then queues it. |
37 | /// </summary> | 37 | /// </summary> |
38 | [Serializable] | 38 | [Serializable] |
39 | internal class EventManager | 39 | public class EventManager |
40 | { | 40 | { |
41 | 41 | ||
42 | // | 42 | // |
@@ -46,7 +46,9 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine | |||
46 | // This class it the link between an event inside OpenSim and the corresponding event in a user script being executed. | 46 | // This class it the link between an event inside OpenSim and the corresponding event in a user script being executed. |
47 | // | 47 | // |
48 | // For example when an user touches an object then the "myScriptEngine.World.EventManager.OnObjectGrab" event is fired inside OpenSim. | 48 | // For example when an user touches an object then the "myScriptEngine.World.EventManager.OnObjectGrab" event is fired inside OpenSim. |
49 | // We hook up to this event and queue a touch_start in EventQueueManager with the proper LSL parameters. It will then be delivered to the script by EventQueueManager. | 49 | // We hook up to this event and queue a touch_start in EventQueueManager with the proper LSL parameters. |
50 | // It will then be delivered to the script by EventQueueManager. | ||
51 | // | ||
50 | // You can check debug C# dump of an LSL script if you need to verify what exact parameters are needed. | 52 | // You can check debug C# dump of an LSL script if you need to verify what exact parameters are needed. |
51 | // | 53 | // |
52 | 54 | ||
@@ -105,128 +107,128 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine | |||
105 | // When queued in EventQueueManager they need to be LSL compatible (name and params) | 107 | // When queued in EventQueueManager they need to be LSL compatible (name and params) |
106 | 108 | ||
107 | //public void state_entry() { } // | 109 | //public void state_entry() { } // |
108 | public void state_exit() | 110 | public void state_exit(uint localID, LLUUID itemID) |
109 | { | 111 | { |
110 | } | 112 | } |
111 | 113 | ||
112 | //public void touch_start() { } | 114 | //public void touch_start(uint localID, LLUUID itemID) { } |
113 | public void touch() | 115 | public void touch(uint localID, LLUUID itemID) |
114 | { | 116 | { |
115 | } | 117 | } |
116 | 118 | ||
117 | public void touch_end() | 119 | public void touch_end(uint localID, LLUUID itemID) |
118 | { | 120 | { |
119 | } | 121 | } |
120 | 122 | ||
121 | public void collision_start() | 123 | public void collision_start(uint localID, LLUUID itemID) |
122 | { | 124 | { |
123 | } | 125 | } |
124 | 126 | ||
125 | public void collision() | 127 | public void collision(uint localID, LLUUID itemID) |
126 | { | 128 | { |
127 | } | 129 | } |
128 | 130 | ||
129 | public void collision_end() | 131 | public void collision_end(uint localID, LLUUID itemID) |
130 | { | 132 | { |
131 | } | 133 | } |
132 | 134 | ||
133 | public void land_collision_start() | 135 | public void land_collision_start(uint localID, LLUUID itemID) |
134 | { | 136 | { |
135 | } | 137 | } |
136 | 138 | ||
137 | public void land_collision() | 139 | public void land_collision(uint localID, LLUUID itemID) |
138 | { | 140 | { |
139 | } | 141 | } |
140 | 142 | ||
141 | public void land_collision_end() | 143 | public void land_collision_end(uint localID, LLUUID itemID) |
142 | { | 144 | { |
143 | } | 145 | } |
144 | 146 | ||
145 | public void timer() | 147 | public void timer(uint localID, LLUUID itemID) |
146 | { | 148 | { |
147 | } | 149 | } |
148 | 150 | ||
149 | public void listen() | 151 | public void listen(uint localID, LLUUID itemID) |
150 | { | 152 | { |
151 | } | 153 | } |
152 | 154 | ||
153 | public void on_rez() | 155 | public void on_rez(uint localID, LLUUID itemID) |
154 | { | 156 | { |
155 | } | 157 | } |
156 | 158 | ||
157 | public void sensor() | 159 | public void sensor(uint localID, LLUUID itemID) |
158 | { | 160 | { |
159 | } | 161 | } |
160 | 162 | ||
161 | public void no_sensor() | 163 | public void no_sensor(uint localID, LLUUID itemID) |
162 | { | 164 | { |
163 | } | 165 | } |
164 | 166 | ||
165 | public void control() | 167 | public void control(uint localID, LLUUID itemID) |
166 | { | 168 | { |
167 | } | 169 | } |
168 | 170 | ||
169 | public void money() | 171 | public void money(uint localID, LLUUID itemID) |
170 | { | 172 | { |
171 | } | 173 | } |
172 | 174 | ||
173 | public void email() | 175 | public void email(uint localID, LLUUID itemID) |
174 | { | 176 | { |
175 | } | 177 | } |
176 | 178 | ||
177 | public void at_target() | 179 | public void at_target(uint localID, LLUUID itemID) |
178 | { | 180 | { |
179 | } | 181 | } |
180 | 182 | ||
181 | public void not_at_target() | 183 | public void not_at_target(uint localID, LLUUID itemID) |
182 | { | 184 | { |
183 | } | 185 | } |
184 | 186 | ||
185 | public void at_rot_target() | 187 | public void at_rot_target(uint localID, LLUUID itemID) |
186 | { | 188 | { |
187 | } | 189 | } |
188 | 190 | ||
189 | public void not_at_rot_target() | 191 | public void not_at_rot_target(uint localID, LLUUID itemID) |
190 | { | 192 | { |
191 | } | 193 | } |
192 | 194 | ||
193 | public void run_time_permissions() | 195 | public void run_time_permissions(uint localID, LLUUID itemID) |
194 | { | 196 | { |
195 | } | 197 | } |
196 | 198 | ||
197 | public void changed() | 199 | public void changed(uint localID, LLUUID itemID) |
198 | { | 200 | { |
199 | } | 201 | } |
200 | 202 | ||
201 | public void attach() | 203 | public void attach(uint localID, LLUUID itemID) |
202 | { | 204 | { |
203 | } | 205 | } |
204 | 206 | ||
205 | public void dataserver() | 207 | public void dataserver(uint localID, LLUUID itemID) |
206 | { | 208 | { |
207 | } | 209 | } |
208 | 210 | ||
209 | public void link_message() | 211 | public void link_message(uint localID, LLUUID itemID) |
210 | { | 212 | { |
211 | } | 213 | } |
212 | 214 | ||
213 | public void moving_start() | 215 | public void moving_start(uint localID, LLUUID itemID) |
214 | { | 216 | { |
215 | } | 217 | } |
216 | 218 | ||
217 | public void moving_end() | 219 | public void moving_end(uint localID, LLUUID itemID) |
218 | { | 220 | { |
219 | } | 221 | } |
220 | 222 | ||
221 | public void object_rez() | 223 | public void object_rez(uint localID, LLUUID itemID) |
222 | { | 224 | { |
223 | } | 225 | } |
224 | 226 | ||
225 | public void remote_data() | 227 | public void remote_data(uint localID, LLUUID itemID) |
226 | { | 228 | { |
227 | } | 229 | } |
228 | 230 | ||
229 | public void http_response() | 231 | public void http_response(uint localID, LLUUID itemID) |
230 | { | 232 | { |
231 | } | 233 | } |
232 | } | 234 | } |
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs index fabce6a..11419be 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs | |||
@@ -41,10 +41,10 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine | |||
41 | [Serializable] | 41 | [Serializable] |
42 | public class ScriptEngine : IRegionModule | 42 | public class ScriptEngine : IRegionModule |
43 | { | 43 | { |
44 | internal Scene World; | 44 | public Scene World; |
45 | internal EventManager m_EventManager; // Handles and queues incoming events from OpenSim | 45 | public EventManager m_EventManager; // Handles and queues incoming events from OpenSim |
46 | internal EventQueueManager m_EventQueueManager; // Executes events | 46 | internal EventQueueManager m_EventQueueManager; // Executes events |
47 | internal ScriptManager m_ScriptManager; // Load, unload and execute scripts | 47 | public ScriptManager m_ScriptManager; // Load, unload and execute scripts |
48 | internal AppDomainManager m_AppDomainManager; | 48 | internal AppDomainManager m_AppDomainManager; |
49 | internal LSLLongCmdHandler m_LSLLongCmdHandler; | 49 | internal LSLLongCmdHandler m_LSLLongCmdHandler; |
50 | 50 | ||
@@ -86,14 +86,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine | |||
86 | // We are shutting down | 86 | // We are shutting down |
87 | } | 87 | } |
88 | 88 | ||
89 | //// !!!FOR DEBUGGING ONLY!!! (for executing script directly from test app) | 89 | |
90 | //[Obsolete("!!!FOR DEBUGGING ONLY!!!")] | ||
91 | //public void StartScript(string ScriptID, IScriptHost ObjectID) | ||
92 | //{ | ||
93 | // this.myEventManager.TEMP_OBJECT_ID = ObjectID; | ||
94 | // Log.Status("ScriptEngine", "DEBUG FUNCTION: StartScript: " + ScriptID); | ||
95 | // myScriptManager.StartScript(ScriptID, ObjectID); | ||
96 | //} | ||
97 | 90 | ||
98 | #region IRegionModule | 91 | #region IRegionModule |
99 | 92 | ||
@@ -112,7 +105,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine | |||
112 | 105 | ||
113 | public string Name | 106 | public string Name |
114 | { | 107 | { |
115 | get { return "LSLScriptingModule"; } | 108 | get { return "DotNetEngine"; } |
116 | } | 109 | } |
117 | 110 | ||
118 | public bool IsSharedModule | 111 | public bool IsSharedModule |
diff --git a/OpenSim/Region/ScriptEngine/RemoteServer/EventManager.cs b/OpenSim/Region/ScriptEngine/RemoteServer/EventManager.cs index b4ac615..f0a3aa1 100644 --- a/OpenSim/Region/ScriptEngine/RemoteServer/EventManager.cs +++ b/OpenSim/Region/ScriptEngine/RemoteServer/EventManager.cs | |||
@@ -38,7 +38,7 @@ namespace OpenSim.Region.ScriptEngine.RemoteServer | |||
38 | internal class EventManager | 38 | internal class EventManager |
39 | { | 39 | { |
40 | 40 | ||
41 | System.Collections.Generic.Dictionary<uint, EventManager> remoteScript = new System.Collections.Generic.Dictionary<uint, EventManager>(); | 41 | System.Collections.Generic.Dictionary<uint, OpenSim.Grid.ScriptServer.RemotingObject> remoteScript = new System.Collections.Generic.Dictionary<uint, OpenSim.Grid.ScriptServer.RemotingObject>(); |
42 | 42 | ||
43 | 43 | ||
44 | private ScriptEngine myScriptEngine; | 44 | private ScriptEngine myScriptEngine; |
@@ -47,179 +47,185 @@ namespace OpenSim.Region.ScriptEngine.RemoteServer | |||
47 | myScriptEngine = _ScriptEngine; | 47 | myScriptEngine = _ScriptEngine; |
48 | 48 | ||
49 | myScriptEngine.Log.Verbose("RemoteEngine", "Hooking up to server events"); | 49 | myScriptEngine.Log.Verbose("RemoteEngine", "Hooking up to server events"); |
50 | myScriptEngine.World.EventManager.OnObjectGrab += touch_start; | 50 | //myScriptEngine.World.EventManager.OnObjectGrab += touch_start; |
51 | myScriptEngine.World.EventManager.OnRezScript += OnRezScript; | 51 | myScriptEngine.World.EventManager.OnRezScript += OnRezScript; |
52 | myScriptEngine.World.EventManager.OnRemoveScript += OnRemoveScript; | 52 | //myScriptEngine.World.EventManager.OnRemoveScript += OnRemoveScript; |
53 | |||
54 | |||
53 | } | 55 | } |
54 | 56 | ||
55 | public void touch_start(uint localID, LLVector3 offsetPos, IClientAPI remoteClient) | 57 | |
58 | public void OnRezScript(uint localID, LLUUID itemID, string script) | ||
56 | { | 59 | { |
57 | remoteScript[localID].touch_start(localID, offsetPos, remoteClient); | 60 | // WE ARE CREATING A NEW SCRIPT ... CREATE SCRIPT, GET A REMOTEID THAT WE MAP FROM LOCALID |
61 | OpenSim.Grid.ScriptServer.RemotingObject obj = myScriptEngine.m_RemoteServer.Connect("localhost", 1234); | ||
62 | remoteScript.Add(localID, obj); | ||
63 | remoteScript[localID].ScriptEngine.m_EventManager.OnRezScript(localID, itemID, script); | ||
58 | } | 64 | } |
59 | 65 | ||
60 | public void OnRezScript(uint localID, LLUUID itemID, string script) | 66 | public void touch_start(uint localID, LLVector3 offsetPos, IClientAPI remoteClient) |
61 | { | 67 | { |
62 | remoteScript[localID].OnRezScript(localID, itemID, script); | 68 | remoteScript[localID].ScriptEngine.m_EventManager.touch_start(localID, offsetPos, remoteClient); |
63 | } | 69 | } |
64 | 70 | ||
65 | public void OnRemoveScript(uint localID, LLUUID itemID) | 71 | public void OnRemoveScript(uint localID, LLUUID itemID) |
66 | { | 72 | { |
67 | remoteScript[localID].OnRemoveScript(localID, itemID); | 73 | remoteScript[localID].ScriptEngine.m_EventManager.OnRemoveScript(localID, itemID); |
68 | } | 74 | } |
69 | 75 | ||
70 | public void state_exit(uint localID, LLUUID itemID) | 76 | public void state_exit(uint localID, LLUUID itemID) |
71 | { | 77 | { |
72 | remoteScript[localID].state_exit(localID, itemID); | 78 | remoteScript[localID].ScriptEngine.m_EventManager.state_exit(localID, itemID); |
73 | } | 79 | } |
74 | 80 | ||
75 | public void touch(uint localID, LLUUID itemID) | 81 | public void touch(uint localID, LLUUID itemID) |
76 | { | 82 | { |
77 | remoteScript[localID].touch(localID, itemID); | 83 | remoteScript[localID].ScriptEngine.m_EventManager.touch(localID, itemID); |
78 | } | 84 | } |
79 | 85 | ||
80 | public void touch_end(uint localID, LLUUID itemID) | 86 | public void touch_end(uint localID, LLUUID itemID) |
81 | { | 87 | { |
82 | remoteScript[localID].touch_end(localID, itemID); | 88 | remoteScript[localID].ScriptEngine.m_EventManager.touch_end(localID, itemID); |
83 | } | 89 | } |
84 | 90 | ||
85 | public void collision_start(uint localID, LLUUID itemID) | 91 | public void collision_start(uint localID, LLUUID itemID) |
86 | { | 92 | { |
87 | remoteScript[localID].collision_start(localID, itemID); | 93 | remoteScript[localID].ScriptEngine.m_EventManager.collision_start(localID, itemID); |
88 | } | 94 | } |
89 | 95 | ||
90 | public void collision(uint localID, LLUUID itemID) | 96 | public void collision(uint localID, LLUUID itemID) |
91 | { | 97 | { |
92 | remoteScript[localID].collision(localID, itemID); | 98 | remoteScript[localID].ScriptEngine.m_EventManager.collision(localID, itemID); |
93 | } | 99 | } |
94 | 100 | ||
95 | public void collision_end(uint localID, LLUUID itemID) | 101 | public void collision_end(uint localID, LLUUID itemID) |
96 | { | 102 | { |
97 | remoteScript[localID].collision_end(localID, itemID); | 103 | remoteScript[localID].ScriptEngine.m_EventManager.collision_end(localID, itemID); |
98 | } | 104 | } |
99 | 105 | ||
100 | public void land_collision_start(uint localID, LLUUID itemID) | 106 | public void land_collision_start(uint localID, LLUUID itemID) |
101 | { | 107 | { |
102 | remoteScript[localID].land_collision_start(localID, itemID); | 108 | remoteScript[localID].ScriptEngine.m_EventManager.land_collision_start(localID, itemID); |
103 | } | 109 | } |
104 | 110 | ||
105 | public void land_collision(uint localID, LLUUID itemID) | 111 | public void land_collision(uint localID, LLUUID itemID) |
106 | { | 112 | { |
107 | remoteScript[localID].land_collision(localID, itemID); | 113 | remoteScript[localID].ScriptEngine.m_EventManager.land_collision(localID, itemID); |
108 | } | 114 | } |
109 | 115 | ||
110 | public void land_collision_end(uint localID, LLUUID itemID) | 116 | public void land_collision_end(uint localID, LLUUID itemID) |
111 | { | 117 | { |
112 | remoteScript[localID].land_collision_end(localID, itemID); | 118 | remoteScript[localID].ScriptEngine.m_EventManager.land_collision_end(localID, itemID); |
113 | } | 119 | } |
114 | 120 | ||
115 | public void timer(uint localID, LLUUID itemID) | 121 | public void timer(uint localID, LLUUID itemID) |
116 | { | 122 | { |
117 | remoteScript[localID].timer(localID, itemID); | 123 | remoteScript[localID].ScriptEngine.m_EventManager.timer(localID, itemID); |
118 | } | 124 | } |
119 | 125 | ||
120 | public void listen(uint localID, LLUUID itemID) | 126 | public void listen(uint localID, LLUUID itemID) |
121 | { | 127 | { |
122 | remoteScript[localID].listen(localID, itemID); | 128 | remoteScript[localID].ScriptEngine.m_EventManager.listen(localID, itemID); |
123 | } | 129 | } |
124 | 130 | ||
125 | public void on_rez(uint localID, LLUUID itemID) | 131 | public void on_rez(uint localID, LLUUID itemID) |
126 | { | 132 | { |
127 | remoteScript[localID].on_rez(localID, itemID); | 133 | remoteScript[localID].ScriptEngine.m_EventManager.on_rez(localID, itemID); |
128 | } | 134 | } |
129 | 135 | ||
130 | public void sensor(uint localID, LLUUID itemID) | 136 | public void sensor(uint localID, LLUUID itemID) |
131 | { | 137 | { |
132 | remoteScript[localID].sensor(localID, itemID); | 138 | remoteScript[localID].ScriptEngine.m_EventManager.sensor(localID, itemID); |
133 | } | 139 | } |
134 | 140 | ||
135 | public void no_sensor(uint localID, LLUUID itemID) | 141 | public void no_sensor(uint localID, LLUUID itemID) |
136 | { | 142 | { |
137 | remoteScript[localID].no_sensor(localID, itemID); | 143 | remoteScript[localID].ScriptEngine.m_EventManager.no_sensor(localID, itemID); |
138 | } | 144 | } |
139 | 145 | ||
140 | public void control(uint localID, LLUUID itemID) | 146 | public void control(uint localID, LLUUID itemID) |
141 | { | 147 | { |
142 | remoteScript[localID].control(localID, itemID); | 148 | remoteScript[localID].ScriptEngine.m_EventManager.control(localID, itemID); |
143 | } | 149 | } |
144 | 150 | ||
145 | public void money(uint localID, LLUUID itemID) | 151 | public void money(uint localID, LLUUID itemID) |
146 | { | 152 | { |
147 | remoteScript[localID].money(localID, itemID); | 153 | remoteScript[localID].ScriptEngine.m_EventManager.money(localID, itemID); |
148 | } | 154 | } |
149 | 155 | ||
150 | public void email(uint localID, LLUUID itemID) | 156 | public void email(uint localID, LLUUID itemID) |
151 | { | 157 | { |
152 | remoteScript[localID].email(localID, itemID); | 158 | remoteScript[localID].ScriptEngine.m_EventManager.email(localID, itemID); |
153 | } | 159 | } |
154 | 160 | ||
155 | public void at_target(uint localID, LLUUID itemID) | 161 | public void at_target(uint localID, LLUUID itemID) |
156 | { | 162 | { |
157 | remoteScript[localID].at_target(localID, itemID); | 163 | remoteScript[localID].ScriptEngine.m_EventManager.at_target(localID, itemID); |
158 | } | 164 | } |
159 | 165 | ||
160 | public void not_at_target(uint localID, LLUUID itemID) | 166 | public void not_at_target(uint localID, LLUUID itemID) |
161 | { | 167 | { |
162 | remoteScript[localID].not_at_target(localID, itemID); | 168 | remoteScript[localID].ScriptEngine.m_EventManager.not_at_target(localID, itemID); |
163 | } | 169 | } |
164 | 170 | ||
165 | public void at_rot_target(uint localID, LLUUID itemID) | 171 | public void at_rot_target(uint localID, LLUUID itemID) |
166 | { | 172 | { |
167 | remoteScript[localID].at_rot_target(localID, itemID); | 173 | remoteScript[localID].ScriptEngine.m_EventManager.at_rot_target(localID, itemID); |
168 | } | 174 | } |
169 | 175 | ||
170 | public void not_at_rot_target(uint localID, LLUUID itemID) | 176 | public void not_at_rot_target(uint localID, LLUUID itemID) |
171 | { | 177 | { |
172 | remoteScript[localID].not_at_rot_target(localID, itemID); | 178 | remoteScript[localID].ScriptEngine.m_EventManager.not_at_rot_target(localID, itemID); |
173 | } | 179 | } |
174 | 180 | ||
175 | public void run_time_permissions(uint localID, LLUUID itemID) | 181 | public void run_time_permissions(uint localID, LLUUID itemID) |
176 | { | 182 | { |
177 | remoteScript[localID].run_time_permissions(localID, itemID); | 183 | remoteScript[localID].ScriptEngine.m_EventManager.run_time_permissions(localID, itemID); |
178 | } | 184 | } |
179 | 185 | ||
180 | public void changed(uint localID, LLUUID itemID) | 186 | public void changed(uint localID, LLUUID itemID) |
181 | { | 187 | { |
182 | remoteScript[localID].changed(localID, itemID); | 188 | remoteScript[localID].ScriptEngine.m_EventManager.changed(localID, itemID); |
183 | } | 189 | } |
184 | 190 | ||
185 | public void attach(uint localID, LLUUID itemID) | 191 | public void attach(uint localID, LLUUID itemID) |
186 | { | 192 | { |
187 | remoteScript[localID].attach(localID, itemID); | 193 | remoteScript[localID].ScriptEngine.m_EventManager.attach(localID, itemID); |
188 | } | 194 | } |
189 | 195 | ||
190 | public void dataserver(uint localID, LLUUID itemID) | 196 | public void dataserver(uint localID, LLUUID itemID) |
191 | { | 197 | { |
192 | remoteScript[localID].dataserver(localID, itemID); | 198 | remoteScript[localID].ScriptEngine.m_EventManager.dataserver(localID, itemID); |
193 | } | 199 | } |
194 | 200 | ||
195 | public void link_message(uint localID, LLUUID itemID) | 201 | public void link_message(uint localID, LLUUID itemID) |
196 | { | 202 | { |
197 | remoteScript[localID].link_message(localID, itemID); | 203 | remoteScript[localID].ScriptEngine.m_EventManager.link_message(localID, itemID); |
198 | } | 204 | } |
199 | 205 | ||
200 | public void moving_start(uint localID, LLUUID itemID) | 206 | public void moving_start(uint localID, LLUUID itemID) |
201 | { | 207 | { |
202 | remoteScript[localID].moving_start(localID, itemID); | 208 | remoteScript[localID].ScriptEngine.m_EventManager.moving_start(localID, itemID); |
203 | } | 209 | } |
204 | 210 | ||
205 | public void moving_end(uint localID, LLUUID itemID) | 211 | public void moving_end(uint localID, LLUUID itemID) |
206 | { | 212 | { |
207 | remoteScript[localID].moving_end(localID, itemID); | 213 | remoteScript[localID].ScriptEngine.m_EventManager.moving_end(localID, itemID); |
208 | } | 214 | } |
209 | 215 | ||
210 | public void object_rez(uint localID, LLUUID itemID) | 216 | public void object_rez(uint localID, LLUUID itemID) |
211 | { | 217 | { |
212 | remoteScript[localID].object_rez(localID, itemID); | 218 | remoteScript[localID].ScriptEngine.m_EventManager.object_rez(localID, itemID); |
213 | } | 219 | } |
214 | 220 | ||
215 | public void remote_data(uint localID, LLUUID itemID) | 221 | public void remote_data(uint localID, LLUUID itemID) |
216 | { | 222 | { |
217 | remoteScript[localID].remote_data(localID, itemID); | 223 | remoteScript[localID].ScriptEngine.m_EventManager.remote_data(localID, itemID); |
218 | } | 224 | } |
219 | 225 | ||
220 | public void http_response(uint localID, LLUUID itemID) | 226 | public void http_response(uint localID, LLUUID itemID) |
221 | { | 227 | { |
222 | remoteScript[localID].http_response(localID, itemID); | 228 | remoteScript[localID].ScriptEngine.m_EventManager.http_response(localID, itemID); |
223 | } | 229 | } |
224 | 230 | ||
225 | } | 231 | } |
diff --git a/OpenSim/Region/ScriptEngine/RemoteServer/RemoteServer.cs b/OpenSim/Region/ScriptEngine/RemoteServer/RemoteServer.cs new file mode 100644 index 0000000..423e6be --- /dev/null +++ b/OpenSim/Region/ScriptEngine/RemoteServer/RemoteServer.cs | |||
@@ -0,0 +1,38 @@ | |||
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using System.Text; | ||
4 | using System.Runtime.Remoting; | ||
5 | using System.Runtime.Remoting.Channels; | ||
6 | using System.Runtime.Remoting.Channels.Tcp; | ||
7 | |||
8 | namespace OpenSim.Region.ScriptEngine.RemoteServer | ||
9 | { | ||
10 | class RemoteServer | ||
11 | { | ||
12 | |||
13 | public OpenSim.Grid.ScriptServer.RemotingObject Connect(string hostname, int port) | ||
14 | { | ||
15 | // Create a channel for communicating w/ the remote object | ||
16 | // Notice no port is specified on the client | ||
17 | TcpChannel chan = new TcpChannel(); | ||
18 | ChannelServices.RegisterChannel(chan, true); | ||
19 | |||
20 | // Create an instance of the remote object | ||
21 | OpenSim.Grid.ScriptServer.RemotingObject obj = (OpenSim.Grid.ScriptServer.RemotingObject)Activator.GetObject( | ||
22 | typeof(OpenSim.Grid.ScriptServer.RemotingObject), | ||
23 | "tcp://" + hostname + ":" + port + "/DotNetEngine"); | ||
24 | |||
25 | // Use the object | ||
26 | if (obj.Equals(null)) | ||
27 | { | ||
28 | System.Console.WriteLine("Error: unable to locate server"); | ||
29 | } | ||
30 | else | ||
31 | { | ||
32 | return obj; | ||
33 | } | ||
34 | return null; | ||
35 | |||
36 | } | ||
37 | } | ||
38 | } | ||
diff --git a/OpenSim/Region/ScriptEngine/RemoteServer/ScriptEngine.cs b/OpenSim/Region/ScriptEngine/RemoteServer/ScriptEngine.cs index ae29ad5..679d5d4 100644 --- a/OpenSim/Region/ScriptEngine/RemoteServer/ScriptEngine.cs +++ b/OpenSim/Region/ScriptEngine/RemoteServer/ScriptEngine.cs | |||
@@ -43,6 +43,7 @@ namespace OpenSim.Region.ScriptEngine.RemoteServer | |||
43 | { | 43 | { |
44 | internal Scene World; | 44 | internal Scene World; |
45 | internal EventManager m_EventManager; // Handles and queues incoming events from OpenSim | 45 | internal EventManager m_EventManager; // Handles and queues incoming events from OpenSim |
46 | internal RemoteServer m_RemoteServer; | ||
46 | 47 | ||
47 | private LogBase m_log; | 48 | private LogBase m_log; |
48 | 49 | ||
@@ -64,6 +65,8 @@ namespace OpenSim.Region.ScriptEngine.RemoteServer | |||
64 | Log.Verbose("ScriptEngine", "RemoteEngine (Remote Script Server) initializing"); | 65 | Log.Verbose("ScriptEngine", "RemoteEngine (Remote Script Server) initializing"); |
65 | // Create all objects we'll be using | 66 | // Create all objects we'll be using |
66 | m_EventManager = new EventManager(this); | 67 | m_EventManager = new EventManager(this); |
68 | m_RemoteServer = new RemoteServer(); | ||
69 | m_RemoteServer.Connect("localhost", 1234); | ||
67 | } | 70 | } |
68 | 71 | ||
69 | public void Shutdown() | 72 | public void Shutdown() |