本文整理汇总了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;
}
示例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();
}
示例3: Read
public override void Read(PacketReader r)
{
BulletId = r.ReadByte();
OwnerId = r.ReadInt32();
ContainerType = r.ReadInt16();
Angle = r.ReadSingle();
}
示例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();
}
示例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();
}
示例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();
}
示例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;
}
}
示例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();
}
示例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();
}
}
示例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);
}
}
}
示例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);
}
示例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();
}
示例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();
}
}
示例14: Read
public override void Read(PacketReader r)
{
ConditionEffect = r.ReadByte();
ConditionDuration = r.ReadSingle();
}