aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs96
1 files changed, 76 insertions, 20 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs b/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs
index d232d82..3f7a8ee 100644
--- a/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs
@@ -897,20 +897,36 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
897 else 897 else
898 { 898 {
899 // we have a proxy on map 899 // we have a proxy on map
900 // this is a fail on large regions 900 ulong oriHandle;
901 uint gtmp = (uint)globalPos.X >> 8; 901 uint oriX;
902 globalPos.X -= (gtmp << 8); 902 uint oriY;
903 globalPos.X += target.RegionLocX; 903 if(Util.ParseFakeParcelID(pick.ParcelId, out oriHandle, out oriX, out oriY))
904 904 {
905 gtmp = (uint)globalPos.Y >> 8; 905 pick.ParcelId = Util.BuildFakeParcelID(target.RegionHandle, oriX, oriY);
906 globalPos.Y -= (gtmp << 8); 906 globalPos.X = target.RegionLocX + oriX;
907 globalPos.Y += target.RegionLocY; 907 globalPos.Y = target.RegionLocY + oriY;
908 pick.GlobalPos = globalPos.ToString();
909 }
910 else
911 {
912 // this is a fail on large regions
913 uint gtmp = (uint)globalPos.X >> 8;
914 globalPos.X -= (gtmp << 8);
915
916 gtmp = (uint)globalPos.Y >> 8;
917 globalPos.Y -= (gtmp << 8);
918
919 pick.ParcelId = Util.BuildFakeParcelID(target.RegionHandle, (uint)globalPos.X, (uint)globalPos.Y);
920
921 globalPos.X += target.RegionLocX;
922 globalPos.Y += target.RegionLocY;
923 pick.GlobalPos = globalPos.ToString();
924 }
908 } 925 }
909 } 926 }
910 927
911 m_log.DebugFormat("[PROFILES]: PickInfoRequest: {0} : {1}", pick.Name.ToString(), pick.SnapshotId.ToString()); 928 m_log.DebugFormat("[PROFILES]: PickInfoRequest: {0} : {1}", pick.Name.ToString(), pick.SnapshotId.ToString());
912 929
913 pick.GlobalPos = globalPos.ToString();
914 lock(m_profilesCache) 930 lock(m_profilesCache)
915 { 931 {
916 if(!m_profilesCache.TryGetValue(targetID, out uce) || uce == null) 932 if(!m_profilesCache.TryGetValue(targetID, out uce) || uce == null)
@@ -1331,17 +1347,36 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
1331 if(uce.props != null) 1347 if(uce.props != null)
1332 { 1348 {
1333 props = uce.props; 1349 props = uce.props;
1350 uint cflags = uce.flags;
1351 // if on same region force online
1352 if(p != null && !p.IsDeleted)
1353 cflags |= 0x10;
1354
1334 remoteClient.SendAvatarProperties(props.UserId, props.AboutText, 1355 remoteClient.SendAvatarProperties(props.UserId, props.AboutText,
1335 uce.born, uce.membershipType , props.FirstLifeText, uce.flags, 1356 uce.born, uce.membershipType , props.FirstLifeText, cflags,
1336 props.FirstLifeImageId, props.ImageId, props.WebUrl, props.PartnerId); 1357 props.FirstLifeImageId, props.ImageId, props.WebUrl, props.PartnerId);
1337 1358
1338
1339 remoteClient.SendAvatarInterestsReply(props.UserId, (uint)props.WantToMask, 1359 remoteClient.SendAvatarInterestsReply(props.UserId, (uint)props.WantToMask,
1340 props.WantToText, (uint)props.SkillsMask, 1360 props.WantToText, (uint)props.SkillsMask,
1341 props.SkillsText, props.Language); 1361 props.SkillsText, props.Language);
1342 return; 1362 return;
1363 }
1364 else
1365 {
1366 if(uce.ClientsWaitingProps == null)
1367 uce.ClientsWaitingProps = new HashSet<IClientAPI>();
1368 else if(uce.ClientsWaitingProps.Contains(remoteClient))
1369 return;
1370 uce.ClientsWaitingProps.Add(remoteClient);
1343 } 1371 }
1344 } 1372 }
1373 else
1374 {
1375 uce = new UserProfileCacheEntry();
1376 uce.ClientsWaitingProps = new HashSet<IClientAPI>();
1377 uce.ClientsWaitingProps.Add(remoteClient);
1378 m_profilesCache.AddOrUpdate(avatarID, uce, PROFILECACHEEXPIRE);
1379 }
1345 } 1380 }
1346 1381
1347 string serverURI = string.Empty; 1382 string serverURI = string.Empty;
@@ -1402,14 +1437,11 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
1402 { 1437 {
1403 props.AboutText ="Profile not available at this time. User may still be unknown to this grid"; 1438 props.AboutText ="Profile not available at this time. User may still be unknown to this grid";
1404 } 1439 }
1405
1406 // if on same region force online
1407 if(p != null && !p.IsDeleted)
1408 flags |= 0x10;
1409 1440
1410 if(!m_allowUserProfileWebURLs) 1441 if(!m_allowUserProfileWebURLs)
1411 props.WebUrl =""; 1442 props.WebUrl ="";
1412 1443
1444 HashSet<IClientAPI> clients;
1413 lock(m_profilesCache) 1445 lock(m_profilesCache)
1414 { 1446 {
1415 if(!m_profilesCache.TryGetValue(props.UserId, out uce) || uce == null) 1447 if(!m_profilesCache.TryGetValue(props.UserId, out uce) || uce == null)
@@ -1418,15 +1450,39 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
1418 uce.born = born; 1450 uce.born = born;
1419 uce.membershipType = membershipType; 1451 uce.membershipType = membershipType;
1420 uce.flags = flags; 1452 uce.flags = flags;
1421 1453 clients = uce.ClientsWaitingProps;
1454 uce.ClientsWaitingProps = null;
1422 m_profilesCache.AddOrUpdate(props.UserId, uce, PROFILECACHEEXPIRE); 1455 m_profilesCache.AddOrUpdate(props.UserId, uce, PROFILECACHEEXPIRE);
1423 } 1456 }
1424 1457
1425 remoteClient.SendAvatarProperties(props.UserId, props.AboutText, born, membershipType , props.FirstLifeText, flags, 1458 // if on same region force online
1459 if(p != null && !p.IsDeleted)
1460 flags |= 0x10;
1461
1462 if(clients == null)
1463 {
1464 remoteClient.SendAvatarProperties(props.UserId, props.AboutText, born, membershipType , props.FirstLifeText, flags,
1426 props.FirstLifeImageId, props.ImageId, props.WebUrl, props.PartnerId); 1465 props.FirstLifeImageId, props.ImageId, props.WebUrl, props.PartnerId);
1427 1466
1428 remoteClient.SendAvatarInterestsReply(props.UserId, (uint)props.WantToMask, props.WantToText, (uint)props.SkillsMask, 1467 remoteClient.SendAvatarInterestsReply(props.UserId, (uint)props.WantToMask, props.WantToText,
1429 props.SkillsText, props.Language); 1468 (uint)props.SkillsMask, props.SkillsText, props.Language);
1469 }
1470 else
1471 {
1472 if(!clients.Contains(remoteClient))
1473 clients.Add(remoteClient);
1474 foreach(IClientAPI cli in clients)
1475 {
1476 if(!cli.IsActive)
1477 continue;
1478 cli.SendAvatarProperties(props.UserId, props.AboutText, born, membershipType , props.FirstLifeText, flags,
1479 props.FirstLifeImageId, props.ImageId, props.WebUrl, props.PartnerId);
1480
1481 cli.SendAvatarInterestsReply(props.UserId, (uint)props.WantToMask, props.WantToText,
1482 (uint)props.SkillsMask, props.SkillsText, props.Language);
1483
1484 }
1485 }
1430 } 1486 }
1431 1487
1432 /// <summary> 1488 /// <summary>