當前位置: 首頁>>代碼示例>>C#>>正文


C# PacketReader.ReadByte方法代碼示例

本文整理匯總了C#中UltimaXNA.Core.Network.PacketReader.ReadByte方法的典型用法代碼示例。如果您正苦於以下問題:C# PacketReader.ReadByte方法的具體用法?C# PacketReader.ReadByte怎麽用?C# PacketReader.ReadByte使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在UltimaXNA.Core.Network.PacketReader的用法示例。


在下文中一共展示了PacketReader.ReadByte方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: ObjectInfoPacket

        public ObjectInfoPacket(PacketReader reader)
            : base(0x1A, "ObjectInfoPacket")
        {
            Serial = reader.ReadInt32();
            ItemID = reader.ReadUInt16();

            Amount = (ushort)(((Serial & 0x80000000) == 0x80000000) ? reader.ReadUInt16() : 0);

            X = reader.ReadInt16();
            Y = reader.ReadInt16();
                        
            Direction = (byte)(((X & 0x8000) == 0x8000) ? reader.ReadByte() : 0);

            Z = reader.ReadSByte();

            Hue = (ushort)(((Y & 0x8000) == 0x8000) ? reader.ReadUInt16() : 0);

            Flags = (byte)(((Y & 0x4000) == 0x4000) ? reader.ReadByte() : 0);

            // sanitize values
            Serial = (int)(Serial & 0x7FFFFFFF);
            ItemID = (ushort)(ItemID & 0x7FFF);
            X = (short)(X & 0x7FFF);
            Y = (short)(Y & 0x3FFF);
        }
開發者ID:msx752,項目名稱:UltimaXNA,代碼行數:25,代碼來源:ObjectInfoPacket.cs

示例2: SwingPacket

 public SwingPacket(PacketReader reader)
     : base(0x2F, "Swing")
 {
     m_flag = reader.ReadByte();
     m_attacker = reader.ReadInt32();
     m_defender = reader.ReadInt32();
 }
開發者ID:FreeReign,項目名稱:UltimaXNA,代碼行數:7,代碼來源:SwingPacket.cs

示例3: WeatherPacket

 public WeatherPacket(PacketReader reader)
     : base(0x65, "Set Weather")
 {
     m_weatherType = reader.ReadByte();
     m_effectId = reader.ReadByte();
     m_temperature = reader.ReadByte();
 }
開發者ID:FreeReign,項目名稱:UltimaXNA,代碼行數:7,代碼來源:WeatherPacket.cs

示例4: TimePacket

 public TimePacket(PacketReader reader)
     : base(0x5B, "Time")
 {
     m_hour = reader.ReadByte();
     m_minute = reader.ReadByte();
     m_second = reader.ReadByte();
 }
開發者ID:gautamabudha,項目名稱:UltimaXNA,代碼行數:7,代碼來源:TimePacket.cs

示例5: TargetCursorPacket

 public TargetCursorPacket(PacketReader reader)
     : base(0x6C, "Target Cursor")
 {
     m_commandtype = reader.ReadByte(); // 0x00 = Select Object; 0x01 = Select X, Y, Z
     m_cursorid = reader.ReadInt32();
     m_cursortype = reader.ReadByte(); // 0 - 2 = unknown; 3 = Cancel current targetting RunUO seems to always send 0.
 }
開發者ID:msx752,項目名稱:UltimaXNA,代碼行數:7,代碼來源:TargetCursorPacket.cs

示例6: ContainerContentPacket

        public ContainerContentPacket(PacketReader reader)
            : base(0x3C, "Container ContentPacket")
        {
            int itemCount = reader.ReadUInt16();
            List<ContentItem> items = new List<ContentItem>(itemCount);

            for (int i = 0; i < itemCount; i++)
            {
                Serial serial = reader.ReadInt32();
                int iItemID = reader.ReadUInt16();
                int iUnknown = reader.ReadByte(); // signed, itemID offset. always 0 in RunUO.
                int iAmount = reader.ReadUInt16();
                int iX = reader.ReadInt16();
                int iY = reader.ReadInt16();
                int iGridLocation = 0;
                if (!NextContainerContentsIsPre6017)
                    iGridLocation = reader.ReadByte(); // always 0 in RunUO.
                int iContainerSerial = reader.ReadInt32();
                int iHue = reader.ReadUInt16();

                items.Add(new ContentItem(serial, iItemID, iAmount, iX, iY, iGridLocation, iContainerSerial, iHue));
            }

            m_items = items.ToArray();
            if (NextContainerContentsIsPre6017)
                NextContainerContentsIsPre6017 = false;
        }
開發者ID:gautamabudha,項目名稱:UltimaXNA,代碼行數:27,代碼來源:ContainerContentPacket.cs

示例7: CustomHousePacket

        public CustomHousePacket(PacketReader reader)
            : base(0xD8, "Custom House Packet")
        {
            byte CompressionType = reader.ReadByte();
            if (CompressionType != 3)
            {
                m_houseSerial = Serial.Null;
                return;
            }
            reader.ReadByte(); // unknown, always 0?
            m_houseSerial = reader.ReadInt32();
            m_revisionHash = reader.ReadInt32();

            // this is for compression type 3 only
            int bufferLength = reader.ReadInt16();
            int trueBufferLength = reader.ReadInt16();
            m_numPlanes = reader.ReadByte();
            // end compression type 3

            m_planes = new CustomHousePlane[m_numPlanes];
            for (int i = 0; i < m_numPlanes; i++)
            {
                m_planes[i] = new CustomHousePlane(reader);
            }
        }
開發者ID:FreeReign,項目名稱:UltimaXNA,代碼行數:25,代碼來源:CustomHousePacket.cs

示例8: ContainerContentPacket

        public ContainerContentPacket(PacketReader reader)
            : base(0x3C, "Container ContentPacket")
        {
            int itemCount = reader.ReadUInt16();
            List<ItemInContainer> items = new List<ItemInContainer>(itemCount);

            bool PacketIsPre6017 = (reader.Buffer.Length == 5 + (19 * itemCount));

            for (int i = 0; i < itemCount; i++)
            {
                Serial serial = reader.ReadInt32();
                int iItemID = reader.ReadUInt16();
                int iUnknown = reader.ReadByte(); // signed, itemID offset. always 0 in RunUO.
                int iAmount = reader.ReadUInt16();
                int iX = reader.ReadInt16();
                int iY = reader.ReadInt16();
                int iGridLocation = 0;
                if (!PacketIsPre6017)
                    iGridLocation = reader.ReadByte(); // always 0 in RunUO.
                int iContainerSerial = reader.ReadInt32();
                int iHue = reader.ReadUInt16();

                items.Add(new ItemInContainer(serial, iItemID, iAmount, iX, iY, iGridLocation, iContainerSerial, iHue));
            }

            m_items = items.ToArray();
        }
開發者ID:msx752,項目名稱:UltimaXNA,代碼行數:27,代碼來源:ContainerContentPacket.cs

示例9: ExtendedStatsInfo

 public ExtendedStatsInfo(PacketReader reader)
 {
     int clientFlag = reader.ReadByte(); // (0x2 for 2D client, 0x5 for KR client)
     Serial = reader.ReadInt32();
     byte unknown0 = reader.ReadByte(); // (always 0)
     byte lockFlags = reader.ReadByte();
     // Lock flags = bitflags 00SSDDII
     //     00 = up
     //     01 = down
     //     10 = locked
     // FF = update mobile status animation ( KR only )
     if (lockFlags != 0xFF) {
         int strengthLock = (lockFlags >> 4) & 0x03;
         int dexterityLock = (lockFlags >> 2) & 0x03;
         int inteligenceLock = (lockFlags) & 0x03;
         Locks = new StatLocks(strengthLock, dexterityLock, inteligenceLock);
     }
     if (clientFlag == 5) {
         Tracer.Warn("ClientFlags == 5 in GeneralInfoPacket ExtendedStats 0x19. This is not a KR client.");
         // If(Lock flags = 0xFF) //Update mobile status animation
         //  BYTE[1] Status // Unveryfied if lock flags == FF the locks will be handled here
         //  BYTE[1] unknown (0x00)
         //  BYTE[1] Animation
         //  BYTE[1] unknown (0x00)
         //  BYTE[1] Frame
         // else
         //  BYTE[1] unknown (0x00)
         //  BYTE[4] unknown (0x00000000)
         // endif
     }
 }
開發者ID:jorsi,項目名稱:UltimaXNA,代碼行數:31,代碼來源:ExtendedStatsInfo.cs

示例10: ServerListEntry

 public ServerListEntry(PacketReader reader)
 {
     Index = (ushort)reader.ReadInt16();
     Name = reader.ReadString(32);
     PercentFull = reader.ReadByte();
     Timezone = reader.ReadByte();
     Address = (uint)reader.ReadInt32();
 }
開發者ID:jorsi,項目名稱:UltimaXNA,代碼行數:8,代碼來源:ServerListEntry.cs

示例11: ServerListEntry

 public ServerListEntry(PacketReader reader)
 {
     index = (ushort)reader.ReadInt16();
     name = reader.ReadString(30);
     percentFull = reader.ReadByte();
     timezone = reader.ReadByte();
     address = (uint)reader.ReadInt32();
 }
開發者ID:gautamabudha,項目名稱:UltimaXNA,代碼行數:8,代碼來源:ServerListEntry.cs

示例12: WarModePacket

        public WarModePacket(PacketReader reader)
            : base(0x72, "Request War Mode")
        {
            m_warmode = reader.ReadByte();

            reader.ReadByte(); // always 0x00
            reader.ReadByte(); // always 0x32
            reader.ReadByte(); // always 0x00
        }
開發者ID:msx752,項目名稱:UltimaXNA,代碼行數:9,代碼來源:WarModePacket.cs

示例13: MovementRejectPacket

 public MovementRejectPacket(PacketReader reader)
     : base(0x21, "Move Request Rejected")
 {
     m_sequence = reader.ReadByte(); // (matches sent sequence)
     m_x = reader.ReadInt16();
     m_y = reader.ReadInt16();
     m_direction = reader.ReadByte();
     m_z = reader.ReadSByte();
 }
開發者ID:FreeReign,項目名稱:UltimaXNA,代碼行數:9,代碼來源:MovementRejectPacket.cs

示例14: WornItemPacket

 public WornItemPacket(PacketReader reader)
     : base(0x2E, "Worn Item")
 {
     m_serial = reader.ReadInt32();
     m_itemId = reader.ReadInt16();
     reader.ReadByte();
     m_layer = reader.ReadByte();
     m_parentSerial = reader.ReadInt32();
     m_hue = reader.ReadInt16();
 }
開發者ID:FreeReign,項目名稱:UltimaXNA,代碼行數:10,代碼來源:WornItemPacket.cs

示例15: MobileAnimationPacket

 public MobileAnimationPacket(PacketReader reader)
     : base(0x6E, "Mobile Animation")
 {
     m_serial = reader.ReadInt32();
     m_action = reader.ReadInt16();
     m_framecount = reader.ReadInt16();
     m_repeatcount = reader.ReadInt16();
     m_reverse = reader.ReadByte(); // 0x00=forward, 0x01=backwards
     m_repeat = reader.ReadByte(); // 0 - Don't repeat / 1 repeat
     m_delay = reader.ReadByte();
 }
開發者ID:msx752,項目名稱:UltimaXNA,代碼行數:11,代碼來源:MobileAnimationPacket.cs


注:本文中的UltimaXNA.Core.Network.PacketReader.ReadByte方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。