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


C# NetState.SupportsExpansion方法代码示例

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


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

示例1: MobileStatus

        public MobileStatus(Mobile beholder, Mobile beheld, NetState ns)
            : base(0x11)
        {
            string name = beheld.Name;
            if (name == null)
            {
                name = "";
            }

            int type;

            // bool isEnhancedClient = beholder.NetState != null && beholder.NetState.Version.IsEnhanced;

            if (beholder != beheld)
            {
                type = 0;
                EnsureCapacity(43);
            }
            //else if (isEnhancedClient)
            //{
            //type = 7;
            //EnsureCapacity(149);
            //}
            else if (Core.HS && ns != null && ns.ExtendedStatus)
            {
                type = 6;
                EnsureCapacity(121);
            }
            else if (Core.ML && ns != null && ns.SupportsExpansion(Expansion.ML))
            {
                type = 5;
                EnsureCapacity(91);
            }
            else
            {
                type = Core.AOS ? 4 : 3;
                EnsureCapacity(88);
            }

            m_Stream.Write(beheld.Serial);

            m_Stream.WriteAsciiFixed(name, 30);

            if (beholder == beheld)
            {
                WriteAttr(beheld.Hits, beheld.HitsMax);
            }
            else
            {
                WriteAttrNorm(beheld.Hits, beheld.HitsMax);
            }

            m_Stream.Write(beheld.CanBeRenamedBy(beholder));

            m_Stream.Write((byte)type);

            if (type > 0)
            {
                m_Stream.Write(beheld.Female);

                m_Stream.Write((short)beheld.Str);
                m_Stream.Write((short)beheld.Dex);
                m_Stream.Write((short)beheld.Int);

                WriteAttr(beheld.Stam, beheld.StamMax);
                WriteAttr(beheld.Mana, beheld.ManaMax);

                m_Stream.Write(beheld.TotalGold);
                m_Stream.Write((short)(Core.AOS ? beheld.PhysicalResistance : (int)(beheld.ArmorRating + 0.5)));
                m_Stream.Write((short)(Mobile.BodyWeight + beheld.TotalWeight));

                if (type >= 5)
                {
                    m_Stream.Write((short)beheld.MaxWeight);
                    m_Stream.Write((byte)(beheld.Race.RaceID + 1)); // Would be 0x00 if it's a non-ML enabled account but...
                }

                m_Stream.Write((short)beheld.StatCap);

                m_Stream.Write((byte)beheld.Followers);
                m_Stream.Write((byte)beheld.FollowersMax);

                if (type >= 4)
                {
                    m_Stream.Write((short)beheld.FireResistance); // Fire
                    m_Stream.Write((short)beheld.ColdResistance); // Cold
                    m_Stream.Write((short)beheld.PoisonResistance); // Poison
                    m_Stream.Write((short)beheld.EnergyResistance); // Energy
                    m_Stream.Write((short)beheld.Luck); // Luck

                    IWeapon weapon = beheld.Weapon;

                    int min = 0, max = 0;

                    if (weapon != null)
                    {
                        weapon.GetStatusDamage(beheld, out min, out max);
                    }

                    m_Stream.Write((short)min); // Damage min
//.........这里部分代码省略.........
开发者ID:Ziden,项目名称:ServUO-EC-Test-Fork,代码行数:101,代码来源:Packets.cs

示例2: MobileStatusExtended

        public MobileStatusExtended(Mobile m, NetState ns)
            : base(0x11)
        {
            string name = m.Name;
            if (name == null)
            {
                name = "";
            }

            int type;

            if (Core.HS && ns != null && ns.ExtendedStatus)
            {
                type = 6;
                EnsureCapacity(121);
            }
            else if (Core.ML && ns != null && ns.SupportsExpansion(Expansion.ML))
            {
                type = 5;
                EnsureCapacity(91);
            }
            else
            {
                type = Core.AOS ? 4 : 3;
                EnsureCapacity(88);
            }

            m_Stream.Write(m.Serial);
            m_Stream.WriteAsciiFixed(name, 30);

            m_Stream.Write((short)m.Hits);
            m_Stream.Write((short)m.HitsMax);

            m_Stream.Write(m.CanBeRenamedBy(m));

            m_Stream.Write((byte)type);

            m_Stream.Write(m.Female);

            m_Stream.Write((short)m.Str);
            m_Stream.Write((short)m.Dex);
            m_Stream.Write((short)m.Int);

            m_Stream.Write((short)m.Stam);
            m_Stream.Write((short)m.StamMax);

            m_Stream.Write((short)m.Mana);
            m_Stream.Write((short)m.ManaMax);

            m_Stream.Write(m.TotalGold);
            m_Stream.Write((short)(Core.AOS ? m.PhysicalResistance : (int)(m.ArmorRating + 0.5)));
            m_Stream.Write((short)(Mobile.BodyWeight + m.TotalWeight));

            if (type >= 5)
            {
                m_Stream.Write((short)m.MaxWeight);
                m_Stream.Write((byte)(m.Race.RaceID + 1)); // Would be 0x00 if it's a non-ML enabled account but...
            }

            m_Stream.Write((short)m.StatCap);

            m_Stream.Write((byte)m.Followers);
            m_Stream.Write((byte)m.FollowersMax);

            if (type >= 4)
            {
                m_Stream.Write((short)m.FireResistance); // Fire
                m_Stream.Write((short)m.ColdResistance); // Cold
                m_Stream.Write((short)m.PoisonResistance); // Poison
                m_Stream.Write((short)m.EnergyResistance); // Energy
                m_Stream.Write((short)m.Luck); // Luck

                IWeapon weapon = m.Weapon;

                int min = 0, max = 0;

                if (weapon != null)
                {
                    weapon.GetStatusDamage(m, out min, out max);
                }

                m_Stream.Write((short)min); // Damage min
                m_Stream.Write((short)max); // Damage max

                m_Stream.Write(m.TithingPoints);
            }

            if (type >= 6)
            {
                for (int i = 0; i < 15; ++i)
                {
                    m_Stream.Write((short)m.GetAOSStatus(i));
                }
            }
        }
开发者ID:Ziden,项目名称:ServUO-EC-Test-Fork,代码行数:95,代码来源:Packets.cs

示例3: MobileStatus

        public MobileStatus( Mobile beholder, Mobile beheld, NetState ns )
            : base(0x11)
        {
            string name = beheld.Name;
            if ( name == null ) name = "";

            int type;

            if ( beholder != beheld )
            {
                type = 0;
                EnsureCapacity( 43 );
            }
            else if ( Core.HS && ns != null && ns.ExtendedStatus )
            {
                type = 6;
                EnsureCapacity( 121 );
            }
            else if ( Core.ML && ns != null && ns.SupportsExpansion( Expansion.ML ) )
            {
                type = 5;
                EnsureCapacity( 91 );
            }
            else
            {
                type = Core.AOS ? 4 : 3;
                EnsureCapacity( 88 );
            }

            m_Stream.Write( beheld.Serial );

            m_Stream.WriteAsciiFixed( name, 30 );

            if ( beholder == beheld )
                WriteAttr( beheld.Hits, beheld.HitsMax );
            else
                WriteAttrNorm( beheld.Hits, beheld.HitsMax );

            m_Stream.Write( beheld.CanBeRenamedBy( beholder ) );

            m_Stream.Write( (byte) type );

            if ( type > 0 )
            {
                m_Stream.Write( beheld.Female );

                m_Stream.Write( (short) beheld.Str );
                m_Stream.Write( (short) beheld.Dex );
                m_Stream.Write( (short) beheld.Int );

                WriteAttr( beheld.Stam, beheld.StamMax );
                WriteAttr( beheld.Mana, beheld.ManaMax );

                m_Stream.Write( (int) beheld.TotalGold );
                m_Stream.Write( (short) (Core.AOS ? beheld.PhysicalResistance : (int)(beheld.ArmorRating + 0.5)) );
                m_Stream.Write( (short) (Mobile.BodyWeight + beheld.TotalWeight) );

                if ( type >= 5 )
                {
                    m_Stream.Write( (short)beheld.MaxWeight );
                    m_Stream.Write( (byte)(beheld.Race.RaceID + 1) );	// Would be 0x00 if it's a non-ML enabled account but...
                }

                m_Stream.Write( (short) beheld.StatCap );

                m_Stream.Write( (byte) beheld.Followers );
                m_Stream.Write( (byte) beheld.FollowersMax );

                if ( type >= 4 )
                {
                    m_Stream.Write( (short) beheld.FireResistance ); // Fire
                    m_Stream.Write( (short) beheld.ColdResistance ); // Cold
                    m_Stream.Write( (short) beheld.PoisonResistance ); // Poison
                    m_Stream.Write( (short) beheld.EnergyResistance ); // Energy
                    m_Stream.Write( (short) beheld.Luck ); // Luck

                    IWeapon weapon = beheld.Weapon;

                    int min = 0, max = 0;

                    if ( weapon != null )
                        weapon.GetStatusDamage( beheld, out min, out max );

                    m_Stream.Write( (short) min ); // Damage min
                    m_Stream.Write( (short) max ); // Damage max

                    m_Stream.Write( (int) beheld.TithingPoints );
                }

                if ( type >= 6 )
                {
                    for ( int i = 0; i < 15; ++i )
                        m_Stream.Write( (short) beheld.GetAOSStatus( i ) );
                }
            }
        }
开发者ID:3HMonkey,项目名称:runuo-ec,代码行数:96,代码来源:Packets.cs


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