本文整理汇总了C#中WowPacketParser.Misc.Packet.WriteLine方法的典型用法代码示例。如果您正苦于以下问题:C# Packet.WriteLine方法的具体用法?C# Packet.WriteLine怎么用?C# Packet.WriteLine使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WowPacketParser.Misc.Packet
的用法示例。
在下文中一共展示了Packet.WriteLine方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HandleDestroyObject
public static void HandleDestroyObject(Packet packet)
{
if (packet.Direction == Direction.ServerToClient)
{
var guid = new byte[8];
guid[3] = packet.ReadBit();
guid[2] = packet.ReadBit();
guid[4] = packet.ReadBit();
guid[1] = packet.ReadBit();
packet.ReadBit("Despawn Animation");
guid[7] = packet.ReadBit();
guid[0] = packet.ReadBit();
guid[6] = packet.ReadBit();
guid[5] = packet.ReadBit();
packet.ParseBitStream(guid, 0, 4, 7, 2, 6, 3, 1, 5);
packet.WriteGuid("Object Guid", guid);
}
else
{
packet.WriteLine(" : CMSG_PVP_LOG_DATA");
}
}
示例2: HandleServerUpdateAccountData
public static void HandleServerUpdateAccountData(Packet packet)
{
var guid = new byte[8];
var t = packet.ReadBits(3);
packet.WriteLine("Data Type: " + (AccountDataType)t);
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.WriteLine("Account Data {0}", data);
packet.ReadXORBytes(guid, 7, 4, 0, 6, 2);
packet.ReadTime("Login Time");
packet.WriteGuid("GUID", guid);
}
示例3: HandleClientWardenData
public static void HandleClientWardenData(Packet packet)
{
var opcode = packet.ReadEnum<WardenClientOpcode>("Warden Client Opcode", TypeCode.Byte);
switch (opcode)
{
case WardenClientOpcode.CheatCheckResults:
{
var length = packet.ReadUInt16("Check Result Length");
packet.ReadInt32("Check Result Checksum");
var result = packet.ReadBytes(length);
packet.WriteLine("Check Results: " + Utilities.ByteArrayToHexString(result));
break;
}
case WardenClientOpcode.TransformedSeed:
{
var sha1 = packet.ReadBytes(20);
packet.WriteLine("SHA1 Seed: " + Utilities.ByteArrayToHexString(sha1));
break;
}
}
}
示例4: HandleVoiceRosterUpdate
public static void HandleVoiceRosterUpdate(Packet packet)
{
packet.ReadGuid("Group GUID");
packet.ReadInt16("Channel ID");
packet.ReadByte("Channel Type"); // 0: channel, 2: party
packet.ReadCString("Channel Name");
packet.WriteLine("Encryption Key: " + Utilities.ByteArrayToHexString(packet.ReadBytes(16)));
packet.WriteLine("IP: " + packet.ReadIPAddress());
packet.ReadInt16("Voice Server Port");
var count = packet.ReadByte("Player Count");
packet.ReadGuid("Leader GUID");
var leaderFlags1 = packet.ReadByte();
packet.WriteLine("Leader Flags 1: 0x" + leaderFlags1.ToString("X2"));
var leaderFlags2 = packet.ReadByte();
packet.WriteLine("Leader Flags 2: 0x" + leaderFlags2.ToString("X2"));
for (var i = 0; i < count - 1; i++)
{
packet.ReadGuid("Player GUID");
packet.ReadByte("Index");
var flags1 = packet.ReadByte();
packet.WriteLine("Flags 1: 0x" + flags1.ToString("X2"));
var flags2 = packet.ReadByte();
packet.WriteLine("Flags 2: 0x" + flags2.ToString("X2"));
}
}
示例5: HandleVoidItemSwapResponse
public static void HandleVoidItemSwapResponse(Packet packet)
{
packet.ReadBit("Has Src Item id (Inv)");
byte[] itemId2 = packet.StartBitStream(4, 1, 6, 0, 3, 7, 2, 5);
packet.ReadBit("Has Dest Item id (Inv)");
byte[] itemId1 = itemId1 = packet.StartBitStream(6, 0, 3, 2, 1, 5, 7, 4);
var usedSrcSlot = !packet.ReadBit("Used Src Slot (Inv)"); // always set?
var usedDestSlot = !packet.ReadBit("Used Dest Slot (Inv)");
packet.ParseBitStream(itemId1, 3, 7, 2, 5, 0, 1, 4, 6);
packet.WriteLine("Dest Item Id: {0}", BitConverter.ToUInt64(itemId1, 0));
packet.ParseBitStream(itemId2, 0, 2, 7, 5, 6, 4, 3, 1);
packet.WriteLine("Src Item Id: {0}", BitConverter.ToUInt64(itemId2, 0));
if (usedSrcSlot)
packet.ReadInt32("New Slot for Src Item");
if (usedDestSlot)
packet.ReadInt32("New Slot for Dest Item");
}
示例6: ParseBattlenet
public static void ParseBattlenet(Packet packet)
{
try
{
var bnetPacket = new BattlenetPacket(packet);
Action<BattlenetPacket> handler;
bnetPacket.Stream.WriteLine(bnetPacket.GetHeader());
if (BattlenetHandlers.TryGetValue(bnetPacket.Header, out handler))
{
handler(bnetPacket);
packet.Status = ParsedStatus.Success;
}
else
{
packet.AsHex();
packet.Status = ParsedStatus.NotParsed;
}
}
catch (Exception ex)
{
packet.WriteLine(ex.GetType().ToString());
packet.WriteLine(ex.Message);
packet.WriteLine(ex.StackTrace);
packet.Status = ParsedStatus.WithErrors;
}
}
示例7: HandleAuthResponse434
public static void HandleAuthResponse434(Packet packet)
{
var isQueued = packet.ReadBit();
var hasAccountInfo = packet.ReadBit();
if (isQueued)
{
var unkByte = packet.ReadByte();
packet.WriteLine("Unk Byte: " + unkByte);
var position = packet.ReadInt32();
packet.WriteLine("Queue Position: " + position);
}
if (hasAccountInfo)
{
packet.ReadInt32("Billing Time Remaining");
packet.ReadEnum<ClientType>("Account Expansion", TypeCode.Byte);
packet.ReadInt32("Unknown UInt32");
packet.ReadEnum<ClientType>("Player Expansion", TypeCode.Byte);
packet.ReadInt32("Billing Time Rested");
packet.ReadEnum<BillingFlag>("Billing Flags", TypeCode.Byte);
}
var code = (ResponseCode)packet.ReadByte();
packet.WriteLine("Auth Code: " + code);
}
示例8: HandleServerAddonsList
public static void HandleServerAddonsList(Packet packet)
{
// This packet requires _addonCount from CMSG_AUTH_SESSION to be parsed.
if (_addonCount == -1)
{
packet.WriteLine("CMSG_AUTH_SESSION was not received - cannot successfully parse this packet.");
packet.ReadToEnd();
return;
}
for (var i = 0; i < _addonCount; i++)
{
packet.ReadByte("Addon State", i);
var sendCrc = packet.ReadBoolean("Use CRC", i);
if (sendCrc)
{
var usePublicKey = packet.ReadBoolean("Use Public Key", i);
if (usePublicKey)
{
var pubKey = packet.ReadChars(256);
packet.Write("[{0}] Public Key: ", i);
foreach (var t in pubKey)
packet.Write(t.ToString(CultureInfo.InvariantCulture));
}
packet.ReadInt32("Unk Int32", i);
}
if (packet.ReadBoolean("Use URL File", i))
packet.ReadCString("Addon URL File", i);
}
if (ClientVersion.AddedInVersion(ClientVersionBuild.V3_0_8_9464))
{
var bannedCount = packet.ReadInt32("Banned Addons Count");
for (var i = 0; i < bannedCount; i++)
{
packet.ReadInt32("ID", i);
var unkStr2 = packet.ReadBytes(16);
packet.WriteLine("[{0}] Unk Hash 1: {1}", i, Utilities.ByteArrayToHexString(unkStr2));
var unkStr3 = packet.ReadBytes(16);
packet.WriteLine("[{0}] Unk Hash 2: {1}", i, Utilities.ByteArrayToHexString(unkStr3));
packet.ReadInt32("Unk Int32 3", i);
if (ClientVersion.AddedInVersion(ClientVersionBuild.V3_3_3a_11723))
packet.ReadInt32("Unk Int32 4", i);
}
}
}
示例9: HandleCombatLogMultiple
public static void HandleCombatLogMultiple(Packet packet)
{
var count = packet.ReadInt32("Count");
var unk1 = packet.ReadInt32();
for (var i = 0; i < count; i++)
{
var unk2 = packet.ReadInt32();
packet.WriteLine("["+ i+ "] Unknown: {0}", unk1 - unk2);
var opcode = Opcodes.GetOpcode(packet.ReadInt32());
packet.WriteLine("Opcode: " + opcode);
switch (opcode)
{
case Opcode.SMSG_SPELLHEALLOG:
{
ReadSpellHealLog(ref packet, i);
break;
}
case Opcode.SMSG_SPELLENERGIZELOG:
{
ReadSpellEnergizeLog(ref packet, i);
break;
}
case Opcode.SMSG_PERIODICAURALOG:
{
ReadPeriodicAuraLog(ref packet, i); // sub_5EEE10
break;
}
case Opcode.SMSG_SPELLLOGEXECUTE:
{
ReadSpellLogExecute(ref packet, i);
break;
}
case Opcode.SMSG_SPELLNONMELEEDAMAGELOG:
{
ReadSpellNonMeleeDamageLog(ref packet, i);
break;
}
case Opcode.SMSG_SPELLLOGMISS:
{
ReadSpellMissLog(ref packet, i);
break;
}
case Opcode.SMSG_SPELLSTEALLOG:
case Opcode.SMSG_SPELLDISPELLOG:
case Opcode.SMSG_SPELLBREAKLOG:
{
ReadSpellRemoveLog(ref packet, i);
break;
}
default:
throw new InvalidDataException("Unknown Spell Log Type/Opcode: " + opcode);
}
}
}
示例10: HandleServerAddonsList
public static void HandleServerAddonsList(Packet packet)
{
for (var i = 0; i < _addonCount; i++)
{
packet.ReadByte("Addon State", i);
var sendCrc = packet.ReadBoolean("Use CRC", i);
if (sendCrc)
{
var usePublicKey = packet.ReadBoolean("Use Public Key", i);
if (usePublicKey)
{
var pubKey = packet.ReadChars(256);
packet.Write("[{0}] Public Key: ", i);
foreach (var t in pubKey)
packet.Write(t);
}
packet.ReadInt32("Unk Int32", i);
}
if (packet.ReadBoolean("Use URL File", i))
packet.ReadCString("Addon URL File", i);
}
if (ClientVersion.AddedInVersion(ClientVersionBuild.V3_0_8_9464))
{
var bannedCount = packet.ReadInt32("Banned Addons Count");
for (var i = 0; i < bannedCount; i++)
{
packet.ReadInt32("ID", i);
var unkStr2 = packet.ReadBytes(16);
packet.WriteLine("[{0}] Unk Hash 1: {1}", i, Utilities.ByteArrayToHexString(unkStr2));
var unkStr3 = packet.ReadBytes(16);
packet.WriteLine("[{0}] Unk Hash 2: {1}", i, Utilities.ByteArrayToHexString(unkStr3));
packet.ReadInt32("Unk Int32 3", i);
if (ClientVersion.AddedInVersion(ClientVersionBuild.V3_3_3a_11723))
packet.ReadInt32("Unk Int32 4", i);
}
}
}
示例11: HandleUpdateObject
public static void HandleUpdateObject(Packet packet)
{
uint map = packet.ReadUInt16("Map");
var count = packet.ReadUInt32("Count");
//var type = packet.ReadByte();
//var typeString = ((UpdateType2)type).ToString();
for (var i = 0; i < count; i++)
{
packet.WriteLine("StartPosFor: " + packet.Position);
var type = packet.ReadByte();
var typeString = ((UpdateTypeCataclysm)type).ToString();
packet.ResetBitReader();
packet.WriteLine("[" + i + "] UpdateType: " + typeString);
switch (typeString)
{
case "Values":
{
var guid = packet.ReadPackedGuid("GUID", i);
WoWObject obj;
var updates = CoreParsers.UpdateHandler.ReadValuesUpdateBlock(packet, guid.GetObjectType(), i, false);
if (Storage.Objects.TryGetValue(guid, out obj))
{
if (obj.ChangedUpdateFieldsList == null)
obj.ChangedUpdateFieldsList = new List<Dictionary<int, UpdateField>>();
obj.ChangedUpdateFieldsList.Add(updates);
}
break;
}
case "CreateObject1":
case "CreateObject2":
{
var guid = packet.ReadPackedGuid("GUID", i);
ReadCreateObjectBlock(ref packet, guid, map, i);
break;
}
case "DestroyObjects":
{
CoreParsers.UpdateHandler.ReadObjectsBlock(packet, i);
break;
}
}
}
}
示例12: HandleCorpseQueryResponse
public static void HandleCorpseQueryResponse(Packet packet)
{
var pos = new Vector3();
var guid = new byte[8];
guid[4] = packet.ReadBit();
guid[2] = packet.ReadBit();
guid[5] = packet.ReadBit();
guid[3] = packet.ReadBit();
guid[1] = packet.ReadBit();
guid[6] = packet.ReadBit();
guid[0] = packet.ReadBit();
packet.ReadBit("Corpse Found");
guid[7] = packet.ReadBit();
packet.ReadXORByte(guid, 3);
packet.ReadXORByte(guid, 1);
packet.ReadXORByte(guid, 2);
packet.ReadEntryWithName<Int32>(StoreNameType.Map, "Map ID");
pos.X = packet.ReadSingle();
packet.ReadXORByte(guid, 6);
packet.ReadXORByte(guid, 4);
packet.ReadXORByte(guid, 5);
packet.ReadEntryWithName<Int32>(StoreNameType.Map, "Corpse Map ID");
packet.ReadXORByte(guid, 7);
pos.Z = packet.ReadSingle();
packet.ReadXORByte(guid, 0);
pos.Y = packet.ReadSingle();
packet.WriteLine("Position: {0}", pos);
packet.WriteGuid("Corpse Low GUID", guid);
}
示例13: HandleDBReply
public static void HandleDBReply(Packet packet)
{
var type = packet.ReadUInt32E<DB2Hash>("TableHash");
var entry = packet.ReadInt32("RecordID");
var timeStamp = packet.ReadUInt32();
packet.AddValue("Timestamp", Utilities.GetDateTimeFromUnixTime(timeStamp));
var allow = packet.ReadBit("Allow");
var size = packet.ReadInt32("Size");
var data = packet.ReadBytes(size);
var db2File = new Packet(data, packet.Opcode, packet.Time, packet.Direction, packet.Number, packet.Writer,
packet.FileName);
if (entry < 0 || !allow)
{
packet.WriteLine("Row {0} has been removed.", -entry);
HotfixStoreMgr.RemoveRecord(type, entry);
Storage.AddHotfixData(entry, type, true, timeStamp);
}
else
{
packet.AddSniffData(StoreNameType.None, entry, type.ToString());
HotfixStoreMgr.AddRecord(type, entry, db2File);
Storage.AddHotfixData(entry, type, false, timeStamp);
db2File.ClosePacket(false);
}
}
示例14: HandleGroupInvite422
public static void HandleGroupInvite422(Packet packet)
{
// note: this handler is different in 4.3.0, it got a bit fancy.
var guidBytes = new byte[8];
guidBytes[6] = (byte)(packet.ReadBit() ? 1 : 0);
guidBytes[5] = (byte)(packet.ReadBit() ? 1 : 0);
guidBytes[0] = (byte)(packet.ReadBit() ? 1 : 0);
guidBytes[3] = (byte)(packet.ReadBit() ? 1 : 0);
guidBytes[4] = (byte)(packet.ReadBit() ? 1 : 0);
guidBytes[7] = (byte)(packet.ReadBit() ? 1 : 0);
guidBytes[1] = (byte)(packet.ReadBit() ? 1 : 0);
guidBytes[2] = (byte)(packet.ReadBit() ? 1 : 0);
packet.ReadInt32("Unk0"); // Always 0
packet.ReadInt32("Unk1"); // Non-zero in cross realm parties (1383)
packet.ReadCString("Name");
if (guidBytes[0] != 0) guidBytes[0] ^= packet.ReadByte();
if (guidBytes[7] != 0) guidBytes[7] ^= packet.ReadByte();
if (guidBytes[4] != 0) guidBytes[4] ^= packet.ReadByte();
if (guidBytes[1] != 0) guidBytes[1] ^= packet.ReadByte();
if (guidBytes[2] != 0) guidBytes[2] ^= packet.ReadByte();
if (guidBytes[6] != 0) guidBytes[6] ^= packet.ReadByte();
if (guidBytes[5] != 0) guidBytes[5] ^= packet.ReadByte();
packet.ReadCString("Realm Name"); // Non-empty in cross realm parties
if (guidBytes[3] != 0) guidBytes[3] ^= packet.ReadByte();
// Non-zero in cross realm parties
packet.WriteLine("GUID: {0}", new Guid(BitConverter.ToUInt64(guidBytes, 0)));
}
示例15: HandleSetActionButton
public static void HandleSetActionButton(Packet packet)
{
packet.ReadByte("Slot Id");
var actionId = packet.StartBitStream(0, 4, 7, 2, 5, 3, 1, 6);
packet.ParseBitStream(actionId, 7, 3, 0, 2, 1, 4, 5, 6);
packet.WriteLine("Action Id: {0}", BitConverter.ToUInt32(actionId, 0));
}