diff options
author | Adam Frisby | 2007-07-18 00:27:11 +0000 |
---|---|---|
committer | Adam Frisby | 2007-07-18 00:27:11 +0000 |
commit | c52f9c04e28023a54e51b941b57872322417ac1c (patch) | |
tree | 0a3c062a6bb45356b940416e855802d50fae82ca | |
parent | * Once more into the breach! (diff) | |
download | opensim-SC-c52f9c04e28023a54e51b941b57872322417ac1c.zip opensim-SC-c52f9c04e28023a54e51b941b57872322417ac1c.tar.gz opensim-SC-c52f9c04e28023a54e51b941b57872322417ac1c.tar.bz2 opensim-SC-c52f9c04e28023a54e51b941b57872322417ac1c.tar.xz |
* One hopefully-final attempt at fixing this remoting issue.
-rw-r--r-- | OpenSim/Region/Communications/OGS1/OGS1GridServices.cs | 112 |
1 files changed, 64 insertions, 48 deletions
diff --git a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs index a859826..13a37dd 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs | |||
@@ -335,37 +335,45 @@ namespace OpenSim.Region.Communications.OGS1 | |||
335 | /// <returns></returns> | 335 | /// <returns></returns> |
336 | public bool InformRegionOfChildAgent(ulong regionHandle, AgentCircuitData agentData) | 336 | public bool InformRegionOfChildAgent(ulong regionHandle, AgentCircuitData agentData) |
337 | { | 337 | { |
338 | if (this.listeners.ContainsKey(regionHandle)) | 338 | try |
339 | { | ||
340 | this.listeners[regionHandle].TriggerExpectUser(regionHandle, agentData); | ||
341 | return true; | ||
342 | } | ||
343 | RegionInfo regInfo = this.RequestNeighbourInfo(regionHandle); | ||
344 | if (regInfo != null) | ||
345 | { | 339 | { |
346 | //don't want to be creating a new link to the remote instance every time like we are here | 340 | if (this.listeners.ContainsKey(regionHandle)) |
347 | bool retValue = false; | ||
348 | |||
349 | |||
350 | OGS1InterRegionRemoting remObject = (OGS1InterRegionRemoting)Activator.GetObject( | ||
351 | typeof(OGS1InterRegionRemoting), | ||
352 | "tcp://"+ regInfo.RemotingAddress+":"+regInfo.RemotingPort+"/InterRegions"); | ||
353 | if (remObject != null) | ||
354 | { | 341 | { |
355 | 342 | this.listeners[regionHandle].TriggerExpectUser(regionHandle, agentData); | |
356 | retValue = remObject.InformRegionOfChildAgent(regionHandle, agentData); | 343 | return true; |
357 | } | 344 | } |
358 | else | 345 | RegionInfo regInfo = this.RequestNeighbourInfo(regionHandle); |
346 | if (regInfo != null) | ||
359 | { | 347 | { |
360 | Console.WriteLine("remoting object not found"); | 348 | //don't want to be creating a new link to the remote instance every time like we are here |
361 | } | 349 | bool retValue = false; |
362 | remObject = null; | 350 | |
351 | |||
352 | OGS1InterRegionRemoting remObject = (OGS1InterRegionRemoting)Activator.GetObject( | ||
353 | typeof(OGS1InterRegionRemoting), | ||
354 | "tcp://" + regInfo.RemotingAddress + ":" + regInfo.RemotingPort + "/InterRegions"); | ||
355 | if (remObject != null) | ||
356 | { | ||
357 | |||
358 | retValue = remObject.InformRegionOfChildAgent(regionHandle, agentData); | ||
359 | } | ||
360 | else | ||
361 | { | ||
362 | Console.WriteLine("remoting object not found"); | ||
363 | } | ||
364 | remObject = null; | ||
363 | 365 | ||
364 | 366 | ||
365 | return retValue; | 367 | return retValue; |
368 | } | ||
369 | |||
370 | return false; | ||
371 | } | ||
372 | catch (System.Runtime.Remoting.RemotingException e) | ||
373 | { | ||
374 | MainLog.Instance.Error("Remoting Error: Unable to connect to remote region.\n" + e.ToString()); | ||
375 | return false; | ||
366 | } | 376 | } |
367 | |||
368 | return false; | ||
369 | } | 377 | } |
370 | 378 | ||
371 | /// <summary> | 379 | /// <summary> |
@@ -377,37 +385,45 @@ namespace OpenSim.Region.Communications.OGS1 | |||
377 | /// <returns></returns> | 385 | /// <returns></returns> |
378 | public bool ExpectAvatarCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position) | 386 | public bool ExpectAvatarCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position) |
379 | { | 387 | { |
380 | if (this.listeners.ContainsKey(regionHandle)) | 388 | try |
381 | { | ||
382 | this.listeners[regionHandle].TriggerExpectAvatarCrossing(regionHandle, agentID, position); | ||
383 | return true; | ||
384 | } | ||
385 | RegionInfo regInfo = this.RequestNeighbourInfo(regionHandle); | ||
386 | if (regInfo != null) | ||
387 | { | 389 | { |
388 | bool retValue = false; | 390 | if (this.listeners.ContainsKey(regionHandle)) |
389 | |||
390 | |||
391 | OGS1InterRegionRemoting remObject = (OGS1InterRegionRemoting)Activator.GetObject( | ||
392 | typeof(OGS1InterRegionRemoting), | ||
393 | "tcp://" + regInfo.RemotingAddress + ":" + regInfo.RemotingPort + "/InterRegions"); | ||
394 | if (remObject != null) | ||
395 | { | 391 | { |
396 | 392 | this.listeners[regionHandle].TriggerExpectAvatarCrossing(regionHandle, agentID, position); | |
397 | retValue = remObject.ExpectAvatarCrossing(regionHandle, agentID, position); | 393 | return true; |
398 | } | 394 | } |
399 | else | 395 | RegionInfo regInfo = this.RequestNeighbourInfo(regionHandle); |
396 | if (regInfo != null) | ||
400 | { | 397 | { |
401 | Console.WriteLine("remoting object not found"); | 398 | bool retValue = false; |
402 | } | 399 | |
403 | remObject = null; | 400 | |
401 | OGS1InterRegionRemoting remObject = (OGS1InterRegionRemoting)Activator.GetObject( | ||
402 | typeof(OGS1InterRegionRemoting), | ||
403 | "tcp://" + regInfo.RemotingAddress + ":" + regInfo.RemotingPort + "/InterRegions"); | ||
404 | if (remObject != null) | ||
405 | { | ||
406 | |||
407 | retValue = remObject.ExpectAvatarCrossing(regionHandle, agentID, position); | ||
408 | } | ||
409 | else | ||
410 | { | ||
411 | Console.WriteLine("remoting object not found"); | ||
412 | } | ||
413 | remObject = null; | ||
404 | 414 | ||
405 | 415 | ||
406 | return retValue; | 416 | return retValue; |
417 | } | ||
418 | //TODO need to see if we know about where this region is and use .net remoting | ||
419 | // to inform it. | ||
420 | return false; | ||
421 | } | ||
422 | catch (System.Runtime.Remoting.RemotingException e) | ||
423 | { | ||
424 | MainLog.Instance.Error("Remoting Error: Unable to connect to remote region.\n" + e.ToString()); | ||
425 | return false; | ||
407 | } | 426 | } |
408 | //TODO need to see if we know about where this region is and use .net remoting | ||
409 | // to inform it. | ||
410 | return false; | ||
411 | } | 427 | } |
412 | #endregion | 428 | #endregion |
413 | 429 | ||