diff options
author | Melanie | 2014-01-05 20:12:32 +0000 |
---|---|---|
committer | Melanie | 2014-01-05 20:12:32 +0000 |
commit | e79fab91dbe731e9d177de61993d963bcc067299 (patch) | |
tree | 4358fd508e55dd91774ba83b8e4c30fc24f452c7 /OpenSim/Services | |
parent | Merge commit '92aad6f1bb45974927fa43d6fd30f98337dee3f0' into careminster (diff) | |
parent | Some missing definitions needed for successful compilation. (diff) | |
download | opensim-SC_OLD-e79fab91dbe731e9d177de61993d963bcc067299.zip opensim-SC_OLD-e79fab91dbe731e9d177de61993d963bcc067299.tar.gz opensim-SC_OLD-e79fab91dbe731e9d177de61993d963bcc067299.tar.bz2 opensim-SC_OLD-e79fab91dbe731e9d177de61993d963bcc067299.tar.xz |
Intermediate commit. Sill errors.
Merge branch 'master' into careminster
Conflicts:
OpenSim/Data/SQLite/SQLiteUserProfilesData.cs
OpenSim/Framework/RegionInfo.cs
OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueHelper.cs
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
OpenSim/Services/UserProfilesService/UserProfilesService.cs
Diffstat (limited to 'OpenSim/Services')
6 files changed, 143 insertions, 4 deletions
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs index 36a5182..3cf3416 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs | |||
@@ -531,9 +531,13 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
531 | region.RegionName = response["Name"].AsString(); | 531 | region.RegionName = response["Name"].AsString(); |
532 | 532 | ||
533 | Vector3d minPosition = response["MinPosition"].AsVector3d(); | 533 | Vector3d minPosition = response["MinPosition"].AsVector3d(); |
534 | Vector3d maxPosition = response["MaxPosition"].AsVector3d(); | ||
534 | region.RegionLocX = (int)minPosition.X; | 535 | region.RegionLocX = (int)minPosition.X; |
535 | region.RegionLocY = (int)minPosition.Y; | 536 | region.RegionLocY = (int)minPosition.Y; |
536 | 537 | ||
538 | region.RegionSizeX = (int)maxPosition.X - (int)minPosition.X; | ||
539 | region.RegionSizeY = (int)maxPosition.Y - (int)minPosition.Y; | ||
540 | |||
537 | if ( ! extraData["HyperGrid"] ) { | 541 | if ( ! extraData["HyperGrid"] ) { |
538 | Uri httpAddress = response["Address"].AsUri(); | 542 | Uri httpAddress = response["Address"].AsUri(); |
539 | region.ExternalHostName = httpAddress.Host; | 543 | 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 e3c70d3..4466222 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; |
@@ -377,6 +403,8 @@ namespace OpenSim.Services.Interfaces | |||
377 | kvp["uuid"] = RegionID.ToString(); | 403 | kvp["uuid"] = RegionID.ToString(); |
378 | kvp["locX"] = RegionLocX.ToString(); | 404 | kvp["locX"] = RegionLocX.ToString(); |
379 | kvp["locY"] = RegionLocY.ToString(); | 405 | kvp["locY"] = RegionLocY.ToString(); |
406 | kvp["sizeX"] = RegionSizeX.ToString(); | ||
407 | kvp["sizeY"] = RegionSizeY.ToString(); | ||
380 | kvp["regionName"] = RegionName; | 408 | kvp["regionName"] = RegionName; |
381 | kvp["serverIP"] = ExternalHostName; //ExternalEndPoint.Address.ToString(); | 409 | kvp["serverIP"] = ExternalHostName; //ExternalEndPoint.Address.ToString(); |
382 | kvp["serverHttpPort"] = HttpPort.ToString(); | 410 | kvp["serverHttpPort"] = HttpPort.ToString(); |
@@ -403,6 +431,16 @@ namespace OpenSim.Services.Interfaces | |||
403 | if (kvp.ContainsKey("locY")) | 431 | if (kvp.ContainsKey("locY")) |
404 | RegionLocY = Convert.ToInt32((string)kvp["locY"]); | 432 | RegionLocY = Convert.ToInt32((string)kvp["locY"]); |
405 | 433 | ||
434 | if (kvp.ContainsKey("sizeX")) | ||
435 | RegionSizeX = Convert.ToInt32((string)kvp["sizeX"]); | ||
436 | else | ||
437 | RegionSizeX = (int)Constants.RegionSize; | ||
438 | |||
439 | if (kvp.ContainsKey("sizeY")) | ||
440 | RegionSizeY = Convert.ToInt32((string)kvp["sizeY"]); | ||
441 | else | ||
442 | RegionSizeX = (int)Constants.RegionSize; | ||
443 | |||
406 | if (kvp.ContainsKey("regionName")) | 444 | if (kvp.ContainsKey("regionName")) |
407 | RegionName = (string)kvp["regionName"]; | 445 | RegionName = (string)kvp["regionName"]; |
408 | 446 | ||
@@ -456,6 +494,9 @@ namespace OpenSim.Services.Interfaces | |||
456 | 494 | ||
457 | if (kvp.ContainsKey("Token")) | 495 | if (kvp.ContainsKey("Token")) |
458 | Token = kvp["Token"].ToString(); | 496 | Token = kvp["Token"].ToString(); |
497 | |||
498 | // m_log.DebugFormat("{0} New GridRegion. id={1}, loc=<{2},{3}>, size=<{4},{5}>", | ||
499 | // LogHeader, RegionID, RegionLocX, RegionLocY, RegionSizeX, RegionSizeY); | ||
459 | } | 500 | } |
460 | } | 501 | } |
461 | } | 502 | } |
diff --git a/OpenSim/Services/LLLoginService/LLLoginResponse.cs b/OpenSim/Services/LLLoginService/LLLoginResponse.cs index 057c492..f641955 100644 --- a/OpenSim/Services/LLLoginService/LLLoginResponse.cs +++ b/OpenSim/Services/LLLoginService/LLLoginResponse.cs | |||
@@ -261,11 +261,11 @@ namespace OpenSim.Services.LLLoginService | |||
261 | Currency = currency; | 261 | Currency = currency; |
262 | ClassifiedFee = classifiedFee; | 262 | ClassifiedFee = classifiedFee; |
263 | 263 | ||
264 | |||
265 | FillOutHomeData(pinfo, home); | 264 | FillOutHomeData(pinfo, home); |
266 | LookAt = String.Format("[r{0},r{1},r{2}]", lookAt.X, lookAt.Y, lookAt.Z); | 265 | LookAt = String.Format("[r{0},r{1},r{2}]", lookAt.X, lookAt.Y, lookAt.Z); |
267 | 266 | ||
268 | FillOutRegionData(destination); | 267 | FillOutRegionData(destination); |
268 | // m_log.DebugFormat("[LOGIN RESPONSE] LLLoginResponse create. sizeX=<{0},{1}>", RegionSizeX, RegionSizeY); | ||
269 | 269 | ||
270 | FillOutSeedCap(aCircuit, destination, clientIP); | 270 | FillOutSeedCap(aCircuit, destination, clientIP); |
271 | 271 | ||
@@ -392,6 +392,8 @@ namespace OpenSim.Services.LLLoginService | |||
392 | SimPort = (uint)endPoint.Port; | 392 | SimPort = (uint)endPoint.Port; |
393 | RegionX = (uint)destination.RegionLocX; | 393 | RegionX = (uint)destination.RegionLocX; |
394 | RegionY = (uint)destination.RegionLocY; | 394 | RegionY = (uint)destination.RegionLocY; |
395 | RegionSizeX = destination.RegionSizeX; | ||
396 | RegionSizeY = destination.RegionSizeY; | ||
395 | } | 397 | } |
396 | 398 | ||
397 | private void FillOutSeedCap(AgentCircuitData aCircuit, GridRegion destination, IPEndPoint ipepClient) | 399 | private void FillOutSeedCap(AgentCircuitData aCircuit, GridRegion destination, IPEndPoint ipepClient) |
@@ -539,6 +541,9 @@ namespace OpenSim.Services.LLLoginService | |||
539 | responseData["message"] = welcomeMessage; | 541 | responseData["message"] = welcomeMessage; |
540 | responseData["region_x"] = (Int32)(RegionX); | 542 | responseData["region_x"] = (Int32)(RegionX); |
541 | responseData["region_y"] = (Int32)(RegionY); | 543 | responseData["region_y"] = (Int32)(RegionY); |
544 | responseData["region_size_x"] = (Int32)RegionSizeX; | ||
545 | responseData["region_size_y"] = (Int32)RegionSizeY; | ||
546 | // m_log.DebugFormat("[LOGIN RESPONSE] returning sizeX=<{0},{1}>", RegionSizeX, RegionSizeY); | ||
542 | 547 | ||
543 | if (searchURL != String.Empty) | 548 | if (searchURL != String.Empty) |
544 | responseData["search"] = searchURL; | 549 | responseData["search"] = searchURL; |
@@ -935,6 +940,9 @@ namespace OpenSim.Services.LLLoginService | |||
935 | set { regionY = value; } | 940 | set { regionY = value; } |
936 | } | 941 | } |
937 | 942 | ||
943 | public int RegionSizeX { get; private set; } | ||
944 | public int RegionSizeY { get; private set; } | ||
945 | |||
938 | public string SunTexture | 946 | public string SunTexture |
939 | { | 947 | { |
940 | get { return sunTexture; } | 948 | get { return sunTexture; } |
diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs index faf7f71..ed62c43 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; |
@@ -397,6 +399,7 @@ namespace OpenSim.Services.LLLoginService | |||
397 | if (guinfo == null) | 399 | if (guinfo == null) |
398 | { | 400 | { |
399 | // something went wrong, make something up, so that we don't have to test this anywhere else | 401 | // something went wrong, make something up, so that we don't have to test this anywhere else |
402 | m_log.DebugFormat("{0} Failed to fetch GridUserInfo. Creating empty GridUserInfo as home", LogHeader); | ||
400 | guinfo = new GridUserInfo(); | 403 | guinfo = new GridUserInfo(); |
401 | guinfo.LastPosition = guinfo.HomePosition = new Vector3(128, 128, 30); | 404 | guinfo.LastPosition = guinfo.HomePosition = new Vector3(128, 128, 30); |
402 | } | 405 | } |
diff --git a/OpenSim/Services/UserProfilesService/UserProfilesService.cs b/OpenSim/Services/UserProfilesService/UserProfilesService.cs index d00f34d..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 | { |
@@ -163,6 +164,78 @@ namespace OpenSim.Services.ProfilesService | |||
163 | } | 164 | } |
164 | #endregion Interests | 165 | #endregion Interests |
165 | 166 | ||
167 | #region User Preferences | ||
168 | public bool UserPreferencesUpdate(ref UserPreferences pref, ref string result) | ||
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 | } | ||
200 | return ProfilesData.UpdateUserPreferences(ref pref, ref result); | ||
201 | } | ||
202 | |||
203 | public bool UserPreferencesRequest(ref UserPreferences pref, ref string result) | ||
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 | } | ||
235 | return ProfilesData.GetUserPreferences(ref pref, ref result); | ||
236 | } | ||
237 | #endregion User Preferences | ||
238 | |||
166 | #region Utility | 239 | #region Utility |
167 | public OSD AvatarImageAssetsRequest(UUID avatarId) | 240 | public OSD AvatarImageAssetsRequest(UUID avatarId) |
168 | { | 241 | { |