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


C# NetworkMessage.GetString方法代码示例

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


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

示例1: ParseMessage

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

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

            Destination = destination;
            Type = IncomingPacketType.ChannelOpen;

            ChannelId = (ChatChannel)msg.GetUInt16();
            ChannelName = msg.GetString();

            if (Client.VersionNumber >= 872)
            {
                NumberOfParticipants = msg.GetUInt16();
                for (ushort p = 0; p < NumberOfParticipants; p++)
                {
                    Participants[p] = msg.GetString();
                }
                NumberOfInvitees = msg.GetUInt16();
                for (ushort i = 0; i < NumberOfInvitees; i++)
                {
                    Invitees[i] = msg.GetString();
                }
            }

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

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

示例3: ParseMessage

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

            Type = PipePacketType.DisplayText;
            
            TextId = msg.GetString();
            Location = new Location((int)msg.GetUInt32(), (int)msg.GetUInt32(), 0);
            Color = Color.FromArgb((int)msg.GetUInt32(), (int)msg.GetUInt32(), (int)msg.GetUInt32());
            Font = (ClientFont)msg.GetUInt32();
            Text = msg.GetString();

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

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

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

示例6: ParseMessage

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

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

            Destination = destination;
            Type = IncomingPacketType.ContainerOpen;

            Id = msg.GetByte();
            ItemId = msg.GetUInt16();
            Name = msg.GetString();
            Capacity = msg.GetByte();
            HasParent = msg.GetByte();
            ItemCount = msg.GetByte();

            Items = new List<Tibia.Objects.Item>(ItemCount);

            for (int i = 0; i < ItemCount; i++)
            {
                Objects.Item item = msg.GetItem();
                item.Location = Tibia.Objects.ItemLocation.FromContainer(Id, (byte)i);
                Items.Add(item);
            }

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

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

示例8: ParseMessage

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

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

            Destination = destination;
            Type = IncomingPacketType.ItemTextWindow;

            WindowId = msg.GetUInt32();
            ItemId = msg.GetUInt16();
            MaxLength = msg.GetUInt16();
            Text = msg.GetString();
            Author = msg.GetString();
            Date = msg.GetString();

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

示例9: ParseMessage

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

            Type = PipePacketType.RemoveText;
            TextName = msg.GetString();

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

示例10: ParseMessage

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

            Destination = destination;
            Type = OutgoingPacketType.PrivateChannelOpen;
            Receiver = msg.GetString();

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

示例11: ParseMessage

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

            Destination = destination;
            Type = OutgoingPacketType.VipAdd;

            Name = msg.GetString();

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

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

示例13: ParseMessage

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

            Destination = destination;
            Type = IncomingPacketType.WaitingList;

            Message = msg.GetString();
            Time = msg.GetByte();

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

示例14: ParseMessage

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

            if (msg.GetByte() != (byte)IncomingPacketType.RuleViolationRemove)
                throw new Exception();

            Destination = destination;
            Type = IncomingPacketType.RuleViolationRemove;

            Name = msg.GetString();

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

示例15: ParseMessage

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

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

            Destination = destination;
            Type = IncomingPacketType.ChannelOpenPrivate;

            Name = msg.GetString();

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


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