aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules
diff options
context:
space:
mode:
authorMelanie2009-12-31 21:53:39 +0000
committerMelanie2009-12-31 21:53:39 +0000
commitb321c0a932936af8124009fc41e1f40d6829f4da (patch)
tree13e4ba232219300240304c0e8fdf0c66a0a88ce7 /OpenSim/Region/CoreModules
parentMerge branch 'master' into careminster (diff)
parentWhitespace cleanup (changed hard tabs to 4 spaces) (diff)
downloadopensim-SC_OLD-b321c0a932936af8124009fc41e1f40d6829f4da.zip
opensim-SC_OLD-b321c0a932936af8124009fc41e1f40d6829f4da.tar.gz
opensim-SC_OLD-b321c0a932936af8124009fc41e1f40d6829f4da.tar.bz2
opensim-SC_OLD-b321c0a932936af8124009fc41e1f40d6829f4da.tar.xz
Merge branch 'master' into careminster
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs23
-rw-r--r--OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueGetModule.cs5
-rw-r--r--OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueHelper.cs42
3 files changed, 70 insertions, 0 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs
index d6a82ef..580e06f 100644
--- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs
@@ -395,7 +395,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
395 395
396 // if it leaves, we want to know, too 396 // if it leaves, we want to know, too
397 client.OnLogout += OnLogout; 397 client.OnLogout += OnLogout;
398
398 client.OnGrantUserRights += GrantUserFriendRights; 399 client.OnGrantUserRights += GrantUserFriendRights;
400 client.OnTrackAgentEvent += FindAgent;
401 client.OnFindAgentEvent += FindAgent;
399 402
400 } 403 }
401 404
@@ -1114,6 +1117,26 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
1114 { 1117 {
1115 ((Scene)remoteClient.Scene).CommsManager.UpdateUserFriendPerms(requester, target, (uint)rights); 1118 ((Scene)remoteClient.Scene).CommsManager.UpdateUserFriendPerms(requester, target, (uint)rights);
1116 } 1119 }
1120 public void FindAgent(IClientAPI remoteClient, UUID hunter, UUID target)
1121 {
1122 List<FriendListItem> friendList = GetUserFriends(hunter);
1123 foreach (FriendListItem item in friendList)
1124 {
1125 if(item.onlinestatus == true)
1126 {
1127 if(item.Friend == target && (item.FriendPerms & (uint)FriendRights.CanSeeOnMap) != 0)
1128 {
1129 ScenePresence SPTarget = ((Scene)remoteClient.Scene).GetScenePresence(target);
1130 string regionname = SPTarget.Scene.RegionInfo.RegionName;
1131 remoteClient.SendScriptTeleportRequest("FindAgent", regionname,new Vector3(SPTarget.AbsolutePosition),new Vector3(SPTarget.Lookat));
1132 }
1133 }
1134 else
1135 {
1136 remoteClient.SendAgentAlertMessage("The agent you are looking for is not online.", false);
1137 }
1138 }
1139 }
1117 1140
1118 public List<FriendListItem> GetUserFriends(UUID agentID) 1141 public List<FriendListItem> GetUserFriends(UUID agentID)
1119 { 1142 {
diff --git a/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueGetModule.cs b/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueGetModule.cs
index 1b23d92..0c6cb1b 100644
--- a/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueGetModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueGetModule.cs
@@ -708,5 +708,10 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue
708 OSD item = EventQueueHelper.GroupMembership(groupUpdate); 708 OSD item = EventQueueHelper.GroupMembership(groupUpdate);
709 Enqueue(item, avatarID); 709 Enqueue(item, avatarID);
710 } 710 }
711 public void QueryReply(PlacesReplyPacket groupUpdate, UUID avatarID)
712 {
713 OSD item = EventQueueHelper.PlacesQuery(groupUpdate);
714 Enqueue(item, avatarID);
715 }
711 } 716 }
712} 717}
diff --git a/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueHelper.cs b/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueHelper.cs
index c50318d..67fc8e6 100644
--- a/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueHelper.cs
+++ b/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueHelper.cs
@@ -454,6 +454,48 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue
454 454
455 return groupUpdate; 455 return groupUpdate;
456 } 456 }
457
458 public static OSD PlacesQuery(PlacesReplyPacket PlacesReply)
459 {
460 OSDMap placesReply = new OSDMap();
461 placesReply.Add("message", OSD.FromString("PlacesReplyMessage"));
462
463 OSDMap body = new OSDMap();
464 OSDArray agentData = new OSDArray();
465 OSDMap agentDataMap = new OSDMap();
466 agentDataMap.Add("AgentID", OSD.FromUUID(PlacesReply.AgentData.AgentID));
467 agentDataMap.Add("QueryID", OSD.FromUUID(PlacesReply.AgentData.QueryID));
468 agentDataMap.Add("TransactionID", OSD.FromUUID(PlacesReply.TransactionData.TransactionID));
469 agentData.Add(agentDataMap);
470 body.Add("AgentData", agentData);
471
472 OSDArray QueryData = new OSDArray();
473
474 foreach (PlacesReplyPacket.QueryDataBlock groupDataBlock in PlacesReply.QueryData)
475 {
476 OSDMap QueryDataMap = new OSDMap();
477 QueryDataMap.Add("ActualArea", OSD.FromInteger(groupDataBlock.ActualArea));
478 QueryDataMap.Add("BillableArea", OSD.FromInteger(groupDataBlock.BillableArea));
479 QueryDataMap.Add("Description", OSD.FromBinary(groupDataBlock.Desc));
480 QueryDataMap.Add("Dwell", OSD.FromInteger((int)groupDataBlock.Dwell));
481 QueryDataMap.Add("Flags", OSD.FromString(Convert.ToString(groupDataBlock.Flags)));
482 QueryDataMap.Add("GlobalX", OSD.FromInteger((int)groupDataBlock.GlobalX));
483 QueryDataMap.Add("GlobalY", OSD.FromInteger((int)groupDataBlock.GlobalY));
484 QueryDataMap.Add("GlobalZ", OSD.FromInteger((int)groupDataBlock.GlobalZ));
485 QueryDataMap.Add("Name", OSD.FromBinary(groupDataBlock.Name));
486 QueryDataMap.Add("OwnerID", OSD.FromUUID(groupDataBlock.OwnerID));
487 QueryDataMap.Add("SimName", OSD.FromBinary(groupDataBlock.SimName));
488 QueryDataMap.Add("SnapShotID", OSD.FromUUID(groupDataBlock.SnapshotID));
489 QueryDataMap.Add("ProductSku", OSD.FromInteger(0));
490 QueryDataMap.Add("Price", OSD.FromInteger(groupDataBlock.Price));
491
492 QueryData.Add(QueryDataMap);
493 }
494 body.Add("QueryData", QueryData);
495 placesReply.Add("QueryData[]", body);
496
497 return placesReply;
498 }
457 499
458 } 500 }
459} 501}