本文整理汇总了C#中Framework.Network.Packets.PacketReader.ReadFloat方法的典型用法代码示例。如果您正苦于以下问题:C# PacketReader.ReadFloat方法的具体用法?C# PacketReader.ReadFloat怎么用?C# PacketReader.ReadFloat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Framework.Network.Packets.PacketReader
的用法示例。
在下文中一共展示了PacketReader.ReadFloat方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HandleMoveStopTurn
public static void HandleMoveStopTurn(ref PacketReader packet, ref WorldClass session)
{
ObjectMovementValues movementValues = new ObjectMovementValues();
BitUnpack BitUnpack = new BitUnpack(packet);
bool[] guidMask = new bool[8];
byte[] guidBytes = new byte[8];
Vector4 vector = new Vector4()
{
X = packet.ReadFloat(),
Z = packet.ReadFloat(),
Y = packet.ReadFloat()
};
bool HasTime = !BitUnpack.GetBit();
guidMask[5] = BitUnpack.GetBit();
bool Unknown = BitUnpack.GetBit();
movementValues.IsTransport = BitUnpack.GetBit();
bool Unknown2 = BitUnpack.GetBit();
guidMask[3] = BitUnpack.GetBit();
bool HasSplineElevation = !BitUnpack.GetBit();
guidMask[0] = BitUnpack.GetBit();
bool HasPitch = !BitUnpack.GetBit();
uint counter = BitUnpack.GetBits<uint>(24);
guidMask[1] = BitUnpack.GetBit();
guidMask[7] = BitUnpack.GetBit();
movementValues.HasMovementFlags = !BitUnpack.GetBit();
movementValues.IsAlive = !BitUnpack.GetBit();
guidMask[2] = BitUnpack.GetBit();
guidMask[6] = BitUnpack.GetBit();
movementValues.HasRotation = !BitUnpack.GetBit();
bool Unknown3 = BitUnpack.GetBit();
movementValues.HasMovementFlags2 = !BitUnpack.GetBit();
bool Unknown4 = BitUnpack.GetBit();
guidMask[4] = BitUnpack.GetBit();
/*if (movementValues.IsTransport)
{
}
if (IsInterpolated)
{
}*/
if (movementValues.HasMovementFlags)
movementValues.MovementFlags = (MovementFlag)BitUnpack.GetBits<uint>(30);
if (movementValues.HasMovementFlags2)
movementValues.MovementFlags2 = (MovementFlag2)BitUnpack.GetBits<uint>(13);
if (guidMask[6]) guidBytes[6] = (byte)(packet.ReadUInt8() ^ 1);
if (guidMask[0]) guidBytes[0] = (byte)(packet.ReadUInt8() ^ 1);
if (guidMask[5]) guidBytes[5] = (byte)(packet.ReadUInt8() ^ 1);
for (int i = 0; i < counter; i++)
packet.ReadUInt32();
if (guidMask[1]) guidBytes[1] = (byte)(packet.ReadUInt8() ^ 1);
if (guidMask[7]) guidBytes[7] = (byte)(packet.ReadUInt8() ^ 1);
if (guidMask[3]) guidBytes[3] = (byte)(packet.ReadUInt8() ^ 1);
if (guidMask[4]) guidBytes[4] = (byte)(packet.ReadUInt8() ^ 1);
if (guidMask[2]) guidBytes[2] = (byte)(packet.ReadUInt8() ^ 1);
/*if (movementValues.IsTransport)
{
}*/
if (movementValues.HasRotation)
vector.W = packet.ReadFloat();
if (movementValues.IsAlive)
movementValues.Time = packet.ReadUInt32();
/*if (IsInterpolated)
{
}*/
if (HasPitch)
//.........这里部分代码省略.........
示例2: HandleMoveFallLand
public static void HandleMoveFallLand(ref PacketReader packet, ref WorldClass session)
{
ObjectMovementValues movementValues = new ObjectMovementValues();
BitUnpack BitUnpack = new BitUnpack(packet);
bool[] guidMask = new bool[8];
byte[] guidBytes = new byte[8];
Vector4 vector = new Vector4()
{
Y = packet.ReadFloat(),
X = packet.ReadFloat(),
Z = packet.ReadFloat()
};
uint counter = BitUnpack.GetBits<uint>(24);
guidMask[2] = BitUnpack.GetBit();
bool HasTime = !BitUnpack.GetBit();
bool HasSplineElevation = !BitUnpack.GetBit();
guidMask[6] = BitUnpack.GetBit();
guidMask[0] = BitUnpack.GetBit();
movementValues.IsTransport = BitUnpack.GetBit();
bool Unknown3 = BitUnpack.GetBit();
bool Unknown = BitUnpack.GetBit();
guidMask[4] = BitUnpack.GetBit();
movementValues.HasMovementFlags2 = !BitUnpack.GetBit();
bool HasPitch = !BitUnpack.GetBit();
movementValues.HasRotation = !BitUnpack.GetBit();
bool Unknown2 = BitUnpack.GetBit();
guidMask[1] = BitUnpack.GetBit();
movementValues.IsAlive = !BitUnpack.GetBit();
movementValues.HasMovementFlags = !BitUnpack.GetBit();
guidMask[5] = BitUnpack.GetBit();
guidMask[7] = BitUnpack.GetBit();
guidMask[3] = BitUnpack.GetBit();
bool Unknown4 = BitUnpack.GetBit();
/*if (movementValues.IsTransport)
{
vehicleGuidMask[4] = BitUnpack.GetBit();
vehicleGuidMask[1] = BitUnpack.GetBit();
bool vehicleUnknown2 = BitUnpack.GetBit();
vehicleGuidMask[2] = BitUnpack.GetBit();
vehicleGuidMask[3] = BitUnpack.GetBit();
vehicleGuidMask[7] = BitUnpack.GetBit();
vehicleGuidMask[0] = BitUnpack.GetBit();
bool vehicleUnknown1 = BitUnpack.GetBit();
vehicleGuidMask[5] = BitUnpack.GetBit();
vehicleGuidMask[6] = BitUnpack.GetBit();
}
if (movementValues.IsInterpolated)
movementValues.IsInterpolated2 = BitUnpack.GetBit();*/
if (movementValues.HasMovementFlags2)
movementValues.MovementFlags2 = (MovementFlag2)BitUnpack.GetBits<uint>(13);
if (movementValues.HasMovementFlags)
movementValues.MovementFlags = (MovementFlag)BitUnpack.GetBits<uint>(30);
if (guidMask[0]) guidBytes[0] = (byte)(packet.ReadUInt8() ^ 1);
if (guidMask[2]) guidBytes[2] = (byte)(packet.ReadUInt8() ^ 1);
if (guidMask[1]) guidBytes[1] = (byte)(packet.ReadUInt8() ^ 1);
if (guidMask[4]) guidBytes[4] = (byte)(packet.ReadUInt8() ^ 1);
for (int i = 0; i < counter; i++)
packet.ReadUInt32();
if (guidMask[6]) guidBytes[6] = (byte)(packet.ReadUInt8() ^ 1);
if (guidMask[5]) guidBytes[5] = (byte)(packet.ReadUInt8() ^ 1);
if (guidMask[7]) guidBytes[7] = (byte)(packet.ReadUInt8() ^ 1);
if (guidMask[3]) guidBytes[3] = (byte)(packet.ReadUInt8() ^ 1);
/*if (movementValues.IsTransport)
{
Vector4 vehiclevector = new Vector4();
vehiclevector.X = packet.ReadFloat();
if (vehicleGuidMask[0]) vehicleGuidBytes[0] = (byte)(packet.ReadUInt8() ^ 1);
if ( vehicleUnknown1 ) uint _25 = packet.ReadUInt32();
if (vehicleGuidMask[4]) vehicleGuidBytes[4] = (byte)(packet.ReadUInt8() ^ 1);
if (vehicleGuidMask[5]) vehicleGuidBytes[5] = (byte)(packet.ReadUInt8() ^ 1);
if (vehicleGuidMask[3]) vehicleGuidBytes[3] = (byte)(packet.ReadUInt8() ^ 1);
byte _88 = packet.ReadUInt8();
if (vehicleGuidMask[7]) vehicleGuidBytes[7] = (byte)(packet.ReadUInt8() ^ 1);
vehiclevector.O = packet.ReadFloat();
//.........这里部分代码省略.........
示例3: HandlePlayerLogin
public static void HandlePlayerLogin(ref PacketReader packet, ref WorldClass session)
{
byte[] guidMask = { 5, 0, 6, 2, 1, 3, 7, 4 };
byte[] guidBytes = { 1, 5, 7, 0, 4, 6, 3, 2 };
BitUnpack GuidUnpacker = new BitUnpack(packet);
var unknown = packet.ReadFloat();
var guid = GuidUnpacker.GetPackedValue(guidMask, guidBytes);
Log.Message(LogType.DEBUG, "Character with Guid: {0}, AccountId: {1} tried to enter the world.", guid, session.Account.Id);
session.Character = new Character(guid);
if (!WorldMgr.AddSession(guid, ref session))
{
Log.Message(LogType.ERROR, "A Character with Guid: {0} is already logged in", guid);
return;
}
WorldMgr.WriteAccountDataTimes(AccountDataMasks.CharacterCacheMask, ref session);
MiscHandler.HandleMessageOfTheDay(ref session);
TimeHandler.HandleLoginSetTimeSpeed(ref session);
//SpecializationHandler.HandleTalentUpdate(ref session);
SpellHandler.HandleSendKnownSpells(ref session);
MiscHandler.HandleUpdateActionButtons(ref session);
if (session.Character.LoginCinematic)
CinematicHandler.HandleStartCinematic(ref session);
ObjectHandler.HandleUpdateObjectCreate(ref session);
}
示例4: HandleForceWalkSpeedChangeAck
public static void HandleForceWalkSpeedChangeAck(ref PacketReader packet, ref WorldClass session)
{
ObjectMovementValues movementValues = new ObjectMovementValues();
BitUnpack BitUnpack = new BitUnpack(packet);
bool[] guidMask = new bool[8];
byte[] guidBytes = new byte[8];
Vector4 vector = new Vector4()
{
Y = packet.ReadFloat(),
Z = packet.ReadFloat(),
X = packet.ReadFloat()
};
uint zeroes = packet.ReadUInt32();
float walkspeed = packet.ReadFloat();
bool Unknown2 = BitUnpack.GetBit();
guidMask[6] = BitUnpack.GetBit();
bool HasPitch = !BitUnpack.GetBit();
movementValues.IsTransport = BitUnpack.GetBit();
bool Unknown3 = BitUnpack.GetBit();
guidMask[1] = BitUnpack.GetBit();
guidMask[2] = BitUnpack.GetBit();
movementValues.IsAlive = !BitUnpack.GetBit();
bool HasTime = !BitUnpack.GetBit();
uint counter = BitUnpack.GetBits<uint>(24);
guidMask[0] = BitUnpack.GetBit();
movementValues.HasMovementFlags = !BitUnpack.GetBit();
guidMask[5] = BitUnpack.GetBit();
bool Unknown4 = BitUnpack.GetBit();
bool HasSplineElevation = !BitUnpack.GetBit();
guidMask[3] = BitUnpack.GetBit();
movementValues.HasRotation = !BitUnpack.GetBit();
movementValues.HasMovementFlags2 = !BitUnpack.GetBit();
guidMask[7] = BitUnpack.GetBit();
guidMask[4] = BitUnpack.GetBit();
bool Unknown = BitUnpack.GetBit();
/*if (movementValues.IsTransport)
{
vehicleGuidMask[2] = BitUnpack.GetBit();
vehicleGuidMask[5] = BitUnpack.GetBit();
vehicleGuidMask[4] = BitUnpack.GetBit();
vehicleGuidMask[1] = BitUnpack.GetBit();
vehicleGuidMask[0] = BitUnpack.GetBit();
vehicleGuidMask[3] = BitUnpack.GetBit();
vehicleGuidMask[7] = BitUnpack.GetBit();
vehicleGuidMask[6] = BitUnpack.GetBit();
bool vehicleUnknown1 = BitUnpack.GetBit();
bool vehicleUnknown2 = BitUnpack.GetBit();
}*/
if (movementValues.HasMovementFlags)
movementValues.MovementFlags = (MovementFlag)BitUnpack.GetBits<uint>(30);
/*if (movementValues.IsInterpolated)
movementValues.IsInterpolated2 = BitUnpack.GetBit();*/
if (movementValues.HasMovementFlags2)
movementValues.MovementFlags2 = (MovementFlag2)BitUnpack.GetBits<uint>(13);
if (guidMask[3]) guidBytes[3] = (byte)(packet.ReadUInt8() ^ 1);
for (int i = 0; i < counter; i++)
packet.ReadUInt32();
if (guidMask[0]) guidBytes[0] = (byte)(packet.ReadUInt8() ^ 1);
if (guidMask[4]) guidBytes[4] = (byte)(packet.ReadUInt8() ^ 1);
if (guidMask[1]) guidBytes[1] = (byte)(packet.ReadUInt8() ^ 1);
if (guidMask[2]) guidBytes[2] = (byte)(packet.ReadUInt8() ^ 1);
if (guidMask[7]) guidBytes[7] = (byte)(packet.ReadUInt8() ^ 1);
if (guidMask[6]) guidBytes[6] = (byte)(packet.ReadUInt8() ^ 1);
if (guidMask[5]) guidBytes[5] = (byte)(packet.ReadUInt8() ^ 1);
/*if (movementValues.IsTransport)
{
Vector4 vehiclevector = new Vector4();
if (vehicleGuidMask[7]) vehicleGuidBytes[7] = (byte)(packet.ReadUInt8() ^ 1);
if (vehicleGuidMask[5]) vehicleGuidBytes[5] = (byte)(packet.ReadUInt8() ^ 1);
vehiclevector.Z = packet.ReadFloat();
if (vehicleGuidMask[3]) vehicleGuidBytes[3] = (byte)(packet.ReadUInt8() ^ 1);
byte _88 = packet.ReadUInt8(); // (BYTE)DATA[88]
if (vehicleGuidMask[1]) vehicleGuidBytes[1] = (byte)(packet.ReadUInt8() ^ 1);
if (vehicleGuidMask[0]) vehicleGuidBytes[0] = (byte)(packet.ReadUInt8() ^ 1);
vehiclevector.X = packet.ReadFloat();
//.........这里部分代码省略.........