本文整理汇总了C#中WowPacketParser.Misc.Packet.ReadCString方法的典型用法代码示例。如果您正苦于以下问题:C# Packet.ReadCString方法的具体用法?C# Packet.ReadCString怎么用?C# Packet.ReadCString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WowPacketParser.Misc.Packet
的用法示例。
在下文中一共展示了Packet.ReadCString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HandleAddCalendarEvent
public static void HandleAddCalendarEvent(Packet packet)
{
packet.ReadCString("Title");
packet.ReadCString("Description");
packet.ReadEnum<CalendarEventType>("Event Type", TypeCode.Byte);
packet.ReadEnum<CalendarRepeatType>("Repeat Type", TypeCode.Byte);
packet.ReadInt32("Max Invites");
packet.ReadEntryWithName<Int32>(StoreNameType.LFGDungeon, "Dungeon ID");
packet.ReadPackedTime("Event Time");
packet.ReadPackedTime("Unk PackedTime");
var flags = packet.ReadEnum<CalendarFlag>("Event Flags", TypeCode.Int32);
if ((flags & CalendarFlag.GuildAnnouncement) != 0)
return;
var count = packet.ReadInt32("Invite Count");
for (var i = 0; i < count; i++)
{
packet.ReadPackedGuid("Creator GUID");
packet.ReadEnum<CalendarEventStatus>("Status", TypeCode.Byte);
packet.ReadEnum<CalendarModerationRank>("Moderation Rank", TypeCode.Byte);
}
}
示例2: HandleCalendarCommandResult
public static void HandleCalendarCommandResult(Packet packet)
{
packet.ReadInt32("UnkInt1");
packet.ReadCString("UnkString1");
packet.ReadCString("Param 1"); // if %s is used in the error message
packet.ReadEnum<CalendarError>("Error", TypeCode.Int32);
}
示例3: HandleArenaTeamCommandResult
public static void HandleArenaTeamCommandResult(Packet packet)
{
packet.ReadUInt32("Action"); // FIXME: Use enum
packet.ReadCString("Team Name");
packet.ReadCString("Player Name");
packet.ReadUInt32("ErrorId"); // FIXME: Use enum
}
示例4: HandleAvailableVoiceChannel
public static void HandleAvailableVoiceChannel(Packet packet)
{
packet.ReadInt64("Unk Int64 1");
packet.ReadByte("Channel Type");
packet.ReadCString("Channel Name");
packet.ReadInt64("Unk Int64 2");
}
示例5: HandleFriendStatus
public static void HandleFriendStatus(Packet packet)
{
var result = packet.ReadByteE<ContactResult>("Result");
packet.ReadGuid("GUID");
switch (result)
{
case ContactResult.FriendAddedOffline:
packet.ReadCString("Note");
break;
case ContactResult.FriendAddedOnline:
{
packet.ReadCString("Note");
ReadSingleContactBlock(packet, false);
break;
}
case ContactResult.Online:
ReadSingleContactBlock(packet, false);
break;
case ContactResult.Unknown2:
packet.ReadByte("Unk byte 1");
break;
case ContactResult.Unknown3:
packet.ReadInt32("Unk int");
break;
}
}
示例6: 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)));
}
示例7: HandleGMResponseReceived
public static void HandleGMResponseReceived(Packet packet)
{
packet.ReadUInt32("Unk 1");
packet.ReadUInt32("Unk 2");
packet.ReadCString("Text");
for (var i = 1; i <= 4; i++)
packet.ReadCString("Response", i);
}
示例8: HandleBug
public static void HandleBug(Packet packet)
{
packet.ReadUInt32("Suggestion");
packet.ReadUInt32("Content Lenght");
packet.ReadCString("Content");
packet.ReadUInt32("Text Lenght");
packet.ReadCString("Text");
}
示例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: HandleMailListResult
public static void HandleMailListResult(Packet packet)
{
packet.ReadUInt32("Total Mails");
var count = packet.ReadByte("Shown Mails");
for (var i = 0; i < count; ++i)
{
packet.ReadUInt16("Message Size", i);
packet.ReadUInt32("Mail Id", i);
var mailType = packet.ReadEnum<MailType>("Message Type", TypeCode.Byte, i);
switch (mailType) // Read GUID if MailType.Normal, int32 (entry) if not
{
case MailType.Normal:
packet.ReadGuid("Player GUID", i);
break;
case MailType.Creature:
packet.Writer.WriteLine("[" + i + "] Entry: " + StoreGetters.GetExistingDatabaseString(StoreNameType.Unit, packet.ReadInt32()));
break;
case MailType.GameObject:
packet.Writer.WriteLine("[" + i + "] Entry: " + StoreGetters.GetExistingDatabaseString(StoreNameType.GameObject, packet.ReadInt32()));
break;
case MailType.Item:
packet.Writer.WriteLine("[" + i + "] Entry: " + StoreGetters.GetExistingDatabaseString(StoreNameType.Item, packet.ReadInt32()));
break;
default:
packet.ReadInt32("Entry", i);
break;
}
packet.ReadUInt32("COD", i);
packet.ReadUInt32("Unk uint32", i);
packet.ReadUInt32("Stationery", i);
packet.ReadUInt32("Money", i);
packet.ReadUInt32("Flags", i);
packet.ReadSingle("Time?", i);
packet.ReadUInt32("Template Id", i);
packet.ReadCString("Subject", i);
packet.ReadCString("Body", i);
var items = packet.ReadByte("Item Count", i);
for (var j = 0; j < items; ++j)
{
packet.ReadByte("Item Index", i, j);
packet.ReadUInt32("Item GuidLow", i, j);
packet.ReadEntryWithName<UInt32>(StoreNameType.Item, "Item Id", i, j);
for (var k = 0; k < 7; ++k)
{
packet.ReadUInt32("Item Enchantment Id", i, j, k);
packet.ReadUInt32("Item Enchantment Duration", i, j, k);
packet.ReadUInt32("Item Enchantment Charges", i, j, k);
}
packet.ReadInt32("Item Random Property Id", i, j);
packet.ReadUInt32("Item Suffix Factor", i, j);
packet.ReadUInt32("Item Count", i, j);
packet.ReadUInt32("Item SpellCharges", i, j);
packet.ReadUInt32("Item Max Durability", i, j);
packet.ReadUInt32("Item Durability", i, j);
packet.ReadByte("Unk byte", i, j);
}
}
}
示例11: ReadSetInfo
public static void ReadSetInfo(Packet packet)
{
packet.ReadPackedGuid("Set ID");
packet.ReadInt32("Index");
packet.ReadCString("Set Name");
packet.ReadCString("Set Icon");
for (var j = 0; j < NumSlots; j++)
packet.ReadPackedGuid("Item GUID " + j);
}
示例12: HandleNpcGossip
public static void HandleNpcGossip(Packet packet)
{
var gossip = new Gossip();
var guid = packet.ReadGuid("GUID");
gossip.ObjectType = guid.GetObjectType();
gossip.ObjectEntry = guid.GetEntry();
var menuId = packet.ReadUInt32("Menu Id");
if (ClientVersion.AddedInVersion(ClientType.MistsOfPandaria))
packet.ReadUInt32("Friendship Faction");
var textId = packet.ReadUInt32("Text Id");
if (guid.GetObjectType() == ObjectType.Unit)
if (Storage.Objects.ContainsKey(guid))
((Unit) Storage.Objects[guid].Item1).GossipId = menuId;
var count = packet.ReadUInt32("Amount of Options");
gossip.GossipOptions = new List<GossipOption>((int) count);
for (var i = 0; i < count; i++)
{
var gossipOption = new GossipOption
{
Index = packet.ReadUInt32("Index", i),
OptionIcon = packet.ReadEnum<GossipOptionIcon>("Icon", TypeCode.Byte, i),
Box = packet.ReadBoolean("Box", i),
RequiredMoney = packet.ReadUInt32("Required money", i),
OptionText = packet.ReadCString("Text", i),
BoxText = packet.ReadCString("Box Text", i)
};
gossip.GossipOptions.Add(gossipOption);
}
Storage.Gossips.Add(Tuple.Create(menuId, textId), gossip, packet.TimeSpan);
packet.AddSniffData(StoreNameType.Gossip, (int)menuId, guid.GetEntry().ToString(CultureInfo.InvariantCulture));
var questgossips = packet.ReadUInt32("Amount of Quest gossips");
for (var i = 0; i < questgossips; i++)
{
packet.ReadEntryWithName<UInt32>(StoreNameType.Quest, "Quest ID", i);
packet.ReadUInt32("Icon", i);
packet.ReadInt32("Level", i);
packet.ReadEnum<QuestFlags>("Flags", TypeCode.UInt32, i);
if (ClientVersion.AddedInVersion(ClientVersionBuild.V5_1_0_16309))
packet.ReadEnum<QuestFlags2>("Flags 2", TypeCode.UInt32, i);
packet.ReadBoolean("Change Icon", i);
packet.ReadCString("Title", i);
}
}
示例13: HandleGameObjectQueryResponse
public static void HandleGameObjectQueryResponse(Packet packet)
{
var entry = packet.ReadEntry("Entry");
if (entry.Value) // entry is masked
return;
GameObjectTemplate gameObject = new GameObjectTemplate
{
Entry = (uint)entry.Key
};
int unk1 = packet.ReadInt32("Unk1 UInt32");
if (unk1 == 0)
{
packet.ReadByte("Unk1 Byte");
return;
}
gameObject.Type = packet.ReadInt32E<GameObjectType>("Type");
gameObject.DisplayID = packet.ReadUInt32("Display ID");
var name = new string[4];
for (int i = 0; i < 4; i++)
name[i] = packet.ReadCString("Name", i);
gameObject.Name = name[0];
gameObject.IconName = packet.ReadCString("Icon Name");
gameObject.CastCaption = packet.ReadCString("Cast Caption");
gameObject.UnkString = packet.ReadCString("Unk String");
gameObject.Data = new int?[32];
for (int i = 0; i < gameObject.Data.Length; i++)
gameObject.Data[i] = packet.ReadInt32("Data", i);
gameObject.Size = packet.ReadSingle("Size");
gameObject.QuestItems = new uint?[packet.ReadByte("QuestItems Length")];
for (int i = 0; i < gameObject.QuestItems.Length; i++)
gameObject.QuestItems[i] = (uint)packet.ReadInt32<ItemId>("Quest Item", i);
packet.ReadUInt32E<ClientType>("Expansion");
packet.ReadByte("Unk1 Byte");
Storage.GameObjectTemplates.Add(gameObject, packet.TimeSpan);
ObjectName objectName = new ObjectName
{
ObjectType = ObjectType.GameObject,
ID = entry.Key,
Name = gameObject.Name
};
Storage.ObjectNames.Add(objectName, packet.TimeSpan);
}
示例14: HandleGMSurveySubmit
public static void HandleGMSurveySubmit(Packet packet)
{
var count = packet.ReadUInt32("Survey Question Count");
for (var i = 0; i < count; ++i)
{
var gmsurveyid = packet.ReadUInt32("GM Survey Id", i);
if (gmsurveyid == 0)
break;
packet.ReadByte("Question Number", i);
packet.ReadCString("Answer", i);
}
packet.ReadCString("Comment");
}
示例15: HandleGMResponseReceived
public static void HandleGMResponseReceived(Packet packet)
{
packet.ReadUInt32("Unk 1");
packet.ReadUInt32("Unk 2");
packet.ReadCString("Text");
for (var i = 1; i <= 4; i++) // Last 3 strings are usually empty
{
packet.ReadCString("Response " + i);
}
}