From 234d4e11059fb2e1fc9dbe879054bd84e95b502b Mon Sep 17 00:00:00 2001 From: Revolution Date: Wed, 30 Dec 2009 21:45:10 -0600 Subject: Adds tons of packets. Applied with change: Changed spelling to Summary (from Summery) Signed-off-by: Melanie --- .../Framework/EventQueue/EventQueueGetModule.cs | 5 +++ .../Framework/EventQueue/EventQueueHelper.cs | 42 ++++++++++++++++++++++ 2 files changed, 47 insertions(+) (limited to 'OpenSim/Region/CoreModules') 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 OSD item = EventQueueHelper.GroupMembership(groupUpdate); Enqueue(item, avatarID); } + public void QueryReply(PlacesReplyPacket groupUpdate, UUID avatarID) + { + OSD item = EventQueueHelper.PlacesQuery(groupUpdate); + Enqueue(item, avatarID); + } } } 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 return groupUpdate; } + + public static OSD PlacesQuery(PlacesReplyPacket PlacesReply) + { + OSDMap placesReply = new OSDMap(); + placesReply.Add("message", OSD.FromString("PlacesReplyMessage")); + + OSDMap body = new OSDMap(); + OSDArray agentData = new OSDArray(); + OSDMap agentDataMap = new OSDMap(); + agentDataMap.Add("AgentID", OSD.FromUUID(PlacesReply.AgentData.AgentID)); + agentDataMap.Add("QueryID", OSD.FromUUID(PlacesReply.AgentData.QueryID)); + agentDataMap.Add("TransactionID", OSD.FromUUID(PlacesReply.TransactionData.TransactionID)); + agentData.Add(agentDataMap); + body.Add("AgentData", agentData); + + OSDArray QueryData = new OSDArray(); + + foreach (PlacesReplyPacket.QueryDataBlock groupDataBlock in PlacesReply.QueryData) + { + OSDMap QueryDataMap = new OSDMap(); + QueryDataMap.Add("ActualArea", OSD.FromInteger(groupDataBlock.ActualArea)); + QueryDataMap.Add("BillableArea", OSD.FromInteger(groupDataBlock.BillableArea)); + QueryDataMap.Add("Description", OSD.FromBinary(groupDataBlock.Desc)); + QueryDataMap.Add("Dwell", OSD.FromInteger((int)groupDataBlock.Dwell)); + QueryDataMap.Add("Flags", OSD.FromString(Convert.ToString(groupDataBlock.Flags))); + QueryDataMap.Add("GlobalX", OSD.FromInteger((int)groupDataBlock.GlobalX)); + QueryDataMap.Add("GlobalY", OSD.FromInteger((int)groupDataBlock.GlobalY)); + QueryDataMap.Add("GlobalZ", OSD.FromInteger((int)groupDataBlock.GlobalZ)); + QueryDataMap.Add("Name", OSD.FromBinary(groupDataBlock.Name)); + QueryDataMap.Add("OwnerID", OSD.FromUUID(groupDataBlock.OwnerID)); + QueryDataMap.Add("SimName", OSD.FromBinary(groupDataBlock.SimName)); + QueryDataMap.Add("SnapShotID", OSD.FromUUID(groupDataBlock.SnapshotID)); + QueryDataMap.Add("ProductSku", OSD.FromInteger(0)); + QueryDataMap.Add("Price", OSD.FromInteger(groupDataBlock.Price)); + + QueryData.Add(QueryDataMap); + } + body.Add("QueryData", QueryData); + placesReply.Add("QueryData[]", body); + + return placesReply; + } } } -- cgit v1.1 From 8ca37dbefadc9b2d31b76786051d0ed8e1342121 Mon Sep 17 00:00:00 2001 From: Revolution Date: Wed, 30 Dec 2009 22:00:58 -0600 Subject: Adds Friend Finding functionality. Signed-off-by: Melanie --- .../CoreModules/Avatar/Friends/FriendsModule.cs | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'OpenSim/Region/CoreModules') 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 // if it leaves, we want to know, too client.OnLogout += OnLogout; + client.OnGrantUserRights += GrantUserFriendRights; + client.OnTrackAgentEvent += FindAgent; + client.OnFindAgentEvent += FindAgent; } @@ -1114,6 +1117,26 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends { ((Scene)remoteClient.Scene).CommsManager.UpdateUserFriendPerms(requester, target, (uint)rights); } + public void FindAgent(IClientAPI remoteClient, UUID hunter, UUID target) + { + List friendList = GetUserFriends(hunter); + foreach (FriendListItem item in friendList) + { + if(item.onlinestatus == true) + { + if(item.Friend == target && (item.FriendPerms & (uint)FriendRights.CanSeeOnMap) != 0) + { + ScenePresence SPTarget = ((Scene)remoteClient.Scene).GetScenePresence(target); + string regionname = SPTarget.Scene.RegionInfo.RegionName; + remoteClient.SendScriptTeleportRequest("FindAgent", regionname,new Vector3(SPTarget.AbsolutePosition),new Vector3(SPTarget.Lookat)); + } + } + else + { + remoteClient.SendAgentAlertMessage("The agent you are looking for is not online.", false); + } + } + } public List GetUserFriends(UUID agentID) { -- cgit v1.1