diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/ServiceConnectorsOut')
8 files changed, 61 insertions, 22 deletions
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authentication/LocalAuthenticationServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authentication/LocalAuthenticationServiceConnector.cs index 16f42a7..f027810 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authentication/LocalAuthenticationServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authentication/LocalAuthenticationServiceConnector.cs | |||
@@ -139,6 +139,13 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Authentication | |||
139 | 139 | ||
140 | #region IAuthenticationService | 140 | #region IAuthenticationService |
141 | 141 | ||
142 | public string Authenticate(UUID principalID, string password, int lifetime, out UUID realID) | ||
143 | { | ||
144 | // Not implemented at the regions | ||
145 | realID = UUID.Zero; | ||
146 | return string.Empty; | ||
147 | } | ||
148 | |||
142 | public string Authenticate(UUID principalID, string password, int lifetime) | 149 | public string Authenticate(UUID principalID, string password, int lifetime) |
143 | { | 150 | { |
144 | // Not implemented at the regions | 151 | // Not implemented at the regions |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/Tests/GridConnectorsTests.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/Tests/GridConnectorsTests.cs index 25ae689..c33f7f5 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/Tests/GridConnectorsTests.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/Tests/GridConnectorsTests.cs | |||
@@ -198,4 +198,4 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid.Tests | |||
198 | Assert.That(results.Count, Is.EqualTo(0), "Retrieved linked regions collection is not the number expected"); | 198 | Assert.That(results.Count, Is.EqualTo(0), "Retrieved linked regions collection is not the number expected"); |
199 | } | 199 | } |
200 | } | 200 | } |
201 | } \ No newline at end of file | 201 | } |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/MapImage/MapImageServiceModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/MapImage/MapImageServiceModule.cs index 860a526..5365b49 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/MapImage/MapImageServiceModule.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/MapImage/MapImageServiceModule.cs | |||
@@ -53,6 +53,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.MapImage | |||
53 | /// </remarks> | 53 | /// </remarks> |
54 | 54 | ||
55 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "MapImageServiceModule")] | 55 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "MapImageServiceModule")] |
56 | |||
56 | public class MapImageServiceModule : IMapImageUploadModule, ISharedRegionModule | 57 | public class MapImageServiceModule : IMapImageUploadModule, ISharedRegionModule |
57 | { | 58 | { |
58 | private static readonly ILog m_log = | 59 | private static readonly ILog m_log = |
@@ -93,9 +94,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.MapImage | |||
93 | if (config == null) | 94 | if (config == null) |
94 | return; | 95 | return; |
95 | 96 | ||
96 | int refreshminutes = Convert.ToInt32(config.GetString("RefreshTime")); | 97 | int refreshminutes = Convert.ToInt32(config.GetString("RefreshTime", "60")); |
97 | |||
98 | // if refresh is less than zero, disable the module | ||
99 | if (refreshminutes < 0) | 98 | if (refreshminutes < 0) |
100 | { | 99 | { |
101 | m_log.WarnFormat("[MAP IMAGE SERVICE MODULE]: Negative refresh time given in config. Module disabled."); | 100 | m_log.WarnFormat("[MAP IMAGE SERVICE MODULE]: Negative refresh time given in config. Module disabled."); |
@@ -128,6 +127,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.MapImage | |||
128 | m_refreshTimer.Interval = m_refreshtime; | 127 | m_refreshTimer.Interval = m_refreshtime; |
129 | m_refreshTimer.Elapsed += new ElapsedEventHandler(HandleMaptileRefresh); | 128 | m_refreshTimer.Elapsed += new ElapsedEventHandler(HandleMaptileRefresh); |
130 | 129 | ||
130 | |||
131 | m_log.InfoFormat("[MAP IMAGE SERVICE MODULE]: enabled with refresh time {0} min and service object {1}", | 131 | m_log.InfoFormat("[MAP IMAGE SERVICE MODULE]: enabled with refresh time {0} min and service object {1}", |
132 | refreshminutes, service); | 132 | refreshminutes, service); |
133 | } | 133 | } |
@@ -212,7 +212,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.MapImage | |||
212 | // If the region/maptile is legacy sized, just upload the one tile like it has always been done | 212 | // If the region/maptile is legacy sized, just upload the one tile like it has always been done |
213 | if (mapTile.Width == Constants.RegionSize && mapTile.Height == Constants.RegionSize) | 213 | if (mapTile.Width == Constants.RegionSize && mapTile.Height == Constants.RegionSize) |
214 | { | 214 | { |
215 | ConvertAndUploadMaptile(mapTile, | 215 | ConvertAndUploadMaptile(scene, mapTile, |
216 | scene.RegionInfo.RegionLocX, scene.RegionInfo.RegionLocY, | 216 | scene.RegionInfo.RegionLocX, scene.RegionInfo.RegionLocY, |
217 | scene.RegionInfo.RegionName); | 217 | scene.RegionInfo.RegionName); |
218 | } | 218 | } |
@@ -234,7 +234,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.MapImage | |||
234 | (int)Constants.RegionSize, (int)Constants.RegionSize); | 234 | (int)Constants.RegionSize, (int)Constants.RegionSize); |
235 | using (Bitmap subMapTile = mapTile.Clone(rect, mapTile.PixelFormat)) | 235 | using (Bitmap subMapTile = mapTile.Clone(rect, mapTile.PixelFormat)) |
236 | { | 236 | { |
237 | ConvertAndUploadMaptile(subMapTile, | 237 | ConvertAndUploadMaptile(scene, subMapTile, |
238 | scene.RegionInfo.RegionLocX + (xx / Constants.RegionSize), | 238 | scene.RegionInfo.RegionLocX + (xx / Constants.RegionSize), |
239 | scene.RegionInfo.RegionLocY + (yy / Constants.RegionSize), | 239 | scene.RegionInfo.RegionLocY + (yy / Constants.RegionSize), |
240 | scene.Name); | 240 | scene.Name); |
@@ -247,8 +247,10 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.MapImage | |||
247 | ///<summary> | 247 | ///<summary> |
248 | /// | 248 | /// |
249 | ///</summary> | 249 | ///</summary> |
250 | private void UploadMapTile(IScene scene) | 250 | public void UploadMapTile(IScene scene) |
251 | { | 251 | { |
252 | m_log.DebugFormat("{0}: upload maptile for {1}", LogHeader, scene.RegionInfo.RegionName); | ||
253 | |||
252 | // Create a JPG map tile and upload it to the AddMapTile API | 254 | // Create a JPG map tile and upload it to the AddMapTile API |
253 | IMapImageGenerator tileGenerator = scene.RequestModuleInterface<IMapImageGenerator>(); | 255 | IMapImageGenerator tileGenerator = scene.RequestModuleInterface<IMapImageGenerator>(); |
254 | if (tileGenerator == null) | 256 | if (tileGenerator == null) |
@@ -259,18 +261,16 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.MapImage | |||
259 | 261 | ||
260 | using (Bitmap mapTile = tileGenerator.CreateMapTile()) | 262 | using (Bitmap mapTile = tileGenerator.CreateMapTile()) |
261 | { | 263 | { |
262 | if (mapTile != null) | 264 | // XXX: The MapImageModule will return a null if the user has chosen not to create map tiles and there |
263 | { | 265 | // is no static map tile. |
264 | UploadMapTile(scene, mapTile); | 266 | if (mapTile == null) |
265 | } | 267 | return; |
266 | else | 268 | |
267 | { | 269 | UploadMapTile(scene, mapTile); |
268 | m_log.WarnFormat("{0} Tile image generation failed", LogHeader); | ||
269 | } | ||
270 | } | 270 | } |
271 | } | 271 | } |
272 | 272 | ||
273 | private void ConvertAndUploadMaptile(Image tileImage, uint locX, uint locY, string regionName) | 273 | private void ConvertAndUploadMaptile(IScene scene, Image tileImage, uint locX, uint locY, string regionName) |
274 | { | 274 | { |
275 | byte[] jpgData = Utils.EmptyBytes; | 275 | byte[] jpgData = Utils.EmptyBytes; |
276 | 276 | ||
@@ -282,7 +282,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.MapImage | |||
282 | if (jpgData != Utils.EmptyBytes) | 282 | if (jpgData != Utils.EmptyBytes) |
283 | { | 283 | { |
284 | string reason = string.Empty; | 284 | string reason = string.Empty; |
285 | if (!m_MapService.AddMapTile((int)locX, (int)locY, jpgData, out reason)) | 285 | if (!m_MapService.AddMapTile((int)locX, (int)locY, jpgData, scene.RegionInfo.ScopeID, out reason)) |
286 | { | 286 | { |
287 | m_log.DebugFormat("{0} Unable to upload tile image for {1} at {2}-{3}: {4}", LogHeader, | 287 | m_log.DebugFormat("{0} Unable to upload tile image for {1} at {2}-{3}: {4}", LogHeader, |
288 | regionName, locX, locY, reason); | 288 | regionName, locX, locY, reason); |
@@ -294,4 +294,4 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.MapImage | |||
294 | } | 294 | } |
295 | } | 295 | } |
296 | } | 296 | } |
297 | } \ No newline at end of file | 297 | } |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs index adf3a91..9d4c282 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs | |||
@@ -269,6 +269,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
269 | return true; | 269 | return true; |
270 | } | 270 | } |
271 | 271 | ||
272 | |||
272 | public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, string theirversion, List<UUID> features, out string version, out string reason) | 273 | public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, string theirversion, List<UUID> features, out string version, out string reason) |
273 | { | 274 | { |
274 | reason = "Communications failure"; | 275 | reason = "Communications failure"; |
@@ -298,6 +299,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
298 | 299 | ||
299 | } | 300 | } |
300 | 301 | ||
302 | |||
301 | return m_scenes[destination.RegionID].QueryAccess(agentID, agentHomeURI, viaTeleport, position, features, out reason); | 303 | return m_scenes[destination.RegionID].QueryAccess(agentID, agentHomeURI, viaTeleport, position, features, out reason); |
302 | } | 304 | } |
303 | 305 | ||
@@ -335,7 +337,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
335 | m_scenes[destination.RegionID].CloseAgent(id, false, auth_token); | 337 | m_scenes[destination.RegionID].CloseAgent(id, false, auth_token); |
336 | return true; | 338 | return true; |
337 | } | 339 | } |
338 | |||
339 | //m_log.Debug("[LOCAL COMMS]: region not found in SendCloseAgent"); | 340 | //m_log.Debug("[LOCAL COMMS]: region not found in SendCloseAgent"); |
340 | return false; | 341 | return false; |
341 | } | 342 | } |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs index f963242..c1daae9 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs | |||
@@ -205,6 +205,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
205 | return m_remoteConnector.UpdateAgent(destination, cAgentData); | 205 | return m_remoteConnector.UpdateAgent(destination, cAgentData); |
206 | } | 206 | } |
207 | 207 | ||
208 | |||
208 | public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, string sversion, List<UUID> features, out string version, out string reason) | 209 | public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, string sversion, List<UUID> features, out string version, out string reason) |
209 | { | 210 | { |
210 | reason = "Communications failure"; | 211 | reason = "Communications failure"; |
@@ -237,7 +238,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
237 | return false; | 238 | return false; |
238 | } | 239 | } |
239 | 240 | ||
240 | |||
241 | public bool CloseAgent(GridRegion destination, UUID id, string auth_token) | 241 | public bool CloseAgent(GridRegion destination, UUID id, string auth_token) |
242 | { | 242 | { |
243 | if (destination == null) | 243 | if (destination == null) |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/LocalUserAccountServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/LocalUserAccountServiceConnector.cs index 6d4ac39..cf9a7b4 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/LocalUserAccountServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/LocalUserAccountServiceConnector.cs | |||
@@ -129,6 +129,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts | |||
129 | // FIXME: Why do we bother setting this module and caching up if we just end up registering the inner | 129 | // FIXME: Why do we bother setting this module and caching up if we just end up registering the inner |
130 | // user account service?! | 130 | // user account service?! |
131 | scene.RegisterModuleInterface<IUserAccountService>(UserAccountService); | 131 | scene.RegisterModuleInterface<IUserAccountService>(UserAccountService); |
132 | scene.RegisterModuleInterface<IUserAccountCacheModule>(m_Cache); | ||
132 | } | 133 | } |
133 | 134 | ||
134 | public void RemoveRegion(Scene scene) | 135 | public void RemoveRegion(Scene scene) |
@@ -181,6 +182,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts | |||
181 | return UserAccountService.GetUserAccount(scopeID, Email); | 182 | return UserAccountService.GetUserAccount(scopeID, Email); |
182 | } | 183 | } |
183 | 184 | ||
185 | public List<UserAccount> GetUserAccountsWhere(UUID scopeID, string query) | ||
186 | { | ||
187 | return null; | ||
188 | } | ||
189 | |||
184 | public List<UserAccount> GetUserAccounts(UUID scopeID, string query) | 190 | public List<UserAccount> GetUserAccounts(UUID scopeID, string query) |
185 | { | 191 | { |
186 | return UserAccountService.GetUserAccounts(scopeID, query); | 192 | return UserAccountService.GetUserAccounts(scopeID, query); |
@@ -203,4 +209,4 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts | |||
203 | 209 | ||
204 | #endregion | 210 | #endregion |
205 | } | 211 | } |
206 | } \ No newline at end of file | 212 | } |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/RemoteUserAccountServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/RemoteUserAccountServiceConnector.cs index 5aa87d3..afbba30 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/RemoteUserAccountServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/RemoteUserAccountServiceConnector.cs | |||
@@ -34,6 +34,7 @@ using OpenSim.Region.Framework.Interfaces; | |||
34 | using OpenSim.Region.Framework.Scenes; | 34 | using OpenSim.Region.Framework.Scenes; |
35 | using OpenSim.Services.Interfaces; | 35 | using OpenSim.Services.Interfaces; |
36 | using OpenSim.Services.Connectors; | 36 | using OpenSim.Services.Connectors; |
37 | using OpenSim.Framework; | ||
37 | 38 | ||
38 | using OpenMetaverse; | 39 | using OpenMetaverse; |
39 | 40 | ||
@@ -103,6 +104,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts | |||
103 | return; | 104 | return; |
104 | 105 | ||
105 | scene.RegisterModuleInterface<IUserAccountService>(this); | 106 | scene.RegisterModuleInterface<IUserAccountService>(this); |
107 | scene.RegisterModuleInterface<IUserAccountCacheModule>(m_Cache); | ||
108 | |||
109 | scene.EventManager.OnNewClient += OnNewClient; | ||
106 | } | 110 | } |
107 | 111 | ||
108 | public void RemoveRegion(Scene scene) | 112 | public void RemoveRegion(Scene scene) |
@@ -117,6 +121,14 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts | |||
117 | return; | 121 | return; |
118 | } | 122 | } |
119 | 123 | ||
124 | // When a user actually enters the sim, clear them from | ||
125 | // cache so the sim will have the current values for | ||
126 | // flags, title, etc. And country, don't forget country! | ||
127 | private void OnNewClient(IClientAPI client) | ||
128 | { | ||
129 | m_Cache.Remove(client.Name); | ||
130 | } | ||
131 | |||
120 | #region Overwritten methods from IUserAccountService | 132 | #region Overwritten methods from IUserAccountService |
121 | 133 | ||
122 | public override UserAccount GetUserAccount(UUID scopeID, UUID userID) | 134 | public override UserAccount GetUserAccount(UUID scopeID, UUID userID) |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/UserAccountCache.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/UserAccountCache.cs index ed52e48..53610d9 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/UserAccountCache.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/UserAccountCache.cs | |||
@@ -34,7 +34,7 @@ using log4net; | |||
34 | 34 | ||
35 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts | 35 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts |
36 | { | 36 | { |
37 | public class UserAccountCache | 37 | public class UserAccountCache : IUserAccountCacheModule |
38 | { | 38 | { |
39 | private const double CACHE_EXPIRATION_SECONDS = 120000.0; // 33 hours! | 39 | private const double CACHE_EXPIRATION_SECONDS = 120000.0; // 33 hours! |
40 | 40 | ||
@@ -97,5 +97,18 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts | |||
97 | 97 | ||
98 | return null; | 98 | return null; |
99 | } | 99 | } |
100 | |||
101 | public void Remove(string name) | ||
102 | { | ||
103 | if (!m_NameCache.Contains(name)) | ||
104 | return; | ||
105 | |||
106 | UUID uuid = UUID.Zero; | ||
107 | if (m_NameCache.TryGetValue(name, out uuid)) | ||
108 | { | ||
109 | m_NameCache.Remove(name); | ||
110 | m_UUIDCache.Remove(uuid); | ||
111 | } | ||
112 | } | ||
100 | } | 113 | } |
101 | } | 114 | } |