当前位置: 首页>>代码示例>>C#>>正文


C# Guid.HasEntry方法代码示例

本文整理汇总了C#中WowPacketParser.Misc.Guid.HasEntry方法的典型用法代码示例。如果您正苦于以下问题:C# Guid.HasEntry方法的具体用法?C# Guid.HasEntry怎么用?C# Guid.HasEntry使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在WowPacketParser.Misc.Guid的用法示例。


在下文中一共展示了Guid.HasEntry方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CheckFilter

        public static bool CheckFilter(Guid guid)
        {
            var result = true;

            if (guid.HasEntry())
                result = CheckFilter(Utilities.ObjectTypeToStore(guid.GetObjectType()), (int)guid.GetEntry());

            return result;
        }
开发者ID:Asdcrew,项目名称:WowPacketParser,代码行数:9,代码来源:Filters.cs

示例2: ReadMovementUpdateBlock


//.........这里部分代码省略.........
                    {
                        lines.Add("Spline Duration Multiplier: " + packet.ReadSingle("Spline Duration Multiplier", index));
                        lines.Add("Spline Duration Multiplier Next: " + packet.ReadSingle("Spline Duration Multiplier Next", index));
                        lines.Add("Spline Vertical Acceleration" + packet.ReadSingle("Spline Vertical Acceleration", index));
                        lines.Add("Spline Start Time " + packet.ReadInt32("Spline Start Time", index));
                    }

                    var splineCount = packet.ReadInt32();
                    for (var i = 0; i < splineCount; i++)
                        lines.Add("[" + i + "] Spline Waypoint: " + packet.ReadVector3("Spline Waypoint", index, i).ToString());

                    if (ClientVersion.AddedInVersion(ClientVersionBuild.V3_1_0_9767))
                        lines.Add("Spline Mode: " + packet.ReadEnum<SplineMode>("Spline Mode", TypeCode.Byte, index).ToString());

                    lines.Add("Spline Endpoint: " + packet.ReadVector3("Spline Endpoint", index).ToString());
                }
            }
            else // !UpdateFlag.Living
            {
                if (flags.HasAnyFlag(UpdateFlag.GOPosition))
                {
                    packet.ReadPackedGuid("GO Position GUID", index);

                    moveInfo.Position = packet.ReadVector3("[" + index + "] GO Position");
                    packet.ReadVector3("GO Transport Position", index);

                    moveInfo.Orientation = packet.ReadSingle("[" + index + "] GO Orientation");
                    packet.ReadSingle("GO Transport Orientation", index);
                }
                else if (flags.HasAnyFlag(UpdateFlag.StationaryObject))
                {
                    moveInfo.Position = packet.ReadVector3();
                    moveInfo.Orientation = packet.ReadSingle();
                    packet.Writer.WriteLine("[{0}] Stationary Position: {1}, O: {2}", index, moveInfo.Position, moveInfo.Orientation);
                }
            }

            if (ClientVersion.RemovedInVersion(ClientVersionBuild.V4_2_2_14545))
            {
                if (flags.HasAnyFlag(UpdateFlag.Unknown1))
                    packet.ReadInt32("Unk Int32", index);

                if (flags.HasAnyFlag(UpdateFlag.LowGuid))
                    packet.ReadInt32("Low GUID", index);
            }

            if (flags.HasAnyFlag(UpdateFlag.AttackingTarget))
                lines.Add("Target GUID: " + packet.ReadPackedGuid("Target GUID", index));

            if (flags.HasAnyFlag(UpdateFlag.Transport))
                lines.Add("Transport Movement Time (ms): " + packet.ReadInt32("Transport Movement Time (ms)", index));

            if (flags.HasAnyFlag(UpdateFlag.Vehicle))
            {
                moveInfo.VehicleId = packet.ReadUInt32("[" + index + "] Vehicle ID");
                lines.Add("Vehicle ID : " + moveInfo.VehicleId);
                lines.Add("Vehicle Orientation: " + packet.ReadSingle("Vehicle Orientation", index));
            }

            if (ClientVersion.AddedInVersion(ClientVersionBuild.V4_2_2_14545))
            {
                if (flags.HasAnyFlag(UpdateFlag.AnimKits))
                {
                    packet.ReadInt16("Unk Int16", index);
                    packet.ReadInt16("Unk Int16", index);
                    packet.ReadInt16("Unk Int16", index);
                }
            }

            if (flags.HasAnyFlag(UpdateFlag.GORotation))
                moveInfo.Rotation = packet.ReadPackedQuaternion("GO Rotation", index);

            if (ClientVersion.AddedInVersion(ClientVersionBuild.V4_2_2_14545))
            {
                if (flags.HasAnyFlag(UpdateFlag.TransportUnkArray))
                {
                    var count = packet.ReadByte("Count", index);
                    for (var i = 0; i < count; i++)
                        packet.ReadInt32("Unk Int32", index, count);
                }
            }

            // Initialize fields that are not used by GOs
            if (guid.GetObjectType() == ObjectType.GameObject)
            {
                moveInfo.VehicleId = 0;
                moveInfo.WalkSpeed = 0;
                moveInfo.RunSpeed = 0;
            }

            if (guid.HasEntry() && guid.GetObjectType() == ObjectType.Unit)
            {
                if (packet.SniffFileInfo.Stuffing.upObjPackets.ContainsKey(guid))
                    packet.SniffFileInfo.Stuffing.upObjPackets[guid].upObjPackets.Enqueue(new UpdateObjectPacket(packet.Time, packet.Number, lines));
                else
                    packet.SniffFileInfo.Stuffing.upObjPackets.TryAdd(guid, new UpdateObjectPackets(new UpdateObjectPacket(packet.Time, packet.Number, lines)));
            }

            return moveInfo;
        }
开发者ID:Asdcrew,项目名称:WowPacketParser,代码行数:101,代码来源:UpdateHandler.cs

示例3: ReadCreateObjectBlock

        private static void ReadCreateObjectBlock(ref Packet packet, Guid guid, uint map, int index)
        {
            var objType = packet.ReadEnum<ObjectType>("Object Type", TypeCode.Byte, index);
            var moves = ReadMovementUpdateBlock(ref packet, guid, index);
            var updates = ReadValuesUpdateBlock(ref packet, objType, index);

            var obj = new WoWObject {Type = objType, Movement = moves, UpdateFields = updates, Map = map, Area = WorldStateHandler.CurrentAreaId, PhaseMask = (uint) MovementHandler.CurrentPhaseMask};
            if (guid.HasEntry() && guid.GetObjectType() == ObjectType.Unit)
            {
                List<string> lines = new List<string>();
                lines.Add("UpdateType: Values");
                foreach (var data in updates)
                    lines.Add("Block Value " + UpdateFields.GetUpdateFieldName(data.Key, "UnitField") + ": " + data.Value.Int32Value + "/" + data.Value.SingleValue);

                if (packet.SniffFileInfo.Stuffing.upObjPackets.ContainsKey(guid))
                    packet.SniffFileInfo.Stuffing.upObjPackets[guid].upObjPackets.Enqueue(new UpdateObjectPacket(packet.Time, packet.Number, lines));
                else
                    packet.SniffFileInfo.Stuffing.upObjPackets.TryAdd(guid, new UpdateObjectPackets(new UpdateObjectPacket(packet.Time, packet.Number, lines)));
            }

            packet.SniffFileInfo.Stuffing.Objects.TryAdd(guid, obj);

            if (guid.HasEntry() && (objType == ObjectType.Unit || objType == ObjectType.GameObject))
                packet.AddSniffData(Utilities.ObjectTypeToStore(objType), (int)guid.GetEntry(), "SPAWN");
        }
开发者ID:Asdcrew,项目名称:WowPacketParser,代码行数:25,代码来源:UpdateHandler.cs

示例4: ReadCreateObjectBlock

        private static void ReadCreateObjectBlock(ref Packet packet, Guid guid, uint map, int index)
        {
            var objType = packet.ReadEnum<ObjectType>("Object Type", TypeCode.Byte, index);
            packet.WriteLine("Pos: " + packet.Position);
            packet.ResetBitReader();
            var moves = ReadMovementUpdateBlock548(ref packet, guid, index);
            packet.WriteLine("Pos: " + packet.Position);
            packet.ResetBitReader();
            var updates = CoreParsers.UpdateHandler.ReadValuesUpdateBlock(ref 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;

            // 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:nelegalno,项目名称:WowPacketParser,代码行数:50,代码来源:UpdateHandler.cs

示例5: ReadCreateObjectBlock

        private static void ReadCreateObjectBlock(ref Packet packet, Guid guid, uint map, int index)
        {
            var objType = packet.ReadEnum<ObjectType>("Object Type", TypeCode.Byte, index);
            var moves = ReadMovementUpdateBlock(ref packet, guid, index);
            var updates = ReadValuesUpdateBlock(ref packet, objType, index);

            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 = WorldStateHandler.CurrentAreaId;
            obj.PhaseMask = (uint) MovementHandler.CurrentPhaseMask;

            Storage.Objects.TryAdd(guid, obj);

            if (guid.HasEntry() && (objType == ObjectType.Unit || objType == ObjectType.GameObject))
                packet.AddSniffData(Utilities.ObjectTypeToStore(objType), (int)guid.GetEntry(), "SPAWN");
        }
开发者ID:Machiavell1,项目名称:WowPacketParser,代码行数:28,代码来源:UpdateHandler.cs

示例6: ReadCreateObjectBlock

        private static void ReadCreateObjectBlock(ref Packet packet, Guid guid, uint map, int index)
        {
            var objType = packet.ReadEnum<ObjectType>("Object Type", TypeCode.Byte, index);
            var moves = ReadMovementUpdateBlock(ref packet, guid, index);
            var updates = ReadValuesUpdateBlock(ref packet, objType, index);

            var obj = new WoWObject {Type = objType, Movement = moves, UpdateFields = updates, Map = map, Area = WorldStateHandler.CurrentAreaId, PhaseMask = (uint) MovementHandler.CurrentPhaseMask};
            packet.SniffFileInfo.Stuffing.Objects.TryAdd(guid, obj);

            if (guid.HasEntry() && (objType == ObjectType.Unit || objType == ObjectType.GameObject))
                packet.AddSniffData(Utilities.ObjectTypeToStore(objType), (int)guid.GetEntry(), "SPAWN");
        }
开发者ID:LegacyCorporation,项目名称:LegacyPacketParser,代码行数:12,代码来源:UpdateHandler.cs

示例7: ReadCreateObjectBlock

        private static void ReadCreateObjectBlock(ref Packet packet, Guid guid, uint map, int index)
        {
            var objType = packet.ReadEnum<ObjectType>("Object Type", TypeCode.Byte, index);
            var moves = ReadMovementUpdateBlock(ref packet, guid, index);
            var updates = ReadValuesUpdateBlock(ref packet, objType, index);

            switch (objType)
            {
                case ObjectType.Unit:
                    var unit = new Unit {Type = objType, Movement = moves, UpdateFields = updates, Map = map, Area = WorldStateHandler.CurrentAreaId, PhaseMask = (uint) MovementHandler.CurrentPhaseMask};
                    packet.SniffFileInfo.Storage.Objects.TryAdd(guid, unit);
                    break;
                case ObjectType.GameObject:
                    var go = new GameObject {Type = objType, Movement = moves, UpdateFields = updates, Map = map, Area = WorldStateHandler.CurrentAreaId, PhaseMask = (uint) MovementHandler.CurrentPhaseMask};
                    packet.SniffFileInfo.Storage.Objects.TryAdd(guid, go);
                    break;
                case ObjectType.Item:
                    var item = new Item {Type = objType, Movement = moves, UpdateFields = updates, Map = map, Area = WorldStateHandler.CurrentAreaId, PhaseMask = (uint) MovementHandler.CurrentPhaseMask};
                    packet.SniffFileInfo.Storage.Objects.TryAdd(guid, item);
                    break;
                case ObjectType.Player:
                    var player = new Player {Type = objType, Movement = moves, UpdateFields = updates, Map = map, Area = WorldStateHandler.CurrentAreaId, PhaseMask = (uint) MovementHandler.CurrentPhaseMask};
                    packet.SniffFileInfo.Storage.Objects.TryAdd(guid, player);
                    break;
                default:
                    var obj = new WoWObject {Type = objType, Movement = moves, UpdateFields = updates, Map = map, Area = WorldStateHandler.CurrentAreaId, PhaseMask = (uint) MovementHandler.CurrentPhaseMask};
                    packet.SniffFileInfo.Storage.Objects.TryAdd(guid, obj);
                    break;
            }

            if (guid.HasEntry() && (objType == ObjectType.Unit || objType == ObjectType.GameObject))
                packet.AddSniffData(Utilities.ObjectTypeToStore(objType), (int)guid.GetEntry(), "SPAWN");
        }
开发者ID:Chaplain,项目名称:WowPacketParser,代码行数:33,代码来源:UpdateHandler.cs


注:本文中的WowPacketParser.Misc.Guid.HasEntry方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。