diff options
Diffstat (limited to 'OpenSim/Services')
6 files changed, 131 insertions, 4 deletions
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs index 816591b..c928f16 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs | |||
@@ -443,9 +443,13 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
443 | region.RegionName = response["Name"].AsString(); | 443 | region.RegionName = response["Name"].AsString(); |
444 | 444 | ||
445 | Vector3d minPosition = response["MinPosition"].AsVector3d(); | 445 | Vector3d minPosition = response["MinPosition"].AsVector3d(); |
446 | Vector3d maxPosition = response["MaxPosition"].AsVector3d(); | ||
446 | region.RegionLocX = (int)minPosition.X; | 447 | region.RegionLocX = (int)minPosition.X; |
447 | region.RegionLocY = (int)minPosition.Y; | 448 | region.RegionLocY = (int)minPosition.Y; |
448 | 449 | ||
450 | region.RegionSizeX = (int)maxPosition.X - (int)minPosition.X; | ||
451 | region.RegionSizeY = (int)maxPosition.Y - (int)minPosition.Y; | ||
452 | |||
449 | if ( ! extraData["HyperGrid"] ) { | 453 | if ( ! extraData["HyperGrid"] ) { |
450 | Uri httpAddress = response["Address"].AsUri(); | 454 | Uri httpAddress = response["Address"].AsUri(); |
451 | region.ExternalHostName = httpAddress.Host; | 455 | region.ExternalHostName = httpAddress.Host; |
diff --git a/OpenSim/Services/GridService/GridService.cs b/OpenSim/Services/GridService/GridService.cs index e72b7f9..137ce04 100644 --- a/OpenSim/Services/GridService/GridService.cs +++ b/OpenSim/Services/GridService/GridService.cs | |||
@@ -313,8 +313,9 @@ namespace OpenSim.Services.GridService | |||
313 | if (region != null) | 313 | if (region != null) |
314 | { | 314 | { |
315 | // Not really? Maybe? | 315 | // Not really? Maybe? |
316 | List<RegionData> rdatas = m_Database.Get(region.posX - (int)Constants.RegionSize - 1, region.posY - (int)Constants.RegionSize - 1, | 316 | List<RegionData> rdatas = m_Database.Get( |
317 | region.posX + (int)Constants.RegionSize + 1, region.posY + (int)Constants.RegionSize + 1, scopeID); | 317 | region.posX - region.sizeX - 1, region.posY - region.sizeY - 1, |
318 | region.posX + region.sizeX + 1, region.posY + region.sizeY + 1, scopeID); | ||
318 | 319 | ||
319 | foreach (RegionData rdata in rdatas) | 320 | foreach (RegionData rdata in rdatas) |
320 | { | 321 | { |
@@ -347,6 +348,11 @@ namespace OpenSim.Services.GridService | |||
347 | return null; | 348 | return null; |
348 | } | 349 | } |
349 | 350 | ||
351 | // Get a region given its base coordinates. | ||
352 | // NOTE: this is NOT 'get a region by some point in the region'. The coordinate MUST | ||
353 | // be the base coordinate of the region. | ||
354 | // The snapping is technically unnecessary but is harmless because regions are always | ||
355 | // multiples of the legacy region size (256). | ||
350 | public GridRegion GetRegionByPosition(UUID scopeID, int x, int y) | 356 | public GridRegion GetRegionByPosition(UUID scopeID, int x, int y) |
351 | { | 357 | { |
352 | int snapX = (int)(x / Constants.RegionSize) * (int)Constants.RegionSize; | 358 | int snapX = (int)(x / Constants.RegionSize) * (int)Constants.RegionSize; |
@@ -441,6 +447,8 @@ namespace OpenSim.Services.GridService | |||
441 | RegionData rdata = new RegionData(); | 447 | RegionData rdata = new RegionData(); |
442 | rdata.posX = (int)rinfo.RegionLocX; | 448 | rdata.posX = (int)rinfo.RegionLocX; |
443 | rdata.posY = (int)rinfo.RegionLocY; | 449 | rdata.posY = (int)rinfo.RegionLocY; |
450 | rdata.sizeX = rinfo.RegionSizeX; | ||
451 | rdata.sizeY = rinfo.RegionSizeY; | ||
444 | rdata.RegionID = rinfo.RegionID; | 452 | rdata.RegionID = rinfo.RegionID; |
445 | rdata.RegionName = rinfo.RegionName; | 453 | rdata.RegionName = rinfo.RegionName; |
446 | rdata.Data = rinfo.ToKeyValuePairs(); | 454 | rdata.Data = rinfo.ToKeyValuePairs(); |
@@ -454,6 +462,8 @@ namespace OpenSim.Services.GridService | |||
454 | GridRegion rinfo = new GridRegion(rdata.Data); | 462 | GridRegion rinfo = new GridRegion(rdata.Data); |
455 | rinfo.RegionLocX = rdata.posX; | 463 | rinfo.RegionLocX = rdata.posX; |
456 | rinfo.RegionLocY = rdata.posY; | 464 | rinfo.RegionLocY = rdata.posY; |
465 | rinfo.RegionSizeX = rdata.sizeX; | ||
466 | rinfo.RegionSizeY = rdata.sizeY; | ||
457 | rinfo.RegionID = rdata.RegionID; | 467 | rinfo.RegionID = rdata.RegionID; |
458 | rinfo.RegionName = rdata.RegionName; | 468 | rinfo.RegionName = rdata.RegionName; |
459 | rinfo.ScopeID = rdata.ScopeID; | 469 | rinfo.ScopeID = rdata.ScopeID; |
diff --git a/OpenSim/Services/Interfaces/IGridService.cs b/OpenSim/Services/Interfaces/IGridService.cs index 88ac5b3..739e279 100644 --- a/OpenSim/Services/Interfaces/IGridService.cs +++ b/OpenSim/Services/Interfaces/IGridService.cs | |||
@@ -29,9 +29,13 @@ using System; | |||
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.Net; | 30 | using System.Net; |
31 | using System.Net.Sockets; | 31 | using System.Net.Sockets; |
32 | using System.Reflection; | ||
33 | |||
32 | using OpenSim.Framework; | 34 | using OpenSim.Framework; |
33 | using OpenMetaverse; | 35 | using OpenMetaverse; |
34 | 36 | ||
37 | using log4net; | ||
38 | |||
35 | namespace OpenSim.Services.Interfaces | 39 | namespace OpenSim.Services.Interfaces |
36 | { | 40 | { |
37 | public interface IGridService | 41 | public interface IGridService |
@@ -119,6 +123,9 @@ namespace OpenSim.Services.Interfaces | |||
119 | 123 | ||
120 | public class GridRegion | 124 | public class GridRegion |
121 | { | 125 | { |
126 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
127 | private static readonly string LogHeader = "[GRID REGION]"; | ||
128 | |||
122 | /// <summary> | 129 | /// <summary> |
123 | /// The port by which http communication occurs with the region | 130 | /// The port by which http communication occurs with the region |
124 | /// </summary> | 131 | /// </summary> |
@@ -177,6 +184,7 @@ namespace OpenSim.Services.Interfaces | |||
177 | 184 | ||
178 | /// <summary> | 185 | /// <summary> |
179 | /// The location of this region in meters. | 186 | /// The location of this region in meters. |
187 | /// DANGER DANGER! Note that this name means something different in RegionInfo. | ||
180 | /// </summary> | 188 | /// </summary> |
181 | public int RegionLocX | 189 | public int RegionLocX |
182 | { | 190 | { |
@@ -185,8 +193,12 @@ namespace OpenSim.Services.Interfaces | |||
185 | } | 193 | } |
186 | protected int m_regionLocX; | 194 | protected int m_regionLocX; |
187 | 195 | ||
196 | public int RegionSizeX { get; set; } | ||
197 | public int RegionSizeY { get; set; } | ||
198 | |||
188 | /// <summary> | 199 | /// <summary> |
189 | /// The location of this region in meters. | 200 | /// The location of this region in meters. |
201 | /// DANGER DANGER! Note that this name means something different in RegionInfo. | ||
190 | /// </summary> | 202 | /// </summary> |
191 | public int RegionLocY | 203 | public int RegionLocY |
192 | { | 204 | { |
@@ -215,13 +227,18 @@ namespace OpenSim.Services.Interfaces | |||
215 | 227 | ||
216 | public GridRegion() | 228 | public GridRegion() |
217 | { | 229 | { |
230 | RegionSizeX = (int)Constants.RegionSize; | ||
231 | RegionSizeY = (int)Constants.RegionSize; | ||
218 | m_serverURI = string.Empty; | 232 | m_serverURI = string.Empty; |
219 | } | 233 | } |
220 | 234 | ||
235 | /* | ||
221 | public GridRegion(int regionLocX, int regionLocY, IPEndPoint internalEndPoint, string externalUri) | 236 | public GridRegion(int regionLocX, int regionLocY, IPEndPoint internalEndPoint, string externalUri) |
222 | { | 237 | { |
223 | m_regionLocX = regionLocX; | 238 | m_regionLocX = regionLocX; |
224 | m_regionLocY = regionLocY; | 239 | m_regionLocY = regionLocY; |
240 | RegionSizeX = (int)Constants.RegionSize; | ||
241 | RegionSizeY = (int)Constants.RegionSize; | ||
225 | 242 | ||
226 | m_internalEndPoint = internalEndPoint; | 243 | m_internalEndPoint = internalEndPoint; |
227 | m_externalHostName = externalUri; | 244 | m_externalHostName = externalUri; |
@@ -231,16 +248,21 @@ namespace OpenSim.Services.Interfaces | |||
231 | { | 248 | { |
232 | m_regionLocX = regionLocX; | 249 | m_regionLocX = regionLocX; |
233 | m_regionLocY = regionLocY; | 250 | m_regionLocY = regionLocY; |
251 | RegionSizeX = (int)Constants.RegionSize; | ||
252 | RegionSizeY = (int)Constants.RegionSize; | ||
234 | 253 | ||
235 | m_externalHostName = externalUri; | 254 | m_externalHostName = externalUri; |
236 | 255 | ||
237 | m_internalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), (int)port); | 256 | m_internalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), (int)port); |
238 | } | 257 | } |
258 | */ | ||
239 | 259 | ||
240 | public GridRegion(uint xcell, uint ycell) | 260 | public GridRegion(uint xcell, uint ycell) |
241 | { | 261 | { |
242 | m_regionLocX = (int)(xcell * Constants.RegionSize); | 262 | m_regionLocX = (int)(xcell * Constants.RegionSize); |
243 | m_regionLocY = (int)(ycell * Constants.RegionSize); | 263 | m_regionLocY = (int)(ycell * Constants.RegionSize); |
264 | RegionSizeX = (int)Constants.RegionSize; | ||
265 | RegionSizeY = (int)Constants.RegionSize; | ||
244 | } | 266 | } |
245 | 267 | ||
246 | public GridRegion(RegionInfo ConvertFrom) | 268 | public GridRegion(RegionInfo ConvertFrom) |
@@ -248,6 +270,8 @@ namespace OpenSim.Services.Interfaces | |||
248 | m_regionName = ConvertFrom.RegionName; | 270 | m_regionName = ConvertFrom.RegionName; |
249 | m_regionLocX = (int)(ConvertFrom.RegionLocX * Constants.RegionSize); | 271 | m_regionLocX = (int)(ConvertFrom.RegionLocX * Constants.RegionSize); |
250 | m_regionLocY = (int)(ConvertFrom.RegionLocY * Constants.RegionSize); | 272 | m_regionLocY = (int)(ConvertFrom.RegionLocY * Constants.RegionSize); |
273 | RegionSizeX = (int)ConvertFrom.RegionSizeX; | ||
274 | RegionSizeY = (int)ConvertFrom.RegionSizeY; | ||
251 | m_internalEndPoint = ConvertFrom.InternalEndPoint; | 275 | m_internalEndPoint = ConvertFrom.InternalEndPoint; |
252 | m_externalHostName = ConvertFrom.ExternalHostName; | 276 | m_externalHostName = ConvertFrom.ExternalHostName; |
253 | m_httpPort = ConvertFrom.HttpPort; | 277 | m_httpPort = ConvertFrom.HttpPort; |
@@ -266,6 +290,8 @@ namespace OpenSim.Services.Interfaces | |||
266 | m_regionName = ConvertFrom.RegionName; | 290 | m_regionName = ConvertFrom.RegionName; |
267 | m_regionLocX = ConvertFrom.RegionLocX; | 291 | m_regionLocX = ConvertFrom.RegionLocX; |
268 | m_regionLocY = ConvertFrom.RegionLocY; | 292 | m_regionLocY = ConvertFrom.RegionLocY; |
293 | RegionSizeX = ConvertFrom.RegionSizeX; | ||
294 | RegionSizeY = ConvertFrom.RegionSizeY; | ||
269 | m_internalEndPoint = ConvertFrom.InternalEndPoint; | 295 | m_internalEndPoint = ConvertFrom.InternalEndPoint; |
270 | m_externalHostName = ConvertFrom.ExternalHostName; | 296 | m_externalHostName = ConvertFrom.ExternalHostName; |
271 | m_httpPort = ConvertFrom.HttpPort; | 297 | m_httpPort = ConvertFrom.HttpPort; |
@@ -373,6 +399,8 @@ namespace OpenSim.Services.Interfaces | |||
373 | kvp["uuid"] = RegionID.ToString(); | 399 | kvp["uuid"] = RegionID.ToString(); |
374 | kvp["locX"] = RegionLocX.ToString(); | 400 | kvp["locX"] = RegionLocX.ToString(); |
375 | kvp["locY"] = RegionLocY.ToString(); | 401 | kvp["locY"] = RegionLocY.ToString(); |
402 | kvp["sizeX"] = RegionSizeX.ToString(); | ||
403 | kvp["sizeY"] = RegionSizeY.ToString(); | ||
376 | kvp["regionName"] = RegionName; | 404 | kvp["regionName"] = RegionName; |
377 | kvp["serverIP"] = ExternalHostName; //ExternalEndPoint.Address.ToString(); | 405 | kvp["serverIP"] = ExternalHostName; //ExternalEndPoint.Address.ToString(); |
378 | kvp["serverHttpPort"] = HttpPort.ToString(); | 406 | kvp["serverHttpPort"] = HttpPort.ToString(); |
@@ -399,6 +427,16 @@ namespace OpenSim.Services.Interfaces | |||
399 | if (kvp.ContainsKey("locY")) | 427 | if (kvp.ContainsKey("locY")) |
400 | RegionLocY = Convert.ToInt32((string)kvp["locY"]); | 428 | RegionLocY = Convert.ToInt32((string)kvp["locY"]); |
401 | 429 | ||
430 | if (kvp.ContainsKey("sizeX")) | ||
431 | RegionSizeX = Convert.ToInt32((string)kvp["sizeX"]); | ||
432 | else | ||
433 | RegionSizeX = (int)Constants.RegionSize; | ||
434 | |||
435 | if (kvp.ContainsKey("sizeY")) | ||
436 | RegionSizeY = Convert.ToInt32((string)kvp["sizeY"]); | ||
437 | else | ||
438 | RegionSizeX = (int)Constants.RegionSize; | ||
439 | |||
402 | if (kvp.ContainsKey("regionName")) | 440 | if (kvp.ContainsKey("regionName")) |
403 | RegionName = (string)kvp["regionName"]; | 441 | RegionName = (string)kvp["regionName"]; |
404 | 442 | ||
@@ -446,6 +484,9 @@ namespace OpenSim.Services.Interfaces | |||
446 | 484 | ||
447 | if (kvp.ContainsKey("Token")) | 485 | if (kvp.ContainsKey("Token")) |
448 | Token = kvp["Token"].ToString(); | 486 | Token = kvp["Token"].ToString(); |
487 | |||
488 | // m_log.DebugFormat("{0} New GridRegion. id={1}, loc=<{2},{3}>, size=<{4},{5}>", | ||
489 | // LogHeader, RegionID, RegionLocX, RegionLocY, RegionSizeX, RegionSizeY); | ||
449 | } | 490 | } |
450 | } | 491 | } |
451 | } | 492 | } |
diff --git a/OpenSim/Services/LLLoginService/LLLoginResponse.cs b/OpenSim/Services/LLLoginService/LLLoginResponse.cs index 6ab5258..5256b74 100644 --- a/OpenSim/Services/LLLoginService/LLLoginResponse.cs +++ b/OpenSim/Services/LLLoginService/LLLoginResponse.cs | |||
@@ -254,11 +254,11 @@ namespace OpenSim.Services.LLLoginService | |||
254 | Currency = currency; | 254 | Currency = currency; |
255 | ClassifiedFee = classifiedFee; | 255 | ClassifiedFee = classifiedFee; |
256 | 256 | ||
257 | |||
258 | FillOutHomeData(pinfo, home); | 257 | FillOutHomeData(pinfo, home); |
259 | LookAt = String.Format("[r{0},r{1},r{2}]", lookAt.X, lookAt.Y, lookAt.Z); | 258 | LookAt = String.Format("[r{0},r{1},r{2}]", lookAt.X, lookAt.Y, lookAt.Z); |
260 | 259 | ||
261 | FillOutRegionData(destination); | 260 | FillOutRegionData(destination); |
261 | // m_log.DebugFormat("[LOGIN RESPONSE] LLLoginResponse create. sizeX=<{0},{1}>", RegionSizeX, RegionSizeY); | ||
262 | 262 | ||
263 | FillOutSeedCap(aCircuit, destination, clientIP); | 263 | FillOutSeedCap(aCircuit, destination, clientIP); |
264 | 264 | ||
@@ -384,6 +384,8 @@ namespace OpenSim.Services.LLLoginService | |||
384 | SimPort = (uint)endPoint.Port; | 384 | SimPort = (uint)endPoint.Port; |
385 | RegionX = (uint)destination.RegionLocX; | 385 | RegionX = (uint)destination.RegionLocX; |
386 | RegionY = (uint)destination.RegionLocY; | 386 | RegionY = (uint)destination.RegionLocY; |
387 | RegionSizeX = destination.RegionSizeX; | ||
388 | RegionSizeY = destination.RegionSizeY; | ||
387 | } | 389 | } |
388 | 390 | ||
389 | private void FillOutSeedCap(AgentCircuitData aCircuit, GridRegion destination, IPEndPoint ipepClient) | 391 | private void FillOutSeedCap(AgentCircuitData aCircuit, GridRegion destination, IPEndPoint ipepClient) |
@@ -529,6 +531,9 @@ namespace OpenSim.Services.LLLoginService | |||
529 | responseData["message"] = welcomeMessage; | 531 | responseData["message"] = welcomeMessage; |
530 | responseData["region_x"] = (Int32)(RegionX); | 532 | responseData["region_x"] = (Int32)(RegionX); |
531 | responseData["region_y"] = (Int32)(RegionY); | 533 | responseData["region_y"] = (Int32)(RegionY); |
534 | responseData["region_size_x"] = (Int32)RegionSizeX; | ||
535 | responseData["region_size_y"] = (Int32)RegionSizeY; | ||
536 | // m_log.DebugFormat("[LOGIN RESPONSE] returning sizeX=<{0},{1}>", RegionSizeX, RegionSizeY); | ||
532 | 537 | ||
533 | if (searchURL != String.Empty) | 538 | if (searchURL != String.Empty) |
534 | responseData["search"] = searchURL; | 539 | responseData["search"] = searchURL; |
@@ -918,6 +923,9 @@ namespace OpenSim.Services.LLLoginService | |||
918 | set { regionY = value; } | 923 | set { regionY = value; } |
919 | } | 924 | } |
920 | 925 | ||
926 | public int RegionSizeX { get; private set; } | ||
927 | public int RegionSizeY { get; private set; } | ||
928 | |||
921 | public string SunTexture | 929 | public string SunTexture |
922 | { | 930 | { |
923 | get { return sunTexture; } | 931 | get { return sunTexture; } |
diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs index fe43582..e2f9966 100644 --- a/OpenSim/Services/LLLoginService/LLLoginService.cs +++ b/OpenSim/Services/LLLoginService/LLLoginService.cs | |||
@@ -50,6 +50,8 @@ namespace OpenSim.Services.LLLoginService | |||
50 | public class LLLoginService : ILoginService | 50 | public class LLLoginService : ILoginService |
51 | { | 51 | { |
52 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 52 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
53 | private static readonly string LogHeader = "[LLOGIN SERVICE]"; | ||
54 | |||
53 | private static bool Initialized = false; | 55 | private static bool Initialized = false; |
54 | 56 | ||
55 | protected IUserAccountService m_UserAccountService; | 57 | protected IUserAccountService m_UserAccountService; |
@@ -389,6 +391,7 @@ namespace OpenSim.Services.LLLoginService | |||
389 | if (guinfo == null) | 391 | if (guinfo == null) |
390 | { | 392 | { |
391 | // something went wrong, make something up, so that we don't have to test this anywhere else | 393 | // something went wrong, make something up, so that we don't have to test this anywhere else |
394 | m_log.DebugFormat("{0} Failed to fetch GridUserInfo. Creating empty GridUserInfo as home", LogHeader); | ||
392 | guinfo = new GridUserInfo(); | 395 | guinfo = new GridUserInfo(); |
393 | guinfo.LastPosition = guinfo.HomePosition = new Vector3(128, 128, 30); | 396 | guinfo.LastPosition = guinfo.HomePosition = new Vector3(128, 128, 30); |
394 | } | 397 | } |
diff --git a/OpenSim/Services/UserProfilesService/UserProfilesService.cs b/OpenSim/Services/UserProfilesService/UserProfilesService.cs index 69c7b91..dd26cdc 100644 --- a/OpenSim/Services/UserProfilesService/UserProfilesService.cs +++ b/OpenSim/Services/UserProfilesService/UserProfilesService.cs | |||
@@ -37,6 +37,7 @@ using OpenSim.Data; | |||
37 | using OpenMetaverse; | 37 | using OpenMetaverse; |
38 | using OpenMetaverse.StructuredData; | 38 | using OpenMetaverse.StructuredData; |
39 | using OpenSim.Framework; | 39 | using OpenSim.Framework; |
40 | using OpenSim.Services.UserAccountService; | ||
40 | 41 | ||
41 | namespace OpenSim.Services.ProfilesService | 42 | namespace OpenSim.Services.ProfilesService |
42 | { | 43 | { |
@@ -166,11 +167,71 @@ namespace OpenSim.Services.ProfilesService | |||
166 | #region User Preferences | 167 | #region User Preferences |
167 | public bool UserPreferencesUpdate(ref UserPreferences pref, ref string result) | 168 | public bool UserPreferencesUpdate(ref UserPreferences pref, ref string result) |
168 | { | 169 | { |
170 | if(string.IsNullOrEmpty(pref.EMail)) | ||
171 | { | ||
172 | UserAccount account = new UserAccount(); | ||
173 | if(userAccounts is UserAccountService.UserAccountService) | ||
174 | { | ||
175 | try | ||
176 | { | ||
177 | account = userAccounts.GetUserAccount(UUID.Zero, pref.UserId); | ||
178 | if(string.IsNullOrEmpty(account.Email)) | ||
179 | { | ||
180 | result = "No Email address on record!"; | ||
181 | return false; | ||
182 | } | ||
183 | else | ||
184 | pref.EMail = account.Email; | ||
185 | } | ||
186 | catch | ||
187 | { | ||
188 | m_log.Info ("[PROFILES]: UserAccountService Exception: Could not get user account"); | ||
189 | result = "Missing Email address!"; | ||
190 | return false; | ||
191 | } | ||
192 | } | ||
193 | else | ||
194 | { | ||
195 | m_log.Info ("[PROFILES]: UserAccountService: Could not get user account"); | ||
196 | result = "Missing Email address!"; | ||
197 | return false; | ||
198 | } | ||
199 | } | ||
169 | return ProfilesData.UpdateUserPreferences(ref pref, ref result); | 200 | return ProfilesData.UpdateUserPreferences(ref pref, ref result); |
170 | } | 201 | } |
171 | 202 | ||
172 | public bool UserPreferencesRequest(ref UserPreferences pref, ref string result) | 203 | public bool UserPreferencesRequest(ref UserPreferences pref, ref string result) |
173 | { | 204 | { |
205 | if(string.IsNullOrEmpty(pref.EMail)) | ||
206 | { | ||
207 | UserAccount account = new UserAccount(); | ||
208 | if(userAccounts is UserAccountService.UserAccountService) | ||
209 | { | ||
210 | try | ||
211 | { | ||
212 | account = userAccounts.GetUserAccount(UUID.Zero, pref.UserId); | ||
213 | if(string.IsNullOrEmpty(account.Email)) | ||
214 | { | ||
215 | result = "No Email address on record!"; | ||
216 | return false; | ||
217 | } | ||
218 | else | ||
219 | pref.EMail = account.Email; | ||
220 | } | ||
221 | catch | ||
222 | { | ||
223 | m_log.Info ("[PROFILES]: UserAccountService Exception: Could not get user account"); | ||
224 | result = "Missing Email address!"; | ||
225 | return false; | ||
226 | } | ||
227 | } | ||
228 | else | ||
229 | { | ||
230 | m_log.Info ("[PROFILES]: UserAccountService: Could not get user account"); | ||
231 | result = "Missing Email address!"; | ||
232 | return false; | ||
233 | } | ||
234 | } | ||
174 | return ProfilesData.GetUserPreferences(ref pref, ref result); | 235 | return ProfilesData.GetUserPreferences(ref pref, ref result); |
175 | } | 236 | } |
176 | #endregion User Preferences | 237 | #endregion User Preferences |