本文整理汇总了C#中WowPacketParser.Misc.Packet.AddValue方法的典型用法代码示例。如果您正苦于以下问题:C# Packet.AddValue方法的具体用法?C# Packet.AddValue怎么用?C# Packet.AddValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WowPacketParser.Misc.Packet
的用法示例。
在下文中一共展示了Packet.AddValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HandleActionButton
public static void HandleActionButton(Packet packet)
{
packet.ReadByte("Button");
var data = packet.ReadInt32();
packet.AddValue("Type", (ActionButtonType)((data & 0xFF000000) >> 24));
packet.AddValue("ID", data & 0x00FFFFFF);
}
示例2: 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.ReadBytes("Encryption Key", 16);
packet.ReadIPAddress("IP");
packet.ReadInt16("Voice Server Port");
var count = packet.ReadByte("Player Count");
packet.ReadGuid("Leader GUID");
var leaderFlags1 = packet.ReadByte();
packet.AddValue("Leader Flags 1", "0x" + leaderFlags1.ToString("X2"));
var leaderFlags2 = packet.ReadByte();
packet.AddValue("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.AddValue("Flags 1", "0x" + flags1.ToString("X2"));
var flags2 = packet.ReadByte();
packet.AddValue("Flags 2", "0x" + flags2.ToString("X2"));
}
}
示例3: HandlePetMode
public static void HandlePetMode(Packet packet)
{
packet.ReadPackedGuid128("PetGUID");
var petModeFlag = packet.ReadUInt32();
packet.AddValue("React state", (ReactState)((petModeFlag >> 8) & 0xFF));
packet.AddValue("Command state", (CommandState)((petModeFlag >> 16) & 0xFF));
packet.AddValue("Flag", (petModeFlag & 0xFFFF0000), (PetModeFlags)(petModeFlag & 0xFFFF0000));
}
示例4: HandleSetActionButton
public static void HandleSetActionButton(Packet packet)
{
uint action = packet.ReadUInt32();
uint type = packet.ReadUInt32();
packet.AddValue("Action ", action);
packet.AddValue("Type ", type);
packet.ReadByte("Slot Id");
}
示例5: 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.AddValue("Unknown", unk1 - unk2, i);
var opcode = Opcodes.GetOpcode(packet.ReadInt32(), Direction.ServerToClient);
packet.AddValue("Opcode", opcode);
switch (opcode)
{
case Opcode.SMSG_SPELL_HEAL_LOG:
{
ReadSpellHealLog(packet, i);
break;
}
case Opcode.SMSG_SPELL_ENERGIZE_LOG:
{
ReadSpellEnergizeLog(packet, i);
break;
}
case Opcode.SMSG_PERIODICAURALOG:
{
ReadPeriodicAuraLog(packet, i); // sub_5EEE10
break;
}
case Opcode.SMSG_SPELL_EXECUTE_LOG:
{
ReadSpellLogExecute(packet, i);
break;
}
case Opcode.SMSG_SPELL_NON_MELEE_DAMAGE_LOG:
{
ReadSpellNonMeleeDamageLog(packet, i);
break;
}
case Opcode.SMSG_SPELL_MISS_LOG:
{
ReadSpellMissLog(packet, i);
break;
}
case Opcode.SMSG_SPELL_STEAL_LOG:
case Opcode.SMSG_SPELL_DISPEL_LOG:
case Opcode.SMSG_SPELL_BREAK_LOG:
{
ReadSpellRemoveLog(packet, i);
break;
}
default:
throw new InvalidDataException("Unknown Spell Log Type/Opcode: " + opcode);
}
}
}
示例6: ReadPetFlags
public static void ReadPetFlags(Packet packet, params object[] idx)
{
var petModeFlag = packet.ReadUInt16();
var reactState = packet.ReadByte();
var flag = petModeFlag >> 16;
var commandState = (petModeFlag & flag);
packet.AddValue("ReactState", (ReactState)reactState, idx);
packet.AddValue("CommandState", (CommandState)commandState, idx);
packet.AddValue("Flag", flag, idx);
}
示例7: HandleAccountCriteriaUpdate
public static void HandleAccountCriteriaUpdate(Packet packet)
{
var counter = new byte[8];
var accountId = new byte[8];
counter[4] = packet.ReadBit();
accountId[2] = packet.ReadBit();
counter[2] = packet.ReadBit();
accountId[4] = packet.ReadBit();
counter[0] = packet.ReadBit();
counter[5] = packet.ReadBit();
accountId[3] = packet.ReadBit();
counter[3] = packet.ReadBit();
accountId[6] = packet.ReadBit();
counter[6] = packet.ReadBit();
accountId[1] = packet.ReadBit();
accountId[7] = packet.ReadBit();
counter[1] = packet.ReadBit();
packet.ReadBits("Flags", 4); // some flag... & 1 -> delete
accountId[5] = packet.ReadBit();
counter[7] = packet.ReadBit();
accountId[0] = packet.ReadBit();
packet.ReadXORByte(accountId, 7);
packet.ReadTime("Timer 2"); // 80
packet.ReadInt32("Criteria ID"); // 16
packet.ReadXORByte(counter, 7);
packet.ReadTime("Timer 1"); // 76
packet.ReadXORByte(accountId, 4);
packet.ReadXORByte(accountId, 3);
packet.ReadPackedTime("Time");
packet.ReadXORByte(counter, 0);
packet.ReadXORByte(counter, 1);
packet.ReadXORByte(counter, 2);
packet.ReadXORByte(counter, 3);
packet.ReadXORByte(accountId, 1);
packet.ReadXORByte(counter, 4);
packet.ReadXORByte(counter, 5);
packet.ReadXORByte(accountId, 5);
packet.ReadXORByte(accountId, 2);
packet.ReadXORByte(counter, 6);
packet.ReadXORByte(accountId, 0);
packet.ReadXORByte(accountId, 6);
packet.AddValue("Account", BitConverter.ToUInt64(accountId, 0));
packet.AddValue("Counter", BitConverter.ToInt64(counter, 0));
}
示例8: HandleServerUpdateAccountData
public static void HandleServerUpdateAccountData(Packet packet)
{
var guid = new byte[8];
packet.ReadBitsE<AccountDataType>("Data Type", 3);
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.AddValue("Account Data", data);
packet.ReadXORBytes(guid, 7, 4, 0, 6, 2);
packet.ReadTime("Login Time");
packet.WriteGuid("GUID", guid);
}
示例9: HandleUpdateWorldState
public static void HandleUpdateWorldState(Packet packet)
{
packet.ReadBit("bit18");
var val = packet.ReadInt32();
var field = packet.ReadInt32();
packet.AddValue("Field", field + " - Value: " + val);
}
示例10: 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.ReadInt32<MapId>("Map ID");
pos.X = packet.ReadSingle();
packet.ReadXORByte(guid, 6);
packet.ReadXORByte(guid, 4);
packet.ReadXORByte(guid, 5);
packet.ReadInt32<MapId>("Corpse Map ID");
packet.ReadXORByte(guid, 7);
pos.Z = packet.ReadSingle();
packet.ReadXORByte(guid, 0);
pos.Y = packet.ReadSingle();
packet.AddValue("Position", pos);
packet.WriteGuid("Corpse Low GUID", guid);
}
示例11: 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);
}
}
示例12: 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;
}
}
}
}
示例13: HandleHotfixNotify
public static void HandleHotfixNotify(Packet packet)
{
var tableHash = packet.ReadUInt32E<DB2Hash>("TableHash");
var recordID = packet.ReadInt32("RecordID");
var timeStamp = packet.ReadUInt32();
packet.AddValue("Timestamp", Utilities.GetDateTimeFromUnixTime(timeStamp));
Storage.AddHotfixData(recordID, tableHash, false, timeStamp);
}
示例14: HandlePetAction
public static void HandlePetAction(Packet packet)
{
packet.ReadPackedGuid128("PetGUID");
var action = (uint)packet.ReadUInt16() + (packet.ReadByte() << 16);
packet.AddValue("Action", action);
packet.ReadByte("Slot");
packet.ReadPackedGuid128("TargetGUID");
packet.ReadVector3("ActionPosition");
}
示例15: HandleDeathReleaseLoc
public static void HandleDeathReleaseLoc(Packet packet)
{
var pos = new Vector3();
pos.Y = packet.ReadSingle();
pos.Z = packet.ReadSingle();
pos.X = packet.ReadSingle();
packet.ReadInt32<MapId>("Map Id");
packet.AddValue("Position", pos);
}