本文整理汇总了C#中GamePacketEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# GamePacketEventArgs类的具体用法?C# GamePacketEventArgs怎么用?C# GamePacketEventArgs使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
GamePacketEventArgs类属于命名空间,在下文中一共展示了GamePacketEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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());
}
}
示例2: Game_OnGameProcessPacket
private static void Game_OnGameProcessPacket(GamePacketEventArgs args)
{
if (Config.Item("AntiCamLock").GetValue<bool>() && args.PacketData[0] == 0x83 && args.PacketData[7] == 0x47 && args.PacketData[8] == 0x47)
{
args.Process = false;
}
}
示例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);
}
}
}
}
}
}
}
示例4: GameOnOnGameProcessPacket
private static void GameOnOnGameProcessPacket(GamePacketEventArgs args)
{
if (args.PacketData[0] == Packet.S2C.Dash.Header)
{
var decodedPacket = Packet.S2C.Dash.Decoded(args.PacketData);
var networkId = decodedPacket.UnitNetworkId;
var speed = decodedPacket.Speed;
var unit = ObjectManager.GetUnitByNetworkId<Obj_AI_Base>(networkId);
if (unit != null && unit.IsValid && unit.Type == GameObjectType.obj_AI_Hero)
{
if (!DetectedDashes.ContainsKey(unit.NetworkId))
{
DetectedDashes.Add(unit.NetworkId, new DashItem());
}
DetectedDashes[unit.NetworkId].StartTick = Environment.TickCount - Game.Ping / 2;
DetectedDashes[unit.NetworkId].Speed = speed;
DetectedDashes[unit.NetworkId].StartPos = unit.ServerPosition.To2D();
DetectedDashes[unit.NetworkId].Processed = false;
DetectedDashes[unit.NetworkId].Unit = unit;
}
}
}
示例5: Game_OnProcessPacket
private static void Game_OnProcessPacket(GamePacketEventArgs args)
{
if (args.PacketData.GetPacketId().Equals(BuyItemAns))
{
LeagueSharp.Common.Utility.DelayAction.Add(300, UpdateInventory);
}
}
示例6: Game_OnGameProcessPacket
private static void Game_OnGameProcessPacket(GamePacketEventArgs args)
{
var data = args.PacketData;
if (data[0] != Packet.S2C.AddGold.Header)
{
return;
}
var decoded = Packet.S2C.AddGold.Decoded(data);
Console.WriteLine(
@"ReceivingUnit: {0} | SourceUnit {1}", decoded.ReceivingUnit.BaseSkinName,
decoded.SourceUnit.BaseSkinName);
if (decoded.ReceivingUnit.IsEnemy)
{
_enemyTeamGold += decoded.Gold;
}
else if (decoded.ReceivingUnit.IsAlly)
{
_myTeamGold += decoded.Gold;
}
else
{
Console.WriteLine(@"Uhh, Chewy? I think you dun goofed.");
}
}
示例7: 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;
}
}
}
}
示例8: GameOnOnSendPacket
private static void GameOnOnSendPacket(GamePacketEventArgs args)
{
if (PacketsSentWriter != null)
{
PacketsSentWriter.WriteLine("Time: " + Core.GameTickCount + ", GamePacket: " + args.GamePacket);
}
}
示例9: Game_OnGameProcessPacket
static void Game_OnGameProcessPacket(GamePacketEventArgs args)
{
if (args.PacketData[0] == 0xC1 || args.PacketData[0] == 0xC2)
{
TimeOffset = BitConverter.ToSingle(args.PacketData, 5) - Game.Time;
new System.Threading.Thread(() =>
{
GetTimers();
}).Start();
}
else if (args.PacketData[0] == Packet.S2C.EmptyJungleCamp.Header)
{
Byte Camp = args.PacketData[9];
TimeSpan time = TimeSpan.FromSeconds(jungleRespawns[Camp] - Game.Time - TimeOffset);
if (time.TotalSeconds < 0)
{
if (Camp == 0xC)
jungleRespawns[Camp] = Game.Time + TimeOffset + 420;
else if (Camp == 0x6)
jungleRespawns[Camp] = Game.Time + TimeOffset + 360;
else if (Camp == 0x1 || Camp == 0x4 || Camp == 0x7 || Camp == 0xA)
jungleRespawns[Camp] = Game.Time + TimeOffset + 300;
else
jungleRespawns[Camp] = Game.Time + TimeOffset + 100;
}
}
}
示例10: Game_OnGameProcessPacket
void Game_OnGameProcessPacket(GamePacketEventArgs args)
{
if (!IsActive())
return;
var reader = new BinaryReader(new MemoryStream(args.PacketData));
byte packetId = reader.ReadByte();
List<int> packetIds = new List<int>();
if (Game.Version.Contains("5.24"))
{
packetIds.Add(21);
packetIds.Add(36);
}
if (Game.Version.Contains("6.1"))
{
packetIds.Add(77);
}
if (Game.Version.Contains("6.2"))
{
packetIds.Add(99);
}
if (Game.Version.Contains("6.3"))
{
packetIds.Add(175);
}
foreach (int id in packetIds)
{
if (packetId == id)
{
args.Process = false;
}
}
}
示例11: GameOnOnProcessPacket
private static void GameOnOnProcessPacket(GamePacketEventArgs args)
{
if (PacketsReceivedWriter != null)
{
PacketsReceivedWriter.WriteLine("Time: " + Core.GameTickCount + ", GamePacket: " + args.GamePacket);
}
}
示例12: OnProcessPacket
public static void OnProcessPacket(GamePacketEventArgs args)
{
if (args.PacketData[0] == 0xBA)
{
ObjectNetworkId = new GamePacket(args.PacketData) { Position = 2 }.ReadInteger();
}
}
示例13: 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;
}
}
示例14: OnGameProcessPacket
private static void OnGameProcessPacket(GamePacketEventArgs args)
{
if(LeagueSharp.Game.Mode != GameMode.Running || OnGameStart == null)
return;
OnGameStart(new EventArgs());
LeagueSharp.Game.OnGameProcessPacket -= OnGameProcessPacket;
}
示例15: 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;
}
}
}
}