コード例 #1
0
        private static List <HitData> BaseReadInfo(ReceivePacket p, bool OnlyBytes, bool genLog)
        {
            List <HitData> hits      = new List <HitData>();
            int            objsCount = p.readC();

            for (int ob = 0; ob < objsCount; ob++)
            {
                HitData hit = new HitData
                {
                    _hitInfo    = p.readUD(),
                    _boomInfo   = p.readUH(),
                    _weaponInfo = p.readUH(),
                    _weaponSlot = p.readC(), //EQMIPEMENT_SLOT
                    StartBullet = p.readTVector(),
                    EndBullet   = p.readTVector()
                };
                if (!OnlyBytes)
                {
                    hit.HitEnum = (HitType)AllUtils.getHitHelmet(hit._hitInfo);
                    if (hit._boomInfo > 0)
                    {
                        hit.BoomPlayers = new List <int>();
                        for (int s = 0; s < 16; s++)
                        {
                            int flag = (1 << s);
                            if ((hit._boomInfo & flag) == flag)
                            {
                                hit.BoomPlayers.Add(s);
                            }
                        }
                    }
                    hit.WeaponClass = (ClassType)(hit._weaponInfo & 63);
                    hit.WeaponId    = (hit._weaponInfo >> 6);
                }
                if (genLog)
                {
                    //Logger.warning("StartBulletAxis: " + hit._startBulletX + ";" + hit._startBulletY + ";" + hit._startBulletZ);
                    //Logger.warning("EndBulletAxis: " + hit._endBulletX + ";" + hit._endBulletY + ";" + hit._endBulletZ);
                }
                hits.Add(hit);
            }
            return(hits);
        }
コード例 #2
0
        private static List <a8000_NormalHitData.HitData> BaseReadInfo(ReceivePacket p, bool OnlyBytes, bool genLog)
        {
            List <a8000_NormalHitData.HitData> hitDataList = new List <a8000_NormalHitData.HitData>();
            int num1 = (int)p.readC();

            for (int index1 = 0; index1 < num1; ++index1)
            {
                a8000_NormalHitData.HitData hitData = new a8000_NormalHitData.HitData()
                {
                    _hitInfo    = p.readUD(),
                    _boomInfo   = p.readUH(),
                    _weaponInfo = p.readUH(),
                    _weaponSlot = p.readC(),
                    StartBullet = p.readTVector(),
                    EndBullet   = p.readTVector()
                };
                if (!OnlyBytes)
                {
                    hitData.HitEnum = (HitType)AllUtils.getHitHelmet(hitData._hitInfo);
                    if (hitData._boomInfo > (ushort)0)
                    {
                        hitData.BoomPlayers = new List <int>();
                        for (int index2 = 0; index2 < 16; ++index2)
                        {
                            int num2 = 1 << index2;
                            if (((int)hitData._boomInfo & num2) == num2)
                            {
                                hitData.BoomPlayers.Add(index2);
                            }
                        }
                    }
                    hitData.WeaponClass = (ClassType)((int)hitData._weaponInfo & 63);
                    hitData.WeaponId    = (int)hitData._weaponInfo >> 6;
                }
                if (!genLog)
                {
                    ;
                }
                hitDataList.Add(hitData);
            }
            return(hitDataList);
        }