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


C# PacketReader.ReadUInt8方法代码示例

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


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

示例1: HandleRealmData

        void HandleRealmData(byte[] data)
        {
            using (var reader = new PacketReader(data, false))
            {
                ClientLink cmd = (ClientLink)reader.ReadUInt8();

                switch (cmd)
                {
                    case ClientLink.CMD_AUTH_LOGON_CHALLENGE:
                    case ClientLink.CMD_AUTH_RECONNECT_CHALLENGE:
                        HandleAuthLogonChallenge(reader);
                        break;
                    case ClientLink.CMD_AUTH_LOGON_PROOF:
                    case ClientLink.CMD_AUTH_RECONNECT_PROOF:
                        HandleAuthLogonProof(reader);
                        break;
                    case ClientLink.CMD_REALM_LIST:
                        HandleRealmList(reader);
                        break;
                    default:
                        Log.Message(LogType.NORMAL, "Received unknown ClientLink: {0}", cmd);
                        break;
                }
            }
        }
开发者ID:Krogonos,项目名称:Mop-5.1.0-Core,代码行数:25,代码来源:RealmClass.cs

示例2: HandleCharDelete

        public static void HandleCharDelete(ref PacketReader packet, ref WorldClass session)
        {
            bool[] guidMask = new bool[8];
            byte[] guidBytes = new byte[8];

            BitUnpack BitUnpack = new BitUnpack(packet);

            var unknown = BitUnpack.GetBit();

            guidMask[7] = BitUnpack.GetBit();
            guidMask[2] = BitUnpack.GetBit();
            guidMask[5] = BitUnpack.GetBit();
            guidMask[6] = BitUnpack.GetBit();
            guidMask[3] = BitUnpack.GetBit();
            guidMask[4] = BitUnpack.GetBit();
            guidMask[0] = BitUnpack.GetBit();
            guidMask[1] = BitUnpack.GetBit();

            if (guidMask[2]) guidBytes[2] = (byte)(packet.ReadUInt8() ^ 1);
            if (guidMask[6]) guidBytes[6] = (byte)(packet.ReadUInt8() ^ 1);
            if (guidMask[1]) guidBytes[1] = (byte)(packet.ReadUInt8() ^ 1);
            if (guidMask[4]) guidBytes[4] = (byte)(packet.ReadUInt8() ^ 1);
            if (guidMask[3]) guidBytes[3] = (byte)(packet.ReadUInt8() ^ 1);
            if (guidMask[0]) guidBytes[0] = (byte)(packet.ReadUInt8() ^ 1);
            if (guidMask[7]) guidBytes[7] = (byte)(packet.ReadUInt8() ^ 1);
            if (guidMask[5]) guidBytes[5] = (byte)(packet.ReadUInt8() ^ 1);

            var guid = BitConverter.ToUInt64(guidBytes, 0);

            PacketWriter deleteChar = new PacketWriter(ServerMessage.DeleteChar);
            deleteChar.WriteUInt8(0x47);
            session.Send(ref deleteChar);

            DB.Characters.Execute("DELETE FROM characters WHERE guid = ?", guid);
            DB.Characters.Execute("DELETE FROM character_spells WHERE guid = ?", guid);
            DB.Characters.Execute("DELETE FROM character_skills WHERE guid = ?", guid);
        }
开发者ID:Krogonos,项目名称:Arctium,代码行数:37,代码来源:CharacterHandler.cs

示例3: HandleMoveStopTurn

        public static void HandleMoveStopTurn(ref PacketReader packet, ref WorldClass session)
        {
            ObjectMovementValues movementValues = new ObjectMovementValues();
            BitUnpack BitUnpack = new BitUnpack(packet);

            bool[] guidMask = new bool[8];
            byte[] guidBytes = new byte[8];

            Vector4 vector = new Vector4()
            {
                X = packet.ReadFloat(),
                Z = packet.ReadFloat(),
                Y = packet.ReadFloat()
            };

            bool HasTime = !BitUnpack.GetBit();

            guidMask[5] = BitUnpack.GetBit();

            bool Unknown = BitUnpack.GetBit();

            movementValues.IsTransport = BitUnpack.GetBit();

            bool Unknown2 = BitUnpack.GetBit();

            guidMask[3] = BitUnpack.GetBit();

            bool HasSplineElevation = !BitUnpack.GetBit();

            guidMask[0] = BitUnpack.GetBit();

            bool HasPitch = !BitUnpack.GetBit();

            uint counter = BitUnpack.GetBits<uint>(24);

            guidMask[1] = BitUnpack.GetBit();
            guidMask[7] = BitUnpack.GetBit();

            movementValues.HasMovementFlags = !BitUnpack.GetBit();
            movementValues.IsAlive = !BitUnpack.GetBit();

            guidMask[2] = BitUnpack.GetBit();
            guidMask[6] = BitUnpack.GetBit();

            movementValues.HasRotation = !BitUnpack.GetBit();

            bool Unknown3 = BitUnpack.GetBit();

            movementValues.HasMovementFlags2 = !BitUnpack.GetBit();

            bool Unknown4 = BitUnpack.GetBit();

            guidMask[4] = BitUnpack.GetBit();

            /*if (movementValues.IsTransport)
            {

            }

            if (IsInterpolated)
            {

            }*/

            if (movementValues.HasMovementFlags)
                movementValues.MovementFlags = (MovementFlag)BitUnpack.GetBits<uint>(30);

            if (movementValues.HasMovementFlags2)
                movementValues.MovementFlags2 = (MovementFlag2)BitUnpack.GetBits<uint>(13);

            if (guidMask[6]) guidBytes[6] = (byte)(packet.ReadUInt8() ^ 1);
            if (guidMask[0]) guidBytes[0] = (byte)(packet.ReadUInt8() ^ 1);
            if (guidMask[5]) guidBytes[5] = (byte)(packet.ReadUInt8() ^ 1);

            for (int i = 0; i < counter; i++)
                packet.ReadUInt32();

            if (guidMask[1]) guidBytes[1] = (byte)(packet.ReadUInt8() ^ 1);
            if (guidMask[7]) guidBytes[7] = (byte)(packet.ReadUInt8() ^ 1);
            if (guidMask[3]) guidBytes[3] = (byte)(packet.ReadUInt8() ^ 1);
            if (guidMask[4]) guidBytes[4] = (byte)(packet.ReadUInt8() ^ 1);
            if (guidMask[2]) guidBytes[2] = (byte)(packet.ReadUInt8() ^ 1);

            /*if (movementValues.IsTransport)
            {

            }*/

            if (movementValues.HasRotation)
                vector.W = packet.ReadFloat();

            if (movementValues.IsAlive)
                movementValues.Time = packet.ReadUInt32();

            /*if (IsInterpolated)
            {

            }*/

            if (HasPitch)
//.........这里部分代码省略.........
开发者ID:boredtodeath,项目名称:Arctium,代码行数:101,代码来源:MoveHandler.cs

示例4: HandleActivePlayer

        public static void HandleActivePlayer(ref PacketReader packet, ref WorldClass session)
        {
            byte active = packet.ReadUInt8();    // Always 0

            Log.Message(LogType.DEBUG, "Player {0} (Guid: {1}) is active.", session.Character.Name, session.Character.Guid);
        }
开发者ID:Kinivus,项目名称:Arctium,代码行数:6,代码来源:MiscHandler.cs

示例5: HandleViolenceLevel

        public static void HandleViolenceLevel(ref PacketReader packet, ref WorldClass session)
        {
            byte violenceLevel = packet.ReadUInt8();

            Log.Message(LogType.DEBUG, "Violence level from account '{0} (Id: {1})' is {2}.", session.Account.Name, session.Account.Id, violenceLevel);
        }
开发者ID:Kinivus,项目名称:Arctium,代码行数:6,代码来源:MiscHandler.cs

示例6: HandleDBQueryBulk

        public static void HandleDBQueryBulk(ref PacketReader packet, ref WorldClass session)
        {
            List<int> IdList = new List<int>();
            BitUnpack BitUnpack = new BitUnpack(packet);

            var type = (DBTypes)packet.ReadUInt32();

            var count = BitUnpack.GetBits<uint>(21);

            bool[][] Mask = new bool[count][];
            byte[][] Bytes = new byte[count][];

            for (int i = 0; i < count; i++)
            {
                Mask[i] = new bool[8];
                Bytes[i] = new byte[8];
            }

            for (int i = 0; i < count; i++)
            {
                Mask[i][7] = BitUnpack.GetBit();
                Mask[i][2] = BitUnpack.GetBit();
                Mask[i][3] = BitUnpack.GetBit();
                Mask[i][5] = BitUnpack.GetBit();
                Mask[i][4] = BitUnpack.GetBit();
                Mask[i][6] = BitUnpack.GetBit();
                Mask[i][0] = BitUnpack.GetBit();
                Mask[i][1] = BitUnpack.GetBit();
            }

            for (int i = 0; i < count; i++)
            {
                if (Mask[i][5])
                    Bytes[i][5] = (byte)(packet.ReadUInt8() ^ 1);

                IdList.Add(packet.ReadInt32());

                if (Mask[i][7])
                    Bytes[i][7] = (byte)(packet.ReadByte() ^ 1);

                if (Mask[i][3])
                    Bytes[i][3] = (byte)(packet.ReadByte() ^ 1);

                if (Mask[i][0])
                    Bytes[i][0] = (byte)(packet.ReadByte() ^ 1);

                if (Mask[i][1])
                    Bytes[i][1] = (byte)(packet.ReadByte() ^ 1);

                if (Mask[i][6])
                    Bytes[i][6] = (byte)(packet.ReadByte() ^ 1);

                if (Mask[i][2])
                    Bytes[i][2] = (byte)(packet.ReadByte() ^ 1);

                if (Mask[i][4])
                    Bytes[i][4] = (byte)(packet.ReadByte() ^ 1);
            }

            switch (type)
            {
                case DBTypes.BroadcastText:
                {
                    foreach (var id in IdList)
                        HandleBroadcastText(ref session, id);

                    break;
                }
                default:
                    break;
            }
        }
开发者ID:Krogonos,项目名称:Arctium,代码行数:72,代码来源:CacheHandler.cs

示例7: HandleMoveFallLand

        public static void HandleMoveFallLand(ref PacketReader packet, ref WorldClass session)
        {
            ObjectMovementValues movementValues = new ObjectMovementValues();
            BitUnpack BitUnpack = new BitUnpack(packet);

            bool[] guidMask = new bool[8];
            byte[] guidBytes = new byte[8];

            Vector4 vector = new Vector4()
            {
                Y = packet.ReadFloat(),
                X = packet.ReadFloat(),
                Z = packet.ReadFloat()
            };

            uint counter = BitUnpack.GetBits<uint>(24);

            guidMask[2] = BitUnpack.GetBit();

            bool HasTime = !BitUnpack.GetBit();

            bool HasSplineElevation = !BitUnpack.GetBit();

            guidMask[6] = BitUnpack.GetBit();
            guidMask[0] = BitUnpack.GetBit();

            movementValues.IsTransport = BitUnpack.GetBit();

            bool Unknown3 = BitUnpack.GetBit();
            bool Unknown = BitUnpack.GetBit();

            guidMask[4] = BitUnpack.GetBit();

            movementValues.HasMovementFlags2 = !BitUnpack.GetBit();

            bool HasPitch = !BitUnpack.GetBit();

            movementValues.HasRotation = !BitUnpack.GetBit();

            bool Unknown2 = BitUnpack.GetBit();

            guidMask[1] = BitUnpack.GetBit();

            movementValues.IsAlive = !BitUnpack.GetBit();
            movementValues.HasMovementFlags = !BitUnpack.GetBit();

            guidMask[5] = BitUnpack.GetBit();
            guidMask[7] = BitUnpack.GetBit();
            guidMask[3] = BitUnpack.GetBit();

            bool Unknown4 = BitUnpack.GetBit();

            /*if (movementValues.IsTransport)
            {
                vehicleGuidMask[4] = BitUnpack.GetBit();
                vehicleGuidMask[1] = BitUnpack.GetBit();
                bool vehicleUnknown2 = BitUnpack.GetBit();
                vehicleGuidMask[2] = BitUnpack.GetBit();
                vehicleGuidMask[3] = BitUnpack.GetBit();
                vehicleGuidMask[7] = BitUnpack.GetBit();
                vehicleGuidMask[0] = BitUnpack.GetBit();
                bool vehicleUnknown1 = BitUnpack.GetBit();
                vehicleGuidMask[5] = BitUnpack.GetBit();
                vehicleGuidMask[6] = BitUnpack.GetBit();
            }

            if (movementValues.IsInterpolated)
                    movementValues.IsInterpolated2 = BitUnpack.GetBit();*/

            if (movementValues.HasMovementFlags2)
                movementValues.MovementFlags2 = (MovementFlag2)BitUnpack.GetBits<uint>(13);

            if (movementValues.HasMovementFlags)
                movementValues.MovementFlags = (MovementFlag)BitUnpack.GetBits<uint>(30);

            if (guidMask[0]) guidBytes[0] = (byte)(packet.ReadUInt8() ^ 1);
            if (guidMask[2]) guidBytes[2] = (byte)(packet.ReadUInt8() ^ 1);
            if (guidMask[1]) guidBytes[1] = (byte)(packet.ReadUInt8() ^ 1);
            if (guidMask[4]) guidBytes[4] = (byte)(packet.ReadUInt8() ^ 1);

            for (int i = 0; i < counter; i++)
                packet.ReadUInt32();

            if (guidMask[6]) guidBytes[6] = (byte)(packet.ReadUInt8() ^ 1);
            if (guidMask[5]) guidBytes[5] = (byte)(packet.ReadUInt8() ^ 1);
            if (guidMask[7]) guidBytes[7] = (byte)(packet.ReadUInt8() ^ 1);
            if (guidMask[3]) guidBytes[3] = (byte)(packet.ReadUInt8() ^ 1);

            /*if (movementValues.IsTransport)
            {
                Vector4 vehiclevector = new Vector4();
                vehiclevector.X = packet.ReadFloat();
                if (vehicleGuidMask[0]) vehicleGuidBytes[0] = (byte)(packet.ReadUInt8() ^ 1);
                if ( vehicleUnknown1 ) uint _25 = packet.ReadUInt32();
                if (vehicleGuidMask[4]) vehicleGuidBytes[4] = (byte)(packet.ReadUInt8() ^ 1);
                if (vehicleGuidMask[5]) vehicleGuidBytes[5] = (byte)(packet.ReadUInt8() ^ 1);
                if (vehicleGuidMask[3]) vehicleGuidBytes[3] = (byte)(packet.ReadUInt8() ^ 1);
                byte _88 = packet.ReadUInt8();
                if (vehicleGuidMask[7]) vehicleGuidBytes[7] = (byte)(packet.ReadUInt8() ^ 1);
                vehiclevector.O = packet.ReadFloat();
//.........这里部分代码省略.........
开发者ID:Mathias1000,项目名称:Arctium,代码行数:101,代码来源:MoveHandler.cs

示例8: HandleForceWalkSpeedChangeAck

        public static void HandleForceWalkSpeedChangeAck(ref PacketReader packet, ref WorldClass session)
        {
            ObjectMovementValues movementValues = new ObjectMovementValues();
            BitUnpack BitUnpack = new BitUnpack(packet);

            bool[] guidMask = new bool[8];
            byte[] guidBytes = new byte[8];

            Vector4 vector = new Vector4()
            {
                Y = packet.ReadFloat(),
                Z = packet.ReadFloat(),
                X = packet.ReadFloat()
            };

            uint zeroes = packet.ReadUInt32();
            float walkspeed = packet.ReadFloat();

            bool Unknown2 = BitUnpack.GetBit();

            guidMask[6] = BitUnpack.GetBit();

            bool HasPitch = !BitUnpack.GetBit();
            movementValues.IsTransport = BitUnpack.GetBit();
            bool Unknown3 = BitUnpack.GetBit();

            guidMask[1] = BitUnpack.GetBit();
            guidMask[2] = BitUnpack.GetBit();

            movementValues.IsAlive = !BitUnpack.GetBit();
            bool HasTime = !BitUnpack.GetBit();

            uint counter = BitUnpack.GetBits<uint>(24);

            guidMask[0] = BitUnpack.GetBit();

            movementValues.HasMovementFlags = !BitUnpack.GetBit();

            guidMask[5] = BitUnpack.GetBit();

            bool Unknown4 = BitUnpack.GetBit();
            bool HasSplineElevation = !BitUnpack.GetBit();

            guidMask[3] = BitUnpack.GetBit();

            movementValues.HasRotation = !BitUnpack.GetBit();
            movementValues.HasMovementFlags2 = !BitUnpack.GetBit();

            guidMask[7] = BitUnpack.GetBit();
            guidMask[4] = BitUnpack.GetBit();

            bool Unknown = BitUnpack.GetBit();

            /*if (movementValues.IsTransport)
            {
                vehicleGuidMask[2] = BitUnpack.GetBit();
                vehicleGuidMask[5] = BitUnpack.GetBit();
                vehicleGuidMask[4] = BitUnpack.GetBit();
                vehicleGuidMask[1] = BitUnpack.GetBit();
                vehicleGuidMask[0] = BitUnpack.GetBit();
                vehicleGuidMask[3] = BitUnpack.GetBit();
                vehicleGuidMask[7] = BitUnpack.GetBit();
                vehicleGuidMask[6] = BitUnpack.GetBit();
                bool vehicleUnknown1 = BitUnpack.GetBit();
                bool vehicleUnknown2 = BitUnpack.GetBit();
            }*/

            if (movementValues.HasMovementFlags)
                movementValues.MovementFlags = (MovementFlag)BitUnpack.GetBits<uint>(30);

            /*if (movementValues.IsInterpolated)
                    movementValues.IsInterpolated2 = BitUnpack.GetBit();*/

            if (movementValues.HasMovementFlags2)
                movementValues.MovementFlags2 = (MovementFlag2)BitUnpack.GetBits<uint>(13);

            if (guidMask[3]) guidBytes[3] = (byte)(packet.ReadUInt8() ^ 1);

            for (int i = 0; i < counter; i++)
                packet.ReadUInt32();

            if (guidMask[0]) guidBytes[0] = (byte)(packet.ReadUInt8() ^ 1);
            if (guidMask[4]) guidBytes[4] = (byte)(packet.ReadUInt8() ^ 1);
            if (guidMask[1]) guidBytes[1] = (byte)(packet.ReadUInt8() ^ 1);
            if (guidMask[2]) guidBytes[2] = (byte)(packet.ReadUInt8() ^ 1);
            if (guidMask[7]) guidBytes[7] = (byte)(packet.ReadUInt8() ^ 1);
            if (guidMask[6]) guidBytes[6] = (byte)(packet.ReadUInt8() ^ 1);
            if (guidMask[5]) guidBytes[5] = (byte)(packet.ReadUInt8() ^ 1);

            /*if (movementValues.IsTransport)
            {
                Vector4 vehiclevector = new Vector4();
                if (vehicleGuidMask[7]) vehicleGuidBytes[7] = (byte)(packet.ReadUInt8() ^ 1);
                if (vehicleGuidMask[5]) vehicleGuidBytes[5] = (byte)(packet.ReadUInt8() ^ 1);
                vehiclevector.Z = packet.ReadFloat();
                if (vehicleGuidMask[3]) vehicleGuidBytes[3] = (byte)(packet.ReadUInt8() ^ 1);
                byte _88 = packet.ReadUInt8(); 					  																			 // (BYTE)DATA[88]
                if (vehicleGuidMask[1]) vehicleGuidBytes[1] = (byte)(packet.ReadUInt8() ^ 1);
                if (vehicleGuidMask[0]) vehicleGuidBytes[0] = (byte)(packet.ReadUInt8() ^ 1);
                vehiclevector.X = packet.ReadFloat();
//.........这里部分代码省略.........
开发者ID:Mathias1000,项目名称:Arctium,代码行数:101,代码来源:MoveHandler.cs

示例9: HandleActionbarToggles

 public static void HandleActionbarToggles(ref PacketReader packet, ref WorldClass session)
 {
     byte actionBar = packet.ReadUInt8();
     Log.Message(LogType.DEBUG, "HandleActionbarToggles - Character (Guid: {0}) send Actionbar Slot: {1}.", session.Character.Guid, actionBar);
 }
开发者ID:Mogale,项目名称:Arctium,代码行数:5,代码来源:MiscHandler.cs


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