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 ++++++++++++++++++++++ OpenSim/Region/Environment/Scenes/Scene.cs | 5 +-- OpenSim/Region/Environment/Scenes/ScenePresence.cs | 4 +++ 3 files changed, 46 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Environment/Scenes') 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 diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index bf56fe8..d7e36c5 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -38,10 +38,10 @@ using OpenSim.Framework; using OpenSim.Framework.Communications; using OpenSim.Framework.Communications.Cache; using OpenSim.Framework.Console; +using OpenSim.Region.Environment.LandManagement; using OpenSim.Framework.Servers; using OpenSim.Region.Capabilities; using OpenSim.Region.Environment.Interfaces; -using OpenSim.Region.Environment.LandManagement; using OpenSim.Region.Environment.Modules; using OpenSim.Region.Environment.Scenes.Scripting; using OpenSim.Region.Environment.Types; @@ -732,7 +732,8 @@ namespace OpenSim.Region.Environment.Scenes client.OnRemoveTaskItem += RemoveTaskInventory; client.OnGrabObject += ProcessObjectGrab; - + client.OnAvatarPickerRequest += ProcessAvatarPickerRequest; + EventManager.TriggerOnNewClient(client); } diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index c9c24fe..3c6cad8 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs @@ -32,9 +32,11 @@ using libsecondlife; using libsecondlife.Packets; using OpenSim.Framework; using OpenSim.Framework.Console; +using OpenSim.Framework.Communications; using OpenSim.Region.Environment.Types; using OpenSim.Region.Physics.Manager; + namespace OpenSim.Region.Environment.Scenes { public partial class ScenePresence : EntityBase @@ -274,6 +276,7 @@ namespace OpenSim.Region.Environment.Scenes m_controllingClient.OnAgentRequestSit += HandleAgentRequestSit; m_controllingClient.OnAgentSit += HandleAgentSit; m_controllingClient.OnSetAlwaysRun += HandleSetAlwaysRun; + // ControllingClient.OnStartAnim += new StartAnim(this.SendAnimPack); // ControllingClient.OnChildAgentStatus += new StatusChange(this.ChildStatusChange); //ControllingClient.OnStopMovement += new GenericCall2(this.StopMovement); @@ -1227,5 +1230,6 @@ namespace OpenSim.Region.Environment.Scenes { m_controllingClient.SendWearables(m_wearables, m_wearablesSerial++); } + } } -- cgit v1.1