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. --- OpenSim/Region/ClientStack/ClientView.API.cs | 5 +++++ OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs | 11 ++++++++++- OpenSim/Region/ClientStack/ClientView.cs | 15 ++++++++++----- 3 files changed, 25 insertions(+), 6 deletions(-) (limited to 'OpenSim/Region/ClientStack') diff --git a/OpenSim/Region/ClientStack/ClientView.API.cs b/OpenSim/Region/ClientStack/ClientView.API.cs index b24b207..77c1701 100644 --- a/OpenSim/Region/ClientStack/ClientView.API.cs +++ b/OpenSim/Region/ClientStack/ClientView.API.cs @@ -55,6 +55,7 @@ namespace OpenSim.Region.ClientStack public event UpdateAgent OnAgentUpdate; public event AgentRequestSit OnAgentRequestSit; public event AgentSit OnAgentSit; + public event AvatarPickerRequest OnAvatarPickerRequest; public event StartAnim OnStartAnim; public event Action OnRequestAvatarsData; public event LinkObjects OnLinkObjects; @@ -705,6 +706,10 @@ namespace OpenSim.Region.ClientStack sendXfer.DataPacket.Data = data; OutPacket(sendXfer); } + public void SendAvatarPickerReply(AvatarPickerReplyPacket replyPacket) + { + OutPacket(replyPacket); + } /// /// diff --git a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs index 82ad1c8..1383ad9 100644 --- a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs +++ b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs @@ -217,7 +217,16 @@ namespace OpenSim.Region.ClientStack OnAgentSit(this, agentSit.AgentData.AgentID); } break; - + case PacketType.AvatarPickerRequest: + AvatarPickerRequestPacket avRequestQuery = (AvatarPickerRequestPacket)Pack; + AvatarPickerRequestPacket.AgentDataBlock Requestdata = avRequestQuery.AgentData; + AvatarPickerRequestPacket.DataBlock querydata = avRequestQuery.Data; + //System.Console.WriteLine("Agent Sends:" + Helpers.FieldToUTF8String(querydata.Name)); + if (OnAvatarPickerRequest != null) + { + OnAvatarPickerRequest(this, Requestdata.AgentID, Requestdata.QueryID, Helpers.FieldToUTF8String(querydata.Name)); + } + break; #endregion #region Objects/m_sceneObjects diff --git a/OpenSim/Region/ClientStack/ClientView.cs b/OpenSim/Region/ClientStack/ClientView.cs index 839556d..353a24c 100644 --- a/OpenSim/Region/ClientStack/ClientView.cs +++ b/OpenSim/Region/ClientStack/ClientView.cs @@ -295,11 +295,16 @@ namespace OpenSim.Region.ClientStack queuedLast = false; // TODO: May be a bit expensive doing this twice. - throttleSentPeriod += nextPacket.Packet.ToBytes().Length; - - //is a out going packet - DebugPacket("OUT", nextPacket.Packet); - ProcessOutPacket(nextPacket.Packet); + + //Don't throttle AvatarPickerReplies!, they return a null .ToBytes()! + if (nextPacket.Packet.Type != PacketType.AvatarPickerReply) + throttleSentPeriod += nextPacket.Packet.ToBytes().Length; + + + //is a out going packet + DebugPacket("OUT", nextPacket.Packet); + ProcessOutPacket(nextPacket.Packet); + } } } -- cgit v1.1