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


C# BitReader.ReadByteArray方法代码示例

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


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

示例1: UpdateItemStats

 // Methods
 public UpdateItemStats(byte[] data)
     : base(data)
 {
     this.stats = new List<StatBase>();
     this.unknown61b = -1;
     this.unknown78b = -1;
     BitReader reader = new BitReader(data, 1);
     this.unknown8b = reader.ReadInt32(10);
     this.uid = reader.ReadUInt32();
     while (reader.ReadBoolean(1))
     {
         BaseStat stat = BaseStat.Get(reader.ReadInt32(9));
         this.unknown60b = reader.ReadInt32(1);
         if (stat.Type == StatType.ChargedSkill)
         {
             this.unknown61b = reader.ReadInt32(1);
             int charges = reader.ReadInt32(8);
             int maxCharges = reader.ReadInt32(8);
             this.unknown78b = reader.ReadInt32(1);
             int level = reader.ReadInt32(6);
             int skill = reader.ReadInt32(10);
             this.stats.Add(new ChargedSkillStat(stat, level, skill, charges, maxCharges));
         }
         else
         {
             if (stat.Signed)
             {
                 this.stats.Add(new SignedStat(stat, reader.ReadInt32(stat.SendBits)));
                 continue;
             }
             this.stats.Add(new UnsignedStat(stat, reader.ReadUInt32(stat.SendBits)));
         }
     }
     this.offset = reader.Position;
     this.unknownEnd = reader.ReadByteArray();
 }
开发者ID:killerbonzai,项目名称:BlueVex2,代码行数:37,代码来源:GameServerPackets.cs

示例2: PlayerLifeManaChange

 // Methods
 public PlayerLifeManaChange(byte[] data)
     : base(data)
 {
     BitReader reader = new BitReader(data, 1);
     this.life = reader.ReadInt32(15);
     this.mana = reader.ReadInt32(15);
     this.stamina = reader.ReadInt32(15);
     this.x = reader.ReadInt32(0x10);
     this.y = reader.ReadInt32(0x10);
     this.unknown85b = reader.ReadByteArray();
 }
开发者ID:killerbonzai,项目名称:BlueVex2,代码行数:12,代码来源:GameServerPackets.cs

示例3: SetState

 // Methods
 public SetState(byte[] data)
     : base(data)
 {
     int num;
     this.unitType = (UnitType) data[1];
     this.uid = BitConverter.ToUInt32(data, 2);
     this.state = BaseState.Get(data[7]);
     this.stats = new List<StatBase>();
     BitReader reader = new BitReader(data, 8);
     Label_003E:
     num = reader.ReadInt32(9);
     if (num != 0x1ff)
     {
         BaseStat stat = BaseStat.Get(num);
         int val = reader.ReadInt32(stat.SendBits);
         if (stat.SendParamBits > 0)
         {
             int param = reader.ReadInt32(stat.SendParamBits);
             if (stat.Signed)
             {
                 this.stats.Add(new SignedStatParam(stat, val, param));
             }
             else
             {
                 this.stats.Add(new UnsignedStatParam(stat, (uint) val, (uint) param));
             }
         }
         else if (stat.Signed)
         {
             this.stats.Add(new SignedStat(stat, val));
         }
         else
         {
             this.stats.Add(new UnsignedStat(stat, (uint) val));
         }
         goto Label_003E;
     }
     this.unknownEnd = reader.ReadByteArray();
 }
开发者ID:killerbonzai,项目名称:BlueVex2,代码行数:40,代码来源:GameServerPackets.cs

示例4: AddUnit

 // Methods
 public AddUnit(byte[] data)
     : base(data)
 {
     int num;
     int num2;
     this.unitType = (UnitType) data[1];
     this.uid = BitConverter.ToUInt32(data, 2);
     this.states = new List<NPCState>();
     BitReader reader = new BitReader(data, 7);
     Label_0030:
     num = reader.ReadInt32(8);
     if (num == 0xff)
     {
         this.offset = reader.Position;
         this.unknownEnd = reader.ReadByteArray();
         return;
     }
     if (!reader.ReadBoolean(1))
     {
         this.states.Add(new NPCState(BaseState.Get(num)));
         goto Label_0030;
     }
     List<StatBase> stats = new List<StatBase>();
     Label_0056:
     num2 = reader.ReadInt32(9);
     if (num2 != 0x1ff)
     {
         BaseStat stat = BaseStat.Get(num2);
         int val = reader.ReadInt32(stat.SendBits);
         if (stat.SendParamBits > 0)
         {
             int param = reader.ReadInt32(stat.SendParamBits);
             if (stat.Signed)
             {
                 stats.Add(new SignedStatParam(stat, val, param));
             }
             else
             {
                 stats.Add(new UnsignedStatParam(stat, (uint) val, (uint) param));
             }
         }
         else if (stat.Signed)
         {
             stats.Add(new SignedStat(stat, val));
         }
         else
         {
             stats.Add(new UnsignedStat(stat, (uint) val));
         }
         goto Label_0056;
     }
     this.states.Add(new NPCState(BaseState.Get(num), stats));
     goto Label_0030;
 }
开发者ID:killerbonzai,项目名称:BlueVex2,代码行数:55,代码来源:GameServerPackets.cs


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