本文整理汇总了C#中WowPacketParser.Misc.Packet.ReadBitsE方法的典型用法代码示例。如果您正苦于以下问题:C# Packet.ReadBitsE方法的具体用法?C# Packet.ReadBitsE怎么用?C# Packet.ReadBitsE使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WowPacketParser.Misc.Packet
的用法示例。
在下文中一共展示了Packet.ReadBitsE方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HandlePartyCommandResult
public static void HandlePartyCommandResult(Packet packet)
{
var nameLength = packet.ReadBits(9);
packet.ReadBitsE<PartyCommand>("Command", 4);
packet.ReadBitsE<PartyResult>("Result", 6);
packet.ReadUInt32("ResultData");
packet.ReadPackedGuid128("ResultGUID");
packet.ReadWoWString("Name", nameLength);
}
示例2: HandleServerUpdateAccountData
public static void HandleServerUpdateAccountData(Packet packet)
{
var guid = new byte[8];
packet.ReadBitsE<AccountDataType>("Data Type", 3);
packet.StartBitStream(guid, 5, 1, 3, 7, 0, 4, 2, 6);
packet.ReadXORBytes(guid, 3, 1, 5);
var decompCount = packet.ReadInt32();
var compCount = packet.ReadInt32();
var pkt = packet.Inflate(compCount, decompCount, false);
var data = pkt.ReadWoWString(decompCount);
pkt.ClosePacket(false);
packet.AddValue("Account Data", data);
packet.ReadXORBytes(guid, 7, 4, 0, 6, 2);
packet.ReadTime("Login Time");
packet.WriteGuid("GUID", guid);
}
示例3: HandleTradeStatus
public static void HandleTradeStatus(Packet packet)
{
packet.ReadBit("Unk Bit");
var status = packet.ReadBitsE<TradeStatus530>("Status", 5);
switch (status)
{
case TradeStatus530.BeginTrade:
var guid = packet.StartBitStream(0, 3, 2, 4, 1, 6, 7, 5);
packet.ParseBitStream(guid, 5, 7, 3, 6, 4, 2, 0, 1);
packet.WriteGuid("GUID", guid);
break;
case TradeStatus530.CloseWindow:
packet.ReadBit("Unk Bit");
packet.ReadInt32("Unk Int32");
packet.ReadInt32("Unk Int32");
break;
case TradeStatus530.TradeCurrency:
case TradeStatus530.CurrencyNotTradable:
packet.ReadInt32("Unk Int32 1");
packet.ReadInt32("Unk Int32 2");
break;
case TradeStatus530.NotEligible:
case TradeStatus530.OnlyConjured:
packet.ReadByte("Unk Byte");
break;
case TradeStatus530.OpenWindow:
packet.ReadInt32("Trade Id");
break;
}
}
示例4: HandleChannelNotify
public static void HandleChannelNotify(Packet packet)
{
var type = packet.ReadBitsE<ChatNotificationType>("Type", 6);
var channelLength = packet.ReadBits(7);
var senderLength = packet.ReadBits(6);
packet.ReadPackedGuid128("SenderGuid");
packet.ReadPackedGuid128("BnetAccountID");
packet.ReadInt32("SenderVirtualRealm");
packet.ReadPackedGuid128("TargetGuid");
packet.ReadInt32("TargetVirtualRealm");
packet.ReadInt32("ChatChannelID");
if (type == ChatNotificationType.ModeChange)
{
packet.ReadByteE<ChannelMemberFlag>("OldFlags");
packet.ReadByteE<ChannelMemberFlag>("NewFlags");
}
packet.ReadWoWString("Channel", channelLength);
packet.ReadWoWString("Sender", senderLength);
}
示例5: HandleClientUpdateAccountData
public static void HandleClientUpdateAccountData(Packet packet)
{
var decompCount = packet.ReadInt32();
packet.ReadTime("Login Time");
var compCount = packet.ReadInt32();
var pkt = packet.Inflate(compCount, decompCount, false);
var data = pkt.ReadWoWString(decompCount);
packet.ReadBitsE<AccountDataType>("Data Type", 3);
packet.WriteLine("Account Data : {0}", data);
}
示例6: HandleServerUpdateAccountData
public static void HandleServerUpdateAccountData(Packet packet)
{
packet.ReadPackedGuid128("Guid");
packet.ReadTime("Time");
var decompCount = packet.ReadInt32();
packet.ResetBitReader();
packet.ReadBitsE<AccountDataType>("Data Type", 3);
var compCount = packet.ReadInt32();
var pkt = packet.Inflate(compCount, decompCount, false);
var data = pkt.ReadWoWString(decompCount);
packet.AddValue("Account Data", data);
}
示例7: HandleSpellNonMeleeDmgLog
public static void HandleSpellNonMeleeDmgLog(Packet packet)
{
packet.ReadPackedGuid128("Me");
packet.ReadPackedGuid128("CasterGUID");
packet.ReadPackedGuid128("CastID");
packet.ReadInt32<SpellId>("SpellID");
packet.ReadInt32("Damage");
packet.ReadInt32("OverKill");
packet.ReadByte("SchoolMask");
packet.ReadInt32("ShieldBlock");
packet.ReadInt32("Resisted");
packet.ReadInt32("Absorbed");
packet.ResetBitReader();
packet.ReadBit("Periodic");
packet.ReadBitsE<AttackerStateFlags>("Flags", 7);
var hasDebugData = packet.ReadBit("HasDebugData");
var hasLogData = packet.ReadBit("HasLogData");
var hasSandboxScaling = packet.ReadBit("HasSandboxScaling");
if (hasDebugData)
{
packet.ReadSingle("CritRoll");
packet.ReadSingle("CritNeeded");
packet.ReadSingle("HitRoll");
packet.ReadSingle("HitNeeded");
packet.ReadSingle("MissChance");
packet.ReadSingle("DodgeChance");
packet.ReadSingle("ParryChance");
packet.ReadSingle("BlockChance");
packet.ReadSingle("GlanceChance");
packet.ReadSingle("CrushChance");
}
if (hasLogData)
SpellHandler.ReadSpellCastLogData(packet, "SpellCastLogData");
if (hasSandboxScaling)
ReadSandboxScalingData(packet, "SandboxScalingData");
}
示例8: HandleSpellNonMeleeDmgLog
public static void HandleSpellNonMeleeDmgLog(Packet packet)
{
packet.ReadPackedGuid128("Me");
packet.ReadPackedGuid128("CasterGUID");
packet.ReadInt32<SpellId>("SpellID");
packet.ReadInt32("Damage");
packet.ReadInt32("OverKill");
packet.ReadByte("SchoolMask");
packet.ReadInt32("ShieldBlock");
packet.ReadInt32("Resisted");
packet.ReadInt32("Absorbed");
packet.ResetBitReader();
packet.ReadBit("Periodic");
packet.ReadBitsE<AttackerStateFlags>("Flags", 9);
var bit148 = packet.ReadBit();
var bit76 = packet.ReadBit("HasLogData");
if (bit148)
{
packet.ReadSingle("CritRoll");
packet.ReadSingle("CritNeeded");
packet.ReadSingle("HitRoll");
packet.ReadSingle("HitNeeded");
packet.ReadSingle("MissChance");
packet.ReadSingle("DodgeChance");
packet.ReadSingle("ParryChance");
packet.ReadSingle("BlockChance");
packet.ReadSingle("GlanceChance");
packet.ReadSingle("CrushChance");
}
if (bit76)
SpellParsers.ReadSpellCastLogData(packet);
}
示例9: HandlePetitionTurnInResults
public static void HandlePetitionTurnInResults(Packet packet)
{
packet.ReadBitsE<PetitionResultType>("Result", 4);
}
示例10: ReadMovementUpdateBlock
//.........这里部分代码省略.........
{
packet.StartBitStream(goTransportGuid, 3, 5, 2, 1, 4);
hasGOTransportTime3 = packet.ReadBit();
hasGOTransportTime2 = packet.ReadBit();
packet.StartBitStream(goTransportGuid, 0, 6, 7);
}
if (isLiving)
{
hasTransportData = packet.ReadBit("Has Transport Data", index);
if (hasTransportData)
{
transportGuid[4] = packet.ReadBit();
transportGuid[0] = packet.ReadBit();
transportGuid[5] = packet.ReadBit();
transportGuid[2] = packet.ReadBit();
transportGuid[3] = packet.ReadBit();
hasTransportTime2 = packet.ReadBit();
transportGuid[7] = packet.ReadBit();
transportGuid[6] = packet.ReadBit();
transportGuid[1] = packet.ReadBit();
hasTransportTime3 = packet.ReadBit();
}
hasPitch = !packet.ReadBit("Has Pitch", index);
packet.ReadBit();
bits168 = packet.ReadBits(19);
guid1[1] = packet.ReadBit();
hasMoveFlagsExtra = !packet.ReadBit();
packet.ReadBit();
hasSplineElevation = !packet.ReadBit("Has SplineElevation", index);
if (hasMoveFlagsExtra)
moveInfo.FlagsExtra = packet.ReadBitsE<MovementFlagExtra>("Extra Movement Flags", 13, index);
hasOrientation = !packet.ReadBit();
hasTimestamp = !packet.ReadBit();
hasMovementFlags = !packet.ReadBit();
bitA8 = !packet.ReadBit("bitA8", index);
guid1[2] = packet.ReadBit();
guid1[6] = packet.ReadBit();
hasFallData = packet.ReadBit();
guid1[5] = packet.ReadBit();
guid1[4] = packet.ReadBit();
guid1[0] = packet.ReadBit();
if (hasMovementFlags)
moveInfo.Flags = packet.ReadBitsE<MovementFlag>("Movement Flags", 30, index);
packet.ReadBit();
if (hasFallData)
hasFallDirection = packet.ReadBit();
bits98 = packet.ReadBits("bits98", 22, index);
guid1[7] = packet.ReadBit();
moveInfo.HasSplineData = packet.ReadBit();
guid1[3] = packet.ReadBit();
if (moveInfo.HasSplineData)
{
hasFullSpline = packet.ReadBit();
if (hasFullSpline)
{
hasSplineVerticalAcceleration = packet.ReadBit();
packet.ReadBitsE<SplineMode>("Spline Mode", 2, index);
splineCount = packet.ReadBits(20);
packet.ReadBitsE<SplineFlag434>("Spline flags", 25, index);
示例11: HandleMoveStop422
public static void HandleMoveStop422(Packet packet)
{
var info = new MovementInfo();
var guidBytes = new byte[8];
var transportGuidBytes = new byte[8];
guidBytes[2] = packet.ReadBit();
guidBytes[0] = packet.ReadBit();
info.HasSplineData = packet.ReadBit("HasSplineData");
info.Flags = packet.ReadBitsE<MovementFlag>("Movement Flags", 30);
guidBytes[4] = packet.ReadBit();
guidBytes[6] = packet.ReadBit();
guidBytes[3] = packet.ReadBit();
guidBytes[5] = packet.ReadBit();
guidBytes[7] = packet.ReadBit();
packet.ReadBitsE<MovementFlagExtra>("Extra Movement Flags", 12);
guidBytes[1] = packet.ReadBit();
var havePitch = packet.ReadBit("HavePitch");
var haveFallData = packet.ReadBit("HaveFallData");
var haveFallDirection = false;
if (haveFallData)
haveFallDirection = packet.ReadBit("HaveFallDirection");
var haveTransportData = packet.ReadBit("HaveTransportData");
var haveTransportTime2 = false;
var haveTransportTime3 = false;
if (haveTransportData)
{
transportGuidBytes = packet.StartBitStream(0, 6, 2, 5, 4, 1, 3, 7);
haveTransportTime2 = packet.ReadBit("HaveTransportTime2");
haveTransportTime3 = packet.ReadBit("HaveTransportTime3");
}
var splineElevation = packet.ReadBit("HaveSplineElevation");
info.Orientation = packet.ReadSingle("Orientation");
packet.ReadUInt32("Timestamp");
info.Position = packet.ReadVector3("Position");
packet.ReadXORByte(guidBytes, 2);
packet.ReadXORByte(guidBytes, 3);
if (havePitch)
packet.ReadSingle("Pitch");
if (haveFallData)
{
packet.ReadUInt32("Fall Time");
packet.ReadSingle("Fall Vertical Speed");
packet.ReadSingle("Fall Horizontal Speed");
if (haveFallDirection)
{
packet.ReadSingle("Fall Cos Angle");
packet.ReadSingle("Fall Sin Angle");
}
}
packet.ReadXORByte(guidBytes, 5);
packet.ReadXORByte(guidBytes, 7);
if (haveTransportData)
{
packet.ReadByte("Transport Seat");
packet.ReadSingle("Transport Orientation");
packet.ReadVector3("Transport Position");
packet.ReadUInt32("Transport Time");
if (haveTransportTime2)
packet.ReadUInt32("Transport Time 2");
packet.ParseBitStream(transportGuidBytes, 3, 6);
if (haveTransportTime3)
packet.ReadUInt32("Transport Time 3");
packet.ParseBitStream(transportGuidBytes, 7, 5, 2, 1, 0, 4);
}
packet.ReadXORByte(guidBytes, 1);
packet.ReadXORByte(guidBytes, 0);
if (splineElevation)
packet.ReadSingle("Spline Elevation");
packet.ReadXORByte(guidBytes, 6);
packet.ReadXORByte(guidBytes, 4);
//.........这里部分代码省略.........
示例12: ReadMovementUpdateBlock510
//.........这里部分代码省略.........
hasTimestamp = !packet.ReadBit("Lacks Timestamp", index);
packet.ReadBit(); // bit172
guid2[2] = packet.ReadBit();
packet.ReadBit(); // bit149
hasPitch = !packet.ReadBit("Lacks Pitch", index);
var hasMoveFlagsExtra = !packet.ReadBit();
guid2[4] = packet.ReadBit();
guid2[5] = packet.ReadBit();
unkLoopCounter2 = packet.ReadBits(24);
hasSplineElevation = !packet.ReadBit();
field8 = !packet.ReadBit();
packet.ReadBit(); // bit148
guid2[0] = packet.ReadBit();
guid2[6] = packet.ReadBit();
guid2[7] = packet.ReadBit();
hasTransportData = packet.ReadBit("Has Transport Data", index);
hasOrientation = !packet.ReadBit();
if (hasTransportData)
{
transportGuid[3] = packet.ReadBit();
transportGuid[0] = packet.ReadBit();
transportGuid[4] = packet.ReadBit();
transportGuid[5] = packet.ReadBit();
transportGuid[2] = packet.ReadBit();
transportGuid[7] = packet.ReadBit();
transportGuid[1] = packet.ReadBit();
hasTransportTime2 = packet.ReadBit();
transportGuid[6] = packet.ReadBit();
hasTransportTime3 = packet.ReadBit();
}
if (hasMoveFlagsExtra)
moveInfo.FlagsExtra = packet.ReadBitsE<MovementFlagExtra>("Extra Movement Flags", 13, index);
var hasMovementFlags = !packet.ReadBit();
guid2[1] = packet.ReadBit();
if (hasFallData)
hasFallDirection = packet.ReadBit("Has Fall Direction", index);
moveInfo.HasSplineData = packet.ReadBit("Has Spline Data", index);
if (hasMovementFlags)
moveInfo.Flags = packet.ReadBitsE<MovementFlag>("Movement Flags", 30, index);
if (moveInfo.HasSplineData)
{
hasFullSpline = packet.ReadBit("Has extended spline data", index);
if (hasFullSpline)
{
hasSplineStartTime = packet.ReadBit();
splineCount = packet.ReadBits("Spline Waypoints", 22, index);
/*var splineFlags = */ packet.ReadBitsE<SplineFlag434>("Spline flags", 25, index);
var bits57 = packet.ReadBits(2);
switch (bits57)
{
case 1:
splineType = SplineType.FacingTarget;
break;
case 0:
splineType = SplineType.FacingAngle;
break;
case 2:
splineType = SplineType.Normal;
break;
case 3:
splineType = SplineType.FacingSpot;
示例13: ReadSpellTargetData
public static void ReadSpellTargetData(Packet packet, params object[] idx)
{
packet.ResetBitReader();
packet.ReadBitsE<TargetFlag>("Flags", ClientVersion.AddedInVersion(ClientVersionBuild.V6_1_0_19678) ? 23 : 21, idx);
var hasSrcLoc = packet.ReadBit("HasSrcLocation", idx);
var hasDstLoc = packet.ReadBit("HasDstLocation", idx);
var hasOrient = packet.ReadBit("HasOrientation", idx);
var nameLength = packet.ReadBits(7);
packet.ReadPackedGuid128("Unit", idx);
packet.ReadPackedGuid128("Item", idx);
if (hasSrcLoc)
ReadLocation(packet, "SrcLocation");
if (hasDstLoc)
ReadLocation(packet, "DstLocation");
if (hasOrient)
packet.ReadSingle("Orientation", idx);
packet.ReadWoWString("Name", nameLength, idx);
}
示例14: HandleTransferAborted
public static void HandleTransferAborted(Packet packet)
{
packet.ReadInt32<MapId>("MapID");
packet.ReadByte("Arg");
packet.ReadBitsE<TransferAbortReason>("TransfertAbort", 5);
}
示例15: HandleRequestAccountData
public static void HandleRequestAccountData(Packet packet)
{
packet.ReadBitsE<AccountDataType>("Data Type", 3);
}