本文整理汇总了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);
}
}
示例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);
}
示例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;
}
}
}
示例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 });
}
示例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());
}
}