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


C# GenericReader.ReadByte方法代碼示例

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


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

示例1: VirtueInfo

        public VirtueInfo( GenericReader reader )
        {
            int version = reader.ReadByte();

            switch ( version )
            {
                case 1:	//Changed the values throughout the virtue system
                case 0:
                {
                    int mask = reader.ReadByte();

                    if ( mask != 0 )
                    {
                        m_Values = new int[8];

                        for ( int i = 0; i < 8; ++i )
                            if ( (mask & (1 << i)) != 0 )
                                m_Values[i] = reader.ReadInt();
                    }

                    break;
                }
            }

            if( version == 0 )
            {
                Compassion *= 200;
                Sacrifice *= 250;	//Even though 40 (the max) only gives 10k, It's because it was formerly too easy

                //No direct conversion factor for Justice, this is just an approximation
                Justice *= 500;

                //All the other virtues haven't been defined at 'version 0' point in time in the scripts.
            }
        }
開發者ID:Godkong,項目名稱:Origins,代碼行數:35,代碼來源:VirtueInfo.cs

示例2: Deserialize

		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadByte();

			if ( version == 0 )
			{
				Timer.DelayCall( TimeSpan.Zero, delegate()
				{
					for ( int i = 0; i < Components.Count; ++i )
					{
						AddonComponent ac = Components[i] as AddonComponent;

						if ( ac != null && ac.Hue == 2118 )
							ac.Hue = 1161;
					}
				} );
			}

			if ( version <= 1 )
			{
				Timer.DelayCall( TimeSpan.Zero, delegate()
				{
					for ( int i = 0; i < Components.Count; ++i )
					{
						AddonComponent ac = Components[i] as AddonComponent;

						if ( ac != null )
							ac.Name = "jack-o-lantern";
					}
				} );
			}
		}
開發者ID:jackuoll,項目名稱:Pre-AOS-RunUO,代碼行數:34,代碼來源:JackOLantern.cs

示例3: VirtueInfo

        public VirtueInfo( GenericReader reader )
        {
            int version = reader.ReadByte();

            switch ( version )
            {
                case 1:	// Changed the values throughout the virtue system
                case 0:
                    {
                        int mask = reader.ReadByte();

                        if ( mask != 0 )
                        {
                            m_Values = new int[8];

                            for ( int i = 0; i < 8; ++i )
                                if ( ( mask & ( 1 << i ) ) != 0 )
                                    m_Values[i] = reader.ReadInt();
                        }

                        break;
                    }
            }

            if ( version == 0 )
            {
                Compassion *= 200;
                Sacrifice *= 250;
                Justice *= 500;
                Honor *= 500;
                Valor *= 400;
            }
        }
開發者ID:Ravenwolfe,項目名稱:xrunuo,代碼行數:33,代碼來源:VirtueInfo.cs

示例4: DeathEntry

        public DeathEntry( GenericReader reader )
        {
            int version = reader.ReadByte();

            m_Name = reader.ReadString();
            m_Deaths = reader.ReadInt();
        }
開發者ID:kamronbatman,項目名稱:Defiance-AOS-Pre-2012,代碼行數:7,代碼來源:KillBook.cs

示例5: Deserialize

		public override void Deserialize(GenericReader reader)
		{
			base.Deserialize(reader);

			reader.GetVersion();

			AccessPrefixes = new WorldChatAccessPrefixOptions(reader);

			ChatPrefix = reader.ReadChar();
			HistoryBuffer = reader.ReadByte();
		}
開發者ID:greeduomacro,項目名稱:RuneUO,代碼行數:11,代碼來源:SystemOpts.cs

示例6: Deserialize

        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );

            int version = reader.ReadByte();

            if ( ItemID == 4678 || ItemID == 4679 )
                ItemID = 4656;
            else if ( ItemID == 4712 || ItemID == 4713 )
                ItemID = 4702;
        }
開發者ID:Godkong,項目名稱:Origins,代碼行數:11,代碼來源:Guillotine.cs

示例7: Lookup

		public ClilocInfo Lookup(GenericReader bin)
		{
			bin.Seek(Offset, SeekOrigin.Begin);
			var data = new byte[Length];

			for (long i = 0; i < data.Length; i++)
			{
				data[i] = bin.ReadByte();
			}

			return Info = new ClilocInfo(Language, Index, Encoding.UTF8.GetString(data));
		}
開發者ID:Ravenwolfe,項目名稱:Core,代碼行數:12,代碼來源:Data.cs

示例8: Deserialize

        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );
            int version = reader.ReadInt();

            m_Code = reader.ReadByte();
            m_Controller = reader.ReadItem() as PrimevalLichPuzzle;

            // remove if no controller exists or is deleted
            if ( null == m_Controller || m_Controller.Deleted )
                Delete();
        }
開發者ID:suiy187,項目名稱:runuocustom,代碼行數:12,代碼來源:PrimevalLichPuzzle.cs

示例9: VirtueInfo

        public VirtueInfo( GenericReader reader )
        {
            int version = reader.ReadByte();

            switch ( version )
            {
                case 0:
                {
                    int mask = reader.ReadByte();

                    if ( mask != 0 )
                    {
                        m_Values = new int[8];

                        for ( int i = 0; i < 8; ++i )
                            if ( (mask & (1 << i)) != 0 )
                                m_Values[i] = reader.ReadInt();
                    }

                    break;
                }
            }
        }
開發者ID:BackupTheBerlios,項目名稱:sunuo-svn,代碼行數:23,代碼來源:VirtueInfo.cs

示例10: Deserialize

		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();

			int dictcount = reader.ReadInt();

			for ( int i = 0; i < dictcount; i++ )
			{
				IMailMessage message = NewMailMessage( reader.ReadByte(), reader.ReadInt() );
				message.Deserialize( reader );
			}
		}
開發者ID:greeduomacro,項目名稱:UO-Forever,代碼行數:14,代碼來源:MailboxPersistence.cs

示例11: Deserialize

        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );

            int version = reader.ReadByte();

            switch ( version )
            {
                case 0:
                {
                    m_LabelNumber = reader.ReadEncodedInt();
                    break;
                }
            }
        }
開發者ID:FreeReign,項目名稱:Rebirth-Repack,代碼行數:15,代碼來源:Static.cs

示例12: ReadEncodedLong

		public static ulong ReadEncodedLong( GenericReader reader )
		{
			ulong v = 0;
			int shift = 0;
			byte b;

			do
			{
				b = reader.ReadByte();
				v |= (b & 0x7Ful) << shift;
				shift += 7;
			} while( b >= 0x80 );

			return v;
		}
開發者ID:kamronbatman,項目名稱:DefianceUO-Pre1.10,代碼行數:15,代碼來源:Serialization.cs

示例13: Object

		public static object Object( GenericReader reader )
		{	
			if ( reader == null )
				return null;
					
			byte type = reader.ReadByte();
			
			switch ( type )
			{
				case 0x0: return null; // invalid
				case 0x1: return reader.ReadInt();
				case 0x2: return reader.ReadString();
				case 0x3: return reader.ReadItem();
				case 0x4: return reader.ReadMobile();
			}
			
			return null;
		}
開發者ID:romeov007,項目名稱:imagine-uo,代碼行數:18,代碼來源:QuestReader.cs

示例14: Deserialize

		public static Poison Deserialize( GenericReader reader )
		{
			switch ( reader.ReadByte() )
			{
				case 1: return GetPoison( reader.ReadByte() );
				case 2:
					//no longer used, safe to remove?
					reader.ReadInt();
					reader.ReadDouble();
					reader.ReadInt();
					reader.ReadTimeSpan();
					break;
			}
			return null;
		}
開發者ID:greeduomacro,項目名稱:UO-Forever,代碼行數:15,代碼來源:Poison.cs

示例15: Deserialize

        public virtual void Deserialize( GenericReader reader )
        {
            int version = reader.ReadInt();

            SetLastMoved();

            switch ( version )
            {
                case 7:
                case 6:
                {
                    SaveFlag flags = (SaveFlag)reader.ReadInt();

                    if ( version < 7 )
                    {
                        LastMoved = reader.ReadDeltaTime();
                    }
                    else
                    {
                        int minutes = reader.ReadEncodedInt();

                        try{ LastMoved = Core.Now - TimeSpan.FromMinutes( minutes ); }
                        catch{ LastMoved = Core.Now; }
                    }

                    if ( GetSaveFlag( flags, SaveFlag.Direction ) )
                        m_Direction = (Direction)reader.ReadByte();

                    if ( GetSaveFlag( flags, SaveFlag.Bounce ) )
                        m_Bounce = BounceInfo.Deserialize( reader );

                    if ( GetSaveFlag( flags, SaveFlag.LootType ) )
                        m_LootType = (LootType)reader.ReadByte();

                    int x = 0, y = 0, z = 0;

                    if ( GetSaveFlag( flags, SaveFlag.LocationFull ) )
                    {
                        x = reader.ReadEncodedInt();
                        y = reader.ReadEncodedInt();
                        z = reader.ReadEncodedInt();
                    }
                    else
                    {
                        if ( GetSaveFlag( flags, SaveFlag.LocationByteXY ) )
                        {
                            x = reader.ReadByte();
                            y = reader.ReadByte();
                        }
                        else if ( GetSaveFlag( flags, SaveFlag.LocationShortXY ) )
                        {
                            x = reader.ReadShort();
                            y = reader.ReadShort();
                        }

                        if ( GetSaveFlag( flags, SaveFlag.LocationSByteZ ) )
                            z = reader.ReadSByte();
                    }

                    m_Location = new Point3D( x, y, z );

                    if ( GetSaveFlag( flags, SaveFlag.ItemID ) )
                        m_ItemID = reader.ReadEncodedInt();

                    if ( GetSaveFlag( flags, SaveFlag.Hue ) )
                        m_Hue = reader.ReadEncodedInt();

                    if ( GetSaveFlag( flags, SaveFlag.Amount ) )
                        m_Amount = reader.ReadEncodedInt();
                    else
                        m_Amount = 1;

                    if ( GetSaveFlag( flags, SaveFlag.Layer ) )
                        m_Layer = (Layer)reader.ReadByte();

                    if ( GetSaveFlag( flags, SaveFlag.Name ) )
                        m_Name = string.Intern(reader.ReadString());

                    if ( GetSaveFlag( flags, SaveFlag.Parent ) )
                    {
                        Serial parent = reader.ReadInt();

                        if ( parent.IsMobile )
                            m_Parent = World.FindMobile( parent );
                        else if ( parent.IsItem )
                            m_Parent = World.FindItem( parent );
                        else
                            m_Parent = null;

                        if ( m_Parent == null && (parent.IsMobile || parent.IsItem) )
                            Delete();
                    }

                    if ( GetSaveFlag( flags, SaveFlag.Items ) )
                        m_Items = reader.ReadItemList();
                    //else
                    //	m_Items = new ArrayList( 1 );

                    if ( GetSaveFlag( flags, SaveFlag.IntWeight ) )
                        m_Weight = reader.ReadEncodedInt();
//.........這裏部分代碼省略.........
開發者ID:BackupTheBerlios,項目名稱:sunuo-svn,代碼行數:101,代碼來源:Item.cs


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