diff options
author | Teravus Ovares | 2007-12-30 23:56:29 +0000 |
---|---|---|
committer | Teravus Ovares | 2007-12-30 23:56:29 +0000 |
commit | 373d801c400f8c4da8bc55ed8637a42be8c6e927 (patch) | |
tree | 9e27367e999e5a96b51d5ac539a1cf4c111a17da /OpenSim/Region | |
parent | * Fixed References in Prebuild so the project compiles (diff) | |
download | opensim-SC-373d801c400f8c4da8bc55ed8637a42be8c6e927.zip opensim-SC-373d801c400f8c4da8bc55ed8637a42be8c6e927.tar.gz opensim-SC-373d801c400f8c4da8bc55ed8637a42be8c6e927.tar.bz2 opensim-SC-373d801c400f8c4da8bc55ed8637a42be8c6e927.tar.xz |
* Added graceful remote script server connection error handling
* Removed a friends module test that I had.
Diffstat (limited to '')
3 files changed, 298 insertions, 46 deletions
diff --git a/OpenSim/Region/Environment/Modules/FriendsModule.cs b/OpenSim/Region/Environment/Modules/FriendsModule.cs index d2fcba9..ee78f15 100644 --- a/OpenSim/Region/Environment/Modules/FriendsModule.cs +++ b/OpenSim/Region/Environment/Modules/FriendsModule.cs | |||
@@ -56,8 +56,8 @@ namespace OpenSim.Region.Environment.Modules | |||
56 | 56 | ||
57 | private void OnNewClient(IClientAPI client) | 57 | private void OnNewClient(IClientAPI client) |
58 | { | 58 | { |
59 | FormFriendship(client,new Guid("c43a67ab-b196-4d62-936c-b40369547dee")); | 59 | //FormFriendship(client,new Guid("c43a67ab-b196-4d62-936c-b40369547dee")); |
60 | FormFriendship(client, new Guid("0a2f777b-f44c-4662-8b22-c90ae038a3e6")); | 60 | //FormFriendship(client, new Guid("0a2f777b-f44c-4662-8b22-c90ae038a3e6")); |
61 | } | 61 | } |
62 | 62 | ||
63 | public void PostInitialise() | 63 | public void PostInitialise() |
diff --git a/OpenSim/Region/ScriptEngine/RemoteServer/EventManager.cs b/OpenSim/Region/ScriptEngine/RemoteServer/EventManager.cs index 1e56b94..5561563 100644 --- a/OpenSim/Region/ScriptEngine/RemoteServer/EventManager.cs +++ b/OpenSim/Region/ScriptEngine/RemoteServer/EventManager.cs | |||
@@ -63,172 +63,410 @@ namespace OpenSim.Region.ScriptEngine.RemoteServer | |||
63 | // WE ARE CREATING A NEW SCRIPT ... CREATE SCRIPT, GET A REMOTEID THAT WE MAP FROM LOCALID | 63 | // WE ARE CREATING A NEW SCRIPT ... CREATE SCRIPT, GET A REMOTEID THAT WE MAP FROM LOCALID |
64 | OpenSim.Grid.ScriptServer.RemotingObject obj = myScriptEngine.m_RemoteServer.Connect("localhost", 1234); | 64 | OpenSim.Grid.ScriptServer.RemotingObject obj = myScriptEngine.m_RemoteServer.Connect("localhost", 1234); |
65 | remoteScript.Add(localID, obj); | 65 | remoteScript.Add(localID, obj); |
66 | remoteScript[localID].ScriptEngine.m_EventManager.OnRezScript(localID, itemID, script); | 66 | try |
67 | { | ||
68 | remoteScript[localID].ScriptEngine.m_EventManager.OnRezScript(localID, itemID, script); | ||
69 | } | ||
70 | catch (System.NullReferenceException) | ||
71 | { | ||
72 | OpenSim.Framework.Console.MainLog.Instance.Error("SCRIPTS", "Error Connecting to Remote Script Server. Is it running?"); | ||
73 | } | ||
67 | } | 74 | } |
68 | 75 | ||
69 | public void touch_start(uint localID, LLVector3 offsetPos, IClientAPI remoteClient) | 76 | public void touch_start(uint localID, LLVector3 offsetPos, IClientAPI remoteClient) |
70 | { | 77 | { |
71 | remoteScript[localID].ScriptEngine.m_EventManager.touch_start(localID, offsetPos, remoteClient); | 78 | try |
79 | { | ||
80 | remoteScript[localID].ScriptEngine.m_EventManager.touch_start(localID, offsetPos, remoteClient); | ||
81 | } | ||
82 | catch (System.NullReferenceException) | ||
83 | { | ||
84 | OpenSim.Framework.Console.MainLog.Instance.Error("SCRIPTS", "Error Connecting to Remote Script Server. Is it running?"); | ||
85 | } | ||
72 | } | 86 | } |
73 | 87 | ||
74 | public void OnRemoveScript(uint localID, LLUUID itemID) | 88 | public void OnRemoveScript(uint localID, LLUUID itemID) |
75 | { | 89 | { |
76 | remoteScript[localID].ScriptEngine.m_EventManager.OnRemoveScript(localID, itemID); | 90 | try |
91 | { | ||
92 | remoteScript[localID].ScriptEngine.m_EventManager.OnRemoveScript(localID, itemID); | ||
93 | } | ||
94 | catch (System.NullReferenceException) | ||
95 | { | ||
96 | OpenSim.Framework.Console.MainLog.Instance.Error("SCRIPTS", "Error Connecting to Remote Script Server. Is it running?"); | ||
97 | } | ||
77 | } | 98 | } |
78 | 99 | ||
79 | public void state_exit(uint localID, LLUUID itemID) | 100 | public void state_exit(uint localID, LLUUID itemID) |
80 | { | 101 | { |
81 | remoteScript[localID].ScriptEngine.m_EventManager.state_exit(localID, itemID); | 102 | try |
103 | { | ||
104 | remoteScript[localID].ScriptEngine.m_EventManager.state_exit(localID, itemID); | ||
105 | } | ||
106 | catch (System.NullReferenceException) | ||
107 | { | ||
108 | OpenSim.Framework.Console.MainLog.Instance.Error("SCRIPTS", "Error Connecting to Remote Script Server. Is it running?"); | ||
109 | } | ||
82 | } | 110 | } |
83 | 111 | ||
84 | public void touch(uint localID, LLUUID itemID) | 112 | public void touch(uint localID, LLUUID itemID) |
85 | { | 113 | { |
86 | remoteScript[localID].ScriptEngine.m_EventManager.touch(localID, itemID); | 114 | try |
115 | { | ||
116 | remoteScript[localID].ScriptEngine.m_EventManager.touch(localID, itemID); | ||
117 | } | ||
118 | catch (System.NullReferenceException) | ||
119 | { | ||
120 | OpenSim.Framework.Console.MainLog.Instance.Error("SCRIPTS", "Error Connecting to Remote Script Server. Is it running?"); | ||
121 | } | ||
87 | } | 122 | } |
88 | 123 | ||
89 | public void touch_end(uint localID, LLUUID itemID) | 124 | public void touch_end(uint localID, LLUUID itemID) |
90 | { | 125 | { |
91 | remoteScript[localID].ScriptEngine.m_EventManager.touch_end(localID, itemID); | 126 | try |
127 | { | ||
128 | remoteScript[localID].ScriptEngine.m_EventManager.touch_end(localID, itemID); | ||
129 | } | ||
130 | catch (System.NullReferenceException) | ||
131 | { | ||
132 | OpenSim.Framework.Console.MainLog.Instance.Error("SCRIPTS", "Error Connecting to Remote Script Server. Is it running?"); | ||
133 | } | ||
92 | } | 134 | } |
93 | 135 | ||
94 | public void collision_start(uint localID, LLUUID itemID) | 136 | public void collision_start(uint localID, LLUUID itemID) |
95 | { | 137 | { |
96 | remoteScript[localID].ScriptEngine.m_EventManager.collision_start(localID, itemID); | 138 | try |
139 | { | ||
140 | remoteScript[localID].ScriptEngine.m_EventManager.collision_start(localID, itemID); | ||
141 | } | ||
142 | catch (System.NullReferenceException) | ||
143 | { | ||
144 | OpenSim.Framework.Console.MainLog.Instance.Error("SCRIPTS", "Error Connecting to Remote Script Server. Is it running?"); | ||
145 | } | ||
97 | } | 146 | } |
98 | 147 | ||
99 | public void collision(uint localID, LLUUID itemID) | 148 | public void collision(uint localID, LLUUID itemID) |
100 | { | 149 | { |
101 | remoteScript[localID].ScriptEngine.m_EventManager.collision(localID, itemID); | 150 | try |
151 | { | ||
152 | remoteScript[localID].ScriptEngine.m_EventManager.collision(localID, itemID); | ||
153 | } | ||
154 | catch (System.NullReferenceException) | ||
155 | { | ||
156 | OpenSim.Framework.Console.MainLog.Instance.Error("SCRIPTS", "Error Connecting to Remote Script Server. Is it running?"); | ||
157 | } | ||
102 | } | 158 | } |
103 | 159 | ||
104 | public void collision_end(uint localID, LLUUID itemID) | 160 | public void collision_end(uint localID, LLUUID itemID) |
105 | { | 161 | { |
106 | remoteScript[localID].ScriptEngine.m_EventManager.collision_end(localID, itemID); | 162 | try |
163 | { | ||
164 | remoteScript[localID].ScriptEngine.m_EventManager.collision_end(localID, itemID); | ||
165 | } | ||
166 | catch (System.NullReferenceException) | ||
167 | { | ||
168 | OpenSim.Framework.Console.MainLog.Instance.Error("SCRIPTS", "Error Connecting to Remote Script Server. Is it running?"); | ||
169 | } | ||
107 | } | 170 | } |
108 | 171 | ||
109 | public void land_collision_start(uint localID, LLUUID itemID) | 172 | public void land_collision_start(uint localID, LLUUID itemID) |
110 | { | 173 | { |
111 | remoteScript[localID].ScriptEngine.m_EventManager.land_collision_start(localID, itemID); | 174 | try |
175 | { | ||
176 | remoteScript[localID].ScriptEngine.m_EventManager.land_collision_start(localID, itemID); | ||
177 | } | ||
178 | catch (System.NullReferenceException) | ||
179 | { | ||
180 | OpenSim.Framework.Console.MainLog.Instance.Error("SCRIPTS", "Error Connecting to Remote Script Server. Is it running?"); | ||
181 | } | ||
112 | } | 182 | } |
113 | 183 | ||
114 | public void land_collision(uint localID, LLUUID itemID) | 184 | public void land_collision(uint localID, LLUUID itemID) |
115 | { | 185 | { |
116 | remoteScript[localID].ScriptEngine.m_EventManager.land_collision(localID, itemID); | 186 | try |
187 | { | ||
188 | remoteScript[localID].ScriptEngine.m_EventManager.land_collision(localID, itemID); | ||
189 | } | ||
190 | catch (System.NullReferenceException) | ||
191 | { | ||
192 | OpenSim.Framework.Console.MainLog.Instance.Error("SCRIPTS", "Error Connecting to Remote Script Server. Is it running?"); | ||
193 | } | ||
117 | } | 194 | } |
118 | 195 | ||
119 | public void land_collision_end(uint localID, LLUUID itemID) | 196 | public void land_collision_end(uint localID, LLUUID itemID) |
120 | { | 197 | { |
121 | remoteScript[localID].ScriptEngine.m_EventManager.land_collision_end(localID, itemID); | 198 | try |
199 | { | ||
200 | remoteScript[localID].ScriptEngine.m_EventManager.land_collision_end(localID, itemID); | ||
201 | } | ||
202 | catch (System.NullReferenceException) | ||
203 | { | ||
204 | OpenSim.Framework.Console.MainLog.Instance.Error("SCRIPTS", "Error Connecting to Remote Script Server. Is it running?"); | ||
205 | } | ||
122 | } | 206 | } |
123 | 207 | ||
124 | public void timer(uint localID, LLUUID itemID) | 208 | public void timer(uint localID, LLUUID itemID) |
125 | { | 209 | { |
126 | remoteScript[localID].ScriptEngine.m_EventManager.timer(localID, itemID); | 210 | try |
211 | { | ||
212 | remoteScript[localID].ScriptEngine.m_EventManager.timer(localID, itemID); | ||
213 | } | ||
214 | catch (System.NullReferenceException) | ||
215 | { | ||
216 | OpenSim.Framework.Console.MainLog.Instance.Error("SCRIPTS", "Error Connecting to Remote Script Server. Is it running?"); | ||
217 | } | ||
127 | } | 218 | } |
128 | 219 | ||
129 | public void listen(uint localID, LLUUID itemID) | 220 | public void listen(uint localID, LLUUID itemID) |
130 | { | 221 | { |
222 | try | ||
223 | { | ||
131 | remoteScript[localID].ScriptEngine.m_EventManager.listen(localID, itemID); | 224 | remoteScript[localID].ScriptEngine.m_EventManager.listen(localID, itemID); |
225 | } | ||
226 | catch (System.NullReferenceException) | ||
227 | { | ||
228 | OpenSim.Framework.Console.MainLog.Instance.Error("SCRIPTS", "Error Connecting to Remote Script Server. Is it running?"); | ||
229 | } | ||
132 | } | 230 | } |
133 | 231 | ||
134 | public void on_rez(uint localID, LLUUID itemID) | 232 | public void on_rez(uint localID, LLUUID itemID) |
135 | { | 233 | { |
136 | remoteScript[localID].ScriptEngine.m_EventManager.on_rez(localID, itemID); | 234 | try |
235 | { | ||
236 | remoteScript[localID].ScriptEngine.m_EventManager.on_rez(localID, itemID); | ||
237 | } | ||
238 | catch (System.NullReferenceException) | ||
239 | { | ||
240 | OpenSim.Framework.Console.MainLog.Instance.Error("SCRIPTS", "Error Connecting to Remote Script Server. Is it running?"); | ||
241 | } | ||
137 | } | 242 | } |
138 | 243 | ||
139 | public void sensor(uint localID, LLUUID itemID) | 244 | public void sensor(uint localID, LLUUID itemID) |
140 | { | 245 | { |
141 | remoteScript[localID].ScriptEngine.m_EventManager.sensor(localID, itemID); | 246 | try |
247 | { | ||
248 | remoteScript[localID].ScriptEngine.m_EventManager.sensor(localID, itemID); | ||
249 | } | ||
250 | catch (System.NullReferenceException) | ||
251 | { | ||
252 | OpenSim.Framework.Console.MainLog.Instance.Error("SCRIPTS", "Error Connecting to Remote Script Server. Is it running?"); | ||
253 | } | ||
142 | } | 254 | } |
143 | 255 | ||
144 | public void no_sensor(uint localID, LLUUID itemID) | 256 | public void no_sensor(uint localID, LLUUID itemID) |
145 | { | 257 | { |
146 | remoteScript[localID].ScriptEngine.m_EventManager.no_sensor(localID, itemID); | 258 | try |
259 | { | ||
260 | remoteScript[localID].ScriptEngine.m_EventManager.no_sensor(localID, itemID); | ||
261 | } | ||
262 | catch (System.NullReferenceException) | ||
263 | { | ||
264 | OpenSim.Framework.Console.MainLog.Instance.Error("SCRIPTS", "Error Connecting to Remote Script Server. Is it running?"); | ||
265 | } | ||
147 | } | 266 | } |
148 | 267 | ||
149 | public void control(uint localID, LLUUID itemID) | 268 | public void control(uint localID, LLUUID itemID) |
150 | { | 269 | { |
151 | remoteScript[localID].ScriptEngine.m_EventManager.control(localID, itemID); | 270 | try |
271 | { | ||
272 | remoteScript[localID].ScriptEngine.m_EventManager.control(localID, itemID); | ||
273 | } | ||
274 | catch (System.NullReferenceException) | ||
275 | { | ||
276 | OpenSim.Framework.Console.MainLog.Instance.Error("SCRIPTS", "Error Connecting to Remote Script Server. Is it running?"); | ||
277 | } | ||
152 | } | 278 | } |
153 | 279 | ||
154 | public void money(uint localID, LLUUID itemID) | 280 | public void money(uint localID, LLUUID itemID) |
155 | { | 281 | { |
156 | remoteScript[localID].ScriptEngine.m_EventManager.money(localID, itemID); | 282 | try |
283 | { | ||
284 | remoteScript[localID].ScriptEngine.m_EventManager.money(localID, itemID); | ||
285 | } | ||
286 | catch (System.NullReferenceException) | ||
287 | { | ||
288 | OpenSim.Framework.Console.MainLog.Instance.Error("SCRIPTS", "Error Connecting to Remote Script Server. Is it running?"); | ||
289 | } | ||
157 | } | 290 | } |
158 | 291 | ||
159 | public void email(uint localID, LLUUID itemID) | 292 | public void email(uint localID, LLUUID itemID) |
160 | { | 293 | { |
161 | remoteScript[localID].ScriptEngine.m_EventManager.email(localID, itemID); | 294 | try |
295 | { | ||
296 | remoteScript[localID].ScriptEngine.m_EventManager.email(localID, itemID); | ||
297 | } | ||
298 | catch (System.NullReferenceException) | ||
299 | { | ||
300 | OpenSim.Framework.Console.MainLog.Instance.Error("SCRIPTS", "Error Connecting to Remote Script Server. Is it running?"); | ||
301 | } | ||
162 | } | 302 | } |
163 | 303 | ||
164 | public void at_target(uint localID, LLUUID itemID) | 304 | public void at_target(uint localID, LLUUID itemID) |
165 | { | 305 | { |
166 | remoteScript[localID].ScriptEngine.m_EventManager.at_target(localID, itemID); | 306 | try |
307 | { | ||
308 | remoteScript[localID].ScriptEngine.m_EventManager.at_target(localID, itemID); | ||
309 | } | ||
310 | catch (System.NullReferenceException) | ||
311 | { | ||
312 | OpenSim.Framework.Console.MainLog.Instance.Error("SCRIPTS", "Error Connecting to Remote Script Server. Is it running?"); | ||
313 | } | ||
167 | } | 314 | } |
168 | 315 | ||
169 | public void not_at_target(uint localID, LLUUID itemID) | 316 | public void not_at_target(uint localID, LLUUID itemID) |
170 | { | 317 | { |
171 | remoteScript[localID].ScriptEngine.m_EventManager.not_at_target(localID, itemID); | 318 | try |
319 | { | ||
320 | remoteScript[localID].ScriptEngine.m_EventManager.not_at_target(localID, itemID); | ||
321 | } | ||
322 | catch (System.NullReferenceException) | ||
323 | { | ||
324 | OpenSim.Framework.Console.MainLog.Instance.Error("SCRIPTS", "Error Connecting to Remote Script Server. Is it running?"); | ||
325 | } | ||
172 | } | 326 | } |
173 | 327 | ||
174 | public void at_rot_target(uint localID, LLUUID itemID) | 328 | public void at_rot_target(uint localID, LLUUID itemID) |
175 | { | 329 | { |
176 | remoteScript[localID].ScriptEngine.m_EventManager.at_rot_target(localID, itemID); | 330 | try |
331 | { | ||
332 | remoteScript[localID].ScriptEngine.m_EventManager.at_rot_target(localID, itemID); | ||
333 | } | ||
334 | catch (System.NullReferenceException) | ||
335 | { | ||
336 | OpenSim.Framework.Console.MainLog.Instance.Error("SCRIPTS", "Error Connecting to Remote Script Server. Is it running?"); | ||
337 | } | ||
177 | } | 338 | } |
178 | 339 | ||
179 | public void not_at_rot_target(uint localID, LLUUID itemID) | 340 | public void not_at_rot_target(uint localID, LLUUID itemID) |
180 | { | 341 | { |
181 | remoteScript[localID].ScriptEngine.m_EventManager.not_at_rot_target(localID, itemID); | 342 | try |
343 | { | ||
344 | remoteScript[localID].ScriptEngine.m_EventManager.not_at_rot_target(localID, itemID); | ||
345 | } | ||
346 | catch (System.NullReferenceException) | ||
347 | { | ||
348 | OpenSim.Framework.Console.MainLog.Instance.Error("SCRIPTS", "Error Connecting to Remote Script Server. Is it running?"); | ||
349 | } | ||
182 | } | 350 | } |
183 | 351 | ||
184 | public void run_time_permissions(uint localID, LLUUID itemID) | 352 | public void run_time_permissions(uint localID, LLUUID itemID) |
185 | { | 353 | { |
186 | remoteScript[localID].ScriptEngine.m_EventManager.run_time_permissions(localID, itemID); | 354 | try |
355 | { | ||
356 | remoteScript[localID].ScriptEngine.m_EventManager.run_time_permissions(localID, itemID); | ||
357 | } | ||
358 | catch (System.NullReferenceException) | ||
359 | { | ||
360 | OpenSim.Framework.Console.MainLog.Instance.Error("SCRIPTS", "Error Connecting to Remote Script Server. Is it running?"); | ||
361 | } | ||
187 | } | 362 | } |
188 | 363 | ||
189 | public void changed(uint localID, LLUUID itemID) | 364 | public void changed(uint localID, LLUUID itemID) |
190 | { | 365 | { |
191 | remoteScript[localID].ScriptEngine.m_EventManager.changed(localID, itemID); | 366 | try |
367 | { | ||
368 | remoteScript[localID].ScriptEngine.m_EventManager.changed(localID, itemID); | ||
369 | } | ||
370 | catch (System.NullReferenceException) | ||
371 | { | ||
372 | OpenSim.Framework.Console.MainLog.Instance.Error("SCRIPTS", "Error Connecting to Remote Script Server. Is it running?"); | ||
373 | } | ||
192 | } | 374 | } |
193 | 375 | ||
194 | public void attach(uint localID, LLUUID itemID) | 376 | public void attach(uint localID, LLUUID itemID) |
195 | { | 377 | { |
196 | remoteScript[localID].ScriptEngine.m_EventManager.attach(localID, itemID); | 378 | try |
379 | { | ||
380 | remoteScript[localID].ScriptEngine.m_EventManager.attach(localID, itemID); | ||
381 | } | ||
382 | catch (System.NullReferenceException) | ||
383 | { | ||
384 | OpenSim.Framework.Console.MainLog.Instance.Error("SCRIPTS", "Error Connecting to Remote Script Server. Is it running?"); | ||
385 | } | ||
197 | } | 386 | } |
198 | 387 | ||
199 | public void dataserver(uint localID, LLUUID itemID) | 388 | public void dataserver(uint localID, LLUUID itemID) |
200 | { | 389 | { |
201 | remoteScript[localID].ScriptEngine.m_EventManager.dataserver(localID, itemID); | 390 | try |
391 | { | ||
392 | remoteScript[localID].ScriptEngine.m_EventManager.dataserver(localID, itemID); | ||
393 | } | ||
394 | catch (System.NullReferenceException) | ||
395 | { | ||
396 | OpenSim.Framework.Console.MainLog.Instance.Error("SCRIPTS", "Error Connecting to Remote Script Server. Is it running?"); | ||
397 | } | ||
202 | } | 398 | } |
203 | 399 | ||
204 | public void link_message(uint localID, LLUUID itemID) | 400 | public void link_message(uint localID, LLUUID itemID) |
205 | { | 401 | { |
206 | remoteScript[localID].ScriptEngine.m_EventManager.link_message(localID, itemID); | 402 | try |
403 | { | ||
404 | remoteScript[localID].ScriptEngine.m_EventManager.link_message(localID, itemID); | ||
405 | } | ||
406 | catch (System.NullReferenceException) | ||
407 | { | ||
408 | OpenSim.Framework.Console.MainLog.Instance.Error("SCRIPTS", "Error Connecting to Remote Script Server. Is it running?"); | ||
409 | } | ||
207 | } | 410 | } |
208 | 411 | ||
209 | public void moving_start(uint localID, LLUUID itemID) | 412 | public void moving_start(uint localID, LLUUID itemID) |
210 | { | 413 | { |
211 | remoteScript[localID].ScriptEngine.m_EventManager.moving_start(localID, itemID); | 414 | try |
415 | { | ||
416 | remoteScript[localID].ScriptEngine.m_EventManager.moving_start(localID, itemID); | ||
417 | } | ||
418 | catch (System.NullReferenceException) | ||
419 | { | ||
420 | OpenSim.Framework.Console.MainLog.Instance.Error("SCRIPTS", "Error Connecting to Remote Script Server. Is it running?"); | ||
421 | } | ||
212 | } | 422 | } |
213 | 423 | ||
214 | public void moving_end(uint localID, LLUUID itemID) | 424 | public void moving_end(uint localID, LLUUID itemID) |
215 | { | 425 | { |
216 | remoteScript[localID].ScriptEngine.m_EventManager.moving_end(localID, itemID); | 426 | try |
427 | { | ||
428 | remoteScript[localID].ScriptEngine.m_EventManager.moving_end(localID, itemID); | ||
429 | } | ||
430 | catch (System.NullReferenceException) | ||
431 | { | ||
432 | OpenSim.Framework.Console.MainLog.Instance.Error("SCRIPTS", "Error Connecting to Remote Script Server. Is it running?"); | ||
433 | } | ||
217 | } | 434 | } |
218 | 435 | ||
219 | public void object_rez(uint localID, LLUUID itemID) | 436 | public void object_rez(uint localID, LLUUID itemID) |
220 | { | 437 | { |
221 | remoteScript[localID].ScriptEngine.m_EventManager.object_rez(localID, itemID); | 438 | try |
439 | { | ||
440 | remoteScript[localID].ScriptEngine.m_EventManager.object_rez(localID, itemID); | ||
441 | } | ||
442 | catch (System.NullReferenceException) | ||
443 | { | ||
444 | OpenSim.Framework.Console.MainLog.Instance.Error("SCRIPTS", "Error Connecting to Remote Script Server. Is it running?"); | ||
445 | } | ||
222 | } | 446 | } |
223 | 447 | ||
224 | public void remote_data(uint localID, LLUUID itemID) | 448 | public void remote_data(uint localID, LLUUID itemID) |
225 | { | 449 | { |
226 | remoteScript[localID].ScriptEngine.m_EventManager.remote_data(localID, itemID); | 450 | try |
451 | { | ||
452 | remoteScript[localID].ScriptEngine.m_EventManager.remote_data(localID, itemID); | ||
453 | } | ||
454 | catch (System.NullReferenceException) | ||
455 | { | ||
456 | OpenSim.Framework.Console.MainLog.Instance.Error("SCRIPTS", "Error Connecting to Remote Script Server. Is it running?"); | ||
457 | } | ||
227 | } | 458 | } |
228 | 459 | ||
229 | public void http_response(uint localID, LLUUID itemID) | 460 | public void http_response(uint localID, LLUUID itemID) |
230 | { | 461 | { |
231 | remoteScript[localID].ScriptEngine.m_EventManager.http_response(localID, itemID); | 462 | try |
463 | { | ||
464 | remoteScript[localID].ScriptEngine.m_EventManager.http_response(localID, itemID); | ||
465 | } | ||
466 | catch (System.NullReferenceException) | ||
467 | { | ||
468 | OpenSim.Framework.Console.MainLog.Instance.Error("SCRIPTS", "Error Connecting to Remote Script Server. Is it running?"); | ||
469 | } | ||
232 | } | 470 | } |
233 | 471 | ||
234 | } | 472 | } |
diff --git a/OpenSim/Region/ScriptEngine/RemoteServer/RemoteServer.cs b/OpenSim/Region/ScriptEngine/RemoteServer/RemoteServer.cs index 1a528c8..4fff20d 100644 --- a/OpenSim/Region/ScriptEngine/RemoteServer/RemoteServer.cs +++ b/OpenSim/Region/ScriptEngine/RemoteServer/RemoteServer.cs | |||
@@ -17,21 +17,35 @@ namespace OpenSim.Region.ScriptEngine.RemoteServer | |||
17 | // Create a channel for communicating w/ the remote object | 17 | // Create a channel for communicating w/ the remote object |
18 | // Notice no port is specified on the client | 18 | // Notice no port is specified on the client |
19 | TcpChannel chan = new TcpChannel(); | 19 | TcpChannel chan = new TcpChannel(); |
20 | ChannelServices.RegisterChannel(chan, true); | 20 | try |
21 | { | ||
22 | ChannelServices.RegisterChannel(chan, true); | ||
23 | } | ||
24 | catch (System.Runtime.Remoting.RemotingException) | ||
25 | { | ||
26 | System.Console.WriteLine("Error: tcp already registered, RemoteServer.cs in OpenSim.Region.ScriptEngine.RemoteServer line 24"); | ||
27 | } | ||
28 | try | ||
29 | { | ||
21 | 30 | ||
22 | // Create an instance of the remote object | 31 | // Create an instance of the remote object |
23 | OpenSim.Grid.ScriptServer.RemotingObject obj = (OpenSim.Grid.ScriptServer.RemotingObject)Activator.GetObject( | 32 | OpenSim.Grid.ScriptServer.RemotingObject obj = (OpenSim.Grid.ScriptServer.RemotingObject)Activator.GetObject( |
24 | typeof(OpenSim.Grid.ScriptServer.RemotingObject), | 33 | typeof(OpenSim.Grid.ScriptServer.RemotingObject), |
25 | "tcp://" + hostname + ":" + port + "/DotNetEngine"); | 34 | "tcp://" + hostname + ":" + port + "/DotNetEngine"); |
26 | 35 | ||
27 | // Use the object | 36 | // Use the object |
28 | if (obj.Equals(null)) | 37 | if (obj.Equals(null)) |
29 | { | 38 | { |
30 | System.Console.WriteLine("Error: unable to locate server"); | 39 | System.Console.WriteLine("Error: unable to locate server"); |
40 | } | ||
41 | else | ||
42 | { | ||
43 | return obj; | ||
44 | } | ||
31 | } | 45 | } |
32 | else | 46 | catch (System.Net.Sockets.SocketException) |
33 | { | 47 | { |
34 | return obj; | 48 | System.Console.WriteLine("Error: unable to connect to server"); |
35 | } | 49 | } |
36 | return null; | 50 | return null; |
37 | 51 | ||