OpenMetaverse.FriendsManager.OnFindAgentReplyHandler C# (CSharp) Method

OnFindAgentReplyHandler() public method

Handle friend location updates
public OnFindAgentReplyHandler ( Packet packet, Simulator simulator ) : void
packet OpenMetaverse.Packets.Packet The Packet
simulator Simulator The Simulator
return void
        public void OnFindAgentReplyHandler(Packet packet, Simulator simulator)
        {
            if(OnFriendFound != null)
            {
            FindAgentPacket reply = (FindAgentPacket)packet;

            float x,y;
            UUID prey = reply.AgentBlock.Prey;
            ulong regionHandle = Helpers.GlobalPosToRegionHandle((float)reply.LocationBlock[0].GlobalX,
                (float)reply.LocationBlock[0].GlobalY, out x, out y);
            Vector3 xyz = new Vector3(x, y, 0f);

            try { OnFriendFound(prey, regionHandle, xyz); }
            catch (Exception e) { Logger.Log(e.Message, Helpers.LogLevel.Error, Client, e); }
            }
        }