Exemplo n.º 1
0
        /// <summary>
        /// Use to map a friends location on the grid.
        /// </summary>
        /// <param name="friendID">Friends UUID to find</param>
        /// <remarks><seealso cref="E:OnFriendFound"/></remarks>
        public void MapFriend(UUID friendID)
        {
            FindAgentPacket stalk = new FindAgentPacket();

            stalk.AgentBlock.Hunter = Client.Self.AgentID;
            stalk.AgentBlock.Prey   = friendID;

            Client.Network.SendPacket(stalk);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Use to map a friends location on the grid.
        /// </summary>
        /// <param name="friendID">Friends UUID to find</param>
        /// <remarks><seealso cref="E:OnFriendFound"/></remarks>
        public void MapFriend(UUID friendID)
        {
            FindAgentPacket stalk = new FindAgentPacket();

            stalk.AgentBlock.Hunter        = Client.Self.AgentID;
            stalk.AgentBlock.Prey          = friendID;
            stalk.AgentBlock.SpaceIP       = 0; // Will be filled in by the simulator
            stalk.LocationBlock            = new FindAgentPacket.LocationBlockBlock[1];
            stalk.LocationBlock[0]         = new FindAgentPacket.LocationBlockBlock();
            stalk.LocationBlock[0].GlobalX = 0.0; // Filled in by the simulator
            stalk.LocationBlock[0].GlobalY = 0.0;

            Client.Network.SendPacket(stalk);
        }
Exemplo n.º 3
0
        /// <summary>Process an incoming packet and raise the appropriate events</summary>
        /// <param name="sender">The sender</param>
        /// <param name="e">The EventArgs object containing the packet data</param>
        public void OnFindAgentReplyHandler(object sender, PacketReceivedEventArgs e)
        {
            if (m_FriendFound != null)
            {
                Packet          packet = e.Packet;
                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);

                OnFriendFoundReply(new FriendFoundReplyEventArgs(prey, regionHandle, xyz));
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// Handle friend location updates
        /// </summary>
        /// <param name="packet">The Packet</param>
        /// <param name="simulator">The Simulator</param>
        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); }
            }
        }
Exemplo n.º 5
0
        /// <summary>
        /// Use to map a friends location on the grid.
        /// </summary>
        /// <param name="friendID">Friends UUID to find</param>
        /// <remarks><seealso cref="E:OnFriendFound"/></remarks>
        public void MapFriend(UUID friendID)
        {
            FindAgentPacket stalk = new FindAgentPacket();
            stalk.AgentBlock.Hunter = Client.Self.AgentID;
            stalk.AgentBlock.Prey = friendID;
            stalk.AgentBlock.SpaceIP = 0; // Will be filled in by the simulator
            stalk.LocationBlock = new FindAgentPacket.LocationBlockBlock[1];
            stalk.LocationBlock[0] = new FindAgentPacket.LocationBlockBlock();
            stalk.LocationBlock[0].GlobalX = 0.0; // Filled in by the simulator
            stalk.LocationBlock[0].GlobalY = 0.0;

            Client.Network.SendPacket(stalk);
        }
Exemplo n.º 6
0
        /// <summary>
        /// Use to map a friends location on the grid.
        /// </summary>
        /// <param name="friendID">Friends UUID to find</param>
        /// <remarks><seealso cref="E:OnFriendFound"/></remarks>
        public void MapFriend(UUID friendID)
        {
            FindAgentPacket stalk = new FindAgentPacket();
            stalk.AgentBlock.Hunter = Client.Self.AgentID;
            stalk.AgentBlock.Prey = friendID;

            Client.Network.SendPacket(stalk);
        }
Exemplo n.º 7
0
        /// <summary>
        /// Use to map a friends location on the grid.
        /// </summary>
        /// <param name="friendID">Friends UUID to find</param>
        /// <remarks><seealso cref="E:OnFriendFound"/></remarks>
        public void MapFriend(LLUUID friendID)
        {
            FindAgentPacket stalk = new FindAgentPacket();
            stalk.AgentBlock.Hunter = Client.Self.AgentID;
            stalk.AgentBlock.Prey = friendID;
            Console.WriteLine(stalk.ToString());

            Client.Network.SendPacket(stalk);
        }