diff options
Diffstat (limited to 'OpenSim/Region/CoreModules')
3 files changed, 175 insertions, 80 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs b/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs index 5314927..57025bf 100644 --- a/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs | |||
@@ -69,6 +69,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles | |||
69 | Dictionary<UUID, int> m_classifiedInterest = new Dictionary<UUID, int>(); | 69 | Dictionary<UUID, int> m_classifiedInterest = new Dictionary<UUID, int>(); |
70 | 70 | ||
71 | private JsonRpcRequestManager rpc = new JsonRpcRequestManager(); | 71 | private JsonRpcRequestManager rpc = new JsonRpcRequestManager(); |
72 | private bool m_allowUserProfileWebURLs = true; | ||
72 | 73 | ||
73 | public Scene Scene | 74 | public Scene Scene |
74 | { | 75 | { |
@@ -159,7 +160,9 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles | |||
159 | Enabled = false; | 160 | Enabled = false; |
160 | return; | 161 | return; |
161 | } | 162 | } |
162 | 163 | ||
164 | m_allowUserProfileWebURLs = profileConfig.GetBoolean("AllowUserProfileWebURLs", m_allowUserProfileWebURLs); | ||
165 | |||
163 | m_log.Debug("[PROFILES]: Full Profiles Enabled"); | 166 | m_log.Debug("[PROFILES]: Full Profiles Enabled"); |
164 | ReplaceableInterface = null; | 167 | ReplaceableInterface = null; |
165 | Enabled = true; | 168 | Enabled = true; |
@@ -316,37 +319,46 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles | |||
316 | return; | 319 | return; |
317 | 320 | ||
318 | IClientAPI remoteClient = (IClientAPI)sender; | 321 | IClientAPI remoteClient = (IClientAPI)sender; |
322 | Dictionary<UUID, string> classifieds = new Dictionary<UUID, string>(); | ||
319 | 323 | ||
320 | UUID targetID; | 324 | UUID targetID; |
321 | UUID.TryParse(args[0], out targetID); | 325 | if(!UUID.TryParse(args[0], out targetID) || targetID == UUID.Zero) |
322 | 326 | return; | |
323 | 327 | ||
324 | ScenePresence p = FindPresence(targetID); | 328 | ScenePresence p = FindPresence(targetID); |
325 | if (p != null && p.isNPC) | 329 | if (p != null && p.isNPC) |
326 | { | 330 | { |
327 | remoteClient.SendAvatarClassifiedReply(new UUID(args[0]), new Dictionary<UUID, string>()); | 331 | remoteClient.SendAvatarClassifiedReply(targetID, classifieds); |
328 | return; | 332 | return; |
329 | } | 333 | } |
330 | 334 | ||
331 | string serverURI = string.Empty; | 335 | string serverURI = string.Empty; |
332 | GetUserProfileServerURI(targetID, out serverURI); | 336 | GetUserProfileServerURI(targetID, out serverURI); |
333 | UUID creatorId = UUID.Zero; | 337 | if(string.IsNullOrWhiteSpace(serverURI)) |
334 | Dictionary<UUID, string> classifieds = new Dictionary<UUID, string>(); | 338 | { |
339 | remoteClient.SendAvatarClassifiedReply(targetID, classifieds); | ||
340 | return; | ||
341 | } | ||
335 | 342 | ||
336 | OSDMap parameters= new OSDMap(); | 343 | OSDMap parameters= new OSDMap(); |
337 | UUID.TryParse(args[0], out creatorId); | 344 | |
338 | parameters.Add("creatorId", OSD.FromUUID(creatorId)); | 345 | parameters.Add("creatorId", OSD.FromUUID(targetID)); |
339 | OSD Params = (OSD)parameters; | 346 | OSD Params = (OSD)parameters; |
340 | if(!rpc.JsonRpcRequest(ref Params, "avatarclassifiedsrequest", serverURI, UUID.Random().ToString())) | 347 | if(!rpc.JsonRpcRequest(ref Params, "avatarclassifiedsrequest", serverURI, UUID.Random().ToString())) |
341 | { | 348 | { |
342 | remoteClient.SendAvatarClassifiedReply(new UUID(args[0]), classifieds); | 349 | remoteClient.SendAvatarClassifiedReply(targetID, classifieds); |
343 | return; | 350 | return; |
344 | } | 351 | } |
345 | 352 | ||
346 | parameters = (OSDMap)Params; | 353 | parameters = (OSDMap)Params; |
347 | 354 | ||
348 | OSDArray list = (OSDArray)parameters["result"]; | 355 | if(!parameters.ContainsKey("result") || parameters["result"] == null) |
356 | { | ||
357 | remoteClient.SendAvatarClassifiedReply(targetID, classifieds); | ||
358 | return; | ||
359 | } | ||
349 | 360 | ||
361 | OSDArray list = (OSDArray)parameters["result"]; | ||
350 | 362 | ||
351 | foreach(OSD map in list) | 363 | foreach(OSD map in list) |
352 | { | 364 | { |
@@ -360,7 +372,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles | |||
360 | { | 372 | { |
361 | if (!m_classifiedCache.ContainsKey(cid)) | 373 | if (!m_classifiedCache.ContainsKey(cid)) |
362 | { | 374 | { |
363 | m_classifiedCache.Add(cid,creatorId); | 375 | m_classifiedCache.Add(cid,targetID); |
364 | m_classifiedInterest.Add(cid, 0); | 376 | m_classifiedInterest.Add(cid, 0); |
365 | } | 377 | } |
366 | 378 | ||
@@ -368,7 +380,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles | |||
368 | } | 380 | } |
369 | } | 381 | } |
370 | 382 | ||
371 | remoteClient.SendAvatarClassifiedReply(new UUID(args[0]), classifieds); | 383 | remoteClient.SendAvatarClassifiedReply(targetID, classifieds); |
372 | } | 384 | } |
373 | 385 | ||
374 | public void ClassifiedInfoRequest(UUID queryClassifiedID, IClientAPI remoteClient) | 386 | public void ClassifiedInfoRequest(UUID queryClassifiedID, IClientAPI remoteClient) |
@@ -395,6 +407,10 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles | |||
395 | 407 | ||
396 | string serverURI = string.Empty; | 408 | string serverURI = string.Empty; |
397 | GetUserProfileServerURI(target, out serverURI); | 409 | GetUserProfileServerURI(target, out serverURI); |
410 | if(string.IsNullOrWhiteSpace(serverURI)) | ||
411 | { | ||
412 | return; | ||
413 | } | ||
398 | 414 | ||
399 | object Ad = (object)ad; | 415 | object Ad = (object)ad; |
400 | if(!rpc.JsonRpcRequest(ref Ad, "classifieds_info_query", serverURI, UUID.Random().ToString())) | 416 | if(!rpc.JsonRpcRequest(ref Ad, "classifieds_info_query", serverURI, UUID.Random().ToString())) |
@@ -465,6 +481,10 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles | |||
465 | 481 | ||
466 | string serverURI = string.Empty; | 482 | string serverURI = string.Empty; |
467 | GetUserProfileServerURI(remoteClient.AgentId, out serverURI); | 483 | GetUserProfileServerURI(remoteClient.AgentId, out serverURI); |
484 | if(string.IsNullOrWhiteSpace(serverURI)) | ||
485 | { | ||
486 | return; | ||
487 | } | ||
468 | 488 | ||
469 | OSDMap parameters = new OSDMap {{"creatorId", OSD.FromUUID(creatorId)}}; | 489 | OSDMap parameters = new OSDMap {{"creatorId", OSD.FromUUID(creatorId)}}; |
470 | OSD Params = (OSD)parameters; | 490 | OSD Params = (OSD)parameters; |
@@ -531,10 +551,14 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles | |||
531 | { | 551 | { |
532 | string serverURI = string.Empty; | 552 | string serverURI = string.Empty; |
533 | GetUserProfileServerURI(remoteClient.AgentId, out serverURI); | 553 | GetUserProfileServerURI(remoteClient.AgentId, out serverURI); |
554 | if(string.IsNullOrWhiteSpace(serverURI)) | ||
555 | return; | ||
534 | 556 | ||
535 | UUID classifiedId; | 557 | UUID classifiedId; |
558 | if(!UUID.TryParse(queryClassifiedID.ToString(), out classifiedId)) | ||
559 | return; | ||
560 | |||
536 | OSDMap parameters= new OSDMap(); | 561 | OSDMap parameters= new OSDMap(); |
537 | UUID.TryParse(queryClassifiedID.ToString(), out classifiedId); | ||
538 | parameters.Add("classifiedId", OSD.FromUUID(classifiedId)); | 562 | parameters.Add("classifiedId", OSD.FromUUID(classifiedId)); |
539 | OSD Params = (OSD)parameters; | 563 | OSD Params = (OSD)parameters; |
540 | if(!rpc.JsonRpcRequest(ref Params, "classified_delete", serverURI, UUID.Random().ToString())) | 564 | if(!rpc.JsonRpcRequest(ref Params, "classified_delete", serverURI, UUID.Random().ToString())) |
@@ -569,33 +593,41 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles | |||
569 | IClientAPI remoteClient = (IClientAPI)sender; | 593 | IClientAPI remoteClient = (IClientAPI)sender; |
570 | 594 | ||
571 | UUID targetId; | 595 | UUID targetId; |
572 | UUID.TryParse(args[0], out targetId); | 596 | if(!UUID.TryParse(args[0], out targetId)) |
597 | return; | ||
573 | 598 | ||
574 | // Can't handle NPC yet... | 599 | Dictionary<UUID, string> picks = new Dictionary<UUID, string>(); |
575 | ScenePresence p = FindPresence(targetId); | ||
576 | 600 | ||
601 | ScenePresence p = FindPresence(targetId); | ||
577 | if (p != null && p.isNPC) | 602 | if (p != null && p.isNPC) |
578 | { | 603 | { |
579 | remoteClient.SendAvatarPicksReply(new UUID(args[0]), new Dictionary<UUID, string>()); | 604 | remoteClient.SendAvatarPicksReply(targetId, picks); |
580 | return; | 605 | return; |
581 | } | 606 | } |
582 | 607 | ||
583 | string serverURI = string.Empty; | 608 | string serverURI = string.Empty; |
584 | GetUserProfileServerURI(targetId, out serverURI); | 609 | GetUserProfileServerURI(targetId, out serverURI); |
585 | 610 | if(string.IsNullOrWhiteSpace(serverURI)) | |
586 | Dictionary<UUID, string> picks = new Dictionary<UUID, string>(); | 611 | { |
612 | remoteClient.SendAvatarPicksReply(targetId, picks); | ||
613 | return; | ||
614 | } | ||
587 | 615 | ||
588 | OSDMap parameters= new OSDMap(); | 616 | OSDMap parameters= new OSDMap(); |
589 | parameters.Add("creatorId", OSD.FromUUID(targetId)); | 617 | parameters.Add("creatorId", OSD.FromUUID(targetId)); |
590 | OSD Params = (OSD)parameters; | 618 | OSD Params = (OSD)parameters; |
591 | if(!rpc.JsonRpcRequest(ref Params, "avatarpicksrequest", serverURI, UUID.Random().ToString())) | 619 | if(!rpc.JsonRpcRequest(ref Params, "avatarpicksrequest", serverURI, UUID.Random().ToString())) |
592 | { | 620 | { |
593 | remoteClient.SendAvatarPicksReply(new UUID(args[0]), picks); | 621 | remoteClient.SendAvatarPicksReply(targetId, picks); |
594 | return; | 622 | return; |
595 | } | 623 | } |
596 | 624 | ||
597 | parameters = (OSDMap)Params; | 625 | parameters = (OSDMap)Params; |
598 | 626 | if(!parameters.ContainsKey("result") || parameters["result"] == null) | |
627 | { | ||
628 | remoteClient.SendAvatarPicksReply(targetId, picks); | ||
629 | return; | ||
630 | } | ||
599 | OSDArray list = (OSDArray)parameters["result"]; | 631 | OSDArray list = (OSDArray)parameters["result"]; |
600 | 632 | ||
601 | foreach(OSD map in list) | 633 | foreach(OSD map in list) |
@@ -603,12 +635,9 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles | |||
603 | OSDMap m = (OSDMap)map; | 635 | OSDMap m = (OSDMap)map; |
604 | UUID cid = m["pickuuid"].AsUUID(); | 636 | UUID cid = m["pickuuid"].AsUUID(); |
605 | string name = m["name"].AsString(); | 637 | string name = m["name"].AsString(); |
606 | |||
607 | m_log.DebugFormat("[PROFILES]: PicksRequest {0}", name); | ||
608 | |||
609 | picks[cid] = name; | 638 | picks[cid] = name; |
610 | } | 639 | } |
611 | remoteClient.SendAvatarPicksReply(new UUID(args[0]), picks); | 640 | remoteClient.SendAvatarPicksReply(targetId, picks); |
612 | } | 641 | } |
613 | 642 | ||
614 | /// <summary> | 643 | /// <summary> |
@@ -628,20 +657,27 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles | |||
628 | if (!(sender is IClientAPI)) | 657 | if (!(sender is IClientAPI)) |
629 | return; | 658 | return; |
630 | 659 | ||
660 | UserProfilePick pick = new UserProfilePick (); | ||
631 | UUID targetID; | 661 | UUID targetID; |
632 | UUID.TryParse (args [0], out targetID); | 662 | if(!UUID.TryParse(args [0], out targetID)) |
663 | return; | ||
664 | |||
665 | pick.CreatorId = targetID; | ||
666 | |||
667 | if(!UUID.TryParse (args [1], out pick.PickId)) | ||
668 | return; | ||
669 | |||
633 | string serverURI = string.Empty; | 670 | string serverURI = string.Empty; |
634 | GetUserProfileServerURI (targetID, out serverURI); | 671 | GetUserProfileServerURI (targetID, out serverURI); |
672 | if(string.IsNullOrWhiteSpace(serverURI)) | ||
673 | { | ||
674 | return; | ||
675 | } | ||
635 | 676 | ||
636 | string theirGatekeeperURI; | 677 | string theirGatekeeperURI; |
637 | GetUserGatekeeperURI (targetID, out theirGatekeeperURI); | 678 | GetUserGatekeeperURI(targetID, out theirGatekeeperURI); |
638 | 679 | ||
639 | IClientAPI remoteClient = (IClientAPI)sender; | 680 | IClientAPI remoteClient = (IClientAPI)sender; |
640 | |||
641 | UserProfilePick pick = new UserProfilePick (); | ||
642 | UUID.TryParse (args [0], out pick.CreatorId); | ||
643 | UUID.TryParse (args [1], out pick.PickId); | ||
644 | |||
645 | 681 | ||
646 | object Pick = (object)pick; | 682 | object Pick = (object)pick; |
647 | if (!rpc.JsonRpcRequest (ref Pick, "pickinforequest", serverURI, UUID.Random ().ToString ())) { | 683 | if (!rpc.JsonRpcRequest (ref Pick, "pickinforequest", serverURI, UUID.Random ().ToString ())) { |
@@ -652,13 +688,9 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles | |||
652 | pick = (UserProfilePick)Pick; | 688 | pick = (UserProfilePick)Pick; |
653 | 689 | ||
654 | Vector3 globalPos = new Vector3(Vector3.Zero); | 690 | Vector3 globalPos = new Vector3(Vector3.Zero); |
691 | Vector3.TryParse(pick.GlobalPos, out globalPos); | ||
655 | 692 | ||
656 | // Smoke and mirrors | 693 | if (!string.IsNullOrWhiteSpace(MyGatekeeper) && pick.Gatekeeper != MyGatekeeper) |
657 | if (pick.Gatekeeper == MyGatekeeper) | ||
658 | { | ||
659 | Vector3.TryParse(pick.GlobalPos,out globalPos); | ||
660 | } | ||
661 | else | ||
662 | { | 694 | { |
663 | // Setup the illusion | 695 | // Setup the illusion |
664 | string region = string.Format("{0} {1}",pick.Gatekeeper,pick.SimName); | 696 | string region = string.Format("{0} {1}",pick.Gatekeeper,pick.SimName); |
@@ -666,21 +698,19 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles | |||
666 | 698 | ||
667 | if(target == null) | 699 | if(target == null) |
668 | { | 700 | { |
669 | // This is a dead or unreachable region | 701 | // This is a unreachable region |
670 | } | 702 | } |
671 | else | 703 | else |
672 | { | 704 | { |
673 | // Work our slight of hand | 705 | // we have a proxy on map |
674 | int x = target.RegionLocX; | 706 | // this is a fail on large regions |
675 | int y = target.RegionLocY; | 707 | uint gtmp = (uint)globalPos.X >> 8; |
676 | 708 | globalPos.X -= (gtmp << 8); | |
677 | dynamic synthX = globalPos.X - (globalPos.X/Constants.RegionSize) * Constants.RegionSize; | 709 | globalPos.X += target.RegionLocX; |
678 | synthX += x; | 710 | |
679 | globalPos.X = synthX; | 711 | gtmp = (uint)globalPos.Y >> 8; |
680 | 712 | globalPos.Y -= (gtmp << 8); | |
681 | dynamic synthY = globalPos.Y - (globalPos.Y/Constants.RegionSize) * Constants.RegionSize; | 713 | globalPos.Y += target.RegionLocY; |
682 | synthY += y; | ||
683 | globalPos.Y = synthY; | ||
684 | } | 714 | } |
685 | } | 715 | } |
686 | 716 | ||
@@ -730,6 +760,11 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles | |||
730 | UserProfilePick pick = new UserProfilePick(); | 760 | UserProfilePick pick = new UserProfilePick(); |
731 | string serverURI = string.Empty; | 761 | string serverURI = string.Empty; |
732 | GetUserProfileServerURI(remoteClient.AgentId, out serverURI); | 762 | GetUserProfileServerURI(remoteClient.AgentId, out serverURI); |
763 | if(string.IsNullOrWhiteSpace(serverURI)) | ||
764 | { | ||
765 | return; | ||
766 | } | ||
767 | |||
733 | ScenePresence p = FindPresence(remoteClient.AgentId); | 768 | ScenePresence p = FindPresence(remoteClient.AgentId); |
734 | 769 | ||
735 | Vector3 avaPos = p.AbsolutePosition; | 770 | Vector3 avaPos = p.AbsolutePosition; |
@@ -795,6 +830,10 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles | |||
795 | { | 830 | { |
796 | string serverURI = string.Empty; | 831 | string serverURI = string.Empty; |
797 | GetUserProfileServerURI(remoteClient.AgentId, out serverURI); | 832 | GetUserProfileServerURI(remoteClient.AgentId, out serverURI); |
833 | if(string.IsNullOrWhiteSpace(serverURI)) | ||
834 | { | ||
835 | return; | ||
836 | } | ||
798 | 837 | ||
799 | OSDMap parameters= new OSDMap(); | 838 | OSDMap parameters= new OSDMap(); |
800 | parameters.Add("pickId", OSD.FromUUID(queryPickID)); | 839 | parameters.Add("pickId", OSD.FromUUID(queryPickID)); |
@@ -828,11 +867,19 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles | |||
828 | if (!(sender is IClientAPI)) | 867 | if (!(sender is IClientAPI)) |
829 | return; | 868 | return; |
830 | 869 | ||
870 | if(!UUID.TryParse(args[0], out note.TargetId)) | ||
871 | return; | ||
872 | |||
831 | IClientAPI remoteClient = (IClientAPI)sender; | 873 | IClientAPI remoteClient = (IClientAPI)sender; |
874 | note.UserId = remoteClient.AgentId; | ||
875 | |||
832 | string serverURI = string.Empty; | 876 | string serverURI = string.Empty; |
833 | GetUserProfileServerURI(remoteClient.AgentId, out serverURI); | 877 | GetUserProfileServerURI(remoteClient.AgentId, out serverURI); |
834 | note.UserId = remoteClient.AgentId; | 878 | if(string.IsNullOrWhiteSpace(serverURI)) |
835 | UUID.TryParse(args[0], out note.TargetId); | 879 | { |
880 | remoteClient.SendAvatarNotesReply(note.TargetId, note.Notes); | ||
881 | return; | ||
882 | } | ||
836 | 883 | ||
837 | object Note = (object)note; | 884 | object Note = (object)note; |
838 | if(!rpc.JsonRpcRequest(ref Note, "avatarnotesrequest", serverURI, UUID.Random().ToString())) | 885 | if(!rpc.JsonRpcRequest(ref Note, "avatarnotesrequest", serverURI, UUID.Random().ToString())) |
@@ -840,8 +887,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles | |||
840 | remoteClient.SendAvatarNotesReply(note.TargetId, note.Notes); | 887 | remoteClient.SendAvatarNotesReply(note.TargetId, note.Notes); |
841 | return; | 888 | return; |
842 | } | 889 | } |
843 | note = (UserProfileNotes) Note; | 890 | note = (UserProfileNotes) Note; |
844 | |||
845 | remoteClient.SendAvatarNotesReply(note.TargetId, note.Notes); | 891 | remoteClient.SendAvatarNotesReply(note.TargetId, note.Notes); |
846 | } | 892 | } |
847 | 893 | ||
@@ -875,6 +921,8 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles | |||
875 | 921 | ||
876 | string serverURI = string.Empty; | 922 | string serverURI = string.Empty; |
877 | GetUserProfileServerURI(remoteClient.AgentId, out serverURI); | 923 | GetUserProfileServerURI(remoteClient.AgentId, out serverURI); |
924 | if(string.IsNullOrWhiteSpace(serverURI)) | ||
925 | return; | ||
878 | 926 | ||
879 | object Note = note; | 927 | object Note = note; |
880 | if(!rpc.JsonRpcRequest(ref Note, "avatar_notes_update", serverURI, UUID.Random().ToString())) | 928 | if(!rpc.JsonRpcRequest(ref Note, "avatar_notes_update", serverURI, UUID.Random().ToString())) |
@@ -910,6 +958,8 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles | |||
910 | 958 | ||
911 | string serverURI = string.Empty; | 959 | string serverURI = string.Empty; |
912 | bool foreign = GetUserProfileServerURI(remoteClient.AgentId, out serverURI); | 960 | bool foreign = GetUserProfileServerURI(remoteClient.AgentId, out serverURI); |
961 | if(string.IsNullOrWhiteSpace(serverURI)) | ||
962 | return; | ||
913 | 963 | ||
914 | object Pref = pref; | 964 | object Pref = pref; |
915 | if(!rpc.JsonRpcRequest(ref Pref, "user_preferences_update", serverURI, UUID.Random().ToString())) | 965 | if(!rpc.JsonRpcRequest(ref Pref, "user_preferences_update", serverURI, UUID.Random().ToString())) |
@@ -934,7 +984,8 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles | |||
934 | 984 | ||
935 | string serverURI = string.Empty; | 985 | string serverURI = string.Empty; |
936 | bool foreign = GetUserProfileServerURI(remoteClient.AgentId, out serverURI); | 986 | bool foreign = GetUserProfileServerURI(remoteClient.AgentId, out serverURI); |
937 | 987 | if(string.IsNullOrWhiteSpace(serverURI)) | |
988 | return; | ||
938 | 989 | ||
939 | object Pref = (object)pref; | 990 | object Pref = (object)pref; |
940 | if(!rpc.JsonRpcRequest(ref Pref, "user_preferences_request", serverURI, UUID.Random().ToString())) | 991 | if(!rpc.JsonRpcRequest(ref Pref, "user_preferences_request", serverURI, UUID.Random().ToString())) |
@@ -985,6 +1036,8 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles | |||
985 | 1036 | ||
986 | string serverURI = string.Empty; | 1037 | string serverURI = string.Empty; |
987 | GetUserProfileServerURI(remoteClient.AgentId, out serverURI); | 1038 | GetUserProfileServerURI(remoteClient.AgentId, out serverURI); |
1039 | if(string.IsNullOrWhiteSpace(serverURI)) | ||
1040 | return; | ||
988 | 1041 | ||
989 | object Param = prop; | 1042 | object Param = prop; |
990 | if(!rpc.JsonRpcRequest(ref Param, "avatar_interests_update", serverURI, UUID.Random().ToString())) | 1043 | if(!rpc.JsonRpcRequest(ref Param, "avatar_interests_update", serverURI, UUID.Random().ToString())) |
@@ -1004,13 +1057,11 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles | |||
1004 | return; | 1057 | return; |
1005 | } | 1058 | } |
1006 | 1059 | ||
1007 | // Can't handle NPC yet... | ||
1008 | ScenePresence p = FindPresence(avatarID); | 1060 | ScenePresence p = FindPresence(avatarID); |
1009 | |||
1010 | if (p != null && p.isNPC) | 1061 | if (p != null && p.isNPC) |
1011 | { | 1062 | { |
1012 | remoteClient.SendAvatarProperties(avatarID, ((INPC)(p.ControllingClient)).profileAbout, ((INPC)(p.ControllingClient)).Born, | 1063 | remoteClient.SendAvatarProperties(avatarID, ((INPC)(p.ControllingClient)).profileAbout, ((INPC)(p.ControllingClient)).Born, |
1013 | Utils.StringToBytes("Non Player Character (NPC)"), "NPCs have no life", 16, | 1064 | Utils.StringToBytes("Non Player Character (NPC)"), "NPCs have no life", 0x10, |
1014 | UUID.Zero, ((INPC)(p.ControllingClient)).profileImage, "", UUID.Zero); | 1065 | UUID.Zero, ((INPC)(p.ControllingClient)).profileImage, "", UUID.Zero); |
1015 | remoteClient.SendAvatarInterestsReply(avatarID, 0, "", | 1066 | remoteClient.SendAvatarInterestsReply(avatarID, 0, "", |
1016 | 0, "Getting into trouble", "Droidspeak"); | 1067 | 0, "Getting into trouble", "Droidspeak"); |
@@ -1033,19 +1084,15 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles | |||
1033 | } | 1084 | } |
1034 | 1085 | ||
1035 | Byte[] membershipType = new Byte[1]; | 1086 | Byte[] membershipType = new Byte[1]; |
1036 | string born = String.Empty; | 1087 | string born = string.Empty; |
1037 | uint flags = 0x00; | 1088 | uint flags = 0x00; |
1038 | 1089 | ||
1039 | if (null != account) | 1090 | if (null != account) |
1040 | { | 1091 | { |
1041 | if (account.UserTitle == "") | 1092 | if (account.UserTitle == "") |
1042 | { | ||
1043 | membershipType[0] = (Byte)((account.UserFlags & 0xf00) >> 8); | 1093 | membershipType[0] = (Byte)((account.UserFlags & 0xf00) >> 8); |
1044 | } | ||
1045 | else | 1094 | else |
1046 | { | ||
1047 | membershipType = Utils.StringToBytes(account.UserTitle); | 1095 | membershipType = Utils.StringToBytes(account.UserTitle); |
1048 | } | ||
1049 | 1096 | ||
1050 | born = Util.ToDateTime(account.Created).ToString( | 1097 | born = Util.ToDateTime(account.Created).ToString( |
1051 | "M/d/yyyy", CultureInfo.InvariantCulture); | 1098 | "M/d/yyyy", CultureInfo.InvariantCulture); |
@@ -1056,16 +1103,13 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles | |||
1056 | if (GetUserAccountData(avatarID, out userInfo) == true) | 1103 | if (GetUserAccountData(avatarID, out userInfo) == true) |
1057 | { | 1104 | { |
1058 | if ((string)userInfo["user_title"] == "") | 1105 | if ((string)userInfo["user_title"] == "") |
1059 | { | ||
1060 | membershipType[0] = (Byte)(((Byte)userInfo["user_flags"] & 0xf00) >> 8); | 1106 | membershipType[0] = (Byte)(((Byte)userInfo["user_flags"] & 0xf00) >> 8); |
1061 | } | ||
1062 | else | 1107 | else |
1063 | { | ||
1064 | membershipType = Utils.StringToBytes((string)userInfo["user_title"]); | 1108 | membershipType = Utils.StringToBytes((string)userInfo["user_title"]); |
1065 | } | ||
1066 | 1109 | ||
1067 | int val_born = (int)userInfo["user_created"]; | 1110 | int val_born = (int)userInfo["user_created"]; |
1068 | born = Util.ToDateTime(val_born).ToString( | 1111 | if(val_born != 0) |
1112 | born = Util.ToDateTime(val_born).ToString( | ||
1069 | "M/d/yyyy", CultureInfo.InvariantCulture); | 1113 | "M/d/yyyy", CultureInfo.InvariantCulture); |
1070 | 1114 | ||
1071 | // picky, picky | 1115 | // picky, picky |
@@ -1075,16 +1119,21 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles | |||
1075 | } | 1119 | } |
1076 | 1120 | ||
1077 | UserProfileProperties props = new UserProfileProperties(); | 1121 | UserProfileProperties props = new UserProfileProperties(); |
1078 | string result = string.Empty; | ||
1079 | |||
1080 | props.UserId = avatarID; | 1122 | props.UserId = avatarID; |
1081 | 1123 | ||
1082 | if (!GetProfileData(ref props, foreign, out result)) | 1124 | string result = string.Empty; |
1125 | if(!GetProfileData(ref props, foreign, out result)) | ||
1083 | { | 1126 | { |
1084 | // m_log.DebugFormat("Error getting profile for {0}: {1}", avatarID, result); | 1127 | props.AboutText ="Profile not avaible at this time. User may still be unknown to this grid"; |
1085 | return; | ||
1086 | } | 1128 | } |
1087 | 1129 | ||
1130 | // if on same region force online | ||
1131 | if(p != null && !p.IsDeleted) | ||
1132 | flags |= 0x10; | ||
1133 | |||
1134 | if(!m_allowUserProfileWebURLs) | ||
1135 | props.WebUrl =""; | ||
1136 | |||
1088 | remoteClient.SendAvatarProperties(props.UserId, props.AboutText, born, membershipType , props.FirstLifeText, flags, | 1137 | remoteClient.SendAvatarProperties(props.UserId, props.AboutText, born, membershipType , props.FirstLifeText, flags, |
1089 | props.FirstLifeImageId, props.ImageId, props.WebUrl, props.PartnerId); | 1138 | props.FirstLifeImageId, props.ImageId, props.WebUrl, props.PartnerId); |
1090 | 1139 | ||
@@ -1115,6 +1164,9 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles | |||
1115 | prop.FirstLifeImageId = newProfile.FirstLifeImage; | 1164 | prop.FirstLifeImageId = newProfile.FirstLifeImage; |
1116 | prop.FirstLifeText = newProfile.FirstLifeAboutText; | 1165 | prop.FirstLifeText = newProfile.FirstLifeAboutText; |
1117 | 1166 | ||
1167 | if(!m_allowUserProfileWebURLs) | ||
1168 | prop.WebUrl =""; | ||
1169 | |||
1118 | string serverURI = string.Empty; | 1170 | string serverURI = string.Empty; |
1119 | GetUserProfileServerURI(remoteClient.AgentId, out serverURI); | 1171 | GetUserProfileServerURI(remoteClient.AgentId, out serverURI); |
1120 | 1172 | ||
@@ -1153,12 +1205,11 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles | |||
1153 | 1205 | ||
1154 | string serverURI = string.Empty; | 1206 | string serverURI = string.Empty; |
1155 | GetUserProfileServerURI(properties.UserId, out serverURI); | 1207 | GetUserProfileServerURI(properties.UserId, out serverURI); |
1156 | |||
1157 | // This is checking a friend on the home grid | 1208 | // This is checking a friend on the home grid |
1158 | // Not HG friend | 1209 | // Not HG friend |
1159 | if (String.IsNullOrEmpty(serverURI)) | 1210 | if (String.IsNullOrEmpty(serverURI)) |
1160 | { | 1211 | { |
1161 | message = "No Presence - foreign friend"; | 1212 | message = "User profile service unknown at this time"; |
1162 | return false; | 1213 | return false; |
1163 | } | 1214 | } |
1164 | 1215 | ||
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Land/LandServiceInConnectorModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Land/LandServiceInConnectorModule.cs index b632146..1273f0d 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Land/LandServiceInConnectorModule.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Land/LandServiceInConnectorModule.cs | |||
@@ -131,7 +131,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Land | |||
131 | 131 | ||
132 | uint rx = 0, ry = 0; | 132 | uint rx = 0, ry = 0; |
133 | Util.RegionHandleToWorldLoc(regionHandle, out rx, out ry); | 133 | Util.RegionHandleToWorldLoc(regionHandle, out rx, out ry); |
134 | 134 | rx += x; | |
135 | ry += y; | ||
135 | foreach (Scene s in m_Scenes) | 136 | foreach (Scene s in m_Scenes) |
136 | { | 137 | { |
137 | uint t = s.RegionInfo.WorldLocX; | 138 | uint t = s.RegionInfo.WorldLocX; |
@@ -147,6 +148,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Land | |||
147 | if( ry < t) | 148 | if( ry < t) |
148 | { | 149 | { |
149 | // m_log.Debug("[LAND IN CONNECTOR]: Found region to GetLandData from"); | 150 | // m_log.Debug("[LAND IN CONNECTOR]: Found region to GetLandData from"); |
151 | x = rx - s.RegionInfo.WorldLocX; | ||
152 | y = ry - s.RegionInfo.WorldLocY; | ||
150 | regionAccess = s.RegionInfo.AccessLevel; | 153 | regionAccess = s.RegionInfo.AccessLevel; |
151 | return s.GetLandData(x, y); | 154 | return s.GetLandData(x, y); |
152 | } | 155 | } |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs index e6e3abb..50e4c8a 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs | |||
@@ -52,6 +52,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
52 | MethodBase.GetCurrentMethod().DeclaringType); | 52 | MethodBase.GetCurrentMethod().DeclaringType); |
53 | 53 | ||
54 | private bool m_Enabled = false; | 54 | private bool m_Enabled = false; |
55 | private string m_ThisGatekeeper = string.Empty; | ||
55 | 56 | ||
56 | private IGridService m_LocalGridService; | 57 | private IGridService m_LocalGridService; |
57 | private IGridService m_RemoteGridService; | 58 | private IGridService m_RemoteGridService; |
@@ -118,13 +119,20 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
118 | m_LocalGridService = new LocalGridServicesConnector(source, m_RegionInfoCache); | 119 | m_LocalGridService = new LocalGridServicesConnector(source, m_RegionInfoCache); |
119 | if (m_LocalGridService == null) | 120 | if (m_LocalGridService == null) |
120 | { | 121 | { |
121 | m_log.Error("[REMOTE GRID CONNECTOR]: failed to loar local connector"); | 122 | m_log.Error("[REMOTE GRID CONNECTOR]: failed to load local connector"); |
122 | return false; | 123 | return false; |
123 | } | 124 | } |
124 | 125 | ||
125 | if(m_RegionInfoCache == null) | 126 | if(m_RegionInfoCache == null) |
126 | m_RegionInfoCache = new RegionInfoCache(); | 127 | m_RegionInfoCache = new RegionInfoCache(); |
127 | 128 | ||
129 | m_ThisGatekeeper = Util.GetConfigVarFromSections<string>(source, "GatekeeperURI", | ||
130 | new string[] { "Startup", "Hypergrid", "GridService" }, String.Empty); | ||
131 | // Legacy. Remove soon! | ||
132 | m_ThisGatekeeper = gridConfig.GetString("Gatekeeper", m_ThisGatekeeper); | ||
133 | |||
134 | Util.checkServiceURI(m_ThisGatekeeper, out m_ThisGatekeeper); | ||
135 | |||
128 | return true; | 136 | return true; |
129 | } | 137 | } |
130 | 138 | ||
@@ -227,11 +235,27 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
227 | return rinfo; | 235 | return rinfo; |
228 | } | 236 | } |
229 | 237 | ||
230 | public GridRegion GetRegionByName(UUID scopeID, string regionName) | 238 | public GridRegion GetRegionByName(UUID scopeID, string name) |
231 | { | 239 | { |
232 | GridRegion rinfo = m_LocalGridService.GetRegionByName(scopeID, regionName); | 240 | GridRegion rinfo = m_LocalGridService.GetRegionByName(scopeID, name); |
233 | if (rinfo != null) | 241 | if (rinfo != null) |
234 | return rinfo; | 242 | return rinfo; |
243 | |||
244 | // HG urls should not get here, strip them | ||
245 | // side effect is that local regions with same name as HG may also be found | ||
246 | // this mb good or bad | ||
247 | string regionName = name; | ||
248 | if(name.Contains(".")) | ||
249 | { | ||
250 | if(string.IsNullOrWhiteSpace(m_ThisGatekeeper)) | ||
251 | return rinfo; // no HG | ||
252 | |||
253 | string regionURI = ""; | ||
254 | if(!Util.buildHGRegionURI(name, out regionURI, out regionName) || string.IsNullOrWhiteSpace(regionName)) | ||
255 | return rinfo; // invalid | ||
256 | if(m_ThisGatekeeper != regionURI) | ||
257 | return rinfo; // not local grid | ||
258 | } | ||
235 | 259 | ||
236 | rinfo = m_RemoteGridService.GetRegionByName(scopeID, regionName); | 260 | rinfo = m_RemoteGridService.GetRegionByName(scopeID, regionName); |
237 | m_RegionInfoCache.Cache(scopeID, rinfo); | 261 | m_RegionInfoCache.Cache(scopeID, rinfo); |
@@ -242,7 +266,24 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
242 | { | 266 | { |
243 | List<GridRegion> rinfo = m_LocalGridService.GetRegionsByName(scopeID, name, maxNumber); | 267 | List<GridRegion> rinfo = m_LocalGridService.GetRegionsByName(scopeID, name, maxNumber); |
244 | //m_log.DebugFormat("[REMOTE GRID CONNECTOR]: Local GetRegionsByName {0} found {1} regions", name, rinfo.Count); | 268 | //m_log.DebugFormat("[REMOTE GRID CONNECTOR]: Local GetRegionsByName {0} found {1} regions", name, rinfo.Count); |
245 | List<GridRegion> grinfo = m_RemoteGridService.GetRegionsByName(scopeID, name, maxNumber); | 269 | |
270 | // HG urls should not get here, strip them | ||
271 | // side effect is that local regions with same name as HG may also be found | ||
272 | // this mb good or bad | ||
273 | string regionName = name; | ||
274 | if(name.Contains(".")) | ||
275 | { | ||
276 | if(string.IsNullOrWhiteSpace(m_ThisGatekeeper)) | ||
277 | return rinfo; // no HG | ||
278 | |||
279 | string regionURI = ""; | ||
280 | if(!Util.buildHGRegionURI(name, out regionURI, out regionName) || string.IsNullOrWhiteSpace(regionName)) | ||
281 | return rinfo; // invalid | ||
282 | if(m_ThisGatekeeper != regionURI) | ||
283 | return rinfo; // not local grid | ||
284 | } | ||
285 | |||
286 | List<GridRegion> grinfo = m_RemoteGridService.GetRegionsByName(scopeID, regionName, maxNumber); | ||
246 | 287 | ||
247 | if (grinfo != null) | 288 | if (grinfo != null) |
248 | { | 289 | { |