本文整理汇总了C#中LeagueSharp.Common.GamePacket类的典型用法代码示例。如果您正苦于以下问题:C# GamePacket类的具体用法?C# GamePacket怎么用?C# GamePacket使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GamePacket类属于LeagueSharp.Common命名空间,在下文中一共展示了GamePacket类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PacketHandler
private static void PacketHandler(GamePacketEventArgs args)
{
var Packetc = new GamePacket(args.PacketData);
if (Packetc.Header == Packet.C2S.Cast.Header)
{
var decodedpacket = Packet.C2S.Cast.Decoded(args.PacketData);
if (LatestCast.Tick + 500 < Environment.TickCount)
{
LatestCast.Timepass = Environment.TickCount - LatestCast.Tick;
LatestCast.Distance = Math.Sqrt(Math.Pow(decodedpacket.ToX - LatestCast.X, 2) + Math.Pow(decodedpacket.ToY - LatestCast.Y, 2));
LatestCast.Delay = (LatestCast.Distance * 0.1 * Config.Item("delaytime").GetValue<Slider>().Value);
if (Environment.TickCount > LatestCast.Tick + LatestCast.Delay)
{
args.Process = false;
}
if (args.Process == true)
{
LatestCast.Tick = Environment.TickCount;
LatestCast.X = decodedpacket.ToX;
LatestCast.Y = decodedpacket.ToY;
}
}
}
}
示例2: OnProcessPacket
public static void OnProcessPacket(GamePacketEventArgs args)
{
if (args.PacketData[0] == 0xBA)
{
ObjectNetworkId = new GamePacket(args.PacketData) { Position = 2 }.ReadInteger();
}
}
示例3: ShowFakeClick
private static void ShowFakeClick(Vector3 position)
{
var tile = NavMesh.WorldToGrid(position.X, position.Y);
var z = NavMesh.GetHeightForPosition(position.X, position.Y);
var p = new GamePacket(0x87);
p.WriteHexString(
"00 00 00 00 02 69 DC 57 4D C9 4F 15 0A 20 00 00 00 00 00 00 00 00 00 01 00 00 00 00 B2 01 00 40");
p.WriteInteger(ObjectManager.Player.NetworkId);
p.WriteByte(0, 8);
p.WriteShort((short) tile.X);
p.WriteFloat(z);
p.WriteShort((short) tile.Y);
p.WriteHexString("6F F2 00 00 00 00 18 F3");
p.WriteShort((short) tile.X);
p.WriteFloat(z);
p.WriteShort((short) tile.Y);
p.WriteHexString(
"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 80 3F 69 DC 57 4D 79 0D DA 08 20 00 00 00 00 00 00 00 00 00 01 00 00 00 00 B1 01 00 40");
p.WriteInteger(ObjectManager.Player.NetworkId);
p.WriteByte(0, 8);
p.WriteShort((short) tile.X);
p.WriteFloat(z);
p.WriteShort((short) tile.Y);
p.WriteHexString("6F F2 00 00 00 00 18 F3");
p.WriteShort((short) tile.X);
p.WriteFloat(z);
p.WriteShort((short) tile.Y);
p.WriteHexString("00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 80 3F 00");
p.Process();
}
示例4: 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());
}
}
示例5: 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;
}
}
}
}
示例6: 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;
}
}
示例7: 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);
}
}
}
}
}
}
}
示例8: 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();
}
示例9: 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;
}
}
示例10: 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);
}
}
示例11: 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;
}
}
}
示例12: 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);
}
示例13: 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;
}
}
示例14: OnGameProcessPacket
private void OnGameProcessPacket(GamePacketEventArgs args)
{
if (targetObj != null && PacketCast && (LXOrbwalker.CurrentMode == LXOrbwalker.Mode.Combo || LXOrbwalker.CurrentMode == LXOrbwalker.Mode.Harass))
{
if (args.PacketData[0] != 100) return;
var PacketData = new GamePacket(args.PacketData);
PacketData.Position = 1;
if (PacketData.ReadInteger() != targetObj.NetworkId) return;
var PacketType = PacketData.ReadByte();
PacketData.Position += 4;
if (PacketData.ReadInteger() != Player.NetworkId) return;
if (PacketType == 12) SkillQ.Cast(targetObj.Position, PacketCast);
return;
}
}
示例15: ChangeSize
private static void ChangeSize()
{
var p = new GamePacket(0xC4);
p.WriteInteger(0);
p.WriteInteger(LastSequence);
p.WriteByte(0x1);
p.WriteByte(0x8);
p.WriteInteger(ObjectManager.Player.NetworkId);
p.WriteInteger(0x800);
p.WriteByte(0x8);
p.WriteFloat(Size);
p.Process();
LastProcess = Environment.TickCount;
}