本文整理汇总了C#中WowPacketParser.Misc.Packet.AddSniffData方法的典型用法代码示例。如果您正苦于以下问题:C# Packet.AddSniffData方法的具体用法?C# Packet.AddSniffData怎么用?C# Packet.AddSniffData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WowPacketParser.Misc.Packet
的用法示例。
在下文中一共展示了Packet.AddSniffData方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HandleClientEnterWorld
public static void HandleClientEnterWorld(Packet packet)
{
var mapId = packet.ReadEntry<Int32>(StoreNameType.Map, "Map");
packet.ReadBit("Loading");
packet.AddSniffData(StoreNameType.Map, mapId, "LOAD_SCREEN");
}
示例2: HandleClientEnterWorld
public static void HandleClientEnterWorld(Packet packet)
{
var mapId = packet.ReadEntry<UInt32>(StoreNameType.Map, "Map Id");
packet.ReadBit("Loading");
CoreParsers.MovementHandler.CurrentMapId = (uint)mapId;
packet.AddSniffData(StoreNameType.Map, (int)mapId, "LOAD_SCREEN");
}
示例3: HandleNpcGossip
public static void HandleNpcGossip(Packet packet)
{
GossipMenu gossip = new GossipMenu();
WowGuid guid = packet.ReadPackedGuid128("GossipGUID");
gossip.ObjectType = guid.GetObjectType();
gossip.ObjectEntry = guid.GetEntry();
int menuId = packet.ReadInt32("GossipID");
gossip.Entry = (uint)menuId;
packet.ReadInt32("FriendshipFactionID");
gossip.TextID = (uint)packet.ReadInt32("TextID");
int int44 = packet.ReadInt32("GossipOptions");
int int60 = packet.ReadInt32("GossipText");
for (int i = 0; i < int44; ++i)
V6_0_2_19033.Parsers.NpcHandler.ReadGossipOptionsData((uint)menuId, packet, i, "GossipOptions");
for (int i = 0; i < int60; ++i)
ReadGossipQuestTextData(packet, i, "GossipQuestText");
if (guid.GetObjectType() == ObjectType.Unit)
if (Storage.Objects.ContainsKey(guid))
((Unit)Storage.Objects[guid].Item1).GossipId = (uint)menuId;
Storage.Gossips.Add(gossip, packet.TimeSpan);
packet.AddSniffData(StoreNameType.Gossip, menuId, guid.GetEntry().ToString(CultureInfo.InvariantCulture));
}
示例4: HandleClientEnterWorld
public static void HandleClientEnterWorld(Packet packet)
{
var mapId = packet.ReadInt32<MapId>("MapID");
packet.ReadBit("Showing");
packet.AddSniffData(StoreNameType.Map, mapId, "LOAD_SCREEN");
}
示例5: 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);
}
}
示例6: HandleClientAreaTrigger
public static void HandleClientAreaTrigger(Packet packet)
{
var entry = packet.ReadEntry("Area Trigger Id");
if (ClientVersion.AddedInVersion(ClientVersionBuild.V5_1_0_16309))
packet.ReadByte("Unk Byte");
packet.AddSniffData(StoreNameType.AreaTrigger, entry.Key, "AREATRIGGER");
}
示例7: HandleClientAreaTrigger
public static void HandleClientAreaTrigger(Packet packet)
{
var entry = packet.ReadEntry("Area Trigger Id");
packet.ReadBit("Unk bit1");
packet.ReadBit("Unk bit2");
packet.AddSniffData(StoreNameType.AreaTrigger, entry.Key, "AREATRIGGER");
}
示例8: HandleClientEnterWorld
public static void HandleClientEnterWorld(Packet packet)
{
packet.Writer.WriteLine("Loading: " + (packet.ReadBit() ? "true" : "false")); // Not sure on the meaning
var mapId = packet.ReadEntryWithName<UInt32>(StoreNameType.Map, "Map");
MovementHandler.CurrentMapId = (uint) mapId;
if (mapId >= 0 && mapId < 1000) // Getting some weird results in a couple of packets
packet.AddSniffData(StoreNameType.Map, mapId, "LOAD_SCREEN");
}
示例9: HandleLoginVerifyWorld
public static void HandleLoginVerifyWorld(Packet packet)
{
packet.ReadSingle("Orientation");
CoreParsers.MovementHandler.CurrentMapId = (uint)packet.ReadEntry<Int32>(StoreNameType.Map, "Map");
packet.ReadSingle("Z");
packet.ReadSingle("X");
packet.ReadSingle("Y");
packet.AddSniffData(StoreNameType.Map, (int)CoreParsers.MovementHandler.CurrentMapId, "NEW_WORLD");
}
示例10: 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);
}
}
示例11: HandleNewWorld434
public static void HandleNewWorld434(Packet packet)
{
var pos = new Vector4();
pos.O = packet.ReadSingle();
pos.Y = packet.ReadSingle();
pos.Z = packet.ReadSingle();
pos.X = packet.ReadSingle();
CoreParsers.MovementHandler.CurrentMapId = (uint)packet.ReadEntryWithName<Int32>(StoreNameType.Map, "Map");
packet.WriteLine("Position: {0}", pos);
packet.AddSniffData(StoreNameType.Map, (int)CoreParsers.MovementHandler.CurrentMapId, "NEW_WORLD");
}
示例12: HandleLoginVerifyWorld
public static void HandleLoginVerifyWorld(Packet packet)
{
var pos = new Vector4();
pos.X = packet.ReadSingle();
pos.O = packet.ReadSingle();
pos.Y = packet.ReadSingle();
CoreParsers.MovementHandler.CurrentMapId = (uint)packet.ReadInt32<MapId>("Map");
pos.Z = packet.ReadSingle();
packet.AddValue("Position", pos);
packet.AddSniffData(StoreNameType.Map, (int)CoreParsers.MovementHandler.CurrentMapId, "NEW_WORLD");
}
示例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,
Type = packet.ReadInt32E<GameObjectType>("Type"),
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?[ClientVersion.AddedInVersion(ClientVersionBuild.V4_0_6_13596) ? 32 : 24];
for (int i = 0; i < gameObject.Data.Length; i++)
gameObject.Data[i] = packet.ReadInt32("Data", i);
if (ClientVersion.AddedInVersion(ClientVersionBuild.V3_0_2_9056)) // not sure when it was added exactly - did not exist in 2.4.1 sniff
gameObject.Size = packet.ReadSingle("Size");
gameObject.QuestItems = new uint?[ClientVersion.AddedInVersion(ClientVersionBuild.V3_2_0_10192) ? 6 : 4];
if (ClientVersion.AddedInVersion(ClientVersionBuild.V3_1_0_9767))
for (int i = 0; i < gameObject.QuestItems.Length; i++)
gameObject.QuestItems[i] = (uint)packet.ReadInt32<ItemId>("Quest Item", i);
if (ClientVersion.AddedInVersion(ClientVersionBuild.V4_0_6_13596))
gameObject.RequiredLevel = packet.ReadInt32("RequiredLevel");
packet.AddSniffData(StoreNameType.GameObject, entry.Key, "QUERY_RESPONSE");
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: HandleGameObjectQueryResponse
public static void HandleGameObjectQueryResponse(Packet packet)
{
var gameObject = new GameObjectTemplate();
var entry = packet.ReadEntry("Entry");
if (entry.Value) // entry is masked
return;
gameObject.Type = packet.ReadEnum<GameObjectType>("Type", TypeCode.Int32);
gameObject.DisplayId = packet.ReadUInt32("Display ID");
var name = new string[4];
for (var 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[ClientVersion.AddedInVersion(ClientVersionBuild.V4_2_0_14333) ? 32 : 24];
for (var i = 0; i < gameObject.Data.Length; i++)
gameObject.Data[i] = packet.ReadInt32("Data", i);
if (ClientVersion.AddedInVersion(ClientVersionBuild.V3_0_2_9056)) // not sure when it was added exactly - did not exist in 2.4.1 sniff
gameObject.Size = packet.ReadSingle("Size");
gameObject.QuestItems = new uint[ClientVersion.AddedInVersion(ClientVersionBuild.V3_2_0_10192) ? 6 : 4];
if (ClientVersion.AddedInVersion(ClientVersionBuild.V3_1_0_9767))
for (var i = 0; i < gameObject.QuestItems.Length; i++)
gameObject.QuestItems[i] = (uint)packet.ReadEntryWithName<Int32>(StoreNameType.Item, "Quest Item", i);
if (ClientVersion.AddedInVersion(ClientVersionBuild.V4_2_0_14333))
gameObject.UnknownUInt = packet.ReadUInt32("Unknown UInt32");
packet.AddSniffData(StoreNameType.GameObject, entry.Key, "QUERY_RESPONSE");
packet.SniffFileInfo.Storage.GameObjectTemplates.TryAdd((uint) entry.Key, gameObject);
var objectName = new ObjectName
{
ObjectType = ObjectType.GameObject,
Name = gameObject.Name,
};
packet.SniffFileInfo.Storage.ObjectNames.TryAdd((uint)entry.Key, objectName);
}
示例15: HandleNpcGossip
public static void HandleNpcGossip(Packet packet)
{
var gossip = new Gossip();
var guid = packet.ReadGuid("GUID"); // TODO: Use this to assign npc entries with gossip ids
gossip.ObjectType = guid.GetObjectType();
gossip.ObjectEntry = guid.GetEntry();
var menuId = packet.ReadUInt32("Menu Id");
var textId = packet.ReadUInt32("Text Id");
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();
gossipOption.Index = packet.ReadUInt32("Index", i);
gossipOption.OptionIcon = packet.ReadByte("Icon", i);
gossipOption.Box = packet.ReadBoolean("Box", i);
gossipOption.RequiredMoney = packet.ReadUInt32("Required money", i);
gossipOption.OptionText = packet.ReadCString("Text", i);
gossipOption.BoxText = packet.ReadCString("Box Text", i);
gossip.GossipOptions.Add(gossipOption);
}
packet.AddSniffData(StoreNameType.Gossip, (int)menuId, guid.GetEntry().ToString(CultureInfo.InvariantCulture));
Storage.Gossips.TryAdd(new Tuple<uint, uint>(menuId, textId), gossip);
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);
packet.ReadBoolean("Unk Bool", i);
packet.ReadCString("Title", i);
}
}