diff options
Merge branch 'master' into careminster
Conflicts:
OpenSim/Region/Framework/Scenes/Scene.cs
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r-- | OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs | 20 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs | 34 |
2 files changed, 30 insertions, 24 deletions
diff --git a/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs b/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs index 640a60b..ef9b4e0 100644 --- a/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs | |||
@@ -151,6 +151,14 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm | |||
151 | 151 | ||
152 | #region IWorldComm Members | 152 | #region IWorldComm Members |
153 | 153 | ||
154 | public int ListenerCount | ||
155 | { | ||
156 | get | ||
157 | { | ||
158 | return m_listenerManager.ListenerCount; | ||
159 | } | ||
160 | } | ||
161 | |||
154 | /// <summary> | 162 | /// <summary> |
155 | /// Create a listen event callback with the specified filters. | 163 | /// Create a listen event callback with the specified filters. |
156 | /// The parameters localID,itemID are needed to uniquely identify | 164 | /// The parameters localID,itemID are needed to uniquely identify |
@@ -438,6 +446,18 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm | |||
438 | private int m_maxhandles; | 446 | private int m_maxhandles; |
439 | private int m_curlisteners; | 447 | private int m_curlisteners; |
440 | 448 | ||
449 | /// <summary> | ||
450 | /// Total number of listeners | ||
451 | /// </summary> | ||
452 | public int ListenerCount | ||
453 | { | ||
454 | get | ||
455 | { | ||
456 | lock (m_listeners) | ||
457 | return m_listeners.Count; | ||
458 | } | ||
459 | } | ||
460 | |||
441 | public ListenerManager(int maxlisteners, int maxhandles) | 461 | public ListenerManager(int maxlisteners, int maxhandles) |
442 | { | 462 | { |
443 | m_maxlisteners = maxlisteners; | 463 | m_maxlisteners = maxlisteners; |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs index 3c36799..4f0363a 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs | |||
@@ -48,8 +48,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
48 | LogManager.GetLogger( | 48 | LogManager.GetLogger( |
49 | MethodBase.GetCurrentMethod().DeclaringType); | 49 | MethodBase.GetCurrentMethod().DeclaringType); |
50 | 50 | ||
51 | private static LocalGridServicesConnector m_MainInstance; | ||
52 | |||
53 | private IGridService m_GridService; | 51 | private IGridService m_GridService; |
54 | private Dictionary<UUID, RegionCache> m_LocalCache = new Dictionary<UUID, RegionCache>(); | 52 | private Dictionary<UUID, RegionCache> m_LocalCache = new Dictionary<UUID, RegionCache>(); |
55 | 53 | ||
@@ -62,7 +60,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
62 | public LocalGridServicesConnector(IConfigSource source) | 60 | public LocalGridServicesConnector(IConfigSource source) |
63 | { | 61 | { |
64 | m_log.Debug("[LOCAL GRID CONNECTOR]: LocalGridServicesConnector instantiated"); | 62 | m_log.Debug("[LOCAL GRID CONNECTOR]: LocalGridServicesConnector instantiated"); |
65 | m_MainInstance = this; | ||
66 | InitialiseService(source); | 63 | InitialiseService(source); |
67 | } | 64 | } |
68 | 65 | ||
@@ -87,7 +84,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
87 | if (name == Name) | 84 | if (name == Name) |
88 | { | 85 | { |
89 | InitialiseService(source); | 86 | InitialiseService(source); |
90 | m_MainInstance = this; | ||
91 | m_Enabled = true; | 87 | m_Enabled = true; |
92 | m_log.Info("[LOCAL GRID CONNECTOR]: Local grid connector enabled"); | 88 | m_log.Info("[LOCAL GRID CONNECTOR]: Local grid connector enabled"); |
93 | } | 89 | } |
@@ -126,12 +122,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
126 | 122 | ||
127 | public void PostInitialise() | 123 | public void PostInitialise() |
128 | { | 124 | { |
129 | if (m_MainInstance == this) | 125 | MainConsole.Instance.Commands.AddCommand("LocalGridConnector", false, "show neighbours", |
130 | { | 126 | "show neighbours", |
131 | MainConsole.Instance.Commands.AddCommand("LocalGridConnector", false, "show neighbours", | 127 | "Shows the local regions' neighbours", NeighboursCommand); |
132 | "show neighbours", | ||
133 | "Shows the local regions' neighbours", NeighboursCommand); | ||
134 | } | ||
135 | } | 128 | } |
136 | 129 | ||
137 | public void Close() | 130 | public void Close() |
@@ -143,22 +136,16 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
143 | if (m_Enabled) | 136 | if (m_Enabled) |
144 | scene.RegisterModuleInterface<IGridService>(this); | 137 | scene.RegisterModuleInterface<IGridService>(this); |
145 | 138 | ||
146 | if (m_MainInstance == this) | 139 | if (m_LocalCache.ContainsKey(scene.RegionInfo.RegionID)) |
147 | { | 140 | m_log.ErrorFormat("[LOCAL GRID CONNECTOR]: simulator seems to have more than one region with the same UUID. Please correct this!"); |
148 | if (m_LocalCache.ContainsKey(scene.RegionInfo.RegionID)) | 141 | else |
149 | m_log.ErrorFormat("[LOCAL GRID CONNECTOR]: simulator seems to have more than one region with the same UUID. Please correct this!"); | 142 | m_LocalCache.Add(scene.RegionInfo.RegionID, new RegionCache(scene)); |
150 | else | ||
151 | m_LocalCache.Add(scene.RegionInfo.RegionID, new RegionCache(scene)); | ||
152 | } | ||
153 | } | 143 | } |
154 | 144 | ||
155 | public void RemoveRegion(Scene scene) | 145 | public void RemoveRegion(Scene scene) |
156 | { | 146 | { |
157 | if (m_MainInstance == this) | 147 | m_LocalCache[scene.RegionInfo.RegionID].Clear(); |
158 | { | 148 | m_LocalCache.Remove(scene.RegionInfo.RegionID); |
159 | m_LocalCache[scene.RegionInfo.RegionID].Clear(); | ||
160 | m_LocalCache.Remove(scene.RegionInfo.RegionID); | ||
161 | } | ||
162 | } | 149 | } |
163 | 150 | ||
164 | public void RegionLoaded(Scene scene) | 151 | public void RegionLoaded(Scene scene) |
@@ -259,6 +246,5 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
259 | 246 | ||
260 | MainConsole.Instance.Output(caps.ToString()); | 247 | MainConsole.Instance.Output(caps.ToString()); |
261 | } | 248 | } |
262 | |||
263 | } | 249 | } |
264 | } | 250 | } \ No newline at end of file |