public void AvatarIntrestsHandler(Packet packet, Simulator simulator)
        {
            AvatarInterestsReplyPacket airp = (AvatarInterestsReplyPacket)packet;
            Avatar av;

            lock (Avatars)
            {
                if (!Avatars.ContainsKey(airp.AgentData.AvatarID))
                {
                    //not in our "cache", create a new object
                    av    = new Avatar();
                    av.ID = airp.AgentData.AvatarID;
                }
                else
                {
                    //Cache hit, modify existing avatar
                    av = Avatars[airp.AgentData.AvatarID];
                }
                //The rest of the properties, thanks LL.
                av.WantToMask    = airp.PropertiesData.WantToMask;
                av.WantToText    = Helpers.FieldToString(airp.PropertiesData.WantToText);
                av.SkillsMask    = airp.PropertiesData.SkillsMask;
                av.SkillsText    = Helpers.FieldToString(airp.PropertiesData.SkillsText);
                av.LanguagesText = Helpers.FieldToString(airp.PropertiesData.LanguagesText);
            }
            if (AvatarIntrestsCallbacks.ContainsKey(airp.AgentData.AvatarID) && AvatarIntrestsCallbacks[airp.AgentData.AvatarID] != null)
            {
                AvatarIntrestsCallbacks[airp.AgentData.AvatarID](av);
            }
        }
Beispiel #2
0
        private void SendAvatarInterests(LLAgent agent, UUID avatarID, User user)
        {
            AvatarInterestsReplyPacket reply = new AvatarInterestsReplyPacket();

            reply.AgentData.AgentID  = agent.ID;
            reply.AgentData.AvatarID = avatarID;
            OSDMap interests;

            if (user != null && (interests = user.GetField("LLInterests") as OSDMap) != null)
            {
                reply.PropertiesData.LanguagesText = Utils.StringToBytes(interests["Languages"].AsString());
                reply.PropertiesData.SkillsMask    = interests["SkillsMask"].AsUInteger();
                reply.PropertiesData.SkillsText    = Utils.StringToBytes(interests["SkillsText"].AsString());
                reply.PropertiesData.WantToMask    = interests["WantMask"].AsUInteger();
                reply.PropertiesData.WantToText    = Utils.StringToBytes(interests["WantText"].AsString());
            }
            else
            {
                reply.PropertiesData.LanguagesText = Utils.EmptyBytes;
                reply.PropertiesData.SkillsText    = Utils.EmptyBytes;
                reply.PropertiesData.WantToText    = Utils.EmptyBytes;
            }

            m_udp.SendPacket(agent, reply, ThrottleCategory.Task, false);
        }
        /// <summary>
        /// Process incoming Avatar Interests information
        /// </summary>
        private void AvatarInterestsHandler(Packet packet, Simulator simulator)
        {
            if (OnAvatarInterests != null)
            {
                AvatarInterestsReplyPacket airp      = (AvatarInterestsReplyPacket)packet;
                Avatar.Interests           interests = new Avatar.Interests();

                interests.WantToMask    = airp.PropertiesData.WantToMask;
                interests.WantToText    = Helpers.FieldToUTF8String(airp.PropertiesData.WantToText);
                interests.SkillsMask    = airp.PropertiesData.SkillsMask;
                interests.SkillsText    = Helpers.FieldToUTF8String(airp.PropertiesData.SkillsText);
                interests.LanguagesText = Helpers.FieldToUTF8String(airp.PropertiesData.LanguagesText);

                OnAvatarInterests(airp.AgentData.AvatarID, interests);
            }
        }
Beispiel #4
0
        private void SendAvatarInterests(LLAgent agent, UUID avatarID, User user)
        {
            AvatarInterestsReplyPacket reply = new AvatarInterestsReplyPacket();
            reply.AgentData.AgentID = agent.ID;
            reply.AgentData.AvatarID = avatarID;
            OSDMap interests;

            if (user != null && (interests = user.GetField("LLInterests") as OSDMap) != null)
            {
                reply.PropertiesData.LanguagesText = Utils.StringToBytes(interests["Languages"].AsString());
                reply.PropertiesData.SkillsMask = interests["SkillsMask"].AsUInteger();
                reply.PropertiesData.SkillsText = Utils.StringToBytes(interests["SkillsText"].AsString());
                reply.PropertiesData.WantToMask = interests["WantMask"].AsUInteger();
                reply.PropertiesData.WantToText = Utils.StringToBytes(interests["WantText"].AsString());
            }
            else
            {
                reply.PropertiesData.LanguagesText = Utils.EmptyBytes;
                reply.PropertiesData.SkillsText = Utils.EmptyBytes;
                reply.PropertiesData.WantToText = Utils.EmptyBytes;
            }

            m_udp.SendPacket(agent, reply, ThrottleCategory.Task, false);
        }