From 9f6b3e2357e76b9b85b447da189b4bf4163edd3c Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Tue, 13 Nov 2007 22:48:19 +0000 Subject: * Added AvatarPicker in Standalone mode. Works for finding avatar to ban, manually trying to add a friend (with the add button) or useful to those who are curious which usernames have visited your standalone sim. Important for future development :D. * Grid mode always returns 0 results until the Grid Communications portion is done. --- .../Environment/Scenes/Scene.PacketHandlers.cs | 39 ++++++++++++++++++++++ 1 file changed, 39 insertions(+) (limited to 'OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs') diff --git a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs index 74e9a43..435022b 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs @@ -29,6 +29,7 @@ using System.Collections.Generic; using libsecondlife; using libsecondlife.Packets; using OpenSim.Framework; +using OpenSim.Framework.UserManagement; using OpenSim.Framework.Console; namespace OpenSim.Region.Environment.Scenes @@ -155,5 +156,43 @@ namespace OpenSim.Region.Environment.Scenes } } } + public void ProcessAvatarPickerRequest(IClientAPI client, LLUUID avatarID, LLUUID RequestID, string query) + { + //EventManager.TriggerAvatarPickerRequest(); + + + List AvatarResponses = new List(); + AvatarResponses = CommsManager.GenerateAgentPickerRequestResponse(RequestID, query); + + AvatarPickerReplyPacket replyPacket = new AvatarPickerReplyPacket(); + AvatarPickerReplyPacket.DataBlock[] searchData = new AvatarPickerReplyPacket.DataBlock[AvatarResponses.Count]; + AvatarPickerReplyPacket.AgentDataBlock agentData = new AvatarPickerReplyPacket.AgentDataBlock(); + + agentData.AgentID = avatarID; + agentData.QueryID = RequestID; + replyPacket.AgentData = agentData; + byte[] bytes = new byte[AvatarResponses.Count * 32]; + + int i = 0; + foreach (AvatarPickerAvatar item in AvatarResponses) + { + LLUUID translatedIDtem = item.AvatarID; + searchData[i] = new AvatarPickerReplyPacket.DataBlock(); + searchData[i].AvatarID = translatedIDtem; + searchData[i].FirstName = Helpers.StringToField((string)item.firstName); + searchData[i].LastName = Helpers.StringToField((string)item.lastName); + i++; + + } + if (AvatarResponses.Count == 0) + { + searchData = new AvatarPickerReplyPacket.DataBlock[0]; + } + replyPacket.Data = searchData; + client.SendAvatarPickerReply(replyPacket); + + + } + } } \ No newline at end of file -- cgit v1.1