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


C# NetworkMessage.GetUInt32方法代码示例

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


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

示例1: ParseMessage

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

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

            Destination = destination;
            Type = IncomingPacketType.ShopWindowOpen;

            byte cap = msg.GetByte();
            ShopList = new List<ShopInfo> { };

            for (int i = 0; i < cap; i++)
            {
                ShopInfo item = new ShopInfo();

                item.ItemId = msg.GetUInt16();
                item.SubType = msg.GetByte();
                item.ItemName = msg.GetString();
                item.Weight = msg.GetUInt32();
                item.BuyPrice = msg.GetUInt32();
                item.SellPrice = msg.GetUInt32();
                ShopList.Add(item);
            }

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

示例2: ParseMessage

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

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

            Destination = destination;
            Type = IncomingPacketType.PlayerStatus;

            Health = msg.GetUInt16();
            MaxHealth = msg.GetUInt16();
            PokemonsCount = msg.GetUInt32();

            Experience = msg.GetUInt32();

            Level = msg.GetUInt16();

            LevelPercent = msg.GetByte();

            Pokemons = msg.GetUInt16();
            PokemonsMax = msg.GetUInt16();

            MagicLevel = msg.GetByte();
            MagicLevelPercent = msg.GetByte();
            Soul = msg.GetByte();

            Stamina = msg.GetUInt16();

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

示例3: Parse

        public static AccountPacket Parse(NetworkMessage message)
        {
            AccountPacket packet = new AccountPacket();
            packet.Os = message.GetUInt16(); // OS
            packet.Version = message.GetUInt16(); // version

            // File checks
            message.GetUInt32();
            message.GetUInt32();
            message.GetUInt32();

            message.RSADecrypt();

            message.GetByte(); // should be zero

            packet.XteaKey = new uint[4];
            packet.XteaKey[0] = message.GetUInt32();
            packet.XteaKey[1] = message.GetUInt32();
            packet.XteaKey[2] = message.GetUInt32();
            packet.XteaKey[3] = message.GetUInt32();

            packet.AccountName = message.GetString(); // account name
            packet.Password = message.GetString(); // password

            return packet;
        }
开发者ID:henriqueuller,项目名称:sharpot,代码行数:26,代码来源:AccountPacket.cs

示例4: 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

示例5: ParseMessage

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

            Type = PipePacketType.UpdateCreatureText;
            
            CreatureId = msg.GetUInt32();
            CreatureName = msg.GetString();
            Location = new Location((int)msg.GetUInt32(), (int)msg.GetUInt32(), 0);
            Text = msg.GetString();

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

示例6: ParseMessage

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

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

            Destination = destination;
            Type = IncomingPacketType.TileTransformThing;

            Position = msg.GetLocation();
            StackPosition = msg.GetByte();
            ThingId = msg.GetUInt16();

            if (ThingId == 0x0061 || ThingId == 0x0062 || ThingId == 0x0063)
            {
                CreatureId = msg.GetUInt32();
                CreatureDirection = msg.GetByte();
            }
            else
            {
                Item = new Pokemon.Objects.Item(Client, ThingId, 0);
                Item.Location = Pokemon.Objects.ItemLocation.FromLocation(Position);

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

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

示例7: ParseMessage

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

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

            Destination = destination;
            Type = IncomingPacketType.ShopSaleGoldCount;

            Cash = msg.GetUInt32();
            byte count = msg.GetByte();

            ItemList = new List<ShopInfo> { };

            for (int i = 0; i < count; i++)
            {
                ShopInfo item = new ShopInfo();

                item.ItemId = msg.GetUInt16();
                item.SubType = msg.GetByte();

                ItemList.Add(item);
            }

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

示例8: ParseMessage

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

            Destination = destination;
            Type = OutgoingPacketType.Attack;

            CreatureId = msg.GetUInt32();

            if (Client.VersionNumber >= 860)
            {
                Count = msg.GetUInt32();
            }

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

示例9: ParseMessage

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

            Type = PipePacketType.OnClickContextMenu;
            EventId = (int)msg.GetUInt32();

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

示例10: ParseMessage

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

            Type = PipePacketType.RemoveIcon;
            IconId = msg.GetUInt32();

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

示例11: ParseMessage

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

            Type = PipePacketType.SetConstant;
            ConstantType = (PipeConstantType)msg.GetByte();
            Value = msg.GetUInt32();

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

示例12: ParseMessage

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

            Type = PipePacketType.RemoveCreatureText;
            CreatureId = msg.GetUInt32();
            CreatureName = msg.GetString();

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

示例13: ParseMessage

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

            Destination = destination;
            Type = OutgoingPacketType.Follow;

            CreatureId = msg.GetUInt32();
            return true;
        }
开发者ID:FaNtA91,项目名称:pokemonapi,代码行数:11,代码来源:FollowPacket.cs

示例14: ParseMessage

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

            Destination = destination;
            Type = IncomingPacketType.VipLogout;

            PlayerId = msg.GetUInt32();

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

示例15: ParseMessage

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

            Type = PipePacketType.AddContextMenu;
            EventId = (int)msg.GetUInt32();
            Text = msg.GetString();
            ContextMenuType = (Constants.ContextMenuType)msg.GetByte();
            HasSeparator = msg.GetByte();

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


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