本文整理汇总了C#中WowPacketParser.Misc.Packet.ReadXORBytes方法的典型用法代码示例。如果您正苦于以下问题:C# Packet.ReadXORBytes方法的具体用法?C# Packet.ReadXORBytes怎么用?C# Packet.ReadXORBytes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WowPacketParser.Misc.Packet
的用法示例。
在下文中一共展示了Packet.ReadXORBytes方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HandleItemEnchantTimeUpdate
public static void HandleItemEnchantTimeUpdate(Packet packet)
{
var itemGuid = new byte[8];
var playerGuid = new byte[8];
itemGuid[3] = packet.ReadBit();
playerGuid[4] = packet.ReadBit();
itemGuid[0] = packet.ReadBit();
playerGuid[7] = packet.ReadBit();
itemGuid[2] = packet.ReadBit();
playerGuid[6] = packet.ReadBit();
packet.StartBitStream(itemGuid, 6, 1);
playerGuid[2] = packet.ReadBit();
itemGuid[7] = packet.ReadBit();
packet.StartBitStream(playerGuid, 3, 1);
itemGuid[5] = packet.ReadBit();
packet.StartBitStream(playerGuid, 5, 0);
itemGuid[4] = packet.ReadBit();
packet.ResetBitReader();
packet.ReadUInt32("Duration");
packet.ReadXORBytes(playerGuid, 2, 3);
packet.ReadXORByte(itemGuid, 7);
packet.ReadXORByte(playerGuid, 0);
packet.ReadUInt32("Slot");
packet.ReadXORByte(itemGuid, 3);
packet.ReadXORByte(playerGuid, 6);
packet.ReadXORBytes(itemGuid, 6, 4, 2);
packet.ReadXORByte(playerGuid, 1);
packet.ReadXORByte(itemGuid, 5);
packet.ReadXORBytes(playerGuid, 5, 4, 7);
packet.ReadXORBytes(itemGuid, 0, 1);
packet.WriteGuid("Player GUID", playerGuid);
packet.WriteGuid("Item GUID", itemGuid);
}
示例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: HandleGuildQueryResponse
public static void HandleGuildQueryResponse(Packet packet)
{
var guid1 = new byte[8];
var guid2 = new byte[8];
var hasData = packet.ReadBit();
int nameLen = 0;
int rankCount = 0;
int[] rankName = null;
if (hasData)
{
packet.StartBitStream(guid2, 1, 7);
nameLen = (int)packet.ReadBits(7);
packet.StartBitStream(guid2, 5, 0, 6, 3, 4, 2);
rankCount = (int)packet.ReadBits(21);
rankName = new int[rankCount];
for (var i = 0; i < rankCount; ++i)
rankName[i] = (int)packet.ReadBits(7);
}
packet.StartBitStream(guid1, 2, 6, 7, 5, 4, 3, 0, 1);
if (hasData)
{
packet.ReadWoWString("Guild Name", nameLen);
packet.ReadXORByte(guid2, 5);
for (var i = 0; i < rankCount; ++i)
{
packet.ReadUInt32("Rights Order", i);
packet.ReadUInt32("Creation Order", i);
packet.ReadWoWString("Rank Name", rankName[i], i);
}
packet.ReadInt32("Emblem Border Color");
packet.ReadXORBytes(guid2, 6, 0);
packet.ReadInt32("Emblem Border Style");
packet.ReadInt32("Emblem Style");
packet.ReadXORByte(guid2, 4);
packet.ReadInt32("Emblem Color");
packet.ReadXORBytes(guid2, 7, 2, 3, 1);
packet.ReadInt32("Emblem Background Color");
packet.WriteGuid("Guid2", guid2);
}
packet.ParseBitStream(guid1, 1, 6, 3, 5, 4, 0, 2, 7);
packet.WriteGuid("Guid1", guid1);
}
示例4: HandleActivateTaxi
public static void HandleActivateTaxi(Packet packet)
{
packet.ReadUInt32("Node 2 ID"); // 28
packet.ReadUInt32("Node 1y ID"); // 24
var guid = packet.StartBitStream(4, 0, 1, 2, 5, 6, 7, 3);
packet.ReadXORBytes(guid, 1, 0, 6, 5, 2, 4, 3, 7);
packet.WriteGuid("Guid", guid);
}
示例5: HandleCriteriaUpdate
public static void HandleCriteriaUpdate(Packet packet)
{
var counter = new byte[8];
var guid2 = new byte[8];
counter[1] = packet.ReadBit();
guid2[2] = packet.ReadBit();
packet.ReadBits("Flags", 4); // some flag... & 1 -> delete
packet.StartBitStream(guid2, 4, 0, 7);
counter[6] = packet.ReadBit();
guid2[5] = packet.ReadBit();
packet.StartBitStream(counter, 0, 2, 4);
packet.StartBitStream(guid2, 3, 6);
packet.StartBitStream(counter, 3, 5);
guid2[1] = packet.ReadBit();
counter[7] = packet.ReadBit();
packet.ResetBitReader();
packet.ReadPackedTime("Time");
packet.ReadXORByte(counter, 1);
packet.ReadXORByte(guid2, 2);
packet.ReadXORByte(counter, 2);
packet.ReadXORByte(guid2, 3);
packet.ReadXORByte(counter, 5);
packet.ReadXORBytes(guid2, 0, 4);
packet.ReadUInt32("Timer 1");
packet.ReadXORByte(guid2, 5);
packet.ReadInt32("Criteria ID");
packet.ReadXORByte(guid2, 1);
packet.ReadXORBytes(counter, 7, 3, 6);
packet.ReadXORByte(guid2, 7);
packet.ReadXORBytes(counter, 0, 4);
packet.ReadXORByte(guid2, 6);
packet.ReadUInt32("Timer 2");
packet.WriteLine("Counter: {0}", BitConverter.ToInt64(counter, 0));
packet.WriteGuid("GUID2", guid2);
}
示例6: HandlePetNameQuery
public static void HandlePetNameQuery(Packet packet)
{
var guid = new byte[8];
var number = new byte[8];
guid[5] = packet.ReadBit();
number[3] = packet.ReadBit();
guid[6] = packet.ReadBit();
packet.StartBitStream(number, 5, 7);
packet.StartBitStream(guid, 2, 4);
number[2] = packet.ReadBit();
guid[3] = packet.ReadBit();
number[1] = packet.ReadBit();
guid[7] = packet.ReadBit();
number[6] = packet.ReadBit();
packet.StartBitStream(guid, 1, 0);
packet.StartBitStream(number, 4, 0);
packet.ResetBitReader();
packet.ReadXORByte(number, 5);
packet.ReadXORBytes(guid, 4, 3);
packet.ReadXORBytes(number, 7, 4);
packet.ReadXORBytes(guid, 5, 2, 0, 6);
packet.ReadXORBytes(number, 2, 0, 6);
packet.ReadXORByte(guid, 1);
packet.ReadXORByte(number, 3);
packet.ReadXORByte(guid, 7);
packet.ReadXORByte(number, 1);
var GUID = new WowGuid64(BitConverter.ToUInt64(guid, 0));
var Number = BitConverter.ToUInt64(number, 0);
packet.WriteGuid("Guid", guid);
packet.AddValue("Pet Number", Number);
// Store temporary name (will be replaced in SMSG_QUERY_PET_NAME_RESPONSE)
StoreGetters.AddName(GUID, Number.ToString(CultureInfo.InvariantCulture));
}
示例7: HandleGOCustomAnim
public static void HandleGOCustomAnim(Packet packet)
{
var guid = new byte[8];
packet.ReadBit("Unk bit");
packet.StartBitStream(guid, 6, 3, 4);
var hasAnim = !packet.ReadBit();
packet.StartBitStream(guid, 5, 1, 2, 0, 7);
packet.ResetBitReader();
packet.ReadXORBytes(guid, 0, 2, 5, 7, 4, 3, 1);
if (hasAnim)
packet.ReadInt32("Anim");
packet.ReadXORByte(guid, 6);
packet.WriteGuid("GUID", guid);
}
示例8: HandleServerUpdateAccountData
public static void HandleServerUpdateAccountData(Packet packet)
{
var guid = new byte[8];
var decompCount = packet.ReadInt32();
var compCount = packet.ReadInt32();
var data = packet.Inflate(compCount, decompCount, false).ReadWoWString(decompCount);
packet.WriteLine("Account Data {0}", data);
packet.ReadTime("Login Time");
guid[7] = packet.ReadBit();
packet.ReadEnum<AccountDataType>("Data Type", 3);
packet.StartBitStream(guid, 3, 6, 1, 5, 0, 4, 2);
packet.ReadXORBytes(guid, 6, 7, 4, 1, 5, 0, 3, 2);
packet.WriteGuid("GUID", guid);
}
示例9: HandleDBQueryBulk
public static void HandleDBQueryBulk(Packet packet)
{
packet.ReadEnum<DB2Hash>("DB2 File", TypeCode.Int32);
var count = packet.ReadBits(21);
var guids = new byte[count][];
for (var i = 0; i < count; ++i)
{
guids[i] = new byte[8];
packet.StartBitStream(guids[i], 5, 7, 6, 1, 4, 3, 2, 1);
}
packet.ResetBitReader();
for (var i = 0; i < count; ++i)
{
packet.ReadXORBytes(guids[i], 3, 7, 1, 6, 4, 0, 5);
packet.ReadInt32("Unk int", i);
packet.ReadXORByte(guids[i], 2);
packet.WriteGuid("Guid", guids[i], i);
}
}
示例10: HandleAuraUpdate
//.........这里部分代码省略.........
var bit456 = !packet.ReadBit(); // field_1C8
guid11[3] = packet.ReadBit();
var bit420 = packet.ReadBit(); // field_1A3
var bit472 = !packet.ReadBit(); // field_1D8
guid11[4] = packet.ReadBit();
var unkflag27 = packet.ReadBit(); // field_EF
int bits7 = 0;
if (!unkflag27)
bits7 = (int)packet.ReadBits(7); // field_EF
var counter4 = packet.ReadBits(25); // field_81
guid11[2] = packet.ReadBit();
for (var i = 0; i < counter4; ++i)
{
var bit136 = packet.ReadBits(4); // field_85
if (bit136 == 11)
packet.ReadBits(4);
}
packet.ReadBit("unk464"); // field_1D0
packet.StartBitStream(guid8, 7, 3, 6, 4, 2, 5, 0, 1);
packet.ReadBit("unk160"); // field_9D
packet.StartBitStream(guid9, 3, 5, 2, 1, 4, 0, 6, 7);
if (bit152)
packet.ReadBits(20); // field_95
if (bit176)
{
var pos = new Vector3();
packet.ReadXORBytes(guid3, 3, 7, 4);
pos.X = packet.ReadSingle();
packet.ReadXORBytes(guid3, 6, 5, 2);
pos.Z = packet.ReadSingle();
pos.Y = packet.ReadSingle();
packet.ReadXORBytes(guid3, 0, 1);
packet.WriteGuid("GUID3", guid3);
packet.WriteLine("Position: {0}", pos);
}
for (var i = 0; i < counter3; ++i)
{
var pos = new Vector3();
packet.ReadXORBytes(guid5[i], 4, 0, 7, 6, 2, 1);
pos.X = packet.ReadSingle();
packet.ReadXORBytes(guid5[i], 5, 3);
pos.Y = packet.ReadSingle();
pos.Z = packet.ReadSingle();
packet.WriteGuid("GUID5", guid5[i], i);
packet.WriteLine("Position: {0}", pos);
}
for (var i = 0; i < counter; ++i)
{
packet.ParseBitStream(guid7[i], 2, 1, 5, 3, 7, 0, 4, 6);
packet.WriteGuid("GUID7", guid7[i], i);
}
if (bit208)
{
var pos = new Vector3();
packet.ReadXORBytes(guid6, 1, 4);
pos.Z = packet.ReadSingle();
示例11: HandleLogXPGain
public static void HandleLogXPGain(Packet packet)
{
var guid = new byte[8];
packet.StartBitStream(guid, 1, 0, 3, 7);
var hasBaseXP = !packet.ReadBit();
packet.StartBitStream(guid, 4, 2, 6, 5);
var hasGroupRate = !packet.ReadBit();
packet.ReadBit("RAF Bonus");
packet.ResetBitReader();
packet.ReadXORBytes(guid, 5, 2);
if (hasBaseXP)
packet.ReadUInt32("Base XP");
packet.ReadXORByte(guid, 4);
packet.ReadUInt32("Total XP");
packet.ReadXORBytes(guid, 6, 0, 3);
packet.ReadByte("XP type");
if (hasGroupRate)
packet.ReadSingle("Group rate");
packet.ReadXORBytes(guid, 1, 7);
packet.WriteGuid("Guid", guid);
}
示例12: HandlePlayObjectSound
public static void HandlePlayObjectSound(Packet packet)
{
var guid1 = new byte[8];
var guid2 = new byte[8];
guid2[5] = packet.ReadBit();
guid1[7] = packet.ReadBit();
guid1[0] = packet.ReadBit();
guid1[3] = packet.ReadBit();
guid2[1] = packet.ReadBit();
guid1[4] = packet.ReadBit();
guid2[7] = packet.ReadBit();
guid2[2] = packet.ReadBit();
guid2[4] = packet.ReadBit();
guid2[3] = packet.ReadBit();
guid1[5] = packet.ReadBit();
guid1[1] = packet.ReadBit();
guid1[6] = packet.ReadBit();
guid1[2] = packet.ReadBit();
guid2[6] = packet.ReadBit();
guid2[0] = packet.ReadBit();
packet.ReadXORBytes(guid1, 6, 2);
packet.ReadXORBytes(guid2, 2, 5);
packet.ReadXORBytes(guid1, 7, 5, 3, 1);
packet.ReadXORBytes(guid2, 3, 1);
var sound = packet.ReadUInt32("Sound Id");
packet.ReadXORByte(guid1, 4);
packet.ReadXORBytes(guid2, 4, 7, 0, 6);
packet.ReadXORByte(guid1, 0);
packet.WriteGuid("Guid 1", guid1);
packet.WriteGuid("Guid 2", guid2);
Storage.Sounds.Add(sound, packet.TimeSpan);
}
示例13: ReadMovementUpdateBlock
//.........这里部分代码省略.........
packet.ReadXORByte(guid1, 3);
moveInfo.RunSpeed = packet.ReadSingle("Run Speed", index) / 7.0f;
packet.ReadXORByte(guid1, 7);
moveInfo.WalkSpeed = packet.ReadSingle("Walk Speed", index) / 2.5f;
packet.ReadSingle("Pitch Speed", index);
if (hasTimestamp)
packet.ReadUInt32("Time?", index);
packet.ReadXORByte(guid1, 4);
packet.ReadXORByte(guid1, 0);
packet.WriteGuid("GUID2", guid1);
if (hasOrientation)
moveInfo.Orientation = packet.ReadSingle("Orientation", index);
}
if (hasAttackingTarget)
{
packet.ParseBitStream(attackingTargetGuid, 5, 1, 2, 0, 3, 4, 6, 7);
packet.WriteGuid("Attacking Target GUID", attackingTargetGuid, index);
}
if (hasStationaryPosition)
{
moveInfo.Orientation = packet.ReadSingle("Stationary Orientation", index);
moveInfo.Position = packet.ReadVector3("Stationary Position", index);
}
if (hasTransportPosition)
{
packet.ReadSByte("Transport Seat", index);
moveInfo.TransportOffset.X = packet.ReadSingle();
packet.ReadXORBytes(goTransportGuid, 1, 0, 2, 6, 5, 4);
if (hasGOTransportTime2)
packet.ReadUInt32("Transport Time 3", index);
packet.ReadXORByte(goTransportGuid, 7);
moveInfo.TransportOffset.O = packet.ReadSingle();
moveInfo.TransportOffset.Z = packet.ReadSingle();
moveInfo.TransportOffset.Y = packet.ReadSingle();
if (hasGOTransportTime3)
packet.ReadUInt32("Transport Time 2", index);
packet.ReadXORByte(goTransportGuid, 3);
packet.ReadUInt32("Transport Time", index);
moveInfo.TransportGuid = new WowGuid64(BitConverter.ToUInt64(goTransportGuid, 0));
packet.AddValue("Transport GUID", moveInfo.TransportGuid, index);
packet.AddValue("Transport Position", moveInfo.TransportOffset, index);
}
if (bit1DC)
packet.ReadInt32("int1D8", index);
if (bit2A4)
packet.ReadInt32("int2A0", index);
if (bit32A)
packet.ReadBytes("Bytes", (int)bits2AA);
if (hasGameObjectRotation)
packet.ReadPackedQuaternion("GameObject Rotation", index);
示例14: HandleAuraUpdate
public static void HandleAuraUpdate(Packet packet)
{
var guid = new byte[8];
var guid2 = new byte[8];
guid[1] = packet.ReadBit();
var hasPowerData = packet.ReadBit();
uint bits3C = 0;
if (hasPowerData)
{
packet.StartBitStream(guid2, 1, 5, 6);
bits3C = packet.ReadBits(21);
packet.StartBitStream(guid2, 2, 3, 7, 0, 4);
}
var bits4 = packet.ReadBits(24);
guid[6] = packet.ReadBit();
var hasAura = new bool[bits4];
var hasCasterGUID = new bool[bits4];
var hasDuration = new bool[bits4];
var hasMaxDuration = new bool[bits4];
var effectCount = new uint[bits4];
var casterGUID = new byte[bits4][];
for (var i = 0; i < bits4; ++i)
{
hasAura[i] = packet.ReadBit();
if (hasAura[i])
{
hasMaxDuration[i] = packet.ReadBit();
effectCount[i] = packet.ReadBits(22);
hasCasterGUID[i] = packet.ReadBit();
if (hasCasterGUID[i])
{
casterGUID[i] = new byte[8];
packet.StartBitStream(casterGUID[i], 5, 7, 4, 1, 6, 0, 3, 2);
}
hasDuration[i] = packet.ReadBit();
}
}
packet.StartBitStream(guid, 2, 3, 7, 4);
packet.ReadBit("Is AURA_UPDATE_ALL");
packet.StartBitStream(guid, 0, 5);
packet.ResetBitReader();
var auras = new List<Aura>();
for (var i = 0; i < bits4; ++i)
{
if (hasAura[i])
{
var aura = new Aura();
if (hasCasterGUID[i])
{
packet.ParseBitStream(casterGUID[i], 2, 7, 6, 1, 4, 0, 5, 3);
packet.WriteGuid("Caster GUID", casterGUID[i], i);
aura.CasterGuid = new Guid(BitConverter.ToUInt64(casterGUID[i], 0));
}
else
aura.CasterGuid = new Guid();
aura.Charges = packet.ReadByte("Charges", i);
if (hasDuration[i])
aura.Duration = packet.ReadInt32("Duration", i);
else
aura.Duration = 0;
aura.SpellId = packet.ReadUInt32("Spell Id", i);
aura.AuraFlags = packet.ReadEnum<AuraFlagMoP>("Flags", TypeCode.Byte, i);
for (var j = 0; j < effectCount[i]; ++j)
packet.ReadSingle("Effect Value", i, j);
packet.ReadInt32("Effect Mask", i);
if (hasMaxDuration[i])
aura.MaxDuration = packet.ReadInt32("Max Duration", i);
else
aura.MaxDuration = 0;
aura.Level = packet.ReadUInt16("Caster Level", i);
auras.Add(aura);
packet.AddSniffData(StoreNameType.Spell, (int)aura.SpellId, "AURA_UPDATE");
}
packet.ReadByte("Slot", i);
}
if (hasPowerData)
{
packet.ReadXORBytes(guid2, 7, 0);
for (var i = 0; i < bits3C; ++i)
{
packet.ReadEnum<PowerType>("Power Type", TypeCode.UInt32, i);
packet.ReadInt32("Power Value", i);
}
packet.ReadXORBytes(guid2, 2, 5);
packet.ReadInt32("Attack power");
packet.ReadInt32("Spell power");
packet.ReadXORBytes(guid2, 6, 4, 3, 1);
packet.ReadInt32("Current Health");
//.........这里部分代码省略.........
示例15: HandleAttackStartStart
public static void HandleAttackStartStart(Packet packet)
{
var victimGUID = new byte[8];
var attackerGUID = new byte[8];
packet.StartBitStream(victimGUID, 6, 2, 1);
attackerGUID[6] = packet.ReadBit();
victimGUID[5] = packet.ReadBit();
packet.StartBitStream(attackerGUID, 1, 3, 0);
packet.StartBitStream(victimGUID, 0, 7);
packet.StartBitStream(attackerGUID, 7, 5, 4);
packet.StartBitStream(victimGUID, 4, 3);
attackerGUID[2] = packet.ReadBit();
packet.ReadXORByte(attackerGUID, 4);
packet.ReadXORByte(victimGUID, 4);
packet.ReadXORBytes(attackerGUID, 2, 6);
packet.ReadXORByte(victimGUID, 7);
packet.ReadXORByte(attackerGUID, 0);
packet.ReadXORByte(victimGUID, 5);
packet.ReadXORByte(attackerGUID, 1);
packet.ReadXORBytes(victimGUID, 2, 6);
packet.ReadXORByte(attackerGUID, 7);
packet.ReadXORByte(victimGUID, 3);
packet.ReadXORByte(attackerGUID, 5);
packet.ReadXORByte(victimGUID, 0);
packet.ReadXORByte(attackerGUID, 3);
packet.ReadXORByte(victimGUID, 1);
packet.WriteGuid("Attacker GUID", attackerGUID);
packet.WriteGuid("Victim GUID", victimGUID);
}