当前位置: 首页>>代码示例>>C#>>正文


C# NetworkMessage.GetOutfit方法代码示例

本文整理汇总了C#中NetworkMessage.GetOutfit方法的典型用法代码示例。如果您正苦于以下问题:C# NetworkMessage.GetOutfit方法的具体用法?C# NetworkMessage.GetOutfit怎么用?C# NetworkMessage.GetOutfit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在NetworkMessage的用法示例。


在下文中一共展示了NetworkMessage.GetOutfit方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ParseMessage

        public override bool ParseMessage(NetworkMessage msg, PacketDestination destination)
        {
            int position = msg.Position;

            if (msg.GetByte() != (byte)IncomingPacketType.OutfitWindow)
                return false;

            Destination = destination;
            Type = IncomingPacketType.OutfitWindow;

            Default = msg.GetOutfit();

            byte count = msg.GetByte();
            OutfitList = new List<AvalibleOutfit> { };

            for (int i = 0; i < count; i++)
            {
                AvalibleOutfit outfit = new AvalibleOutfit();

                outfit.Id = msg.GetUInt16();
                outfit.Name = msg.GetString();
                outfit.Addons = msg.GetByte();

                OutfitList.Add(outfit);
            }

            return true;
        }
开发者ID:FaNtA91,项目名称:pokemonapi,代码行数:28,代码来源:OutfitWindowPacket.cs

示例2: ParseMessage

        public override bool ParseMessage(NetworkMessage msg, PacketDestination destination)
        {
            if (msg.GetByte() != (byte)IncomingPacketType.TileAddThing)
                return false;

            Destination = destination;
            Type = IncomingPacketType.TileAddThing;

            Location = msg.GetLocation();
            Stack = msg.GetByte();
            ThingId = msg.GetUInt16();

            if (ThingId == 0x0061 || ThingId == 0x0062)
            {
                Creature = new PacketCreature(Client);

                if (ThingId == 0x0062)
                {
                    Creature.Type = PacketCreatureType.Known;
                    Creature.Id = msg.GetUInt32();
                }
                else if (ThingId == 0x0061)
                {
                    Creature.Type = PacketCreatureType.Unknown;
                    Creature.RemoveId = msg.GetUInt32();
                    Creature.Id = msg.GetUInt32();
                    Creature.Name = msg.GetString();
                }

                Creature.Health = msg.GetByte();
                Creature.Direction = msg.GetByte();

                Creature.Outfit = msg.GetOutfit();

                Creature.LightLevel = msg.GetByte();
                Creature.LightColor = msg.GetByte();

                Creature.Speed = msg.GetUInt16();
                Creature.Skull = (Constants.Skull)msg.GetByte();
                Creature.PartyShield = (PartyShield)msg.GetByte();
            }
            else if (ThingId == 0x0063)
            {
                Creature = new PacketCreature(Client);
                Creature.Type = PacketCreatureType.Turn;
                Creature.Id = msg.GetUInt32();
                Creature.Direction = msg.GetByte();
            }
            else
            {
                Item = new Pokemon.Objects.Item(Client, ThingId);
                Item.Location = Pokemon.Objects.ItemLocation.FromLocation(Location);

                if (Item.HasExtraByte)
                    Item.Count = msg.GetByte();
            }

            return true;
        }
开发者ID:FaNtA91,项目名称:pokemonapi,代码行数:59,代码来源:TileAddThingPacket.cs

示例3: ParseMessage

        public override bool ParseMessage(NetworkMessage msg, PacketDestination destination)
        {
            if (msg.GetByte() != (byte)OutgoingPacketType.SetOutfit)
                return false;

            Destination = destination;
            Type = OutgoingPacketType.SetOutfit;

            Outfit = msg.GetOutfit();

            return true;
        }
开发者ID:Xileck,项目名称:tibiaapi,代码行数:12,代码来源:SetOutfitPacket.cs

示例4: ParseMessage

        public override bool ParseMessage(NetworkMessage msg, PacketDestination destination)
        {
            int position = msg.Position;

            if (msg.GetByte() != (byte)IncomingPacketType.CreatureOutfit)
                return false;

            Destination = destination;
            Type = IncomingPacketType.CreatureOutfit;

            CreatureId = msg.GetUInt32();
            Outfit = msg.GetOutfit();

            return true;
        }
开发者ID:Xileck,项目名称:tibiaapi,代码行数:15,代码来源:CreatureOutfitPacket.cs

示例5: ParseThing

        protected bool ParseThing(NetworkMessage msg, Location pos, Tile tile, int n, NetworkMessage outMsg)
        {
            //get thing type
            ushort thingId = msg.GetUInt16();
            outMsg.AddUInt16(thingId);

            PacketCreature c;

            if (thingId == 0x0061 || thingId == 0x0062)
            {

                c = new PacketCreature(Client);
                c.Location = pos;

                //creatures
                if (thingId == 0x0062) //creature is known
                {
                    c.Type = PacketCreatureType.Known;
                    c.Id = msg.GetUInt32();
                    outMsg.AddUInt32(c.Id); //creatureid
                }
                else if (thingId == 0x0061)
                { //creature is not known
                    //perhaps we have to remove a known creature
                    c.RemoveId = msg.GetUInt32();
                    outMsg.AddUInt32(c.RemoveId);

                    //add a new creature
                    c.Type = PacketCreatureType.Unknown;
                    c.Id = msg.GetUInt32();
                    outMsg.AddUInt32(c.Id);

                    c.Name = msg.GetString();
                    outMsg.AddString(c.Name);
                }

                //read creature properties
                c.Health = msg.GetByte();
                outMsg.AddByte(c.Health);

                c.Direction = msg.GetByte();
                outMsg.AddByte(c.Direction);

                c.Outfit = msg.GetOutfit();
                outMsg.AddOutfit(c.Outfit);

                c.LightLevel = msg.GetByte();
                outMsg.AddByte(c.LightLevel);

                c.LightColor = msg.GetByte();
                outMsg.AddByte(c.LightColor);

                c.Speed = msg.GetUInt16();
                outMsg.AddUInt16(c.Speed);

                c.Skull = (Constants.Skull)msg.GetByte();
                outMsg.AddByte((byte)c.Skull);

                c.PartyShield = (Constants.PartyShield)msg.GetByte();
                outMsg.AddByte((byte)c.PartyShield);

                creatures.Add(c);

                return true;
            }
            else if (thingId == 0x0063)
            {
                //creature turn
                c = new PacketCreature(Client);
                c.Location = pos;
                c.Type = PacketCreatureType.Turn;
                c.Id = msg.GetUInt32();
                outMsg.AddUInt32(c.Id);

                c.Direction = msg.GetByte();
                outMsg.AddByte(c.Direction);

                creatures.Add(c);

                return true;
            }
            else
            {
                //item
                UInt16 itemId;
                if (thingId == UInt16.MaxValue)
                {
                    itemId = msg.GetUInt16();
                    outMsg.AddUInt16(itemId);
                }
                else
                    itemId = thingId;

                Item item = new Item(Client, itemId, 0, "", ItemLocation.FromLocation(pos, (byte)n));

                if (item.HasExtraByte)
                {
                    item.Count = msg.GetByte();
                    outMsg.AddByte(item.Count);
                }
//.........这里部分代码省略.........
开发者ID:FaNtA91,项目名称:pokemonapi,代码行数:101,代码来源:MapPacket.cs


注:本文中的NetworkMessage.GetOutfit方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。