本文整理汇总了C#中WowPacketParser.Misc.Packet.ReadChars方法的典型用法代码示例。如果您正苦于以下问题:C# Packet.ReadChars方法的具体用法?C# Packet.ReadChars怎么用?C# Packet.ReadChars使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WowPacketParser.Misc.Packet
的用法示例。
在下文中一共展示了Packet.ReadChars方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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);
}
}
}
示例2: HandleServerAddonsList
public static void HandleServerAddonsList(Packet packet)
{
for (var i = 0; i < _addonCount; i++)
{
packet.ReadByte("Addon State");
var sendCrc = packet.ReadBoolean("Use CRC");
if (sendCrc)
{
var usePublicKey = packet.ReadBoolean("Use Public Key");
if (usePublicKey)
{
var pubKey = packet.ReadChars(256);
packet.Writer.Write("Public Key: ");
foreach (var t in pubKey)
packet.Writer.Write(t);
}
packet.ReadInt32("Unk Int32");
}
var unkByte2 = packet.ReadBoolean("Use URL File");
if (!unkByte2)
continue;
packet.ReadCString("Addon URL File");
}
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");
var unkStr2 = packet.ReadBytes(16);
packet.Writer.WriteLine("Unk Hash 1: " + Utilities.ByteArrayToHexString(unkStr2));
var unkStr3 = packet.ReadBytes(16);
packet.Writer.WriteLine("Unk Hash 2: " + Utilities.ByteArrayToHexString(unkStr3));
packet.ReadInt32("Unk Int32 3");
if (ClientVersion.AddedInVersion(ClientVersionBuild.V3_3_3a_11723))
packet.ReadInt32("Unk Int32 4");
}
}
}