diff options
author | Melanie Thielker | 2008-12-28 19:15:20 +0000 |
---|---|---|
committer | Melanie Thielker | 2008-12-28 19:15:20 +0000 |
commit | bafa5a3693ec054670ae19d115a5d0734ef7a68f (patch) | |
tree | 4dac6b5bc1f942306e94e7b36826a7ca47b6fab5 | |
parent | Insert a 15 seconds delay before the script engine starts loading scripts (diff) | |
download | opensim-SC_OLD-bafa5a3693ec054670ae19d115a5d0734ef7a68f.zip opensim-SC_OLD-bafa5a3693ec054670ae19d115a5d0734ef7a68f.tar.gz opensim-SC_OLD-bafa5a3693ec054670ae19d115a5d0734ef7a68f.tar.bz2 opensim-SC_OLD-bafa5a3693ec054670ae19d115a5d0734ef7a68f.tar.xz |
Demonstration code for modular comms. No user functionality
-rw-r--r-- | OpenSim/Region/Environment/Interfaces/IInterregionComms.cs | 4 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Modules/Framework/InterregionComms.cs | 37 |
2 files changed, 37 insertions, 4 deletions
diff --git a/OpenSim/Region/Environment/Interfaces/IInterregionComms.cs b/OpenSim/Region/Environment/Interfaces/IInterregionComms.cs index d2b5dad..37cf2de 100644 --- a/OpenSim/Region/Environment/Interfaces/IInterregionComms.cs +++ b/OpenSim/Region/Environment/Interfaces/IInterregionComms.cs | |||
@@ -31,8 +31,12 @@ using OpenMetaverse; | |||
31 | 31 | ||
32 | namespace OpenSim.Region.Environment.Interfaces | 32 | namespace OpenSim.Region.Environment.Interfaces |
33 | { | 33 | { |
34 | public delegate void InterregionDataReceived(InterregionData data); | ||
35 | |||
34 | public interface IInterregionComms : IRegionModule | 36 | public interface IInterregionComms : IRegionModule |
35 | { | 37 | { |
38 | event InterregionDataReceived OnInterregionData; | ||
39 | |||
36 | bool SendInterregionData(UUID destination, InterregionData data); | 40 | bool SendInterregionData(UUID destination, InterregionData data); |
37 | } | 41 | } |
38 | } | 42 | } |
diff --git a/OpenSim/Region/Environment/Modules/Framework/InterregionComms.cs b/OpenSim/Region/Environment/Modules/Framework/InterregionComms.cs index 9fe17d6..f6bcf88 100644 --- a/OpenSim/Region/Environment/Modules/Framework/InterregionComms.cs +++ b/OpenSim/Region/Environment/Modules/Framework/InterregionComms.cs | |||
@@ -47,13 +47,27 @@ namespace OpenSim.Region.Environment.Modules.Framework | |||
47 | public class InterregionCommsModule : IInterregionComms | 47 | public class InterregionCommsModule : IInterregionComms |
48 | { | 48 | { |
49 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 49 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
50 | private Scene m_Scene = null; | 50 | private List<Scene> m_SceneList = new List<Scene>(); |
51 | 51 | ||
52 | public event InterregionDataReceived OnInterregionData; | ||
53 | |||
52 | public void Initialise(Scene scene, IConfigSource config) | 54 | public void Initialise(Scene scene, IConfigSource config) |
53 | { | 55 | { |
54 | m_Scene = scene; | 56 | if (m_SceneList.Count == 0) |
57 | { | ||
58 | // Do first-time only init here | ||
59 | // | ||
60 | } | ||
61 | |||
62 | if (!m_SceneList.Contains(scene)) | ||
63 | { | ||
64 | lock(m_SceneList) | ||
65 | { | ||
66 | m_SceneList.Add(scene); | ||
67 | scene.RegisterModuleInterface<IInterregionComms>(this); | ||
68 | } | ||
55 | 69 | ||
56 | m_Scene.RegisterModuleInterface<IInterregionComms>(this); | 70 | } |
57 | } | 71 | } |
58 | 72 | ||
59 | public void PostInitialise() | 73 | public void PostInitialise() |
@@ -71,11 +85,26 @@ namespace OpenSim.Region.Environment.Modules.Framework | |||
71 | 85 | ||
72 | public bool IsSharedModule | 86 | public bool IsSharedModule |
73 | { | 87 | { |
74 | get { return false; } | 88 | get { return true; } |
75 | } | 89 | } |
76 | 90 | ||
77 | public bool SendInterregionData(UUID destination, InterregionData data) | 91 | public bool SendInterregionData(UUID destination, InterregionData data) |
78 | { | 92 | { |
93 | lock(m_SceneList) | ||
94 | { | ||
95 | foreach(Scene s in m_SceneList) | ||
96 | { | ||
97 | if (s.RegionInfo.RegionID == destination) | ||
98 | { | ||
99 | if (OnInterregionData != null) | ||
100 | OnInterregionData(data); | ||
101 | return true; | ||
102 | } | ||
103 | } | ||
104 | } | ||
105 | |||
106 | // Implement remote sending here | ||
107 | // | ||
79 | return false; | 108 | return false; |
80 | } | 109 | } |
81 | } | 110 | } |