Beispiel #1
0
        // Player changes appearance (clothes, hair, etc)
        private void _handleAvatarAgree(Packet pkt)
        {
            short      playerID = pkt.GetShort();
            AvatarSlot slot     = (AvatarSlot)pkt.GetChar();

            switch (slot)
            {
            case AvatarSlot.Clothes:
            {
                AvatarData newRenderData = new AvatarData(
                    playerID,
                    slot,
                    pkt.GetChar() == 0,                                      //sound
                    pkt.GetShort(),                                          //boots
                    pkt.GetShort(),                                          //armor
                    pkt.GetShort(),                                          //hat
                    pkt.GetShort(),                                          //weapon
                    pkt.GetShort()                                           //shield
                    );
                if (OnPlayerAvatarChange != null)
                {
                    OnPlayerAvatarChange(newRenderData);
                }
            }
            break;

            case AvatarSlot.Hair:
            {
                if (pkt.GetChar() != 0)
                {
                    return;                                                     //subloc -- not sure what this does
                }
                AvatarData data = new AvatarData(playerID, slot, pkt.GetChar(), pkt.GetChar());
                if (OnPlayerAvatarChange != null)
                {
                    OnPlayerAvatarChange(data);
                }
            }
            break;

            case AvatarSlot.HairColor:
            {
                if (pkt.GetChar() != 0)
                {
                    return;                                                     //subloc -- not sure what this does
                }
                AvatarData data = new AvatarData(playerID, slot, 0, pkt.GetChar());
                if (OnPlayerAvatarChange != null)
                {
                    OnPlayerAvatarChange(data);
                }
            }
            break;
            }
        }
Beispiel #2
0
		internal AvatarData(short id, AvatarSlot slot, byte hairStyle, byte hairColor)
		{
			pid = id;
			this.slot = slot;

			hairstyle = hairStyle;
			haircolor = hairColor;

			sound = false;
			boots = armor = hat = shield = weapon = 0;
		}
Beispiel #3
0
        internal AvatarData(short id, AvatarSlot slot, byte hairStyle, byte hairColor)
        {
            pid       = id;
            this.slot = slot;

            hairstyle = hairStyle;
            haircolor = hairColor;

            sound = false;
            boots = armor = hat = shield = weapon = 0;
        }
Beispiel #4
0
        //this is only ever sent to MainPlayer (avatar handles other players)
        private void _handlePaperdollRemove(Packet pkt)
        {
            if (OnPlayerPaperdollChange == null)
            {
                return;
            }

            //the $strip command does this wrong (adding 0's in), somehow the original client is smart enough to figure it out
            //normally would put this block in the _handleAvatarAgree
            short      playerID = pkt.GetShort();
            AvatarSlot slot     = (AvatarSlot)pkt.GetChar();
            bool       sound    = pkt.GetChar() == 0;    //sound : 0

            short boots = pkt.GetShort();

            if (pkt.Length != 45)
            {
                pkt.Skip(sizeof(short) * 3);                               //three 0s
            }
            short armor = pkt.GetShort();

            if (pkt.Length != 45)
            {
                pkt.Skip(sizeof(short));                               // one 0
            }
            short hat = pkt.GetShort();
            short shield, weapon;

            if (pkt.Length != 45)
            {
                shield = pkt.GetShort();
                weapon = pkt.GetShort();
            }
            else
            {
                weapon = pkt.GetShort();
                shield = pkt.GetShort();
            }

            AvatarData renderData = new AvatarData(playerID, slot, sound, boots, armor, hat, weapon, shield);

            if (OnPlayerAvatarChange != null)
            {
                OnPlayerAvatarChange(renderData);
            }

            PaperdollEquipData data = new PaperdollEquipData(pkt, true);

            OnPlayerPaperdollChange(data);
        }
Beispiel #5
0
		internal AvatarData(short id, AvatarSlot slot, bool sound, short boots, short armor, short hat, short weapon, short shield)
		{
			pid = id;
			this.slot = slot;

			this.sound = sound;
			this.boots = boots;
			this.armor = armor;
			this.hat = hat;
			this.shield = shield;
			this.weapon = weapon;

			hairstyle = haircolor = 0;
		}
Beispiel #6
0
        internal AvatarData(short id, AvatarSlot slot, bool sound, short boots, short armor, short hat, short weapon, short shield)
        {
            pid       = id;
            this.slot = slot;

            this.sound  = sound;
            this.boots  = boots;
            this.armor  = armor;
            this.hat    = hat;
            this.shield = shield;
            this.weapon = weapon;

            hairstyle = haircolor = 0;
        }