OGS1InterSimComms.cs 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. using System;
  2. using libsecondlife;
  3. using OpenSim.Framework.Types;
  4. namespace OpenSim.Region.Communications.OGS1
  5. {
  6. public delegate bool InformRegionChild(ulong regionHandle, AgentCircuitData agentData);
  7. public delegate bool ExpectArrival(ulong regionHandle, LLUUID agentID, LLVector3 position);
  8. public sealed class InterRegionSingleton
  9. {
  10. static readonly InterRegionSingleton instance = new InterRegionSingleton();
  11. public event InformRegionChild OnChildAgent;
  12. public event ExpectArrival OnArrival;
  13. static InterRegionSingleton()
  14. {
  15. }
  16. InterRegionSingleton()
  17. {
  18. }
  19. public static InterRegionSingleton Instance
  20. {
  21. get
  22. {
  23. return instance;
  24. }
  25. }
  26. public bool InformRegionOfChildAgent(ulong regionHandle, AgentCircuitData agentData)
  27. {
  28. if (OnChildAgent != null)
  29. {
  30. return OnChildAgent(regionHandle, agentData);
  31. }
  32. return false;
  33. }
  34. public bool ExpectAvatarCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position)
  35. {
  36. if (OnArrival != null)
  37. {
  38. return OnArrival(regionHandle, agentID, position);
  39. }
  40. return false;
  41. }
  42. }
  43. public class OGS1InterRegionRemoting : MarshalByRefObject
  44. {
  45. public OGS1InterRegionRemoting()
  46. {
  47. }
  48. public bool InformRegionOfChildAgent(ulong regionHandle, AgentCircuitData agentData)
  49. {
  50. return InterRegionSingleton.Instance.InformRegionOfChildAgent(regionHandle, agentData);
  51. }
  52. public bool ExpectAvatarCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position)
  53. {
  54. return InterRegionSingleton.Instance.ExpectAvatarCrossing(regionHandle, agentID, position);
  55. }
  56. }
  57. }