diff options
author | Justin Clark-Casey (justincc) | 2009-09-24 17:35:03 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2009-09-24 17:35:03 +0100 |
commit | ad753d784cfefacd8fb745a1431bf98feac9bbd6 (patch) | |
tree | 795ec1ba25eada570c342746f07654849a7199f4 /OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs | |
parent | minor: make rest (not comm) modules less noisy if they are disabled (diff) | |
parent | Changed name of the hyperlink XMLRPC method to linkk-region, so that it doesn... (diff) | |
download | opensim-SC_OLD-ad753d784cfefacd8fb745a1431bf98feac9bbd6.zip opensim-SC_OLD-ad753d784cfefacd8fb745a1431bf98feac9bbd6.tar.gz opensim-SC_OLD-ad753d784cfefacd8fb745a1431bf98feac9bbd6.tar.bz2 opensim-SC_OLD-ad753d784cfefacd8fb745a1431bf98feac9bbd6.tar.xz |
Merge branch 'master' of ssh://justincc@opensimulator.org/var/git/opensim
Diffstat (limited to 'OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs | 84 |
1 files changed, 50 insertions, 34 deletions
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs index 74ece2e..743d3b9 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs | |||
@@ -35,6 +35,7 @@ using OpenSim.Server.Base; | |||
35 | using OpenSim.Region.Framework.Interfaces; | 35 | using OpenSim.Region.Framework.Interfaces; |
36 | using OpenSim.Region.Framework.Scenes; | 36 | using OpenSim.Region.Framework.Scenes; |
37 | using OpenSim.Services.Interfaces; | 37 | using OpenSim.Services.Interfaces; |
38 | using GridRegion = OpenSim.Services.Interfaces.GridRegion; | ||
38 | using OpenMetaverse; | 39 | using OpenMetaverse; |
39 | 40 | ||
40 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | 41 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid |
@@ -50,6 +51,16 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
50 | 51 | ||
51 | private bool m_Enabled = false; | 52 | private bool m_Enabled = false; |
52 | 53 | ||
54 | public LocalGridServicesConnector() | ||
55 | { | ||
56 | } | ||
57 | |||
58 | public LocalGridServicesConnector(IConfigSource source) | ||
59 | { | ||
60 | m_log.Debug("[LOCAL GRID CONNECTOR]: LocalGridServicesConnector instantiated"); | ||
61 | InitialiseService(source); | ||
62 | } | ||
63 | |||
53 | #region ISharedRegionModule | 64 | #region ISharedRegionModule |
54 | 65 | ||
55 | public Type ReplaceableInterface | 66 | public Type ReplaceableInterface |
@@ -70,38 +81,43 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
70 | string name = moduleConfig.GetString("GridServices", ""); | 81 | string name = moduleConfig.GetString("GridServices", ""); |
71 | if (name == Name) | 82 | if (name == Name) |
72 | { | 83 | { |
73 | IConfig assetConfig = source.Configs["GridService"]; | 84 | InitialiseService(source); |
74 | if (assetConfig == null) | ||
75 | { | ||
76 | m_log.Error("[GRID CONNECTOR]: GridService missing from OpenSim.ini"); | ||
77 | return; | ||
78 | } | ||
79 | |||
80 | string serviceDll = assetConfig.GetString("LocalServiceModule", | ||
81 | String.Empty); | ||
82 | |||
83 | if (serviceDll == String.Empty) | ||
84 | { | ||
85 | m_log.Error("[GRID CONNECTOR]: No LocalServiceModule named in section GridService"); | ||
86 | return; | ||
87 | } | ||
88 | |||
89 | Object[] args = new Object[] { source }; | ||
90 | m_GridService = | ||
91 | ServerUtils.LoadPlugin<IGridService>(serviceDll, | ||
92 | args); | ||
93 | |||
94 | if (m_GridService == null) | ||
95 | { | ||
96 | m_log.Error("[GRID CONNECTOR]: Can't load asset service"); | ||
97 | return; | ||
98 | } | ||
99 | m_Enabled = true; | 85 | m_Enabled = true; |
100 | m_log.Info("[GRID CONNECTOR]: Local grid connector enabled"); | 86 | m_log.Info("[LOCAL GRID CONNECTOR]: Local grid connector enabled"); |
101 | } | 87 | } |
102 | } | 88 | } |
103 | } | 89 | } |
104 | 90 | ||
91 | private void InitialiseService(IConfigSource source) | ||
92 | { | ||
93 | IConfig assetConfig = source.Configs["GridService"]; | ||
94 | if (assetConfig == null) | ||
95 | { | ||
96 | m_log.Error("[LOCAL GRID CONNECTOR]: GridService missing from OpenSim.ini"); | ||
97 | return; | ||
98 | } | ||
99 | |||
100 | string serviceDll = assetConfig.GetString("LocalServiceModule", | ||
101 | String.Empty); | ||
102 | |||
103 | if (serviceDll == String.Empty) | ||
104 | { | ||
105 | m_log.Error("[LOCAL GRID CONNECTOR]: No LocalServiceModule named in section GridService"); | ||
106 | return; | ||
107 | } | ||
108 | |||
109 | Object[] args = new Object[] { source }; | ||
110 | m_GridService = | ||
111 | ServerUtils.LoadPlugin<IGridService>(serviceDll, | ||
112 | args); | ||
113 | |||
114 | if (m_GridService == null) | ||
115 | { | ||
116 | m_log.Error("[LOCAL GRID CONNECTOR]: Can't load grid service"); | ||
117 | return; | ||
118 | } | ||
119 | } | ||
120 | |||
105 | public void PostInitialise() | 121 | public void PostInitialise() |
106 | { | 122 | { |
107 | } | 123 | } |
@@ -130,7 +146,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
130 | 146 | ||
131 | #region IGridService | 147 | #region IGridService |
132 | 148 | ||
133 | public bool RegisterRegion(UUID scopeID, SimpleRegionInfo regionInfo) | 149 | public bool RegisterRegion(UUID scopeID, GridRegion regionInfo) |
134 | { | 150 | { |
135 | return m_GridService.RegisterRegion(scopeID, regionInfo); | 151 | return m_GridService.RegisterRegion(scopeID, regionInfo); |
136 | } | 152 | } |
@@ -140,32 +156,32 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
140 | return m_GridService.DeregisterRegion(regionID); | 156 | return m_GridService.DeregisterRegion(regionID); |
141 | } | 157 | } |
142 | 158 | ||
143 | public List<SimpleRegionInfo> GetNeighbours(UUID scopeID, UUID regionID) | 159 | public List<GridRegion> GetNeighbours(UUID scopeID, UUID regionID) |
144 | { | 160 | { |
145 | return m_GridService.GetNeighbours(scopeID, regionID); | 161 | return m_GridService.GetNeighbours(scopeID, regionID); |
146 | } | 162 | } |
147 | 163 | ||
148 | public SimpleRegionInfo GetRegionByUUID(UUID scopeID, UUID regionID) | 164 | public GridRegion GetRegionByUUID(UUID scopeID, UUID regionID) |
149 | { | 165 | { |
150 | return m_GridService.GetRegionByUUID(scopeID, regionID); | 166 | return m_GridService.GetRegionByUUID(scopeID, regionID); |
151 | } | 167 | } |
152 | 168 | ||
153 | public SimpleRegionInfo GetRegionByPosition(UUID scopeID, int x, int y) | 169 | public GridRegion GetRegionByPosition(UUID scopeID, int x, int y) |
154 | { | 170 | { |
155 | return m_GridService.GetRegionByPosition(scopeID, x, y); | 171 | return m_GridService.GetRegionByPosition(scopeID, x, y); |
156 | } | 172 | } |
157 | 173 | ||
158 | public SimpleRegionInfo GetRegionByName(UUID scopeID, string regionName) | 174 | public GridRegion GetRegionByName(UUID scopeID, string regionName) |
159 | { | 175 | { |
160 | return m_GridService.GetRegionByName(scopeID, regionName); | 176 | return m_GridService.GetRegionByName(scopeID, regionName); |
161 | } | 177 | } |
162 | 178 | ||
163 | public List<SimpleRegionInfo> GetRegionsByName(UUID scopeID, string name, int maxNumber) | 179 | public List<GridRegion> GetRegionsByName(UUID scopeID, string name, int maxNumber) |
164 | { | 180 | { |
165 | return m_GridService.GetRegionsByName(scopeID, name, maxNumber); | 181 | return m_GridService.GetRegionsByName(scopeID, name, maxNumber); |
166 | } | 182 | } |
167 | 183 | ||
168 | public List<SimpleRegionInfo> GetRegionRange(UUID scopeID, int xmin, int xmax, int ymin, int ymax) | 184 | public List<GridRegion> GetRegionRange(UUID scopeID, int xmin, int xmax, int ymin, int ymax) |
169 | { | 185 | { |
170 | return m_GridService.GetRegionRange(scopeID, xmin, xmax, ymin, ymax); | 186 | return m_GridService.GetRegionRange(scopeID, xmin, xmax, ymin, ymax); |
171 | } | 187 | } |