本文整理汇总了C#中WowPacketParser.Misc.WowGuid类 的典型用法代码示例。如果您正苦于以下问题:C# WowGuid类的具体用法?C# WowGuid怎么用?C# WowGuid使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
WowGuid类 属于WowPacketParser.Misc命名空间,在下文中一共展示了WowGuid类 的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: TestConstructor
public void TestConstructor()
{
var guid = new WowGuid(1);
Assert.IsNotNull(guid);
Assert.AreEqual(1, guid.Full);
}
开发者ID:samaelsacred, 项目名称:WowPacketParser, 代码行数:7, 代码来源:GuidTest.cs
示例2: CheckFilter
public static bool CheckFilter(WowGuid guid)
{
var result = true;
if (guid.HasEntry())
result = CheckFilter(Utilities.ObjectTypeToStore(guid.GetObjectType()), (int)guid.GetEntry());
return result;
}
开发者ID:cyberbrest, 项目名称:WowPacketParser, 代码行数:9, 代码来源:Filters.cs
示例3: TestGetHashCode
public void TestGetHashCode()
{
var guid1 = new WowGuid(0xF130005C0500105F);
var guid15 = new WowGuid(0xF130005C0500105F);
var guid2 = new WowGuid(0x600000002B2D7C9);
Assert.AreEqual(guid1.GetHashCode(), guid15.GetHashCode());
Assert.AreNotEqual(guid1.GetHashCode(), guid2.GetHashCode());
}
开发者ID:samaelsacred, 项目名称:WowPacketParser, 代码行数:9, 代码来源:GuidTest.cs
示例4: GetName
public static string GetName(WowGuid guid)
{
string name;
if (NameDict.TryGetValue(guid, out name))
return name;
return null;
}
开发者ID:TrinityCore, 项目名称:WowPacketParser, 代码行数:9, 代码来源:StoreGetters.cs
示例5: TestGetLow
public void TestGetLow()
{
var guid1 = new WowGuid(0xF130005C0500105F);
var guid2 = new WowGuid(0x600000002B2D7C9);
var guid3 = new WowGuid(0);
Assert.AreEqual(0x105F, guid1.GetLow());
Assert.AreEqual(0x2B2D7C9, guid2.GetLow());
Assert.AreEqual(0, guid3.GetLow());
}
开发者ID:samaelsacred, 项目名称:WowPacketParser, 代码行数:10, 代码来源:GuidTest.cs
示例6: TestGetHighType
public void TestGetHighType()
{
var guid1 = new WowGuid(0xF130005C0500105F);
var guid2 = new WowGuid(0x600000002B2D7C9);
var guid3 = new WowGuid(0);
Assert.AreEqual(HighGuidType.Unit, guid1.GetHighType());
Assert.AreEqual(HighGuidType.Player, guid2.GetHighType());
Assert.AreEqual(HighGuidType.None, guid3.GetHighType());
}
开发者ID:samaelsacred, 项目名称:WowPacketParser, 代码行数:10, 代码来源:GuidTest.cs
示例7: TestEquals
public void TestEquals()
{
var guid1 = new WowGuid(0xF130005C0500105F);
var guid2 = new WowGuid(0x600000002B2D7C9);
var guid25 = new WowGuid(0x600000002B2D7C9);
var guid3 = new WowGuid(0);
Assert.IsFalse(guid1.Equals(guid2));
Assert.IsTrue(guid2.Equals(guid25));
Assert.IsTrue(guid2.Equals((object) guid25));
Assert.IsFalse(guid2.Equals(new object()));
Assert.IsTrue(guid3.Equals(guid3));
}
开发者ID:samaelsacred, 项目名称:WowPacketParser, 代码行数:13, 代码来源:GuidTest.cs
示例8: HandlePetNameQuery
public static void HandlePetNameQuery(Packet packet)
{
var number = new byte[8];
var guid = new byte[8];
guid[6] = packet.ReadBit();
number[4] = packet.ReadBit();
number[6] = packet.ReadBit();
number[5] = packet.ReadBit();
guid[4] = packet.ReadBit();
number[7] = packet.ReadBit();
guid[5] = packet.ReadBit();
guid[3] = packet.ReadBit();
guid[2] = packet.ReadBit();
guid[7] = packet.ReadBit();
number[1] = packet.ReadBit();
number[0] = packet.ReadBit();
number[2] = packet.ReadBit();
number[3] = packet.ReadBit();
guid[1] = packet.ReadBit();
guid[0] = packet.ReadBit();
packet.ReadXORByte(guid, 7);
packet.ReadXORByte(number, 2);
packet.ReadXORByte(guid, 4);
packet.ReadXORByte(guid, 6);
packet.ReadXORByte(guid, 5);
packet.ReadXORByte(number, 5);
packet.ReadXORByte(guid, 3);
packet.ReadXORByte(number, 0);
packet.ReadXORByte(number, 6);
packet.ReadXORByte(guid, 1);
packet.ReadXORByte(number, 4);
packet.ReadXORByte(guid, 0);
packet.ReadXORByte(number, 7);
packet.ReadXORByte(number, 1);
packet.ReadXORByte(guid, 2);
packet.ReadXORByte(number, 3);
packet.WriteGuid("Guid2", number);
packet.WriteGuid("Guid3", guid);
var GUID = new WowGuid(BitConverter.ToUInt64(guid, 0));
var Number = BitConverter.ToUInt64(number, 0);
packet.WriteGuid("Guid", guid);
packet.AddValue("Pet Number", Number);
// Store temporary name (will be replaced in SMSG_PET_NAME_QUERY_RESPONSE)
StoreGetters.AddName(GUID, Number.ToString(CultureInfo.InvariantCulture));
}
开发者ID:samaelsacred, 项目名称:WowPacketParser, 代码行数:50, 代码来源:PetHandler.cs
示例9: ReadCreateObjectBlock
private static void ReadCreateObjectBlock(Packet packet, WowGuid guid, uint map, object index)
{
var objType = packet.ReadByteE<ObjectType>("Object Type", index);
var moves = ReadMovementUpdateBlock(packet, guid, index);
var updates = CoreParsers.UpdateHandler.ReadValuesUpdateBlock(packet, objType, index, true);
WoWObject obj;
switch (objType)
{
case ObjectType.Unit:
obj = new Unit();
break;
case ObjectType.GameObject:
obj = new GameObject();
break;
case ObjectType.Item:
obj = new Item();
break;
case ObjectType.Player:
obj = new Player();
break;
default:
obj = new WoWObject();
break;
}
obj.Type = objType;
obj.Movement = moves;
obj.UpdateFields = updates;
obj.Map = map;
obj.Area = CoreParsers.WorldStateHandler.CurrentAreaId;
obj.PhaseMask = (uint)CoreParsers.MovementHandler.CurrentPhaseMask;
obj.Phases = new HashSet<ushort>(CoreParsers.MovementHandler.ActivePhases);
// If this is the second time we see the same object (same guid,
// same position) update its phasemask
if (Storage.Objects.ContainsKey(guid))
{
var existObj = Storage.Objects[guid].Item1;
CoreParsers.UpdateHandler.ProcessExistingObject(ref existObj, obj, guid); // can't do "ref Storage.Objects[guid].Item1 directly
}
else
Storage.Objects.Add(guid, obj, packet.TimeSpan);
if (guid.HasEntry() && (objType == ObjectType.Unit || objType == ObjectType.GameObject))
packet.AddSniffData(Utilities.ObjectTypeToStore(objType), (int)guid.GetEntry(), "SPAWN");
}
开发者ID:Oboltys, 项目名称:WowPacketParser, 代码行数:47, 代码来源:UpdateHandler.cs
示例10: ReadMovementUpdateBlock
private static MovementInfo ReadMovementUpdateBlock(Packet packet, WowGuid guid, object index)
{
var moveInfo = new MovementInfo();
var guid1 = new byte[8];
var transportGuid = new byte[8];
var goTransportGuid = new byte[8];
var attackingTargetGuid = new byte[8];
var hasAnimKit1 = false;
var hasAnimKit2 = false;
var hasAnimKit3 = false;
var hasFullSpline = false;
var hasSplineStartTime = false;
var hasSplineVerticalAcceleration = false;
var hasGOTransportTime2 = false;
var hasGOTransportTime3 = false;
var hasSplineElevation = false;
var hasMovementFlags = false;
var hasMoveFlagsExtra = false;
var hasTimestamp = false;
var hasOrientation = false;
var hasTransportData = false;
var hasTransportTime3 = false;
var hasTransportTime2 = false;
var hasPitch = false;
var hasFallData = false;
var hasFallDirection = false;
var bit130 = false;
var bitA0 = false;
var bit23C = false;
var bit298 = false;
var bit230 = false;
var bit284 = false;
var bit228 = false;
var bit258 = false;
var bit218 = false;
var bit220 = false;
var bits160 = 0u;
var splineCount = 0u;
var bits11C = 0u;
var bits90 = 0u;
var bits25C = 0u;
var bits26C = 0u;
var bits288 = 0u;
var bits418 = 0u;
var bits2AA = 0u;
SplineType splineType = SplineType.Stop;
var bit2A9 = packet.ReadBit();
var bit29C = packet.ReadBit();
packet.ReadBit(); // fake 1
var bit1DC = packet.ReadBit();
var bit2A4 = packet.ReadBit();
var bit2A8 = packet.ReadBit();
packet.ReadBit(); // fake 0
var hasAttackingTarget = packet.ReadBit("Has Attacking Target", index);
var transportFrames = packet.ReadBits("Transport Frames Count", 22, index);
var bit414 = packet.ReadBit();
packet.ReadBit(); // fake 3
var bit428 = packet.ReadBit();
var bit32A = packet.ReadBit();
var hasStationaryPosition = packet.ReadBit("Has Stationary Position", index);
packet.ReadBit(); // fake 2
var isLiving = packet.ReadBit("Is Living", index);
var hasAnimKits = packet.ReadBit("Has Anim Kits", index);
var hasVehicleData = packet.ReadBit("Has Vehicle Data", index);
var hasGameObjectPosition = packet.ReadBit("Has GameObject Position", index);
var hasSceneObjectData = packet.ReadBit("Has Scene Object Data", index);
var hasGameObjectRotation = packet.ReadBit("Has GameObject Rotation", index);
if (bit29C)
{
bit284 = packet.ReadBit();
if (bit284)
{
bits25C = packet.ReadBits(21);
bits26C = packet.ReadBits(21);
}
packet.ReadBit("bit20C", index);
packet.ReadBit("bit210", index);
bit23C = packet.ReadBit();
bit298 = packet.ReadBit();
packet.ReadBit("bit20F", index);
packet.ReadBit("bit20E", index);
bit218 = packet.ReadBit();
bit220 = packet.ReadBit();
if (bit298)
bits288 = packet.ReadBits(20);
bit228 = packet.ReadBit();
packet.ReadBit("bit20D", index);
bit230 = packet.ReadBit();
bit258 = packet.ReadBit();
}
if (bit428)
//.........这里部分代码省略.........
开发者ID:Oboltys, 项目名称:WowPacketParser, 代码行数:101, 代码来源:UpdateHandler.cs
示例11: ReadMovementUpdateBlock434
private static MovementInfo ReadMovementUpdateBlock434(Packet packet, WowGuid guid, object index)
{
var moveInfo = new MovementInfo();
// bits
/*var bit3 =*/
packet.ReadBit();
/*var bit4 =*/
packet.ReadBit();
var hasGameObjectRotation = packet.ReadBit("Has GameObject Rotation", index);
var hasAnimKits = packet.ReadBit("Has AnimKits", index);
var hasAttackingTarget = packet.ReadBit("Has Attacking Target", index);
packet.ReadBit("Self", index);
var hasVehicleData = packet.ReadBit("Has Vehicle Data", index);
var living = packet.ReadBit("Living", index);
var unkLoopCounter = packet.ReadBits("Unknown array size", 24, index);
/*var bit1 =*/
packet.ReadBit();
var hasGameObjectPosition = packet.ReadBit("Has GameObject Position", index);
var hasStationaryPosition = packet.ReadBit("Has Stationary Position", index);
var bit456 = packet.ReadBit();
/*var bit2 =*/
packet.ReadBit();
var transport = packet.ReadBit("Transport", index);
var hasOrientation = false;
var guid2 = new byte[8];
var hasPitch = false;
var hasFallData = false;
var hasSplineElevation = false;
var hasTransportData = false;
var hasTimestamp = false;
var transportGuid = new byte[8];
var hasTransportTime2 = false;
var hasTransportTime3 = false;
var bit216 = false;
var hasSplineStartTime = false;
var splineCount = 0u;
var splineType = SplineType.Stop;
var facingTargetGuid = new byte[8];
var hasSplineVerticalAcceleration = false;
var hasFallDirection = false;
var goTransportGuid = new byte[8];
var hasGOTransportTime2 = false;
var hasGOTransportTime3 = false;
var attackingTargetGuid = new byte[8];
var hasAnimKit1 = false;
var hasAnimKit2 = false;
var hasAnimKit3 = false;
if (living)
{
var hasMovementFlags = !packet.ReadBit();
hasOrientation = !packet.ReadBit("Lacks orientation", index);
guid2[7] = packet.ReadBit();
guid2[3] = packet.ReadBit();
guid2[2] = packet.ReadBit();
if (hasMovementFlags)
moveInfo.Flags = (MovementFlag)packet.ReadBitsE<Enums.MovementFlag>("Movement Flags", 30, index);
packet.ReadBit("Has MovementInfo spline", index);
hasPitch = !packet.ReadBit("Lacks pitch", index);
moveInfo.HasSplineData = packet.ReadBit("Has Spline Data", index);
hasFallData = packet.ReadBit("Has Fall Data", index);
hasSplineElevation = !packet.ReadBit("Lacks spline elevation", index);
guid2[5] = packet.ReadBit();
hasTransportData = packet.ReadBit("Has Transport Data", index);
hasTimestamp = !packet.ReadBit("Lacks timestamp", index);
if (hasTransportData)
{
transportGuid[1] = packet.ReadBit();
hasTransportTime2 = packet.ReadBit();
transportGuid[4] = packet.ReadBit();
transportGuid[0] = packet.ReadBit();
transportGuid[6] = packet.ReadBit();
hasTransportTime3 = packet.ReadBit();
transportGuid[7] = packet.ReadBit();
transportGuid[5] = packet.ReadBit();
transportGuid[3] = packet.ReadBit();
transportGuid[2] = packet.ReadBit();
}
guid2[4] = packet.ReadBit();
if (moveInfo.HasSplineData)
{
bit216 = packet.ReadBit("Has extended spline data", index);
if (bit216)
{
/*var splineMode =*/
packet.ReadBitsE<SplineMode>("Spline Mode", 2, index);
hasSplineStartTime = packet.ReadBit("Has spline start time", index);
splineCount = packet.ReadBits("Spline Waypoints", 22, index);
var bits57 = packet.ReadBits(2);
switch (bits57)
{
case 0:
splineType = SplineType.FacingAngle;
break;
case 1:
splineType = SplineType.FacingSpot;
break;
//.........这里部分代码省略.........
开发者ID:Oboltys, 项目名称:WowPacketParser, 代码行数:101, 代码来源:UpdateHandler.cs
示例12: ReadMovementUpdateBlock
private static MovementInfo ReadMovementUpdateBlock(ref Packet packet, WowGuid guid, object index)
{
var moveInfo = new MovementInfo();
var guid1 = new byte[8];
var transportGuid = new byte[8];
var goTransportGuid = new byte[8];
var attackingTargetGuid = new byte[8];
var guid5 = new byte[8];
var guid6 = new byte[8];
var guid7 = new byte[8];
var bit160 = false;
var bit528 = false;
var bit600 = false;
var bit544 = false;
var bit526 = false;
var bit552 = false;
var bit524 = false;
var bit572 = false;
var bit525 = false;
var bit664 = false;
var bit527 = false;
var bit536 = false;
var bit644 = false;
var bit560 = false;
var hasAnimKit1 = false;
var hasAnimKit2 = false;
var hasAnimKit3 = false;
var hasFullSpline = false;
var hasSplineStartTime = false;
var hasSplineVerticalAcceleration = false;
var hasMovementFlags = false;
var hasMoveFlagsExtra = false;
var hasTimestamp = false;
var hasOrientation = false;
var hasTransportData = false;
var hasTransportTime2 = false;
var hasTransportTime3 = false;
var hasGOTransportTime2 = false;
var hasGOTransportTime3 = false;
var hasPitch = false;
var hasFallData = false;
var hasFallDirection = false;
var hasSplineElevation = false;
var bits168 = 0u;
var splineCount = 0u;
var bits138 = 0u;
var bits98 = 0u;
var bits25C = 0u;
var bits26C = 0u;
var bits288 = 0u;
var bits418 = 0u;
var bits2AA = 0u;
var splineType = SplineType.Stop;
var bit676 = packet.ReadBit("bit676", index);
var hasAnimKits = packet.ReadBit("Has Anim Kits", index); // 498
var isLiving = packet.ReadBit("Is Living", index); // 368
var bit810 = packet.ReadBit("bit810", index);
packet.ReadBit(); //fake bit
var transportFrames = packet.ReadBits("Transport Frames Count", 22, index); // 1068
var hasVehicleData = packet.ReadBit("Has Vehicle Data", index); // 488
var bit1044 = packet.ReadBit("bit1044", index);
packet.ReadBit(); //fake bit
var bit476 = packet.ReadBit("bit476", index);
var hasGameObjectRotation = packet.ReadBit("Has GameObject Rotation", index); // 512
packet.ReadBit(); //fake bit
var bit680 = packet.ReadBit("bit680", index);
var hasAttackingTarget = packet.ReadBit("Has Attacking Target", index); // 464
var hasSceneObjectData = packet.ReadBit("Has Scene Object Data", index); // 1032
var bit1064 = packet.ReadBit("bit1064", index);
packet.ReadBit(); //fake bit
var bit668 = packet.ReadBit("bit668", index);
var hasTransportPosition = packet.ReadBit("Has Transport Position", index); // 424
var bit681 = packet.ReadBit("bit681", index);
var hasStationaryPosition = packet.ReadBit("Has Stationary Position", index); // 448
if (isLiving)
{
guid1[2] = packet.ReadBit();
var bit140 = packet.ReadBit();
hasPitch = !packet.ReadBit("Has Pitch", index); //104
hasTransportData = packet.ReadBit("Has Transport Data", index); //96
packet.ReadBit(); // 164 fake bit
if (hasTransportData)
{
transportGuid[4] = packet.ReadBit();
transportGuid[2] = packet.ReadBit();
hasTransportTime3 = packet.ReadBit();
transportGuid[0] = packet.ReadBit();
transportGuid[1] = packet.ReadBit();
transportGuid[3] = packet.ReadBit();
transportGuid[6] = packet.ReadBit();
transportGuid[7] = packet.ReadBit();
hasTransportTime2 = packet.ReadBit();
//.........这里部分代码省略.........
开发者ID:samaelsacred, 项目名称:WowPacketParser, 代码行数:101, 代码来源:UpdateHandler.cs
示例13: Equals
public bool Equals(WowGuid other)
{
return other.Low == Low && other.High == High;
}
开发者ID:horn, 项目名称:WowPacketParser, 代码行数:4, 代码来源:WowGuid.cs
示例14: ProcessExistingObject
public static void ProcessExistingObject(ref WoWObject obj, WoWObject newObj, WowGuid guid)
{
obj.PhaseMask |= newObj.PhaseMask;
if (guid.GetHighType() == HighGuidType.Creature) // skip if not an unit
{
if (!obj.Movement.HasWpsOrRandMov)
if (obj.Movement.Position != newObj.Movement.Position)
{
UpdateField uf;
if (obj.UpdateFields.TryGetValue(UpdateFields.GetUpdateField(UnitField.UNIT_FIELD_FLAGS), out uf))
if ((uf.UInt32Value & (uint) UnitFlags.IsInCombat) == 0) // movement could be because of aggro so ignore that
obj.Movement.HasWpsOrRandMov = true;
}
}
}
开发者ID:ChipLeo, 项目名称:WowPacketParser, 代码行数:15, 代码来源:UpdateHandler.cs
示例15: ReadMovementUpdateBlock
private static MovementInfo ReadMovementUpdateBlock(Packet packet, WowGuid guid, object index)
{
var moveInfo = new MovementInfo();
var guid1 = new byte[8];
var transportGuid = new byte[8];
var goTransportGuid = new byte[8];
var attackingTargetGuid = new byte[8];
var guid5 = new byte[8];
var guid6 = new byte[8];
var guid7 = new byte[8];
var hasAnimKit1 = false;
var hasAnimKit2 = false;
var hasAnimKit3 = false;
var hasFullSpline = false;
var hasSplineStartTime = false;
var hasSplineVerticalAcceleration = false;
var hasMovementFlags = false;
var hasMoveFlagsExtra = false;
var hasTimestamp = false;
var hasOrientation = false;
var hasTransportData = false;
var hasTransportTime2 = false;
var hasTransportTime3 = false;
var hasGOTransportTime2 = false;
var hasGOTransportTime3 = false;
var hasPitch = false;
var hasFallData = false;
var hasFallDirection = false;
var hasSplineElevation = false;
var bit134 = false;
var bitA8 = false;
var bit23C = false;
var bit298 = false;
var bit230 = false;
var bit284 = false;
var bit228 = false;
var bit258 = false;
var bit218 = false;
var bit220 = false;
var bits168 = 0u;
var splineCount = 0u;
var bits138 = 0u;
var bits98 = 0u;
var bits25C = 0u;
var bits26C = 0u;
var bits288 = 0u;
var bits418 = 0u;
var bits2AA = 0u;
var splineType = SplineType.Stop;
var bit2A4 = packet.ReadBit(); // 676
var hasVehicleData = packet.ReadBit("Has Vehicle Data", index); // 488
var bit414 = packet.ReadBit(); // 1044
var hasGameObjectRotation = packet.ReadBit("Has GameObject Rotation", index); // 512
packet.ReadBit(); // fake 0
var isLiving = packet.ReadBit("Is Living", index); // 368
var hasSceneObjectData = packet.ReadBit("Has Scene Object Data", index); // 1032
packet.ReadBit(); // fake 2
var bit29C = packet.ReadBit(); // 668
var bit2A8 = packet.ReadBit(); // 680
var bit2A9 = packet.ReadBit(); // 681
packet.ReadBit(); // fake 1
var hasTransportPosition = packet.ReadBit("Has Transport Position", index); // 424
var bit1DC = packet.ReadBit(); // 476
var hasAnimKits = packet.ReadBit("Has Anim Kits", index); // 498
var hasStationaryPosition = packet.ReadBit("Has Stationary Position", index); // 448
var hasAttackingTarget = packet.ReadBit("Has Attacking Target", index); // 464
packet.ReadBit(); // fake 3
var transportFrames = packet.ReadBits("Transport Frames Count", 22, index); // 1068
var bit32A = packet.ReadBit(); // 810
var bit428 = packet.ReadBit(); // 1064
if (bit428)
bits418 = packet.ReadBits(22);
if (hasTransportPosition)
{
packet.StartBitStream(goTransportGuid, 3, 5, 2, 1, 4);
hasGOTransportTime3 = packet.ReadBit();
hasGOTransportTime2 = packet.ReadBit();
packet.StartBitStream(goTransportGuid, 0, 6, 7);
}
if (isLiving)
{
hasTransportData = packet.ReadBit("Has Transport Data", index);
if (hasTransportData)
{
transportGuid[4] = packet.ReadBit();
transportGuid[0] = packet.ReadBit();
transportGuid[5] = packet.ReadBit();
transportGuid[2] = packet.ReadBit();
transportGuid[3] = packet.ReadBit();
hasTransportTime2 = packet.ReadBit();
transportGuid[7] = packet.ReadBit();
transportGuid[6] = packet.ReadBit();
//.........这里部分代码省略.........
开发者ID:Oboltys, 项目名称:WowPacketParser, 代码行数:101, 代码来源:UpdateHandler.cs
示例16: HandleVendorInventoryList
public static void HandleVendorInventoryList(Packet packet)
{
var npcVendor = new NpcVendor();
var guid = new byte[8];
guid[4] = packet.ReadBit();
var itemCount = packet.ReadBits(18);
var hasCondition = new bool[itemCount];
var hasExtendedCost = new bool[itemCount];
for (int i = 0; i < itemCount; ++i)
{
packet.ReadBit("Unk bit", i);
hasCondition[i]= !packet.ReadBit();
hasExtendedCost[i] = !packet.ReadBit();
}
guid[1] = packet.ReadBit();
guid[6] = packet.ReadBit();
guid[2] = packet.ReadBit();
guid[5] = packet.ReadBit();
guid[7] = packet.ReadBit();
guid[0] = packet.ReadBit();
guid[3] = packet.ReadBit();
packet.ReadXORByte(guid, 3);
npcVendor.VendorItems = new List<VendorItem>((int)itemCount);
for (int i = 0; i < itemCount; ++i)
{
var vendorItem = new VendorItem();
packet.ReadInt32("Max Durability", i);
vendorItem.Type = packet.ReadUInt32("Type", i); // 1 - item, 2 - currency
var buyCount = packet.ReadUInt32("Buy Count", i);
if (hasExtendedCost[i])
vendorItem.ExtendedCostId = packet.ReadUInt32("Extended Cost", i);
packet.ReadInt32("Price", i);
vendorItem.ItemId = (uint)packet.ReadEntry<Int32>(StoreNameType.Item, "Item ID", i);
vendorItem.Slot = packet.ReadUInt32("Item Position", i);
if (hasCondition[i])
packet.ReadInt32("Condition ID", i);
var maxCount = packet.ReadInt32("Max Count", i);
packet.ReadInt32("Item Upgrade ID", i);
packet.ReadInt32("Display ID", i);
npcVendor.VendorItems.Add(vendorItem);
}
packet.ReadXORByte(guid, 6);
packet.ReadXORByte(guid, 0);
packet.ReadXORByte(guid, 2);
packet.ReadXORByte(guid, 5);
packet.ReadByte("Byte10");
packet.ReadXORByte(guid, 1);
packet.ReadXORByte(guid, 4);
packet.ReadXORByte(guid, 7);
packet.WriteGuid("Guid", guid);
var vendorGUID = new WowGuid(BitConverter.ToUInt64(guid, 0));
Storage.NpcVendors.Add(vendorGUID.GetEntry(), npcVendor, packet.TimeSpan);
}
开发者ID:samaelsacred, 项目名称:WowPacketParser, 代码行数:67, 代码来源:NpcHandler.cs
示例17: HandleNpcGossip
public static void HandleNpcGossip(Packet packet)
{
var gossip = new Gossip();
var guidBytes = new byte[8];
guidBytes[7] = packet.ReadBit();
guidBytes[6] = packet.ReadBit();
guidBytes[1] = packet.ReadBit();
var questgossips = packet.ReadBits(19);
guidBytes[0] = packet.ReadBit();
guidBytes[4] = packet.ReadBit();
guidBytes[5] = packet.ReadBit();
guidBytes[2] = packet.ReadBit();
guidBytes[3] = packet.ReadBit();
var amountOfOptions = packet.ReadBits(20);
var boxTextLen = new uint[amountOfOptions];
var optionTextLen = new uint[amountOfOptions];
for (var i = 0; i < amountOfOptions; ++i)
{
boxTextLen[i] = packet.ReadBits(12);
optionTextLen[i] = packet.ReadBits(12);
}
var titleLen = new uint[questgossips];
for (var i = 0; i < questgossips; ++i)
{
packet.ReadBit("Change Icon", i);
titleLen[i] = packet.ReadBits(9);
}
for (var i = 0; i < questgossips; ++i)
{
packet.ReadEnum<QuestFlags2>("Flags 2", TypeCode.UInt32, i);
packet.ReadEntry<UInt32>(StoreNameType.Quest, "Quest ID", i);
packet.ReadInt32("Level", i);
packet.ReadUInt32("Icon", i);
packet.ReadEnum<QuestFlags>("Flags", TypeCode.UInt32, i);
packet.ReadWoWString("Title", titleLen[i], i);
}
packet.ReadXORByte(guidBytes, 6);
gossip.GossipOptions = new List<GossipOption>((int)amountOfOptions);
for (var i = 0; i < amountOfOptions; ++i)
{
var gossipOption = new GossipOption
{
RequiredMoney = packet.ReadUInt32("Required money", i),
OptionText = packet.ReadWoWString("Text", optionTextLen[i], i),
Index = packet.ReadUInt32("Index", i),
OptionIcon = packet.ReadEnum<GossipOptionIcon>("Icon", TypeCode.Byte, i),
BoxText = packet.ReadWoWString("Box Text", boxTextLen[i], i),
Box = packet.ReadBoolean("Box", i),
};
gossip.GossipOptions.Add(gossipOption);
}
packet.ReadXORByte(guidBytes, 2);
var textId = packet.ReadUInt32("Text Id");
packet.ReadXORByte(guidBytes, 1);
packet.ReadXORByte(guidBytes, 5);
var menuId = packet.ReadUInt32("Menu Id");
packet.ReadUInt32("Friendship Faction");
packet.ReadXORByte(guidBytes, 4);
packet.ReadXORByte(guidBytes, 7);
packet.ReadXORByte(guidBytes, 3);
packet.ReadXORByte(guidBytes, 0);
packet.WriteGuid("Guid", guidBytes);
var guid = new WowGuid(BitConverter.ToUInt64(guidBytes, 0));
gossip.ObjectType = guid.GetObjectType();
gossip.ObjectEntry = guid.GetEntry();
if (guid.GetObjectType() == ObjectType.Unit)
if (Storage.Objects.ContainsKey(guid))
((Unit)Storage.Objects[guid].Item1).GossipId = menuId;
if (Storage.Gossips.ContainsKey(Tuple.Create(menuId, textId)))
{
var oldGossipOptions = Storage.Gossips[Tuple.Create(menuId, textId)];
if (oldGossipOptions != null)
{
foreach (var gossipOptions in gossip.GossipOptions)
oldGossipOptions.Item1.GossipOptions.Add(gossipOptions);
}
}
else
Storage.Gossips.Add(Tuple.Create(menuId, textId), gossip, packet.TimeSpan);
//.........这里部分代码省略.........
开发者ID:samaelsacred, 项目名称:WowPacketParser, 代码行数:101, 代码来源:NpcHandler.cs
示例18: ReadMovementInfo
public static MovementInfo ReadMovementInfo(Packet packet, WowGuid guid, object index = null)
{
if (ClientVersion.Build == ClientVersionBuild.V4_2_0_14333)
return ReadMovementInfo420(packet, index);
return ReadMovementInfoGen(packet, guid, index);
}
开发者ID:DrEhsan, 项目名称:WowPacketParser, 代码行数:7, 代码来源:MovementHandler.cs
示例19: ReadMovementUpdateBlock510
private static MovementInfo ReadMovementUpdateBlock510(Packet packet, WowGuid guid, object index)
{
var moveInfo = new MovementInfo();
var bit654 = packet.ReadBit("Has bit654", index);
packet.ReadBit();
var hasGameObjectRotation = packet.ReadBit("Has GameObject Rotation", index);
var hasAttackingTarget = packet.ReadBit("Has Attacking Target", index);
/*var bit2 = */ packet.ReadBit();
var bit520 = packet.ReadBit("Has bit520", index);
var unkLoopCounter = packet.ReadBits(24);
var transport = packet.ReadBit("Transport", index);
var hasGameObjectPosition = packet.ReadBit("Has GameObject Position", index);
/*var bit653 = */ packet.ReadBit();
var bit784 = packet.ReadBit("Has bit784", index);
/*var isSelf = */ packet.ReadBit("Self", index);
/*var bit1 = */ packet.ReadBit();
var living = packet.ReadBit("Living", index);
/*var bit3 = */ packet.ReadBit();
var bit644 = packet.ReadBit("Has bit644", index);
var hasStationaryPosition = packet.ReadBit("Has Stationary Position", index);
var hasVehicleData = packet.ReadBit("Has Vehicle Data", index);
var bits360 = packet.ReadBits(21);
var hasAnimKits = packet.ReadBit("Has AnimKits", index);
for (var i = 0; i < bits360; ++i)
packet.ReadBits(2);
var guid2 = new byte[8];
var facingTargetGuid = new byte[8];
var unkSplineCounter = 0u;
var attackingTargetGuid = new byte[8];
var transportGuid = new byte[8];
var goTransportGuid = new byte[8];
var hasFallData = false;
var hasFallDirection = false;
var hasTimestamp = false;
var hasOrientation = false;
var hasPitch = false;
var hasSplineElevation = false;
var hasTransportData = false;
var hasTransportTime2 = false;
var hasTransportTime3 = false;
var hasFullSpline = false;
var hasSplineVerticalAcceleration = false;
var hasUnkSplineCounter = false;
var hasSplineStartTime = false;
var hasGOTransportTime3 = false;
var hasGOTransportTime2 = false;
var hasAnimKit1 = false;
var hasAnimKit2 = false;
var hasAnimKit3 = false;
var splineType = SplineType.Stop;
var unkLoopCounter2 = 0u;
var splineCount = 0u;
var field8 = false;
var bit540 = false;
var bit552 = false;
var bit580 = false;
var bit624 = false;
var bit147 = 0u;
var bit151 = 0u;
var bit158 = 0u;
var bit198 = 0u;
if (living)
{
guid2[3] = packet.ReadBit();
hasFallData = packet.ReadBit("Has Fall Data", index);
hasTimestamp = !packet.ReadBit("Lacks Timestamp", index);
packet.ReadBit(); // bit172
guid2[2] = packet.ReadBit();
packet.ReadBit(); // bit149
hasPitch = !packet.ReadBit("Lacks Pitch", index);
var hasMoveFlagsExtra = !packet.ReadBit();
guid2[4] = packet.ReadBit();
guid2[5] = packet.ReadBit();
unkLoopCounter2 = packet.ReadBits(24);
hasSplineElevation = !packet.ReadBit();
field8 = !packet.ReadBit();
packet.ReadBit(); // bit148
guid2[0] = packet.ReadBit();
guid2[6] = packet.ReadBit();
guid2[7] = packet.ReadBit();
hasTransportData = packet.ReadBit("Has Transport Data", index);
hasOrientation = !packet.ReadBit();
if (hasTransportData)
{
transportGuid[3] = packet.ReadBit();
transportGuid[0] = packet.ReadBit();
transportGuid[4] = packet.ReadBit();
transportGuid[5] = packet.ReadBit();
transportGuid[2] = packet.ReadBit();
transportGuid[7] = packet.ReadBit();
transportGuid[1] = packet.ReadBit();
hasTransportTime2 = packet.ReadBit();
transportGuid[6] = packet.ReadBit();
hasTransportTime3 = packet.ReadBit();
}
//.........这里部分代码省略.........
开发者ID:ChipLeo, 项目名称:WowPacketParser, 代码行数:101, 代码来源:UpdateHandler.cs
示例20: ReadMovementInfoGen
六六分期app的软件客服如何联系?不知道吗?加qq群【895510560】即可!标题:六六分期
阅读:18305| 2023-10-27
今天小编告诉大家如何处理win10系统火狐flash插件总是崩溃的问题,可能很多用户都不知
阅读:9690| 2022-11-06
今天小编告诉大家如何对win10系统删除桌面回收站图标进行设置,可能很多用户都不知道
阅读:8186| 2022-11-06
今天小编告诉大家如何对win10系统电脑设置节能降温的设置方法,想必大家都遇到过需要
阅读:8555| 2022-11-06
我们在使用xp系统的过程中,经常需要对xp系统无线网络安装向导设置进行设置,可能很多
阅读:8465| 2022-11-06
今天小编告诉大家如何处理win7系统玩cf老是与主机连接不稳定的问题,可能很多用户都不
阅读:9405| 2022-11-06
电脑对日常生活的重要性小编就不多说了,可是一旦碰到win7系统设置cf烟雾头的问题,很
阅读:8437| 2022-11-06
我们在日常使用电脑的时候,有的小伙伴们可能在打开应用的时候会遇见提示应用程序无法
阅读:7871| 2022-11-06
今天小编告诉大家如何对win7系统打开vcf文件进行设置,可能很多用户都不知道怎么对win
阅读:8422| 2022-11-06
今天小编告诉大家如何对win10系统s4开启USB调试模式进行设置,可能很多用户都不知道怎
阅读:7400| 2022-11-06
请发表评论