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


C# GamePacket.Size方法代码示例

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


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

示例1: 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

示例2: LogGamePacket

 private static void LogGamePacket(GamePacket result, String file = null, String prefix = null)
 {
     byte[] b = new byte[result.Size()];
     long size = result.Size();
     int cur = 0;
     while (cur < size - 1)
     {
         b[cur] = result.ReadByte(cur);
         cur++;
     }
     LogPacket(b, file, prefix);
 }
开发者ID:zjian1013,项目名称:SAwareness,代码行数:12,代码来源:Utils.cs

示例3: 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

示例4: AddTo

 private static void AddTo(this DataGridView view, GamePacket p)
 {
     view.Rows.Add(
         new object[] { p.Header.ToHexString(), p.Size().ToString(), p.Channel.ToString(), p.Flags.ToString(), (Environment.TickCount - TickCount)/1000 });
 }
开发者ID:GitMiester,项目名称:L-Assemblies,代码行数:5,代码来源:Program.cs

示例5: OnGameProcessPacket

        public static void OnGameProcessPacket(GamePacketEventArgs args)
        {
            return;
            try
            {

                if (isComboing())
                {
                    if (args.PacketData[0] == 35 && Riven.Q.IsReady())
                    {
                        Console.WriteLine("Gott");
                        GamePacket gp = new GamePacket(args.PacketData);
                        gp.Position = 2;
                        int netId = gp.ReadInteger();
                        if (LXOrbwalker.GetPossibleTarget() == null || LXOrbwalker.GetPossibleTarget().NetworkId != netId)
                            return;
                        if (!LXOrbwalker.CanAttack())
                            Riven.Q.Cast(LXOrbwalker.GetPossibleTarget().Position);
                    }

                    if (args.PacketData[0] == 0x17)
                    {
                        Console.WriteLine("cancel");

                        GamePacket packet = new GamePacket(args.PacketData);
                        packet.Position = 2;
                        int sourceId = packet.ReadInteger();
                        if (sourceId == Riven.Player.NetworkId)
                        {
                            Console.WriteLine("cancel wawf");
                            Packet.C2S.Move.Encoded(new Packet.C2S.Move.Struct(Game.CursorPos.X, Game.CursorPos.Y)).Send();
                            if (LXOrbwalker.GetPossibleTarget() != null)
                            {
                                Riven.moveTo(LXOrbwalker.GetPossibleTarget().Position);
                                //Packet.C2S.Move.Encoded(new Packet.C2S.Move.Struct(LXOrbwalker.GetPossibleTarget().Position.X, LXOrbwalker.GetPossibleTarget().Position.Y)).Send();

                                // LXOrbwalker.ResetAutoAttackTimer();
                                Riven.cancelAnim(true);
                            }
                        }
                    }

                    if (args.PacketData[0] == 0xDF && false)
                    {

                        Console.WriteLine("cancel");

                        GamePacket packet = new GamePacket(args.PacketData);
                        packet.Position = 2;
                        int sourceId = packet.ReadInteger();
                        if (sourceId == Riven.Player.NetworkId)
                        {
                            Console.WriteLine("cancel wawf");
                            Riven.moveTo(Game.CursorPos);
                            Packet.C2S.Move.Encoded(new Packet.C2S.Move.Struct(Game.CursorPos.X, Game.CursorPos.Y)).Send();
                            LXOrbwalker.ResetAutoAttackTimer();
                            Riven.cancelAnim();
                        }
                    }

                    if (args.PacketData[0] == 0x61) //move
                    {
                        GamePacket packet = new GamePacket(args.PacketData);
                        packet.Position = 12;
                        int sourceId = packet.ReadInteger();
                        if (sourceId == Riven.Player.NetworkId)
                        {
                            if (LXOrbwalker.GetPossibleTarget() != null)
                            {
                            //    Packet.C2S.Move.Encoded(new Packet.C2S.Move.Struct(LXOrbwalker.GetPossibleTarget().Position.X, LXOrbwalker.GetPossibleTarget().Position.Y)).Send();
                                LXOrbwalker.ResetAutoAttackTimer();
                            }
                        }
                    }
                    else if (args.PacketData[0] == 0x38) //animation2
                    {
                        GamePacket packet = new GamePacket(args.PacketData);
                        packet.Position = 1;
                        int sourceId = packet.ReadInteger();
                        if (packet.Size() == 9 && sourceId == Riven.Player.NetworkId)
                        {
                            Riven.moveTo(Game.CursorPos);
                            Packet.C2S.Move.Encoded(new Packet.C2S.Move.Struct(Game.CursorPos.X, Game.CursorPos.Y)).Send();
                            LXOrbwalker.ResetAutoAttackTimer();
                            Riven.cancelAnim();
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
            }
        }
开发者ID:Merc491,项目名称:GoodGuyJodu,代码行数:94,代码来源:RivenSharp.cs


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