コード例 #1
0
ファイル: FriendsManager.cs プロジェクト: careytews/ALIVE
        /// <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);
        }
コード例 #2
0
ファイル: FriendsManager.cs プロジェクト: scatterp/plexview
        /// <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);
        }
コード例 #3
0
ファイル: FriendsManager.cs プロジェクト: scatterp/plexview
        /// <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));
            }
        }
コード例 #4
0
ファイル: FriendsManager.cs プロジェクト: careytews/ALIVE
        /// <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); }
            }
        }
コード例 #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);
        }
コード例 #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);
        }
コード例 #7
0
ファイル: FriendsManager.cs プロジェクト: RavenB/gridsearch
        /// <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);
        }