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


C# NetworkMessage.GetLocation方法代码示例

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


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

示例1: ParseMessage

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

            Destination = destination;
            Type = OutgoingPacketType.ItemMove;

            FromLocation = msg.GetLocation();
            SpriteId = msg.GetUInt16();
            FromStackPosition = msg.GetByte();
            ToLocation = msg.GetLocation();
            Count = msg.GetByte();

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

示例2: ParseMessage

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

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

            Destination = destination;
            Type = IncomingPacketType.CreatureMove;

            FromLocation = msg.GetLocation();
            FromStackPosition = msg.GetByte();
            ToLocation = msg.GetLocation();

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

示例3: ParseMessage

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

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

            Destination = destination;
            Type = IncomingPacketType.Projectile;

            FromPosition = msg.GetLocation();
            ToPosition = msg.GetLocation();
            Effect = (ProjectileType)msg.GetByte();

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

示例4: ParseMessage

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

            Destination = destination;
            Type = IncomingPacketType.TileUpdate;
            outMsg.AddByte((byte)Type);

            Objects.Location pos = msg.GetLocation();
            outMsg.AddLocation(pos);

            ushort thingId = msg.PeekUInt16();

            if (thingId == 0xFF01)
            {
                outMsg.AddUInt16(msg.GetUInt16());
            }
            else
            {
                ParseTileDescription(msg, pos, outMsg);
                outMsg.AddUInt16(msg.GetUInt16());
            }

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

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

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

示例7: ParseMessage

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

            Destination = destination;
            Type = OutgoingPacketType.TileUpdate;

            Location = msg.GetLocation();

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

示例8: ParseMessage

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

            Destination = destination;
            Type = OutgoingPacketType.LookAt;

            Location = msg.GetLocation();
            SpriteId = msg.GetUInt16();
            StackPosition = msg.GetByte();

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

示例9: ParseMessage

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

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

            Destination = destination;
            Type = IncomingPacketType.MagicEffect;

            Location = msg.GetLocation();
            Effect = (Effect)msg.GetByte();

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

示例10: ParseMessage

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

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

            Destination = destination;
            Type = IncomingPacketType.TileRemoveThing;

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

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

示例11: ParseMessage

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

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

            Destination = destination;
            Type = IncomingPacketType.AnimatedText;

            Location = msg.GetLocation();
            Color = (TextColor)msg.GetByte();
            Message = msg.GetString();

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

示例12: ParseMessage

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

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

            Destination = destination;
            Type = IncomingPacketType.MapDescription;
            outMsg.AddByte((byte)Type);

            Client.playerLocation = msg.GetLocation();
            outMsg.AddLocation(Client.playerLocation);

            return ParseMapDescription(msg, Client.playerLocation.X - 8, Client.playerLocation.Y - 6, Client.playerLocation.Z, 18, 14, outMsg);
        }
开发者ID:FaNtA91,项目名称:pokemonapi,代码行数:16,代码来源:MapDescriptionPacket.cs

示例13: ParseMessage

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

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

            Destination = destination;
            Type = IncomingPacketType.CreatureSpeech;

            Unknown = msg.GetUInt32();
            SenderName = msg.GetString();
            SenderLevel = msg.GetUInt16();

            SpeechTypeInfo info = Enums.GetSpeechTypeInfo(Client.VersionNumber, msg.GetByte());
            SpeechType = info.SpeechType;

            switch (info.AdditionalSpeechData)
            {
                case AdditionalSpeechData.Location:
                    Position = msg.GetLocation();
                    break;
                case AdditionalSpeechData.ChannelId:
                    ChannelId = (ChatChannel)msg.GetUInt16();
                    break;
                case AdditionalSpeechData.Time:
                    Time = msg.GetUInt32();
                    break;
                default:
                    break;
            }

            Message = msg.GetString();

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


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