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


C# ByteBuffer.ReadInt32方法代码示例

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


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

示例1: Update

        public void Update(ByteBuffer buff)
        {
            uint data = buff.ReadByte();

            switch (data)
            {
                case 0x01://level
                    Level = buff.ReadUInt32();
                    break;
                case 0x02://exp
                    XP = buff.ReadUInt64();
                    break;
                case 0x03://str
                    buff.ReadUInt32();
                    break;
                case 0x04://dex
                    buff.ReadUInt32();
                    break;
                case 0x05://con
                    buff.ReadUInt32();
                    break;
                case 0x06://int
                    buff.ReadUInt32();
                    break;
                case 0x07://wit
                    buff.ReadUInt32();
                    break;
                case 0x08://men
                    buff.ReadUInt32();
                    break;
                case 0x09://cur hp
                    Cur_HP = buff.ReadUInt32();
                    break;
                case 0x0A://max hp
                    Max_HP = buff.ReadUInt32();
                    break;
                case 0x0B://cur mp
                    Cur_MP = buff.ReadUInt32();
                    break;
                case 0x0C://max mp
                    Max_MP = buff.ReadUInt32();
                    break;
                case 0x0D://sp
                    SP = buff.ReadUInt32();
                    break;
                case 0x0E://cur load
                    Cur_Load = buff.ReadUInt32();
                    break;
                case 0x0F://max load
                    Max_Load = buff.ReadUInt32();
                    break;
                case 0x10://..
                    buff.ReadUInt32();
                    break;
                case 0x11://patk
                    Patk = buff.ReadUInt32();
                    break;
                case 0x12://atk spd
                    PatkSpeed = buff.ReadUInt32();
                    break;
                case 0x13://pdef
                    PDef = buff.ReadUInt32();
                    break;
                case 0x14://evasion
                    Evasion = buff.ReadUInt32();
                    break;
                case 0x15://acc
                    Accuracy = buff.ReadUInt32();
                    break;
                case 0x16://crit
                    Focus = buff.ReadUInt32();
                    break;
                case 0x17://m atk
                    Matk = buff.ReadUInt32();
                    break;
                case 0x18://cast spd
                    MatkSpeed = buff.ReadUInt32();
                    break;
                case 0x19://mdef
                    MDef = buff.ReadUInt32();
                    break;
                case 0x1A://pvp flag
                    PvPFlag = buff.ReadUInt32();
                    break;
                case 0x1B://karma
                    Karma = buff.ReadInt32();
                    break;
                case 0x1C://..
                    buff.ReadUInt32();
                    break;
                case 0x1D://..
                    buff.ReadUInt32();
                    break;
                case 0x1E://..
                    buff.ReadUInt32();
                    break;
                case 0x1F://..
                    buff.ReadUInt32();
                    break;
                case 0x20://..
//.........这里部分代码省略.........
开发者ID:stephenZh,项目名称:l2net,代码行数:101,代码来源:Pet_Info.cs

示例2: Load_Pet

        public void Load_Pet(ByteBuffer buff)
        {
            SummonType = buff.ReadUInt32(); //1 = summon, 2 = pet
            ID = buff.ReadUInt32();
            NPCID = buff.ReadUInt32();
            isAttackAble = buff.ReadUInt32();//attackable = 0

            X = buff.ReadUInt32();
            Y = buff.ReadUInt32();
            Z = buff.ReadUInt32();
            Heading = buff.ReadInt32();
            buff.ReadUInt32();//0x00

            MatkSpeed = buff.ReadUInt32();
            PatkSpeed = buff.ReadUInt32();
            RunSpeed = buff.ReadUInt32();
            WalkSpeed = buff.ReadUInt32();
            SwimRunSpeed = buff.ReadUInt32();
            SwimWalkSpeed = buff.ReadUInt32();
            flRunSpeed = buff.ReadUInt32();
            flWalkSpeed = buff.ReadUInt32();
            if (Globals.gamedata.Chron >= Chronicle.CT1)
            {
                FlyRunSpeed = buff.ReadUInt32();
                FlyWalkSpeed = buff.ReadUInt32();
            }

            MoveSpeedMult = System.Convert.ToSingle(buff.ReadDouble());
            AttackSpeedMult = System.Convert.ToSingle(buff.ReadDouble());
            CollisionRadius = System.Convert.ToSingle(buff.ReadDouble());
            CollisionHeight = System.Convert.ToSingle(buff.ReadDouble());

            LWeapon = buff.ReadUInt32();
            Armor = buff.ReadUInt32();
            RWeapon = buff.ReadUInt32();

            HasOwner = buff.ReadByte(); //owneronline
            isRunning = buff.ReadByte();
            isInCombat = buff.ReadByte();
            isAlikeDead = buff.ReadByte();
            isSummoned = buff.ReadByte(); //isSummoned 0=teleported  1=default   2=summoned

            if (Globals.gamedata.Chron >= Chronicle.CT3_0)
            {
                buff.ReadUInt32(); //FF FF FF FF
            }
            Name = buff.ReadString();
            if (string.IsNullOrWhiteSpace(Name))
            {
                Name = Util.GetNPCName(NPCID);//"Unnamed Pet";
            }
            if (Globals.gamedata.Chron >= Chronicle.CT3_0)
            {
                buff.ReadUInt32(); //FF FF FF FF
            }
            Title = buff.ReadString(); //OwnerName
            buff.ReadUInt32();//1

            PvPFlag = buff.ReadUInt32();
            Karma = buff.ReadInt32();

            Cur_Fed = buff.ReadUInt32();
            Max_Fed = buff.ReadUInt32();

            Cur_HP = buff.ReadUInt32();
            Max_HP = buff.ReadUInt32();

            Cur_MP = buff.ReadUInt32();
            Max_MP = buff.ReadUInt32();

            SP = buff.ReadUInt32();
            Level = buff.ReadUInt32();
            XP = buff.ReadUInt64();

            XP_ThisLevel = buff.ReadUInt64();
            XP_NextLevel = buff.ReadUInt64();

            Cur_Load = buff.ReadUInt32();
            Max_Load = buff.ReadUInt32();

            Patk = buff.ReadUInt32();
            PDef = buff.ReadUInt32();
            Accuracy = buff.ReadUInt32();// p
            Evasion = buff.ReadUInt32();//p
            Focus = buff.ReadUInt32();//p
            Matk = buff.ReadUInt32();
            MDef = buff.ReadUInt32();

            buff.ReadUInt32();//m acu
            buff.ReadUInt32();//m eva
            buff.ReadUInt32();//m crit

            buff.ReadUInt32();// speed
            buff.ReadUInt32();//patak sped
            buff.ReadUInt32();// cast

            /*if (Globals.gamedata.Chron < Chronicle.CT3_0)
            {
                AbnormalEffects = buff.ReadUInt32(); //AbnormalEffect bleed=1; poison=2; poison & bleed=3; flame=4;
            }
//.........这里部分代码省略.........
开发者ID:stephenZh,项目名称:l2net,代码行数:101,代码来源:Pet_Info.cs


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