本文整理汇总了C#中WowPacketParser.Misc.Packet.ReadBool方法的典型用法代码示例。如果您正苦于以下问题:C# Packet.ReadBool方法的具体用法?C# Packet.ReadBool怎么用?C# Packet.ReadBool使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WowPacketParser.Misc.Packet
的用法示例。
在下文中一共展示了Packet.ReadBool方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HandleBotDetected
public static void HandleBotDetected(Packet packet)
{
packet.ReadBool("Glider 1 Detected");
packet.ReadBool("Glider 2 Detected");
packet.ReadBool("Inner Space Detected");
packet.ReadBytes(20); // Hash
}
示例2: HandleInstanceLockWarningQuery
public static void HandleInstanceLockWarningQuery(Packet packet)
{
packet.ReadInt32("Time");
packet.ReadInt32("Encounters Completed Mask");
packet.ReadBool("Extending");
if (ClientVersion.AddedInVersion(ClientVersionBuild.V4_0_6a_13623)) // guessing
packet.ReadBool("Locked warning"); // Displays a window asking if the player choose to join an instance which is saved.
}
示例3: HandleLfgBootProposalUpdate
public static void HandleLfgBootProposalUpdate(Packet packet)
{
packet.ReadBool("In Progress");
packet.ReadBool("Did Vote");
packet.ReadBool("Vote");
if (ClientVersion.AddedInVersion(ClientVersionBuild.V4_2_2_14545))
packet.ReadByte("Offline/afk");
packet.ReadGuid("Victim GUID");
packet.ReadInt32("Total Votes");
packet.ReadInt32("Agree Count");
packet.ReadInt32("Time Left");
packet.ReadInt32("Needed Votes");
packet.ReadCString("Comment");
}
示例4: HandleGroupAssistantLeader
public static void HandleGroupAssistantLeader(Packet packet)
{
var guid = new byte[8];
packet.ReadBool("Promote");
guid[1] = packet.ReadBit();
var bit11 = packet.ReadBit();
guid[0] = packet.ReadBit();
guid[7] = packet.ReadBit();
guid[5] = packet.ReadBit();
guid[3] = packet.ReadBit();
guid[4] = packet.ReadBit();
guid[2] = packet.ReadBit();
guid[6] = packet.ReadBit();
packet.ReadXORByte(guid, 7);
packet.ReadXORByte(guid, 4);
packet.ReadXORByte(guid, 1);
packet.ReadXORByte(guid, 6);
packet.ReadXORByte(guid, 0);
packet.ReadXORByte(guid, 2);
packet.ReadXORByte(guid, 3);
packet.ReadXORByte(guid, 5);
packet.WriteGuid("Guid", guid);
}
示例5: HandleDestroyObject
public static void HandleDestroyObject(Packet packet)
{
packet.ReadGuid("GUID");
if (ClientVersion.AddedInVersion(ClientVersionBuild.V3_0_2_9056))
packet.ReadBool("Despawn Animation");
}
示例6: HandleUpdateObject
public static void HandleUpdateObject(Packet packet)
{
uint map = MovementHandler.CurrentMapId;
if (ClientVersion.AddedInVersion(ClientVersionBuild.V4_0_1_13164))
map = packet.ReadUInt16("Map");
var count = packet.ReadUInt32("Count");
if (ClientVersion.RemovedInVersion(ClientVersionBuild.V3_0_2_9056))
packet.ReadBool("Has Transport");
for (var i = 0; i < count; i++)
{
var type = packet.ReadByte();
var typeString = ClientVersion.AddedInVersion(ClientType.Cataclysm) ? ((UpdateTypeCataclysm)type).ToString() : ((UpdateType)type).ToString();
packet.AddValue("UpdateType", typeString, i);
switch (typeString)
{
case "Values":
{
var guid = packet.ReadPackedGuid("GUID", i);
WoWObject obj;
var updates = 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 "Movement":
{
var guid = ClientVersion.AddedInVersion(ClientVersionBuild.V3_1_2_9901) ? packet.ReadPackedGuid("GUID", i) : packet.ReadGuid("GUID", i);
ReadMovementUpdateBlock(packet, guid, i);
// Should we update Storage.Object?
break;
}
case "CreateObject1":
case "CreateObject2": // Might != CreateObject1 on Cata
{
var guid = packet.ReadPackedGuid("GUID", i);
ReadCreateObjectBlock(packet, guid, map, i);
break;
}
case "FarObjects":
case "NearObjects":
case "DestroyObjects":
{
ReadObjectsBlock(packet, i);
break;
}
}
}
}
示例7: HandleServerAddonsList
public static void HandleServerAddonsList(Packet packet)
{
// This packet requires _addonCount from CMSG_AUTH_SESSION to be parsed.
if (_addonCount == -1)
{
packet.AddValue("Error", "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.ReadBool("Use CRC", i);
if (sendCrc)
{
var usePublicKey = packet.ReadBool("Use Public Key", i);
if (usePublicKey)
packet.ReadBytes("Name MD5", 256);
packet.ReadInt32("Unk Int32", i);
}
if (packet.ReadBool("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);
packet.ReadBytes("Name MD5", 16);
packet.ReadBytes("Version MD5", 16);
packet.ReadTime("Time", i);
if (ClientVersion.AddedInVersion(ClientVersionBuild.V3_3_3a_11723))
packet.ReadInt32("Is banned", i);
}
}
}
示例8: HandleChannelJoin
public static void HandleChannelJoin(Packet packet)
{
packet.ReadInt32("Channel Id");
packet.ReadBool("Has Voice");
packet.ReadBool("Joined by zone update");
if (ClientVersion.AddedInVersion(ClientVersionBuild.V4_0_1_13164))
{
packet.ReadCString("Channel Pass");
packet.ReadCString("Channel Name");
}
else
{
packet.ReadCString("Channel Name");
packet.ReadCString("Channel Pass");
}
}
示例9: HandleNpcGossip
public static void HandleNpcGossip(Packet packet)
{
GossipMenu gossip = new GossipMenu();
WowGuid guid = packet.ReadGuid("GUID");
gossip.ObjectType = guid.GetObjectType();
gossip.ObjectEntry = guid.GetEntry();
uint menuId = packet.ReadUInt32("Menu Id");
gossip.Entry = menuId;
if (ClientVersion.AddedInVersion(ClientType.MistsOfPandaria))
packet.ReadUInt32("Friendship Faction");
gossip.TextID = packet.ReadUInt32("Text Id");
uint count = packet.ReadUInt32("Amount of Options");
for (int i = 0; i < count; i++)
{
GossipMenuOption gossipOption = new GossipMenuOption
{
MenuID = menuId,
ID = packet.ReadUInt32("Index", i),
OptionIcon = packet.ReadByteE<GossipOptionIcon>("Icon", i),
BoxCoded = packet.ReadBool("Box", i),
BoxMoney = packet.ReadUInt32("Required money", i),
OptionText = packet.ReadCString("Text", i),
BoxText = packet.ReadCString("Box Text", i)
};
Storage.GossipMenuOptions.Add(gossipOption, packet.TimeSpan);
}
uint questgossips = packet.ReadUInt32("Amount of Quest gossips");
for (int i = 0; i < questgossips; i++)
{
packet.ReadUInt32<QuestId>("Quest ID", i);
packet.ReadUInt32("Icon", i);
packet.ReadInt32("Level", i);
packet.ReadUInt32E<QuestFlags>("Flags", i);
if (ClientVersion.AddedInVersion(ClientVersionBuild.V5_1_0_16309))
packet.ReadUInt32E<QuestFlags2>("Flags 2", i);
packet.ReadBool("Change Icon", i);
packet.ReadCString("Title", i);
}
if (guid.GetObjectType() == ObjectType.Unit)
if (Storage.Objects.ContainsKey(guid))
((Unit)Storage.Objects[guid].Item1).GossipId = menuId;
Storage.Gossips.Add(gossip, packet.TimeSpan);
packet.AddSniffData(StoreNameType.Gossip, (int)menuId, guid.GetEntry().ToString(CultureInfo.InvariantCulture));
}
示例10: HandleGetGMTicket
public static void HandleGetGMTicket(Packet packet)
{
var ticketStatus = packet.ReadInt32E<GMTicketStatus>("TicketStatus");
if (ticketStatus != GMTicketStatus.GMTICKET_STATUS_HASTEXT)
return;
packet.ReadInt32("TicketID");
packet.ReadCString("Description");
packet.ReadByte("Category");
packet.ReadSingle("Ticket Age");
packet.ReadSingle("Oldest Ticket Time");
packet.ReadSingle("Update Time");
packet.ReadBool("Assigned to GM");
packet.ReadBool("Opened by GM");
if (ClientVersion.AddedInVersion(ClientVersionBuild.V4_3_4_15595))
{
packet.ReadCString("Average wait time Text");
packet.ReadUInt32("Average wait time");
}
}
示例11: HandleAuctionHello
public static void HandleAuctionHello(Packet packet)
{
packet.ReadGuid("GUID");
if (packet.Direction == Direction.ClientToServer)
return;
packet.ReadUInt32("AuctionHouse ID");
if (ClientVersion.AddedInVersion(ClientVersionBuild.V3_3_0_10958))
packet.ReadBool("Enabled");
}
示例12: HandleComplain
public static void HandleComplain(Packet packet)
{
bool fromChat = packet.ReadBool("From Chat"); // false = from mail
packet.ReadGuid("Guid");
packet.ReadInt32E<Language>("Language");
packet.ReadInt32E<ChatMessageType>("Type");
packet.ReadInt32("Channel ID");
if (fromChat)
{
packet.ReadTime("Time ago");
packet.ReadCString("Complain");
}
}
示例13: HandleSetFactionStanding
public static void HandleSetFactionStanding(Packet packet)
{
if (ClientVersion.AddedInVersion(ClientVersionBuild.V2_4_0_8089))
packet.ReadSingle("Reputation loss");
if (ClientVersion.AddedInVersion(ClientType.WrathOfTheLichKing))
packet.ReadBool("Play Visual");
var count = packet.ReadInt32("Count");
for (var i = 0; i < count; i++)
{
packet.ReadInt32("Faction List Id");
packet.ReadInt32("Standing");
}
}
示例14: HandleCorpseQuery
public static void HandleCorpseQuery(Packet packet)
{
if (packet.Direction == Direction.ClientToServer)
return;
if (!packet.ReadBool("Corpse Found"))
return;
packet.ReadInt32<MapId>("Map ID");
packet.ReadVector3("Corpse Position");
packet.ReadInt32<MapId>("Corpse Map ID");
if (ClientVersion.AddedInVersion(ClientVersionBuild.V3_2_2_10482))
packet.ReadInt32("Corpse Low GUID");
}
示例15: HandleLfgCompletionReward434
public static void HandleLfgCompletionReward434(Packet packet)
{
packet.ReadLfgEntry("Random LFG Entry");
packet.ReadLfgEntry("Actual LFG Entry");
packet.ReadUInt32("Base Money");
packet.ReadUInt32("Base XP");
var numFields = packet.ReadByte("Reward Item Count");
for (var i = 0; i < numFields; i++)
{
packet.ReadInt32<ItemId>("Reward Item Or Currency Id", i);
packet.ReadInt32("Reward Item Display ID", i);
packet.ReadInt32("Reward Item Stack Count", i);
packet.ReadBool("Is Currency", i);
}
}