aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/ServiceConnectorsOut
diff options
context:
space:
mode:
authorUbitUmarov2015-09-01 14:54:35 +0100
committerUbitUmarov2015-09-01 14:54:35 +0100
commit371c9dd2af01a2e7422ec901ee1f80757284a78c (patch)
tree058d2a513cacb12efcce0c0df0ae14ad135dbfe2 /OpenSim/Region/CoreModules/ServiceConnectorsOut
parentremove lixo (diff)
parentdont change camera on crossings (diff)
downloadopensim-SC-371c9dd2af01a2e7422ec901ee1f80757284a78c.zip
opensim-SC-371c9dd2af01a2e7422ec901ee1f80757284a78c.tar.gz
opensim-SC-371c9dd2af01a2e7422ec901ee1f80757284a78c.tar.bz2
opensim-SC-371c9dd2af01a2e7422ec901ee1f80757284a78c.tar.xz
bad merge?
Diffstat (limited to 'OpenSim/Region/CoreModules/ServiceConnectorsOut')
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Authentication/LocalAuthenticationServiceConnector.cs7
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/Tests/GridConnectorsTests.cs2
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/MapImage/MapImageServiceModule.cs69
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs27
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs15
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/LocalUserAccountServiceConnector.cs8
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/RemoteUserAccountServiceConnector.cs12
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/UserAccountCache.cs15
8 files changed, 148 insertions, 7 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 aa5f889..8df30d4 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..d786c80 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/MapImage/MapImageServiceModule.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/MapImage/MapImageServiceModule.cs
@@ -53,7 +53,11 @@ 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<<<<<<< HEAD
56 public class MapImageServiceModule : IMapImageUploadModule, ISharedRegionModule 57 public class MapImageServiceModule : IMapImageUploadModule, ISharedRegionModule
58=======
59 public class MapImageServiceModule : ISharedRegionModule, IMapImageUploadModule
60>>>>>>> avn/ubitvar
57 { 61 {
58 private static readonly ILog m_log = 62 private static readonly ILog m_log =
59 LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 63 LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
@@ -93,9 +97,13 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.MapImage
93 if (config == null) 97 if (config == null)
94 return; 98 return;
95 99
100<<<<<<< HEAD
96 int refreshminutes = Convert.ToInt32(config.GetString("RefreshTime")); 101 int refreshminutes = Convert.ToInt32(config.GetString("RefreshTime"));
97 102
98 // if refresh is less than zero, disable the module 103 // if refresh is less than zero, disable the module
104=======
105 int refreshminutes = Convert.ToInt32(config.GetString("RefreshTime", "-1"));
106>>>>>>> avn/ubitvar
99 if (refreshminutes < 0) 107 if (refreshminutes < 0)
100 { 108 {
101 m_log.WarnFormat("[MAP IMAGE SERVICE MODULE]: Negative refresh time given in config. Module disabled."); 109 m_log.WarnFormat("[MAP IMAGE SERVICE MODULE]: Negative refresh time given in config. Module disabled.");
@@ -128,7 +136,19 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.MapImage
128 m_refreshTimer.Interval = m_refreshtime; 136 m_refreshTimer.Interval = m_refreshtime;
129 m_refreshTimer.Elapsed += new ElapsedEventHandler(HandleMaptileRefresh); 137 m_refreshTimer.Elapsed += new ElapsedEventHandler(HandleMaptileRefresh);
130 138
139<<<<<<< HEAD
131 m_log.InfoFormat("[MAP IMAGE SERVICE MODULE]: enabled with refresh time {0} min and service object {1}", 140 m_log.InfoFormat("[MAP IMAGE SERVICE MODULE]: enabled with refresh time {0} min and service object {1}",
141=======
142 if (m_refreshtime > 0)
143 {
144 m_refreshTimer.Enabled = true;
145 m_refreshTimer.AutoReset = true;
146 m_refreshTimer.Interval = m_refreshtime;
147 m_refreshTimer.Elapsed += new ElapsedEventHandler(HandleMaptileRefresh);
148 }
149
150 m_log.InfoFormat("[MAP IMAGE SERVICE MODULE]: enabled with refresh time {0} min and service object {1}",
151>>>>>>> avn/ubitvar
132 refreshminutes, service); 152 refreshminutes, service);
133 } 153 }
134 else 154 else
@@ -154,7 +174,10 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.MapImage
154 // v2 Map generation on startup is now handled by scene to allow bmp to be shared with 174 // v2 Map generation on startup is now handled by scene to allow bmp to be shared with
155 // v1 service and not generate map tiles twice as was previous behavior 175 // v1 service and not generate map tiles twice as was previous behavior
156 //scene.EventManager.OnRegionReadyStatusChange += s => { if (s.Ready) UploadMapTile(s); }; 176 //scene.EventManager.OnRegionReadyStatusChange += s => { if (s.Ready) UploadMapTile(s); };
177<<<<<<< HEAD
157 178
179=======
180>>>>>>> avn/ubitvar
158 scene.RegisterModuleInterface<IMapImageUploadModule>(this); 181 scene.RegisterModuleInterface<IMapImageUploadModule>(this);
159 } 182 }
160 183
@@ -212,9 +235,15 @@ 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 235 // 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) 236 if (mapTile.Width == Constants.RegionSize && mapTile.Height == Constants.RegionSize)
214 { 237 {
238<<<<<<< HEAD
215 ConvertAndUploadMaptile(mapTile, 239 ConvertAndUploadMaptile(mapTile,
216 scene.RegionInfo.RegionLocX, scene.RegionInfo.RegionLocY, 240 scene.RegionInfo.RegionLocX, scene.RegionInfo.RegionLocY,
217 scene.RegionInfo.RegionName); 241 scene.RegionInfo.RegionName);
242=======
243 ConvertAndUploadMaptile(mapTile, scene,
244 scene.RegionInfo.RegionLocX, scene.RegionInfo.RegionLocY,
245 scene.RegionInfo.RegionName);
246>>>>>>> avn/ubitvar
218 } 247 }
219 else 248 else
220 { 249 {
@@ -234,10 +263,17 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.MapImage
234 (int)Constants.RegionSize, (int)Constants.RegionSize); 263 (int)Constants.RegionSize, (int)Constants.RegionSize);
235 using (Bitmap subMapTile = mapTile.Clone(rect, mapTile.PixelFormat)) 264 using (Bitmap subMapTile = mapTile.Clone(rect, mapTile.PixelFormat))
236 { 265 {
266<<<<<<< HEAD
237 ConvertAndUploadMaptile(subMapTile, 267 ConvertAndUploadMaptile(subMapTile,
238 scene.RegionInfo.RegionLocX + (xx / Constants.RegionSize), 268 scene.RegionInfo.RegionLocX + (xx / Constants.RegionSize),
239 scene.RegionInfo.RegionLocY + (yy / Constants.RegionSize), 269 scene.RegionInfo.RegionLocY + (yy / Constants.RegionSize),
240 scene.Name); 270 scene.Name);
271=======
272 ConvertAndUploadMaptile(subMapTile, scene,
273 scene.RegionInfo.RegionLocX + (xx / Constants.RegionSize),
274 scene.RegionInfo.RegionLocY + (yy / Constants.RegionSize),
275 scene.Name);
276>>>>>>> avn/ubitvar
241 } 277 }
242 } 278 }
243 } 279 }
@@ -247,8 +283,13 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.MapImage
247 ///<summary> 283 ///<summary>
248 /// 284 ///
249 ///</summary> 285 ///</summary>
250 private void UploadMapTile(IScene scene) 286 public void UploadMapTile(IScene scene)
251 { 287 {
288<<<<<<< HEAD
289=======
290 m_log.DebugFormat("{0}: upload maptile for {1}", LogHeader, scene.RegionInfo.RegionName);
291
292>>>>>>> avn/ubitvar
252 // Create a JPG map tile and upload it to the AddMapTile API 293 // Create a JPG map tile and upload it to the AddMapTile API
253 IMapImageGenerator tileGenerator = scene.RequestModuleInterface<IMapImageGenerator>(); 294 IMapImageGenerator tileGenerator = scene.RequestModuleInterface<IMapImageGenerator>();
254 if (tileGenerator == null) 295 if (tileGenerator == null)
@@ -259,6 +300,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.MapImage
259 300
260 using (Bitmap mapTile = tileGenerator.CreateMapTile()) 301 using (Bitmap mapTile = tileGenerator.CreateMapTile())
261 { 302 {
303<<<<<<< HEAD
262 if (mapTile != null) 304 if (mapTile != null)
263 { 305 {
264 UploadMapTile(scene, mapTile); 306 UploadMapTile(scene, mapTile);
@@ -274,6 +316,21 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.MapImage
274 { 316 {
275 byte[] jpgData = Utils.EmptyBytes; 317 byte[] jpgData = Utils.EmptyBytes;
276 318
319=======
320 // XXX: The MapImageModule will return a null if the user has chosen not to create map tiles and there
321 // is no static map tile.
322 if (mapTile == null)
323 return;
324
325 UploadMapTile(scene, mapTile);
326 }
327 }
328
329 private void ConvertAndUploadMaptile(Image tileImage, IScene scene, uint locX, uint locY, string regionName)
330 {
331 byte[] jpgData = Utils.EmptyBytes;
332
333>>>>>>> avn/ubitvar
277 using (MemoryStream stream = new MemoryStream()) 334 using (MemoryStream stream = new MemoryStream())
278 { 335 {
279 tileImage.Save(stream, ImageFormat.Jpeg); 336 tileImage.Save(stream, ImageFormat.Jpeg);
@@ -282,7 +339,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.MapImage
282 if (jpgData != Utils.EmptyBytes) 339 if (jpgData != Utils.EmptyBytes)
283 { 340 {
284 string reason = string.Empty; 341 string reason = string.Empty;
342<<<<<<< HEAD
285 if (!m_MapService.AddMapTile((int)locX, (int)locY, jpgData, out reason)) 343 if (!m_MapService.AddMapTile((int)locX, (int)locY, jpgData, out reason))
344=======
345 if (!m_MapService.AddMapTile((int)locX, (int)locY, jpgData, scene.RegionInfo.ScopeID, out reason))
346>>>>>>> avn/ubitvar
286 { 347 {
287 m_log.DebugFormat("{0} Unable to upload tile image for {1} at {2}-{3}: {4}", LogHeader, 348 m_log.DebugFormat("{0} Unable to upload tile image for {1} at {2}-{3}: {4}", LogHeader,
288 regionName, locX, locY, reason); 349 regionName, locX, locY, reason);
@@ -290,8 +351,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.MapImage
290 } 351 }
291 else 352 else
292 { 353 {
354<<<<<<< HEAD
293 m_log.WarnFormat("{0} Tile image generation failed for region {1}", LogHeader, regionName); 355 m_log.WarnFormat("{0} Tile image generation failed for region {1}", LogHeader, regionName);
356=======
357 m_log.WarnFormat("{0} Tile image generation failed for region {1}", LogHeader, scene.RegionInfo.RegionName);
358>>>>>>> avn/ubitvar
294 } 359 }
295 } 360 }
296 } 361 }
297} \ No newline at end of file 362}
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs
index adf3a91..50238a5 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs
@@ -269,7 +269,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
269 return true; 269 return true;
270 } 270 }
271 271
272<<<<<<< HEAD
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)
274=======
275 public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, string theirversion, out string version, out string reason)
276>>>>>>> avn/ubitvar
273 { 277 {
274 reason = "Communications failure"; 278 reason = "Communications failure";
275 version = ServiceVersion; 279 version = ServiceVersion;
@@ -298,7 +302,29 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
298 302
299 } 303 }
300 304
305<<<<<<< HEAD
301 return m_scenes[destination.RegionID].QueryAccess(agentID, agentHomeURI, viaTeleport, position, features, out reason); 306 return m_scenes[destination.RegionID].QueryAccess(agentID, agentHomeURI, viaTeleport, position, features, out reason);
307=======
308
309 // not really need on a grid running var regions sims
310
311 uint size = m_scenes[destination.RegionID].RegionInfo.RegionSizeX;
312
313 float theirVersionNumber = 0f;
314 string[] versionComponents = theirversion.Split(new char[] { '/' });
315 if (versionComponents.Length >= 2)
316 float.TryParse(versionComponents[1], out theirVersionNumber);
317
318 // Var regions here, and the requesting simulator is in an older version.
319 // We will forbide this, because it crashes the viewers
320 if (theirVersionNumber < 0.3f && size > 256)
321 {
322 reason = "Destination is a variable-sized region, and source is an old simulator. Consider upgrading.";
323 m_log.DebugFormat("[LOCAL SIMULATION CONNECTOR]: Request to access this variable-sized region from {0} simulator was denied", theirVersionNumber);
324 return false;
325 }
326 return m_scenes[destination.RegionID].QueryAccess(agentID, position, out reason);
327>>>>>>> avn/ubitvar
302 } 328 }
303 329
304 //m_log.Debug("[LOCAL COMMS]: region not found for QueryAccess"); 330 //m_log.Debug("[LOCAL COMMS]: region not found for QueryAccess");
@@ -335,7 +361,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
335 m_scenes[destination.RegionID].CloseAgent(id, false, auth_token); 361 m_scenes[destination.RegionID].CloseAgent(id, false, auth_token);
336 return true; 362 return true;
337 } 363 }
338
339 //m_log.Debug("[LOCAL COMMS]: region not found in SendCloseAgent"); 364 //m_log.Debug("[LOCAL COMMS]: region not found in SendCloseAgent");
340 return false; 365 return false;
341 } 366 }
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs
index dca3dd7..7044d92 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs
@@ -206,7 +206,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
206 return m_remoteConnector.UpdateAgent(destination, cAgentData); 206 return m_remoteConnector.UpdateAgent(destination, cAgentData);
207 } 207 }
208 208
209<<<<<<< HEAD
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) 210 public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, string sversion, List<UUID> features, out string version, out string reason)
211=======
212 public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, string sversion, out string version, out string reason)
213>>>>>>> avn/ubitvar
210 { 214 {
211 reason = "Communications failure"; 215 reason = "Communications failure";
212 version = "Unknown"; 216 version = "Unknown";
@@ -215,12 +219,22 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
215 return false; 219 return false;
216 220
217 // Try local first 221 // Try local first
222<<<<<<< HEAD
218 if (m_localBackend.QueryAccess(destination, agentID, agentHomeURI, viaTeleport, position, sversion, features, out version, out reason)) 223 if (m_localBackend.QueryAccess(destination, agentID, agentHomeURI, viaTeleport, position, sversion, features, out version, out reason))
224=======
225 if (m_localBackend.QueryAccess(destination, agentID, agentHomeURI, viaTeleport, position, sversion, out version, out reason))
226 return true;
227>>>>>>> avn/ubitvar
219 return true; 228 return true;
220 229
221 // else do the remote thing 230 // else do the remote thing
222 if (!m_localBackend.IsLocalRegion(destination.RegionID)) 231 if (!m_localBackend.IsLocalRegion(destination.RegionID))
232<<<<<<< HEAD
223 return m_remoteConnector.QueryAccess(destination, agentID, agentHomeURI, viaTeleport, position, sversion, features, out version, out reason); 233 return m_remoteConnector.QueryAccess(destination, agentID, agentHomeURI, viaTeleport, position, sversion, features, out version, out reason);
234=======
235 return m_remoteConnector.QueryAccess(destination, agentID, agentHomeURI, viaTeleport, position, sversion, out version, out reason);
236
237>>>>>>> avn/ubitvar
224 238
225 return false; 239 return false;
226 } 240 }
@@ -238,7 +252,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
238 return false; 252 return false;
239 } 253 }
240 254
241
242 public bool CloseAgent(GridRegion destination, UUID id, string auth_token) 255 public bool CloseAgent(GridRegion destination, UUID id, string auth_token)
243 { 256 {
244 if (destination == null) 257 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;
34using OpenSim.Region.Framework.Scenes; 34using OpenSim.Region.Framework.Scenes;
35using OpenSim.Services.Interfaces; 35using OpenSim.Services.Interfaces;
36using OpenSim.Services.Connectors; 36using OpenSim.Services.Connectors;
37using OpenSim.Framework;
37 38
38using OpenMetaverse; 39using 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
35namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts 35namespace 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}