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


C# GamePacket.ReadInteger方法代码示例

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


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

示例1: Game_OnGameProcessPacket

        private static void Game_OnGameProcessPacket(GamePacketEventArgs args)
        {
            var packet = new GamePacket(args.PacketData);
            Camp camp;

            switch (packet.Header)
            {
                case 0xC3:
                    packet.Position = 5;
                    var UnitNetworkId = packet.ReadInteger();
                    var CampId = packet.ReadInteger();
                    var EmptyType = packet.ReadByte();
                    var BuffHash = packet.ReadInteger();
                    var respawnTime = packet.ReadFloat();

                    camp = Camps[CampId];
                    if (camp != null)
                        camp.Kill(respawnTime);

                    break;

                case 0xE9:
                    packet.Position = 21;
                    var campId = packet.ReadByte();

                    camp = Camps[campId];
                    if (camp != null)
                        camp.Spawn();

                    break;
            }
        }
开发者ID:se05010,项目名称:LeagueSharp13,代码行数:32,代码来源:Program.cs

示例2: OnGameProcessPacket

 public static void OnGameProcessPacket(GamePacketEventArgs args)
 {
     try
     {
         if (Config.Item("db_targ").GetValue<KeyBind>().Active)
         {
             LogPacket(args);
         }
         if (Riven.orbwalker.ActiveMode.ToString() == "Combo")
         {
             if (args.PacketData[0] == 101 && Riven.Q.IsReady())
             {
                // LogPacket(args);
                 GamePacket gp = new GamePacket(args.PacketData);
                 gp.Position = 5;
                 int dType = (int)gp.ReadByte();
                 int targetID = gp.ReadInteger();
                 int source = gp.ReadInteger();
                 if (Riven.Player.NetworkId != source)
                     return;
                 Obj_AI_Hero targ = ObjectManager.GetUnitByNetworkId<Obj_AI_Hero>(targetID);
                 if(dType == 12 || dType == 3)
                     Riven.Q.Cast(targ.Position);
             }
         }
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.ToString());
     }
 }
开发者ID:Merc491,项目名称:GoodGuyJodu,代码行数:31,代码来源:RivenSharp.cs

示例3: Game_OnGameProcessPacket

 static void Game_OnGameProcessPacket(GamePacketEventArgs args)
 {
     if (config.Item("grabem").GetValue<KeyBind>().Active)
     {
         GamePacket g = new GamePacket(args.PacketData);
         if (g.Header == 0xFE)
         {
             if (Packet.MultiPacket.OnAttack.Decoded(args.PacketData).Type == Packet.AttackTypePacket.TargetedAA)
             {
                 g.Position = 1;
                 var k = ObjectManager.GetUnitByNetworkId<Obj_AI_Base>(g.ReadInteger());
                 if (k is Obj_AI_Hero && k.IsEnemy)
                 {
                     if (Vector3.Distance(k.Position, ObjectManager.Player.Position) <= 925)
                     {
                         //Game.PrintChat(k.Name + " auto'd");
                         List<Vector3> v = new List<Vector3> {k.Position};
                         var l = LeagueSharp.Common.Collision.GetCollision(v, p);
                         if (l.Count == 0)
                         {
                             //Game.PrintChat("casting q");
                             ObjectManager.Player.Spellbook.CastSpell(SpellSlot.Q, k.Position);
                         }
                     }
                 }
             }
         }
     }
 }
开发者ID:blm95,项目名称:LeagueSharp2,代码行数:29,代码来源:Program.cs

示例4: Game_OnGameSendPacket

        private static void Game_OnGameSendPacket(GamePacketEventArgs args)
        {
            if (args.PacketData[0] != 0xA8)
                return;

            var p = new GamePacket(args.PacketData) { Position = 5 };
            LastSequence = p.ReadInteger();
        }
开发者ID:se05010,项目名称:LeagueSharp13,代码行数:8,代码来源:Program.cs

示例5: Game_OnGameProcessPacket

        public static void Game_OnGameProcessPacket(GamePacketEventArgs args)
        {
            if (!Config.Item("comboWreset").GetValue<bool>() || args.PacketData[0] != 0x65 || !MasterYi.W.IsReady() ||
                LxOrbwalker.CurrentMode != LxOrbwalker.Mode.Combo)
            {
                return;
            }

            // LogPacket(args);
            var gp = new GamePacket(args.PacketData) {Position = 1};
            var dmg = Packet.S2C.Damage.Decoded(args.PacketData);

            var targetId = gp.ReadInteger();
            int dType = gp.ReadByte();
            int unknown = gp.ReadShort();
            var damageAmount = gp.ReadFloat();
            var targetNetworkIdCopy = gp.ReadInteger();
            var sourceNetworkId = gp.ReadInteger();
            var dmga =
                (float)
                    MasterYi.Player.GetAutoAttackDamage(
                        ObjectManager.GetUnitByNetworkId<Obj_AI_Base>(targetId));
            if (dmga - 10 > damageAmount || dmga + 10 < damageAmount)
            {
                return;
            }

            if (MasterYi.Player.NetworkId != dmg.SourceNetworkId && MasterYi.Player.NetworkId == targetId)
            {
                return;
            }

            var targ = ObjectManager.GetUnitByNetworkId<Obj_AI_Base>(dmg.TargetNetworkId);
            if ((int) dmg.Type != 12 && (int) dmg.Type != 4 && (int) dmg.Type != 3)
            {
                return;
            }

            if (MasterYi.W.IsReady() && LxOrbwalker.InAutoAttackRange(targ))
            {
                MasterYi.W.Cast(targ.Position);
                // LXOrbwalker.ResetAutoAttackTimer();
            }
            // Console.WriteLine("dtyoe: " + dType);
        }
开发者ID:ngothaison,项目名称:HuyNKSDK,代码行数:45,代码来源:MasterSharp.cs

示例6: Game_OnGameProcessPacket

 private static void Game_OnGameProcessPacket(GamePacketEventArgs args)
 {
     if (args.PacketData[0] == 0x71)
     {
         var packet = new GamePacket(args.PacketData) {Position = 1};
         var networkId = packet.ReadInteger();
         WObjectNetworkId = networkId;
     }
 }
开发者ID:Sthephanfelix,项目名称:LeagueSharp-4,代码行数:9,代码来源:OrbManager.cs

示例7: GameOnOnGameProcessPacket

        /// <summary>
        ///     Detects the spells that have missile and are casted from fow.
        /// </summary>
        public static void GameOnOnGameProcessPacket(GamePacketEventArgs args)
        {
            //Gets received when a projectile is created.
            if (args.PacketData[0] == 0x3B)
            {
                var packet = new GamePacket(args.PacketData);

                packet.Position = 1;

                packet.ReadFloat(); //Missile network ID

                var missilePosition = new Vector3(packet.ReadFloat(), packet.ReadFloat(), packet.ReadFloat());
                var unitPosition = new Vector3(packet.ReadFloat(), packet.ReadFloat(), packet.ReadFloat());

                packet.Position = packet.Size() - 119;
                var missileSpeed = packet.ReadFloat();

                packet.Position = 65;
                var endPos = new Vector3(packet.ReadFloat(), packet.ReadFloat(), packet.ReadFloat());

                packet.Position = 112;
                var id = packet.ReadByte();

                packet.Position = packet.Size() - 83;

                var unit = ObjectManager.GetUnitByNetworkId<Obj_AI_Hero>(packet.ReadInteger());
                if ((!unit.IsValid || unit.Team == ObjectManager.Player.Team))
                {
                    return;
                }

                var spellData = SpellDatabase.GetBySpeed(unit.ChampionName, (int)missileSpeed, id);

                if (spellData == null)
                {
                    return;
                }
                if (spellData.SpellName != "Laser")
                {
                    return;
                }
                var castTime = Environment.TickCount - Game.Ping / 2 - spellData.Delay
                               - (int)
                                 (1000 * missilePosition.SwitchYZ().To2D().Distance(unitPosition.SwitchYZ())
                                  / spellData.MissileSpeed);

                //Trigger the skillshot detection callbacks.
                TriggerOnDetectSkillshot(
                    DetectionType.RecvPacket,
                    spellData,
                    castTime,
                    unitPosition.SwitchYZ().To2D(),
                    endPos.SwitchYZ().To2D(),
                    unit);
            }
        }
开发者ID:codekrolik,项目名称:Supper,代码行数:59,代码来源:SkillshotDetector.cs

示例8: Game_OnGameProcessPacket

 static void Game_OnGameProcessPacket(GamePacketEventArgs args)
 {
     if (args.PacketData[0] == 0xFE && Config.Item("AntiCamLock").GetValue<bool>())
     {
         var p = new GamePacket(args.PacketData);
         if (p.ReadInteger(1) == ObjectManager.Player.NetworkId && p.Size() > 9)
         {
             args.Process = false;
         }
     }
 }
开发者ID:GuiltyWolf,项目名称:LeagueSharp,代码行数:11,代码来源:Program.cs

示例9: OnGameProcessPacket

        public static void OnGameProcessPacket(GamePacketEventArgs args)
        {
            try
            {
                if (Talon.orbwalker.ActiveMode.ToString() == "Combo" || Config.Item("harHard").GetValue<KeyBind>().Active)
                {
                    if (args.PacketData[0] == 101 && Talon.Q.IsReady())
                    {
                        Packet.S2C.Damage.Struct dmg = Packet.S2C.Damage.Decoded(args.PacketData);
                        // LogPacket(args);
                        GamePacket gp = new GamePacket(args.PacketData);
                        gp.Position = 1;

                        int targetID = gp.ReadInteger();
                        int dType = (int)gp.ReadByte();
                        int Unknown = gp.ReadShort();
                        float DamageAmount = gp.ReadFloat();
                        int TargetNetworkIdCopy = gp.ReadInteger();
                        int SourceNetworkId = gp.ReadInteger();
                        if (Talon.Player.NetworkId != dmg.SourceNetworkId)
                            return;
                        Obj_AI_Hero targ = ObjectManager.GetUnitByNetworkId<Obj_AI_Hero>(targetID);
                        if (targ != null)
                        {
                            Talon.sumItems.cast(SummonerItems.ItemIds.Ghostblade);
                            Talon.Q.Cast();
                            useQ = true;
                            Orbwalking.ResetAutoAttackTimer();

                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
            }
        }
开发者ID:Merc491,项目名称:GoodGuyJodu,代码行数:38,代码来源:TalonSharp.cs

示例10: Game_OnGameProcessPacket

        private static void Game_OnGameProcessPacket(GamePacketEventArgs args)
        {
            if (args.PacketData[0] == 113)
            {
                var packet = new GamePacket(args.PacketData);
                packet.Position = 1;
                var networkId = packet.ReadInteger();
                var active = packet.ReadByte() == 1;

                if (active)
                    WObjectNetworkId = networkId;
                else
                    WObjectNetworkId = -1;
            }
        }
开发者ID:Chogart,项目名称:LeagueSharp-2,代码行数:15,代码来源:OrbManager.cs

示例11: Game_OnGameProcessPacket

        static void Game_OnGameProcessPacket(GamePacketEventArgs args)
        {
            if (args.PacketData[0] == Packet.S2C.EmptyJungleCamp.Header)
            {
                Packet.S2C.EmptyJungleCamp.Struct camp = Packet.S2C.EmptyJungleCamp.Decoded(args.PacketData);
                Console.WriteLine("disable camp: "+camp.CampId);
                jTimer.disableCamp((byte)camp.CampId);
            }

            if (args.PacketData[0] == 0xE9)
            {
                GamePacket gp = new GamePacket(args.PacketData);
                gp.Position = 21;
                byte campID = gp.ReadByte();
                Console.WriteLine("Enable camp: "+campID);
                jTimer.enableCamp(campID);

            }

            //AfterAttack
            if (args.PacketData[0] == 0x65 && Config.Item("doJungle").GetValue<KeyBind>().Active)
            {
                GamePacket gp = new GamePacket(args.PacketData);
                gp.Position = 1;
                Packet.S2C.Damage.Struct dmg = Packet.S2C.Damage.Decoded(args.PacketData);

                int targetID = gp.ReadInteger();
                int dType = (int)gp.ReadByte();
                int Unknown = gp.ReadShort();
                float DamageAmount = gp.ReadFloat();
                int TargetNetworkIdCopy = gp.ReadInteger();
                int SourceNetworkId = gp.ReadInteger();
                float dmga = (float)player.GetAutoAttackDamage(ObjectManager.GetUnitByNetworkId<Obj_AI_Base>(targetID));
                if (dmga - 10 > DamageAmount || dmga + 10 < DamageAmount)
                    return;
                if (player.NetworkId != dmg.SourceNetworkId || player.NetworkId == targetID || player.NetworkId == TargetNetworkIdCopy)
                    return;
                Obj_AI_Base targ = ObjectManager.GetUnitByNetworkId<Obj_AI_Base>(dmg.TargetNetworkId);
                if ((int) dmg.Type == 12 || (int) dmg.Type == 4 || (int) dmg.Type == 3)
                {
                    Console.WriteLine("dmg: " + DamageAmount + " : " + dmga);

                    JungleClearer.jungler.doAfterAttack(targ);
                }

            }
        }
开发者ID:Merc491,项目名称:GoodGuyJodu,代码行数:47,代码来源:HypaJungle.cs

示例12: Game_OnGameProcessPacket

 private static void Game_OnGameProcessPacket(GamePacketEventArgs args)
 {
     if (args.PacketData[0] != 0x34)
     {
         return;
     }
     var packet = new GamePacket(args.PacketData);
     packet.Position = 1;
     var networkId = packet.ReadInteger();
     if (args.PacketData[9] != 17)
     {
         return;
     }
     if (ActiveAttacks.ContainsKey(networkId))
     {
         ActiveAttacks.Remove(networkId);
     }
 }
开发者ID:Jokiblack,项目名称:LeagueSharpCommon,代码行数:18,代码来源:HealthPrediction.cs

示例13: Decoded

                public static Struct Decoded(byte[] data)
                {
                    var packet = new GamePacket(data);
                    var result = new Struct();

                    packet.Position = 1;
                    result.UnitNetworkId = packet.ReadInteger();
                    packet.ReadShort();
                    result.MaxHealth = packet.ReadFloat();
                    result.CurrentHealth = packet.ReadFloat();
                    return result;
                }
开发者ID:yol0swag,项目名称:LeagueSharpCommon,代码行数:12,代码来源:Packet.cs

示例14: Game_OnGameProcessPacket

 private static void Game_OnGameProcessPacket(GamePacketEventArgs args)
 {
     if (args.PacketData[0] == 0x17)
     {
         var packet = new GamePacket(args.PacketData);
         packet.Position = 1;
         if (packet.ReadInteger() == ObjectManager.Player.NetworkId)
         {
             packet.Position = 7;
             var id = packet.ReadByte();
             switch (id)
             {
                 case 0x42:
                     if (Select == Cards.Blue) SendWPacket();
                     break;
                 case 0x47:
                     if (Select == Cards.Yellow) SendWPacket();
                     break;
                 case 0x52:
                     if (Select == Cards.Red) SendWPacket();
                     break;
             }
         }
     }
 }
开发者ID:Chogart,项目名称:LeagueSharp-2,代码行数:25,代码来源:CardSelector.cs

示例15: Game_OnGameProcessPacket

        static void Game_OnGameProcessPacket(GamePacketEventArgs args)
        {
            GamePacket g = new GamePacket(args.PacketData);
            if (g.Header != 0xFE)
                return;

            if (menu.Item("qAA").GetValue<KeyBind>().Active)
            {
                if (Packet.MultiPacket.OnAttack.Decoded(args.PacketData).Type == Packet.AttackTypePacket.TargetedAA)
                {
                    g.Position = 1;
                    var k = ObjectManager.GetUnitByNetworkId<Obj_AI_Base>(g.ReadInteger());
                    if (k is Obj_AI_Hero && k.IsEnemy)
                    {
                        if (Vector3.Distance(k.Position, Player.Position) <= Q.Range)
                        {
                            Q.Cast(k.Position, packets());
                        }
                    }
                }
            }
        }
开发者ID:lanyi777,项目名称:CN,代码行数:22,代码来源:Program.cs


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