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


C# PacketReader.ReadSingle方法代码示例

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


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

示例1: Read

        public virtual IDataObject Read(PacketReader r)
        {
            X = r.ReadSingle();
            Y = r.ReadSingle();

            return this;
        }
开发者ID:Zeroeh,项目名称:K_Relay,代码行数:7,代码来源:Location.cs

示例2: Read

 public override void Read(PacketReader r)
 {
     Location = (Location) new Location().Read(r);
     Radius = r.ReadSingle();
     Damage = r.ReadUInt16();
     Effects = (ConditionEffectIndex)r.ReadByte();
     EffectDuration = r.ReadSingle();
     OriginType = r.ReadInt16();
 }
开发者ID:JuixGames,项目名称:K_Relay,代码行数:9,代码来源:AoEPacket.cs

示例3: Read

 public override void Read(PacketReader r)
 {
     BulletId = r.ReadByte();
     OwnerId = r.ReadInt32();
     ContainerType = r.ReadInt16();
     Angle = r.ReadSingle();
 }
开发者ID:JuixGames,项目名称:K_Relay,代码行数:7,代码来源:AllyShootPacket.cs

示例4: RealmList

        public RealmList(PacketReader reader)
        {
            Type = reader.ReadByte();
            locked = reader.ReadByte();
            Flags = reader.ReadByte();
            Name = reader.ReadCString();
            string address = reader.ReadCString();
            string[] tokens = address.Split(':');
            Address = tokens[0];
            Port = tokens.Length > 1 ? int.Parse(tokens[1]) : 8085;
            Population = reader.ReadSingle();
            load = reader.ReadByte();
            timezone = reader.ReadByte();
            unk1 = reader.ReadByte();

            if ((Flags & 4) != 0)
            {
                major = reader.ReadByte();
                minor = reader.ReadByte();
                bugfix = reader.ReadByte();
                build = reader.ReadUInt16();
            }

            unk2 = reader.ReadUInt16();
        }
开发者ID:Lucoms,项目名称:EDWoWGMClient,代码行数:25,代码来源:RealmList.cs

示例5: Read

 public override void Read(PacketReader r)
 {
     Time = r.ReadInt32();
     BulletId = r.ReadByte();
     ContainerType = r.ReadInt16();
     Position = (Location)new Location().Read(r);
     Angle = r.ReadSingle();
 }
开发者ID:JuixGames,项目名称:K_Relay,代码行数:8,代码来源:PlayerShootPacket.cs

示例6: Read

 public override void Read(PacketReader r)
 {
     BulletId = r.ReadByte();
     OwnerId = r.ReadInt32();
     ContainerType = r.ReadInt32();
     StartingLoc = (Location) new Location().Read(r);
     Angle = r.ReadSingle();
     Damage = r.ReadInt16();
 }
开发者ID:JuixGames,项目名称:K_Relay,代码行数:9,代码来源:Shoot2Packet.cs

示例7: Read

        public override void Read(PacketReader r)
        {
            BulletId = r.ReadByte();
            OwnerId = r.ReadInt32();
            BulletType = r.ReadByte();
            Location = (Location) new Location().Read(r);
            Angle = r.ReadSingle();
            Damage = r.ReadInt16();

            if (r.BaseStream.Position < r.BaseStream.Length)
            {
                NumShots = r.ReadByte();
                AngleInc = r.ReadSingle();
            }
            else
            {
                NumShots = 1;
                AngleInc = 0.0F;
            }
        }
开发者ID:JuixGames,项目名称:K_Relay,代码行数:20,代码来源:ShootPacket.cs

示例8: IS_CPP

 /// <summary>
 /// Creates a new camera position packet.
 /// </summary>
 /// <param name="buffer">A buffer contaning the packet data.</param>
 public IS_CPP(byte[] buffer)
     : this() {
     PacketReader reader = new PacketReader(buffer);
     Size = reader.ReadByte();
     Type = (PacketType)reader.ReadByte();
     ReqI = reader.ReadByte();
     reader.Skip(1);
     Pos = new Vec(reader.ReadInt32(), reader.ReadInt32(), reader.ReadInt32());
     H = reader.ReadUInt16();
     P = reader.ReadUInt16();
     R = reader.ReadUInt16();
     ViewPLID = reader.ReadByte();
     InGameCam = (ViewIndentifier)reader.ReadByte();
     FOV = reader.ReadSingle();
     Time = TimeSpan.FromMilliseconds(reader.ReadUInt16());
     Flags = (StateFlags)reader.ReadUInt16();
 }
开发者ID:maindefine,项目名称:insimdotnet,代码行数:21,代码来源:IS_CPP.cs

示例9: OutGaugePack

        /// <summary>
        /// Creates a new instance of the <see cref="OutGaugePack"/> class.
        /// </summary>
        /// <param name="buffer">A buffer contaning the packet data.</param>
        public OutGaugePack(byte[] buffer) {
            if (buffer == null) {
                throw new ArgumentNullException("buffer");
            }

            PacketReader reader = new PacketReader(buffer);
            Time = TimeSpan.FromMilliseconds(reader.ReadUInt32());
            Car = reader.ReadString(4);
            Flags = (OutGaugeFlags)reader.ReadUInt16();
            Gear = reader.ReadByte();
            PLID = reader.ReadByte();
            Speed = reader.ReadSingle();
            RPM = reader.ReadSingle();
            Turbo = reader.ReadSingle();
            EngTemp = reader.ReadSingle();
            Fuel = reader.ReadSingle();
            OilPressure = reader.ReadSingle();
            OilTemp = reader.ReadSingle();
            DashLights = (DashLightFlags)reader.ReadUInt32();
            ShowLights = (DashLightFlags)reader.ReadUInt32();
            Throttle = reader.ReadSingle();
            Brake = reader.ReadSingle();
            Clutch = reader.ReadSingle();
            Display1 = reader.ReadString(16);
            Display2 = reader.ReadString(16);

            // ID is optional.
            if (buffer.Length == MaxSize) {
                ID = reader.ReadInt32();
            }
        }
开发者ID:maindefine,项目名称:insimdotnet,代码行数:35,代码来源:OutGaugePack.cs

示例10: ProcessGameSpawn

        public static void ProcessGameSpawn(Client client, PacketReader packetReader)
        {
            var uid = packetReader.ReadUInt64();
            var xpos = packetReader.ReadSingle();
            var ypos = packetReader.ReadSingle();
            var zpos = packetReader.ReadSingle();
            var xdir = packetReader.ReadSingle();
            var ydir = packetReader.ReadSingle();
            var zdir = packetReader.ReadSingle();

            if (client.GetStage() != null)
            {
                var traits = client.GetStage().GetTraits();

                if (traits.Ruleset.IsDuel())
                {
                    if (traits.DuelQueue.Challenger != client && traits.DuelQueue.Champion != client)
                        return;
                }
                if (traits.Ruleset.IsTeam())
                    return;

                var position = new Position();
                var direction = new Direction();

                position.X = xpos;
                position.Y = ypos;
                position.Z = zpos;

                direction.X = xdir;
                direction.Y = ydir;
                direction.Z = zdir;
                lock (client.GetStage().ObjectLock)
                {
                    Battle.GameSpawn(client.GetStage().GetTraits().Players, client.GetMuid(),
                                     position, direction);
                }
            }
        }
开发者ID:Theoretical,项目名称:bunnyemu,代码行数:39,代码来源:StageHandler.cs

示例11: ResponseSpawnWorldItem

        public static void ResponseSpawnWorldItem(Client client, PacketReader packet)
        {
            var charId = packet.ReadMuid();
            var itemId = packet.ReadInt32();
            var X = packet.ReadSingle();
            var Y = packet.ReadSingle();
            var Z = packet.ReadSingle();

            var spawn = new ItemSpawn();
            spawn.Position.X = X;
            spawn.Position.Y = Y;
            spawn.Position.Z = Z;
            spawn.ItemId = (ushort)itemId;
            spawn.Taken = false;
            spawn.ItemUid = client.GetStage().GetTraits().WorldItemUid;
            spawn.NextSpawn = DateTime.Now.AddMilliseconds(WorldItemManager.GetTime(itemId));

            Interlocked.Increment(ref client.GetStage().GetTraits().WorldItemUid);

            lock (client.GetStage().GetTraits().WorldItems)
                client.GetStage().GetTraits().WorldItems.Add(spawn);

            lock (client.GetStage().ObjectLock)
                Battle.SpawnWorldItem(client.GetStage().GetTraits().Players,
                                       spawn);
        }
开发者ID:Theoretical,项目名称:bunnyemu,代码行数:26,代码来源:StageHandler.cs

示例12: IS_STA

 /// <summary>
 /// Creates a new state packet.
 /// </summary>
 /// <param name="buffer">A buffer contaning the packet data.</param>
 public IS_STA(byte[] buffer)
     : this() {
     PacketReader reader = new PacketReader(buffer);
     Size = reader.ReadByte();
     Type = (PacketType)reader.ReadByte();
     ReqI = reader.ReadByte();
     reader.Skip(1);
     ReplaySpeed = reader.ReadSingle();
     Flags = (StateFlags)reader.ReadUInt16();
     InGameCam = (ViewIndentifier)reader.ReadByte();
     ViewPLID = reader.ReadByte();
     NumP = reader.ReadByte();
     NumConns = reader.ReadByte();
     NumFinished = reader.ReadByte();
     RaceInProg = reader.ReadByte();
     QualMins = reader.ReadByte();
     RaceLaps = reader.ReadByte();
     reader.Skip(2);
     Track = reader.ReadString(6);
     Weather = reader.ReadByte();
     Wind = reader.ReadByte();
 }
开发者ID:Kristoffeh,项目名称:InSim.NET_Library,代码行数:26,代码来源:IS_STA.cs

示例13: OutSimPack

        /// <summary>
        /// Creates a new instance of the <see cref="OutSimPack"/> class.
        /// </summary>
        /// <param name="buffer">A buffer containing the packet data.</param>
        public OutSimPack(byte[] buffer) {
            if (buffer == null) {
                throw new ArgumentNullException("buffer");
            }

            PacketReader reader = new PacketReader(buffer);
            Time = TimeSpan.FromMilliseconds(reader.ReadUInt32());
            AngVel = new Vector(reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle());
            Heading = reader.ReadSingle();
            Pitch = reader.ReadSingle();
            Roll = reader.ReadSingle();
            Accel = new Vector(reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle());
            Vel = new Vector(reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle());
            Pos = new Vec(reader.ReadInt32(), reader.ReadInt32(), reader.ReadInt32());

            if (buffer.Length == MaxSize) {
                ID = reader.ReadInt32();
            }
        }
开发者ID:Kristoffeh,项目名称:InSim.NET_Library,代码行数:23,代码来源:OutSimPack.cs

示例14: Read

 public override void Read(PacketReader r)
 {
     ConditionEffect = r.ReadByte();
     ConditionDuration = r.ReadSingle();
 }
开发者ID:Zeroeh,项目名称:K_Relay,代码行数:5,代码来源:SetConditionPacket.cs


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